Skip to content

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

@andrewchumchal

Description

@andrewchumchal

Summary

Replace the fully hardcoded SettingsPanel.tsx with a schema-driven settings system backed by a user-editable settings.json file — modelled on VS Code's settings architecture.

Motivation

  • The current SettingsPanel.tsx is ~1500 lines of hardcoded React. Extensions can never add their own settings without modifying core.
  • Power users have no way to directly edit settings as text (copy/paste, version control, scripting).
  • A schema-driven approach means the UI is generated from a definition, making it trivially extensible.

Proposed architecture

Storage

electron-store already writes JSON to userData/openconduit/. No backend change required — just expose the file path and add a "Open settings.json" command.

Schema

Each settings section is defined as a JSON Schema fragment:

interface SettingsContribution {
  title: string;
  order?: number;   // controls section ordering in the UI
  properties: Record<string, JSONSchemaProperty>;
}

Core registers its own contributions (providers, MCP, routing, etc.). Extensions will register theirs via the Extension Platform (#TBD).

Settings UI (revamped SettingsPanel)

  • Schema-driven form renderer — inputs, toggles, arrays, and key-value pairs generated from schema type + description
  • Search — filter settings by keyword across all sections
  • Section navigation — left-side TOC (like VS Code)
  • "Open settings.json" button → opens the raw file in the default editor (or an in-app JSON editor pane)
  • Reset to default per-property button

Raw JSON editor

  • In-app JSON editor pane (CodeMirror or Monaco) with schema validation
  • Errors highlighted inline
  • Changes saved on blur / explicit save

Migration plan

  1. Add settings:open-file IPC + ⌘K command — expose the existing JSON file immediately (low risk, high value)
  2. Introduce SettingsContribution type and register core sections against it
  3. Rewrite SettingsPanel as a schema-driven renderer, section by section
  4. Remove hardcoded JSX as each section is migrated

Acceptance criteria

  • settings.json is openable via ⌘K command and a button in the Settings panel
  • SettingsContribution type defined; core registers all existing sections
  • Settings UI renders from schema (section nav, search, per-field reset)
  • In-app JSON editor with schema validation
  • Extensions can register their own SettingsContribution (see Extension Platform issue)
  • No settings data is lost during migration

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions