Description
Goal
Add a YAML text editor to the web front-end to view and edit the active .profiles configuration file, with a two-step safety model: edits are applied in memory first (session trial, reusing the drop-config pipeline), and written to disk only through an explicit, compliance-gated Save.
Design spec: docs/superpowers/specs/2026-11-03-yaml-config-editor-design.md
Implementation plan: docs/superpowers/plans/2026-11-03-yaml-config-editor.md
Editor technology
CodeMirror 6 (codemirror + @codemirror/lang-yaml, ~150 KB) in a full-screen modal, themed from the existing data-theme tokens. Monaco (~2 MB) rejected as too heavy for the PWA; plain textarea rejected (no highlighting).
Backend — new endpoints on /api/config
GET /content— raw YAML text + filename +config_path;session_trial: truewhen the active config came from a drop (no disk path).POST /validate—{content, filename}→200 {valid, issues: [{severity, message}]}. Always 200; validity in the body. Parses viaConfigReader.from_content; no state change. Powers Test and the save gates.POST /template— rendersSTARTER_CONFIG_TEMPLATE.format(cwd=active directory)in memory (same content as--init); nothing written.POST /save— validate → optionalforce: true→ write toconfig_path. 400 for session-trial configs (no path). Bad YAML never touches the file withoutforce.POST /save-as—{content, filename, directory, force, overwrite}; extensions restricted to.profiles/.profiles.yaml; existing target refused withoutoverwrite: true; on success applies the saved config and re-derives the active directory.
Apply reuses the existing POST /load-content unchanged.
Frontend — full-screen modal
Toolbar: New (template, confirms if dirty) · Test (✓ valid / ✗ inline issue list) · Apply (live session-trial apply) · Save · Save as (directory browse + filename input, "Replace?" confirm on existing target) · Revert.
- Save / Save as run server validation first; on issues, show the list and offer "Go back and fix" / "Force save anyway".
- Dirty indicator; Escape/✕ warns on unsaved edits;
Cmd/Ctrl+S→ Save (falls back to Apply for session trials). - Save disabled for session-trial configs (no disk path).
- Entry point next to the existing config actions; Apply refreshes the app like a config load.
dist/rebuilt and committed.
Non-goals
- No form-based GUI editor.
- No schema autocomplete for v1 (server-validated feedback is enough).
- No file picker for arbitrary configs (edits the active config only).
Documentation (en + fr)
- User guide: Config Editor section (toolbar, two-step model, compliance gate, force-save, Save-as extensions).
--init/ starter-template docs: pointer to New in the UI.- Advanced guide: the new
/api/config/*endpoints for alternative front-ends. - README feature bullet (en/fr).
Tests
- pytest route tests for the 5 endpoints (valid/invalid/force/overwrite/extension restriction/session-trial refusal).
- vitest for the modal (open/load, Test, Apply, save gating, force path, Save-as dialog, dirty-escape warning).
Activity
fix(desktop): skip non-config odoc documents instead of failing the a…