feat(studio): edit fleets.toml in-app — CodeMirror TOML editor (ADR #19 C) - #27
Closed
brettchien wants to merge 1 commit into
Closed
feat(studio): edit fleets.toml in-app — CodeMirror TOML editor (ADR #19 C)#27brettchien wants to merge 1 commit into
brettchien wants to merge 1 commit into
Conversation
… C)
The edit half of the config panel: the operator edits the raw fleets.toml in a
CodeMirror TOML editor and saves; the change validates, persists, and hot-reloads
without a restart. Completes declare(edit) → switch → observe → reconcile.
- studio-cp: `read_bindings_text` / `write_bindings_atomic` (temp+rename) /
`save_bindings_text` — validate the text parses BEFORE writing (a bad edit
never lands on disk) and store bytes verbatim, so comments/layout survive with
no format-preserving lib. Unit tests: round-trip, reject-invalid-without-write,
missing-file-is-empty.
- oab-mcp: `fleet_config` now also returns the raw `text`; new write tool
`fleet_config_write { text }` validates + writes + hot-reloads (bindings moved
behind an RwLock; the per-cluster resolved-config memo is cleared on write).
Catalog is 10 tools.
- src-tauri: `fleet_config_write` bridge command.
- console: CodeMirror 6 TOML editor (StreamLanguage + legacy TOML mode) mounted
imperatively in a section separate from the re-rendered panel, so switching
fleets never wipes an open edit. "Edit config" opens it; Save calls the write
tool and surfaces a parse error inline; Cancel discards. 1 new render test.
Slice C of the config panel, stacked on the A+B view/switch slice. Editing is
raw-text (operator chose a TOML editor over a structured form).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drafted by Orca (
ecs-claude) — flagging authorship (shared GitHub identity across the fleet).Slice C of the config panel — the edit half — stacked on #26 (A+B view/switch); base retargets to
mainwhen #26 merges. Completes the loop: declare(edit) → switch → observe → reconcile.The operator asked for a raw TOML editor (not a structured form), so this edits
fleets.tomlas text.What:
studio-cp—read_bindings_text/write_bindings_atomic(temp file + rename) /save_bindings_text: validate the text parses before writing (a bad edit never lands on disk) and store the bytes verbatim — comments/layout survive with no format-preserving library. Unit tests: round-trip + preserved-verbatim, reject-invalid-without-write, missing-file-is-empty.oab-mcp—fleet_confignow also returns the rawtext; new write toolfleet_config_write { text }validates + writes + hot-reloads (bindings moved behind anRwLock; the per-cluster resolved-config memo is cleared on write, since a changed profile/region invalidates it). Catalog is 10 tools.src-tauri—fleet_config_writebridge command.console— a CodeMirror 6 TOML editor (StreamLanguage+ the legacy TOML mode — the standard CM6 route, no dedicated TOML lang pkg exists). Mounted imperatively in a section separate from the re-rendered panel, so switching fleets never wipes an open edit. "Edit config" opens it; Save calls the write tool and surfaces a parse error inline; Cancel discards. New deps:codemirror+@codemirror/{state,view,language,legacy-modes}(bundle grows to ~405 KB / 132 KB gzip — expected for an editor).Effect: the config panel now views fleets, switches between them (#26), and edits the binding file in-app — the full "no panel for config" gap closed.
Verification:
tscclean ·vitest22/22 ·vite buildOK (CM6 bundles).studio-cp+oab-mcp:cargo check+cargo check --testsclean locally. Test execution + the src-tauritauri buildare left to CI —ci.yml build-test(ubuntu) runs the Rust workspace tests (mysave_bindings_text+ catalog tests), anddesktop.yml bundle-macosruns on this PR (npm run build+tauri build, compiling the bridge). Full local Rust test-linking has previously exhausted this runtime's disk.Known follow-up: the CM editor uses CodeMirror's default (light) theme; a dark-mode theme keyed to the app's
prefers-color-schemeis a small follow-up, not in this slice.Relates to #19, stacks on #26.
🤖 Generated with Claude Code