Skip to content

feat: add hierarchical block selection - #497

Merged
Azganoth merged 2 commits into
mainfrom
feature/hierarchical-block-selection
Sep 22, 2026
Merged

Azganoth merged 2 commits into
mainfrom
feature/hierarchical-block-selection

Conversation

@Azganoth

Copy link
Copy Markdown
Owner

Summary

  • Add a Leafdown-owned directional block selection for root and nested blocks, retaining exact cross-parent endpoints so adjacent list items are never absorbed through hidden wrapper promotion.
  • Add local pointer gutters with first-line-aligned handles, Shift-range interaction, drag preparation, accessible announcements, and source-projection-safe mapping and history.
  • Reuse the existing context popup with rendered block bounds, block-aware actions, neutral selection presentation, and focused desktop coverage for narrow layouts and nested structures.

Related Issue

Closes #478

Verification

  • pnpm exec vitest run src/features/editor/plugins/blockSelection.test.ts src/features/editor/plugins/blockSelectionInteraction.test.ts src/features/editor/plugins/blockSelectionProjection.test.ts src/features/editor/plugins/contextPopup.test.ts src/features/editor/commands/formatting/blocks.test.ts src/features/editor/tests/editorPresentation.test.ts verifies exact cross-list ranges, replacement, mapping, source projection, pointer interaction, popup integration, formatting, and presentation.
  • pnpm check:frontend verifies formatting, TypeScript, Oxlint, the production build, and the complete frontend coverage suite.
  • pnpm build:e2e:desktop builds the assembled desktop test binary.
  • pnpm test:e2e:desktop:run -- --scenario block-selection verifies nested gutter geometry, handle visibility and expansion, selection stability, popup behavior, focus, and exact cross-list presentation in the Windows WebView.

Not verified: the full desktop E2E suite or a separate manual interactive Tauri pass.

Notes

Cross-parent ranges use exact selectable-block endpoints and ProseMirror open structural slices instead of promoting endpoints to list wrappers. This intentionally supersedes the original lowest-common-ancestor promotion detail in #478 because promotion visually and operationally absorbed adjacent list items; the final behavior is recorded in the specification and decision record.

@Azganoth Azganoth added the Feature New feature or request label Sep 22, 2026
@Azganoth Azganoth self-assigned this Sep 22, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Leafdown Sep 22, 2026
@Azganoth
Azganoth merged commit 6963978 into main Sep 22, 2026
3 checks passed
@Azganoth
Azganoth deleted the feature/hierarchical-block-selection branch September 22, 2026 14:57
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Leafdown Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Implement hierarchical block selection and local gutter interaction

1 participant