You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a Dispatch user who edits config.json directly for advanced settings like views, schemes, and keybindings, I want first-class validation and editor hints so I can confidently customize the app without discovering mistakes only after the TUI starts.
flowchart TD
A[Edit config.json] --> B[Run dispatch config validate]
B --> C{Valid?}
C -->|yes| D[Launch Dispatch with confidence]
C -->|no| E[Show field-specific fixes]
Loading
Problem
internal/config/config.go defines many structured settings, while cmd/dispatch/config.go exposes only scalar list/get/set/edit/path operations. Advanced users must hand-edit maps and arrays such as keybindings, views, schemes, aliases, tags, and exclusions without a JSON Schema or a standalone validation command. The README and web/src/pages/config.astro document options, but they can drift from the Go structs and validators.
Proposed solution
Add dispatch config validate [--json] [--path <file>] and dispatch config schema in cmd/dispatch/config.go, backed by reusable metadata from internal/config/config.go. The validator should load the target config, run the existing migration/sanitize/validation paths, report unknown fields and invalid enum/duration/keybinding values with actionable paths, and include tests in cmd/dispatch/config_test.go and internal/config/config_test.go. Publish the generated schema in docs and reference it from README and web/src/pages/config.astro so editors can provide completions.
User impact
Users get fast feedback before restarting Dispatch, contributors have one source of truth for config docs, and support/debugging gets easier because invalid customizations can be reproduced with a single command.
Acceptance criteria
dispatch config validate exits 0 for a valid config and non-zero with clear diagnostics for invalid JSON, unknown keys, invalid enums, bad durations, and keybinding conflicts.
dispatch config validate --json emits machine-readable diagnostics suitable for scripts and CI.
dispatch config schema emits a JSON Schema covering documented config keys, nested views, schemes, and keybindings action names.
README and web/src/pages/config.astro link to the schema/validation workflow and mention editor integration.
Unit tests cover success, malformed config, invalid enum values, invalid named views, and keybinding collision cases.
As a Dispatch user who edits
config.jsondirectly for advanced settings likeviews,schemes, andkeybindings, I want first-class validation and editor hints so I can confidently customize the app without discovering mistakes only after the TUI starts.flowchart TD A[Edit config.json] --> B[Run dispatch config validate] B --> C{Valid?} C -->|yes| D[Launch Dispatch with confidence] C -->|no| E[Show field-specific fixes]Problem
internal/config/config.godefines many structured settings, whilecmd/dispatch/config.goexposes only scalarlist/get/set/edit/pathoperations. Advanced users must hand-edit maps and arrays such askeybindings,views,schemes, aliases, tags, and exclusions without a JSON Schema or a standalone validation command. The README andweb/src/pages/config.astrodocument options, but they can drift from the Go structs and validators.Proposed solution
Add
dispatch config validate [--json] [--path <file>]anddispatch config schemaincmd/dispatch/config.go, backed by reusable metadata frominternal/config/config.go. The validator should load the target config, run the existing migration/sanitize/validation paths, report unknown fields and invalid enum/duration/keybinding values with actionable paths, and include tests incmd/dispatch/config_test.goandinternal/config/config_test.go. Publish the generated schema in docs and reference it from README andweb/src/pages/config.astroso editors can provide completions.User impact
Users get fast feedback before restarting Dispatch, contributors have one source of truth for config docs, and support/debugging gets easier because invalid customizations can be reproduced with a single command.
Acceptance criteria
dispatch config validateexits 0 for a valid config and non-zero with clear diagnostics for invalid JSON, unknown keys, invalid enums, bad durations, and keybinding conflicts.dispatch config validate --jsonemits machine-readable diagnostics suitable for scripts and CI.dispatch config schemaemits a JSON Schema covering documented config keys, nestedviews,schemes, andkeybindingsaction names.web/src/pages/config.astrolink to the schema/validation workflow and mention editor integration.Complexity
M