Skip to content

feat(studio): edit fleets.toml in-app — CodeMirror TOML editor (ADR #19 C) - #30

Merged
brettchien merged 1 commit into
mainfrom
feat/fleet-config-edit
Aug 13, 2026
Merged

feat(studio): edit fleets.toml in-app — CodeMirror TOML editor (ADR #19 C)#30
brettchien merged 1 commit into
mainfrom
feat/fleet-config-edit

Conversation

@brettchien

Copy link
Copy Markdown
Contributor

Drafted by Orca (ecs-claude) — flagging authorship (shared GitHub identity).

Slice C of the config panel — in-app editing of fleets.toml via a CodeMirror TOML editor. Supersedes #27, which GitHub auto-closed when its stacked base branch (feat/fleet-config-panel, #26) was squash-merged into main. Same commit, rebased onto current main (now carries #26 A+B and #28's ServiceNotFound fix).

What:

  • studio-cpread_bindings_text / write_bindings_atomic (temp+rename) / save_bindings_text: validate the text parses before writing (a bad edit never lands on disk), store bytes verbatim (comments/layout preserved, no format-preserving lib). Unit tests: round-trip, reject-invalid-without-write, missing-file-is-empty.
  • oab-mcpfleet_config now returns the raw text; new write tool fleet_config_write { text } validates + writes + hot-reloads (bindings behind an RwLock; per-cluster resolved-config memo cleared on write). 10 tools.
  • src-taurifleet_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.

Verification (rebased branch): cargo check --tests -p studio-cp -p oab-mcp clean with #28 present (both sets of studio-cp changes coexist); console tsc clean, vitest 22/22, vite build OK. Rust test execution + the tauri build are covered by CI (build-test + bundle-macos).

Relates to #19; follows #26 (A+B) and #28.

🤖 Generated with Claude Code

… 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>
@brettchien
brettchien merged commit b035eb6 into main Aug 13, 2026
2 checks passed
@brettchien
brettchien deleted the feat/fleet-config-edit branch August 13, 2026 16:27
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.

1 participant