You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add hierarchical keyboard selection for blocks #481
Add progressive keyboard entry and extension for hierarchical block selection after #478 provides the selection primitive. Focused-editor Mod+A climbs Leafdown's structural scopes instead of jumping directly to the whole document, while Escape, arrows, and Enter make the same nested selection model usable without a gutter.
This remains separate from the core selection because editor keymaps, the app-visible Select all command, tables, nested parents, context-popup and preview dismissal, caret restoration, and source projection require one focused precedence contract.
Expected behavior
With focus in ordinary editor content, the first Mod+A selects the nearest eligible block at the caret's structural depth. Repeating it selects that block's sibling group, then promotes to the containing eligible block and continues outward until the whole document is selected. Repeating at the widest scope is stable.
A complete list item is one escalation scope and includes its nested children. Nested list items participate at their own depth. Blockquotes expose the container and eligible child scopes validated by Validate nested sibling block selection and local gutter targeting #483. Tables remain atomic and native table or CellSelection behavior retains precedence inside them.
Edit > Select all continues to select the complete document immediately; progressive behavior belongs to the focused-editor keyboard gesture.
A keyboard-created block selection opens or repositions the existing selection context popup while focus stays in the editor. Menu key or Shift+F10 moves focus into that same popup; there is no handle-specific menu.
Escape first dismisses an open context popup or footnote preview and leaves the selection standing. With no dismissible surface open, it enters block selection from the current caret or text range, or exits block selection and restores the remembered text-selection bookmark when valid; otherwise it resolves the nearest editable caret.
Up and Down move the selection head through eligible siblings at the current parent. Shift+Up and Shift+Down extend or retract the contiguous range while preserving anchor and direction. Enter restores editing at the remembered caret or a valid caret in the head block.
Entering block selection finalizes active source projection before changing selection. Popup and preview dismissal remains earlier in key handling, and non-editor focused controls retain native behavior.
Keyboard changes announce the selected block type, sibling count, or promoted scope while focus remains in the editor.
Project origin: the Advanced selection and structural editing draft retains sentence selection, word-boundary behavior, and selected-word match highlighting rather than this now-shaped block-selection work.
Documentation: docs/specification.md owns interaction behavior and docs/reference.md owns displayed shortcuts. src/commands/metadata.ts remains the app-visible command registry even when the focused editor keymap owns progressive Mod+A.
Complete list items, nested list items, blockquotes, atomic objects, tables, and CellSelection have explicit escalation coverage.
Edit > Select all still selects the whole document immediately and reports correct command state.
Escape, Up, Down, Shift+Up, Shift+Down, and Enter implement entry, navigation, extension, reversal, exit, and caret restoration.
The existing context popup opens or refreshes for keyboard selection, retains editor focus until explicitly invoked, and dismisses before selection changes.
Node selection, ordinary text selection, native table behavior, popup or preview focus, and non-editor controls retain their shortcut ownership.
Selection changes announce block type, count, or promoted scope.
Focused automated coverage and pnpm check:frontend pass; manual Tauri verification covers the complete key sequence on Windows.
docs/specification.md, docs/reference.md, and CHANGELOG.md describe the shipped behavior.
Notes
Implementation direction
Handle progressive Mod+A in the focused editor keymap rather than changing the app command behind Edit > Select all. Determine the next scope from the current selection and resolved eligible-parent chain, not from timing between key presses. Respect event.defaultPrevented so a more specific editor owner can win before structural escalation.
Summary
Add progressive keyboard entry and extension for hierarchical block selection after #478 provides the selection primitive. Focused-editor
Mod+Aclimbs Leafdown's structural scopes instead of jumping directly to the whole document, whileEscape, arrows, and Enter make the same nested selection model usable without a gutter.This remains separate from the core selection because editor keymaps, the app-visible Select all command, tables, nested parents, context-popup and preview dismissal, caret restoration, and source projection require one focused precedence contract.
Expected behavior
Mod+Aselects the nearest eligible block at the caret's structural depth. Repeating it selects that block's sibling group, then promotes to the containing eligible block and continues outward until the whole document is selected. Repeating at the widest scope is stable.CellSelectionbehavior retains precedence inside them.Escapefirst dismisses an open context popup or footnote preview and leaves the selection standing. With no dismissible surface open, it enters block selection from the current caret or text range, or exits block selection and restores the remembered text-selection bookmark when valid; otherwise it resolves the nearest editable caret.UpandDownmove the selection head through eligible siblings at the current parent.Shift+UpandShift+Downextend or retract the contiguous range while preserving anchor and direction.Enterrestores editing at the remembered caret or a valid caret in the head block.Related context
Advanced selection and structural editingdraft retains sentence selection, word-boundary behavior, and selected-word match highlighting rather than this now-shaped block-selection work.docs/specification.mdowns interaction behavior anddocs/reference.mdowns displayed shortcuts.src/commands/metadata.tsremains the app-visible command registry even when the focused editor keymap owns progressiveMod+A.Done when
Mod+Aprogresses from the nearest eligible block through sibling and containing scopes to the whole document, following Validate nested sibling block selection and local gutter targeting #483's node map.CellSelectionhave explicit escalation coverage.Escape,Up,Down,Shift+Up,Shift+Down, andEnterimplement entry, navigation, extension, reversal, exit, and caret restoration.pnpm check:frontendpass; manual Tauri verification covers the complete key sequence on Windows.docs/specification.md,docs/reference.md, andCHANGELOG.mddescribe the shipped behavior.Notes
Implementation direction
Handle progressive
Mod+Ain the focused editor keymap rather than changing the app command behind Edit > Select all. Determine the next scope from the current selection and resolved eligible-parent chain, not from timing between key presses. Respectevent.defaultPreventedso a more specific editor owner can win before structural escalation.Out of scope