Repository navigation
fix: keep block gutter controls within the document view - #664
Merged
Merged
Conversation
…tside-card # Conflicts: # docs/specification.md # src/features/editor/plugins/blockSelectionInteraction.ts
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.
Summary
Block handles, the insertion button, and the insertion line live on a window-wide fixed layer attached to the page body and are positioned from each block's raw client rect, so a block scrolled past the top or bottom of the document card painted its controls, and their pointer targets, over the surrounding app.
Mod+Alt+Iscrolls to the caret first when the caret's block is wholly out of view, so the menu never anchors to a button nobody can see. The specification records this.Related Issue
Closes #657
Verification
pnpm exec vitest run src/features/editor/plugins/blockSelectionInteraction.test.tspassed. New cases at both edges of a scrolled view check the layer clip, gutters fitted to the visible part of their blocks, pointer tracking that stops outside the view, and keyboard insertion anchors kept inside it, including an off-view target scrolled in; they fail against the previous plugin.pnpm check:frontendpassed.block-selectionscenario that scrolls a nested list item across the top edge and a blockquote across the bottom edge at 640×400, then checks gutter containment, that points just outside the view hit neither a handle nor the insertion button, and that the button hides once the pointer leaves the view. Not run locally; CI runs it.Manually verified in headless Microsoft Edge on Windows, with the editor mounted in the app's card and
ScrollAreaat a temporary dev route and driven with CDP mouse input:Not verified: larger text sizes and sidebar resizing, beyond the repositioning already triggered by window, document, and view resizes.
Notes
Menus keep their ordinary popup placement; pointer handling through menus is the separate defect the issue names.