Repository navigation
Closed
Labels
Milestone
Description
Follow-up to the YAML config editor (#95). Bundle of small approved improvements (shortcuts docs + editor session persistence + optional polish).
Tasks
1. ShortcutsModal coverage
src/profiles/web/src/components/ShortcutsModal.tsx — add a "Configuration editor" section documenting existing actual behavior only:
Ctrl/Cmd+S— Save (Apply fallback when the config is a session trial, as wired inConfigEditorModal.tsxvia the capture-phase window listener);Escape— close the editor (guarded by the unsaved-changes confirmation);Ctrl/Cmd+,— open the configuration editor (added in commit 50ca16d).
2. Editor session persistence (cursor + undo history across reopen)
Module-level Map<string, Snapshot> keyed by anchor (config_path ?? "session-trial"), where Snapshot = { doc, selection, history } (CodeMirror history JSON state):
- On modal close (and only if
load.status === "ready"): store the current document text, selection and history state. - On modal open (after fetch): restore selection + history only if the loaded baseline text equals the snapshot's doc — otherwise start fresh (content changed externally, snapshot is stale and its entry is dropped).
- Clear the entry when the anchor's content is known to have changed via app actions (Save As re-target, Revert).
3. Optional polish (may be dropped without blocking the rest)
- Word-wrap toggle in the status bar (toggles the
EditorView.lineWrappingextension on the live view). - Font-size nudge — only if it does not complicate the status bar; drop freely.
Acceptance criteria
-
?overlay lists the editor shortcuts; none invented beyond actual behavior. - Re-opening the modal for the same config restores cursor position and undo history.
- A changed baseline discards the stale snapshot instead of restoring the wrong selection.
- Persistence is per-anchor: two different configs do not cross-contaminate state.
Tests
ConfigEditorModal.test.tsx: modal close/reopen → selection and undo history restored; edit the baseline externally (mock returns different text) → fresh state, snapshot dropped.- ShortcutsModal: content/snapshot test for the new "Configuration editor" section.
Activity