Repository navigation
fix(docs): keep selection menus inside the editor - #585
Closed
imshashank wants to merge 3 commits into
Closed
imshashank wants to merge 3 commits into
imshashank wants to merge 3 commits into
Conversation
The formatting popover was anchored at the selection midpoint, shifted left by half its own width through a CSS transform, and pinned 44px above the selection top. Neither axis was bounded, and the surface scrolls inside an overflow container, so a selection starting at the left edge of the narrow drawer put roughly half the popover outside it, and a selection on the first line put the popover above the box entirely (#515). The popover now measures itself after mount, centres on the selection only where the result fits, clamps into the editor box otherwise, and flips below the selection when there is no room above it. The placement rule is a pure exported helper, so the reported geometry is a unit test. Verified: - bun test tests/features/docs/editor/rich-text-editor.test.tsx: 31 passed - bun test tests/features/docs: 487 passed, 3 failed, and the same three fail on a clean main checkout (useAutosave x2 under full-suite timing, and the outline memo setext underline case), so they are pre-existing - RED both ways: restoring the pre-fix arithmetic fails the six placement tests and both component tests; restoring only the pre-fix rendering fails the two component tests (left 12px instead of 8px, top -40px instead of 28px) - biome check, check-comments, check-bytes and check-deps are clean - apps/web tsc --noEmit names neither touched file (the checkout reports pre-existing errors elsewhere) Fixes #515 Signed-off-by: ayam04 <[email protected]>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Contributor
Author
|
Incorporated into main by #586 at 11332e2. The final editor fix includes multiline selection placement and retained-selection resize handling, with real Chrome light/dark verification and 33 editor tests. The combined release passed 7,056 tests, all six CI jobs, CodeQL, links and preview checks. Original contributor history and ayam04 co-author credit are preserved in the squash commit. Closing as incorporated; production promotion is tracked separately. |
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.
Continues #581 and preserves its original contributor commit and review context. The selection toolbar stays inside the editor box and uses the final selected line when it must appear below a multiline selection.
The added component regression uses distinct endpoint coordinates. It fails at 28px before the repair and passes at 92px after the repair. Existing centering, edge clamping, and short-editor behavior remain covered.
Validation: frozen install,
bun run verifypassed with 7,032 tests and no failures or skips. The editor file passed all 32 tests. A local real-Chrome fixture using the shipped CSS passed in light and dark themes, placing the toolbar exactly 8px below the final selected line and 8px inside the editor edge.This draft is ready for independent source review and fresh exact-head CI. The original PR remains open until this replacement actually lands.
Fixes #515