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
Interactive /settings UI for config inspection and edits
Summary
Add a /settings overlay (and jcode settings CLI) that surfaces every config key, its current effective value, the scope it came from (default / user / project / env / flag), and lets the user edit it inline. Mirrors pi's /settings.
jcode now has many configurable behaviors (provider profiles, compaction reserves, ambient mode, swarm spawn mode, transport preference, telemetry opt-ins, alignment). Today users edit ~/.jcode/config.toml by hand or guess at env-var names.
An interactive UI prevents the "I changed setting X but it didn't take effect" class of confusion (/settings shows precedence).
Current state in jcode
src/config.rs and src/config/ hold the config types; no in-TUI overlay for browsing/editing them.
jcode provider list/current/doctor exist for provider config only.
Add a derive(SettingsSchema) proc-macro in crates/jcode-config-types (or a hand-written fn schema() -> SettingsSchema) that emits { key, type, default, description, scope_supported } for every config field. Re-using serde field attrs avoids drift.
Categories: General, Providers, Compaction, Ambient, Swarm, Memory, UI, Telemetry, Network.
2. Effective-value resolver
For each key, compute (effective_value, source) where source ∈ default | global_config | project_config | env_var | cli_flag | session_override.
Expose via jcode settings get <key> and jcode settings show --json.
3. TUI overlay
New overlay in src/tui/settings_ui.rs:
Left pane: category tree with search (/ to filter).
Right pane: keys in selected category with [value] (source).
Enter to edit; r to reset to default; s to switch scope (global ↔ project).
? shows the field description and any examples.
Editor accepts the field's declared type (string, int, bool, enum). Enum fields use a dropdown.
4. Writes
On save, write back to the appropriate file (~/.jcode/config.toml for global, .jcode/config.toml for project). Preserve comments + ordering via a TOML edit library (toml_edit).
Hot-apply where possible (theme, transport preference, compaction thresholds). For fields that need a restart, show a clear toast.
5. CLI parity
jcode settings list [--category <c>]
jcode settings get <key>
jcode settings set <key> <value> [--scope user|project]
jcode settings reset <key>
Testing
Unit
Effective-value resolution covers all six sources with priority correctly applied.
Round-trip read/write preserves unrelated comments in config.toml.
TUI test
Open /settings, edit ui.alignment to center, save, restart, verify persisted.
Manual
Set JCODE_TELEMETRY=0 env var; /settings shows the telemetry key with source env_var and dimmed (read-only this session).
Acceptance criteria
Every documented config key appears in /settings with a description.
Scope precedence is shown next to each value.
Writes preserve formatting of existing config files.
Interactive
/settingsUI for config inspection and editsSummary
Add a
/settingsoverlay (andjcode settingsCLI) that surfaces every config key, its current effective value, the scope it came from (default / user / project / env / flag), and lets the user edit it inline. Mirrors pi's/settings.Reference: pi Settings and docs/settings.md.
Why
~/.jcode/config.tomlby hand or guess at env-var names./settingsshows precedence).Current state in jcode
src/config.rsandsrc/config/hold the config types; no in-TUI overlay for browsing/editing them.jcode provider list/current/doctorexist for provider config only.Implementation checklist
1. Reflection of the config types
derive(SettingsSchema)proc-macro incrates/jcode-config-types(or a hand-writtenfn schema() -> SettingsSchema) that emits{ key, type, default, description, scope_supported }for every config field. Re-usingserdefield attrs avoids drift.2. Effective-value resolver
(effective_value, source)where source ∈default | global_config | project_config | env_var | cli_flag | session_override.jcode settings get <key>andjcode settings show --json.3. TUI overlay
src/tui/settings_ui.rs:/to filter).[value] (source).Enterto edit;rto reset to default;sto switch scope (global ↔ project).?shows the field description and any examples.4. Writes
~/.jcode/config.tomlfor global,.jcode/config.tomlfor project). Preserve comments + ordering via a TOML edit library (toml_edit).5. CLI parity
jcode settings list [--category <c>]jcode settings get <key>jcode settings set <key> <value> [--scope user|project]jcode settings reset <key>Testing
Unit
config.toml.TUI test
/settings, editui.alignmenttocenter, save, restart, verify persisted.Manual
JCODE_TELEMETRY=0env var;/settingsshows the telemetry key with sourceenv_varand dimmed (read-only this session).Acceptance criteria
/settingswith a description.jcode settings set …works in headless mode.References
Implementation notes addendum (Devin gap-analysis pass, 2026-05-21)
Verified jcode code paths
src/config.rs,src/config/, types incrates/jcode-config-types. Config file lives at~/.jcode/config.toml(TOML).src/tui/ui_overlays.rs(help overlay), and the picker pattern insrc/tui/account_picker.rs/src/tui/login_picker.rs."/settings"to the dispatch insrc/tui/app/commands.rsand the help list insrc/tui/ui_overlays.rs.Recommended subscreens (mirror pi)
one-at-a-timevsall), transport preference.jcode doctor(Add general-purposejcode doctordiagnostic command #8) output.Persistence
~/.jcode/config.toml(user) or.jcode/config.toml(project). Use atomic-rename to avoid mid-write crashes.$VISUAL/$EDITOR) for advanced fields not exposed in the picker.Cross-references
--extension-policy safe|balanced|permissive+ command-level exec mediation #14, Extension trust lifecycle and kill-switch #15 — every customization surface this issue exposes is owned by another issue. Land those first; this issue is the front door.Reference
/settingsis described under Settings.