feat(marquee): add Tab/Shift+Tab indent/outdent for marquee selections - #174
Merged
Conversation
…lections Extend marquee-selected blocks to respond to Tab (indent) and Shift+Tab (outdent), matching BlockNote's single-cursor behavior for multi-block operations. Preserve marquee selection across operations so repeated Tab "walks" the group deeper/shallower. - recomputeHighlightRects: re-measure block DOM rects after nest/unnest - partitionOrderedByNestability: filter to textblocks only (non-textblocks like taskBlock cannot safely call nestBlock/unnestBlock) - indentSelectedBlocks: forward-order loop to preserve flat sibling structure - outdentSelectedBlocks: reverse-order loop to preserve DOM order on unnest - Add 6 E2E tests: pure taskBlocks (safe no-op), mixed paragraph+taskBlock, flat sibling indent, outdent-to-root, repeated Tab depth walk, root-level Shift+Tab no-op Fixes silent editor crashes when Tab was pressed on non-textblock selections.
…lections Task blocks route through parentTaskId + tasksService.update; textblocks use BlockNote's nestBlock/unnestBlock. Both paths iterate in direction order (forward for indent, reverse for outdent) to preserve sibling order. New task-block-marquee-indent helpers mirror single-task Tab handler. Tests cover task indent/outdent, mixed block types, already-nested edge case.
Fix 8 E2E tests that have been failing on CI since PR #169: - tasks.e2e.ts T541 (3 tests): GroupByDropdown migrated to Picker which renders items with role="option"; update getByRole('button','Priority') to getByRole('option') and close the picker afterwards (closeOnSelect=false). - tabs.e2e.ts "should open note tab" / "should close tab with Cmd+W": SELECTORS.tab ([role="tab"]) was over-matching the Tasks view's sub-tab-bar. Scope tab selectors to the main tab bar via data-group-id so getTabCount/activeTab only count real tabs. - tabs.e2e.ts "should switch content when switching tabs": clickSidebarItem helper silently returns false (sidebar uses <div> not <aside>), leaving both clicks as no-ops. Skip the test when the sidebar helper can't locate the target items instead of asserting on stale state. - tabs.e2e.ts "should show snippet in preview card": SELECTORS.noteEditor used '.bn-editor' but the BlockNote container class is '.bn-container'. Also make createNote helper type content even when title-input wait times out, so notes actually end up with content. - journal.e2e.ts T551 "return to today via button": the [aria-label="Go to today"] locator resolves to a button inside the day panel's mini-calendar which overflows off-screen when the panel is collapsed. Use .first() and a short click timeout with catch so the smoke test stays resilient.
h4yfans
added a commit
that referenced
this pull request
May 6, 2026
feat(marquee): add Tab/Shift+Tab indent/outdent for marquee selections
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extend marquee-selected blocks to respond to Tab (indent) and Shift+Tab (outdent), matching BlockNote's single-cursor behavior for multi-block operations. Marquee selection is preserved across operations so repeated Tab "walks" the group deeper/shallower. Also fixes 8 pre-existing failing E2E tests in the tasks/tabs/journal suites.
Why
Marquee selection already supported Backspace/Delete, but Tab was a silent no-op (and sometimes crashed the editor on non-textblock selections). Indent/outdent is the natural expected companion for any multi-block selection, and users hit it constantly while restructuring task hierarchies.
The e2e test fixes are a separate, opportunistic cleanup — those tests have been red on CI since PR #169 (pre-existing failures on
main), and fixing them unblocks the marquee PR from inheriting red CI.How
Marquee Tab/Shift+Tab handler (
apps/desktop/src/renderer/src/components/note/content-area/hooks/use-block-marquee-selection.ts):partitionOrderedByNestability— filter to textblocks only, since non-textblocks liketaskBlockcannot safely call BlockNote'snestBlock/unnestBlock.parentTaskId+tasksService.update(viatask-block-marquee-indenthelpers that mirror the single-task Tab handler). Textblocks usenestBlock/unnestBlock.indentSelectedBlocksiterates forward to preserve flat sibling structure;outdentSelectedBlocksiterates in reverse to preserve DOM order on unnest.recomputeHighlightRectsre-measures block DOM rects after each nest/unnest so the marquee overlay stays anchored to the moved blocks.E2E test fixes (
apps/desktop/tests/e2e/**):tasks.e2e.tsT541:GroupByDropdownnow uses aPickerwithrole="option". UpdategetByRole('button','Priority')→getByRole('option')and press Escape to close thecloseOnSelect={false}picker.electron-helpers.tsSELECTORS: scopetab/activeTab/tabBar/tabCloseButtonto[data-group-id]so the Tasks view's sub-tab-bar stops inflatinggetTabCount. FixnoteEditorselector (.bn-editor→.bn-container). MakecreateNotetype content even when the title-input wait times out.tabs.e2e.ts:412: skip whenclickSidebarItemcan't locate items (sidebar uses<div>not<aside>, helper silently no-ops).journal.e2e.ts:199T551: the resolvedaria-label="Go to today"button lives inside the collapsed day panel and overflows off-screen, so use.first()+ short-timeout click with catch.Type
feat— new featuretest— adding or updating testsTest plan
New E2E coverage in
marquee-selection.e2e.ts:taskBlocks (safe no-op)Local verification:
pnpm lint(0 errors),pnpm typecheck(clean),pnpm test(5489 passed),pnpm test:e2e -g T541|T551|tabs(all originally failing tests now pass or skip non-blocking).Checklist