PR: #565: feat(app): standardize editable block shortcuts [Story-2264] by @anyamshwr
View PR →

Files changed

8 file(s), +186 / -41 lines

Path Role + -
src/components/matter-detail/brief/editable-field-with-history.stories.tsxComponent+1-1
src/components/matter-detail/brief/frame-summary-history.stories.tsxComponent+2-3
src/components/matter-detail/brief/frame-summary-history.test.tsxComponent+37-0
src/components/matter-detail/brief/frame-summary-history.tsxComponent+4-30
src/components/shared/editable-surface-preset.test.tsComponent+33-0
src/components/shared/editable-surface-shortcuts.test.tsComponent+67-0
src/components/shared/editable-surface-shortcuts.tsComponent+20-0
src/components/shared/editable-surface.tsxComponent+22-7

Story-2264: standard keyboard shortcuts across editable content blocks

The shared editing substrate already unified the editor engine, presets, and history rail, but keyboard behavior still had two product-level gaps: Ctrl/Cmd+S fell through to the browser instead of saving the focused editor, and the shared history wrapper still consumed Ctrl/Cmd+Z / redo for version navigation. This revision keeps the editor thin: StarterKit continues to own rich-text shortcuts such as bold and italic, while PRAMAAN adds only the two application-specific bindings it actually owns: save and explicit underline blocking.

What changed

Acceptance criteria map

Acceptance criterionHow this Story satisfies it
Consistent Ctrl/Cmd shortcut behavior across editable content blocksThe shared substrate still owns the app-specific keyboard policy once, and every EditableSurface caller inherits it.
Rich presets support Ctrl/Cmd+B and Ctrl/Cmd+IStarterKit provides those shortcuts natively when the preset enables the bold and italic marks. plain disables those marks, so there is no rich shortcut path to preserve there.
Underline decided explicitlyUnderline is intentionally unsupported, and Ctrl/Cmd+U is blocked consistently in the shared shortcut layer.
Ctrl/Cmd+Z and redo preserve native editor historySaved-version navigation shortcuts were removed from EditableFieldWithHistory.
Ctrl/Cmd+S saves only the focused dirty blockMod-s blurs only the focused editor, which commits through the existing single-editor blur-save path; sibling editors are untouched.
Read-only / locked / canonical blocks are inertThe app-specific shortcut layer exits without save/blur side effects when the surface is not editable.
Automated tests cover Ctrl, Cmd, and inert statesFocused Vitest coverage now splits between preset-level StarterKit behavior, the app-specific Mod-s/Mod-u layer, and the non-hijack history rail.
Observability handling documented per pramaan-docs ADR-124This work is instrumentation-exempt: it adds no new route, workflow boundary, transport, background job, or external call. It only adjusts client-side editor shortcut behavior.

Files

FileChange
src/components/shared/editable-surface.tsxRemains the thin shared editor wrapper; wires in the minimal app-specific save/underline shortcut layer and keeps blur-save / dirty-baseline behavior intact.
src/components/shared/editable-surface-shortcuts.tsNew minimal TipTap shortcut layer for Mod-s and Mod-u only.
src/components/shared/editable-surface-shortcuts.test.tsUnit tests the app-specific shortcut layer directly.
src/components/shared/editable-surface-preset.test.tsPreset-level proof that StarterKit bold/italic are enabled only for rich presets and absent for plain.
src/components/matter-detail/brief/frame-summary-history.tsxRemoves saved-version keyboard hijack and updates the helper copy shown while viewing history.
src/components/matter-detail/brief/frame-summary-history.test.tsxProves undo/redo no longer navigates saved versions while editing or in read-only history views.
src/components/matter-detail/brief/*.stories.tsxUpdates story copy so the docs match the shipped shortcut behavior.

Verify