Skip to content

feat(#37): JSON-based settings + schema-driven UI#42

Merged
andrewchumchal merged 4 commits into
devfrom
feat/settings-revamp
May 19, 2026
Merged

feat(#37): JSON-based settings + schema-driven UI#42
andrewchumchal merged 4 commits into
devfrom
feat/settings-revamp

Conversation

@andrewchumchal
Copy link
Copy Markdown
Contributor

Closes #37

Summary

Full implementation of JSON-based settings and a schema-driven settings UI across all four phases.

Changes

Phase 1 — Settings modal revamp + settings:open-file

  • Replaced off-canvas slide-out with a centered modal (h-[88vh], fixed)
  • Left sidebar nav with icons; search input above tab list
  • settings:open-file IPC channel + "Open settings.json" button

Phase 2 — SettingsContribution type system + registry

  • Added SettingsStringProperty, SettingsNumberProperty, SettingsBooleanProperty, SettingsProperty, SettingsSection, SettingsContribution types to types.ts
  • settingsRegistry singleton (src/settings/settingsRegistry.ts)
  • coreContributions.ts registers built-in sections: General, Labs, Updates

Phase 3 — Schema-driven renderer + search

  • SchemaFormRenderer renders any SettingsContribution as form sections
  • PropertyField handles string/number/boolean with all property options (enum, sensitive, multiline, minimum, maximum, step, etc.)
  • SchemaSearchResults full-text search across all registry contributions
  • GeneralTab and LabsTab replaced with schema-driven renderer; Updates tab added
  • Search input in left sidebar clears on tab switch

Phase 4 — In-app CodeMirror JSON editor

  • New JSON tab (after About) — full settings as formatted, editable JSON
  • CodeMirror 6 with oneDark theme + custom slate-950 structural overrides
  • JSON syntax highlighting, line numbers, undo/redo history
  • Toolbar with "Unsaved changes" / parse error feedback, Reset + Save buttons
  • Save validates JSON before applying; editor syncs when settings change externally

Dependencies added

  • @codemirror/state, @codemirror/view, @codemirror/commands, @codemirror/lang-json, @codemirror/theme-one-dark

- SettingsPanel: off-canvas slide-in → centered fixed dialog (920px, 88vh)
- Replace horizontal top tabs with left sidebar icon+label nav
- ExtraTab interface gains optional icon prop
- Add 'Open settings.json' button to General → Configuration section
- SETTINGS_OPEN_FILE ('settings:open-file') IPC constant in types.ts
- AppService.config.openSettingsFile() method
- CommandPalette: 'Open settings.json' command (guards on service capability)
- Add SettingsStringProperty, SettingsNumberProperty, SettingsBooleanProperty,
  SettingsSection, SettingsContribution types to types.ts
- src/settings/settingsRegistry.ts — singleton register/unregister/getAll
- src/settings/coreContributions.ts — registers General, Labs, Updates sections
- index.ts: export settingsRegistry, auto-register core contributions on import
- Complex sections (Providers, MCP, Routing, Analytics) left as custom components
- Add SchemaFormRenderer: renders SettingsContribution sections to form
  controls (Toggle/select/text/number) with per-field Reset button
- Add PropertyField: boolean card-style, string (text/select/password/
  textarea), number (input w/ min/max/step); handles dot-notation paths
- Add SchemaSearchResults: full-text search across all registered
  contributions, grouped by contribution label + section breadcrumb
- Add search input in settings sidebar (above nav); clears to tab on click
- Replace GeneralTab JSX with SchemaFormRenderer; override defaultProviderId
  to render the populated provider dropdown; keep Configuration section
- Replace LabsTab sections with SchemaFormRenderer; keep ⚗️ banner;
  remove LabsFeatureRow (superseded by PropertyField boolean card)
- Add Updates tab (openconduit.updates from registry) with refresh icon
- Section now accepts optional description prop
- Import coreContributions as side-effect in SettingsPanel to ensure the
  registry is populated regardless of how the component is imported
@andrewchumchal andrewchumchal merged commit dc35c7b into dev May 19, 2026
@andrewchumchal andrewchumchal deleted the feat/settings-revamp branch May 19, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: JSON-based settings (settings.json + schema-driven UI)

1 participant