Skip to content

feat: block browsing#553

Merged
cguedes merged 30 commits into
mainfrom
151-block-browsing
Sep 20, 2023
Merged

feat: block browsing#553
cguedes merged 30 commits into
mainfrom
151-block-browsing

Conversation

@sehyod

@sehyod sehyod commented Sep 15, 2023

Copy link
Copy Markdown
Collaborator
  • Pressing Escape toggles block browsing
  • Pressing Enter while in block browsing mode focuses the content of the current block
  • Arrows change the selected block
    • Up: selects the previous sibling or the parent node
    • Down: selects the first child or the next sibling node
    • Left: selects the parent node
    • Right: selects the first child node
  • Left Arrow (resp. Right Arrow) collapses (resp. uncollapses) nodes
  • Shift+ Up/Down Arrow expands the selection
    • Up: adds the previous sibling block to current selection or selects the parent block
    • Down: adds the next sibling block to current selection
  • Cmd+A only selects the content of the current blocks (pressing again selects everything)
  • Cmd+A while in block browsing node selects all the blocks
  • Removing and copy/pasting block selection works as expected
  • Cmd+Shift+ Up/Down Arrows moves the selected blocks
    • Up: moves above collapsed sibling, or indents the selection if it has an uncollapsed sibling, or moves above parent
    • Down: moves after collapsed sibling, or moves inside uncollapsed sibling if there is one, or unindents the selection
  • Tab (resp. Shift+Tab) indent (resp. unindent) the selected blocks
  • Formatting buttons work as expected when in block browsing mode
  • List buttons work as expected when in block browsing mode (transform the top blocks but not their children)
  • Heading buttons are disabled when in block browsing mode (implementing them would require a more logic and I don't think it's worth it since I don't think it is a common use case to transform multiple blocks into heading at the same time)

This PR decreases the coverage, I am planning on adding tests in a follow-up PR (related to #361)

Here is a short video to show some of these features:

Screen.Recording.2023-09-20.at.13.41.38.mov

Closes #151

@codecov

codecov Bot commented Sep 15, 2023

Copy link
Copy Markdown

Codecov Report

Merging #553 (85e5676) into main (77ef904) will decrease coverage by 3.97%.
The diff coverage is 25.32%.

@@            Coverage Diff             @@
##             main     #553      +/-   ##
==========================================
- Coverage   81.07%   77.10%   -3.97%     
==========================================
  Files         222      228       +6     
  Lines       13124    14092     +968     
  Branches     1243     1278      +35     
==========================================
+ Hits        10640    10866     +226     
- Misses       2469     3208     +739     
- Partials       15       18       +3     
Files Changed Coverage Δ
src/application/KeyboardShortcutsModal.tsx 0.00% <0.00%> (ø)
...ponents/tipTapNodes/notionBlock/commands/indent.ts 23.80% <0.00%> (ø)
...ipTapNodes/notionBlock/commands/toggleCollapsed.ts 21.87% <0.00%> (+0.66%) ⬆️
...odes/notionBlock/plugins/collapsibleArrowPlugin.ts 88.23% <0.00%> (ø)
...apNodes/notionBlock/plugins/blockBrowsingPlugin.ts 17.42% <17.42%> (ø)
...ipTapNodes/notionBlock/selection/BlockSelection.ts 21.14% <21.14%> (ø)
...pTapNodes/notionBlock/utils/addIndentBlockSteps.ts 23.33% <23.33%> (ø)
...ponents/tipTapNodes/notionBlock/NotionBlockNode.ts 54.90% <24.61%> (-10.91%) ⬇️
...nts/tipTapNodes/notionBlock/commands/toggleMark.ts 36.11% <36.11%> (ø)
...TapNodes/notionBlock/utils/getNotionBlockParent.ts 41.37% <41.37%> (ø)
... and 9 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sehyod sehyod marked this pull request as ready for review September 19, 2023 13:53
@sehyod sehyod requested a review from cguedes September 19, 2023 13:54
@cguedes cguedes merged commit ebaa9fb into main Sep 20, 2023
@cguedes cguedes deleted the 151-block-browsing branch September 20, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Esc should toggle between block browsing and text editing

2 participants