Skip to content

chore(editor): shortcuts docs, editor session persistence, word-wrap toggle #103

Closed

Description

@falbany

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 in ConfigEditorModal.tsx via 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.lineWrapping extension 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

  1. added
    enhancement
    frontend
    on Nov 4, 2026
  2. added this to the v1.0.0 milestone on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfrontend

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions