fix: stop the editor TOC rail squashing rows on long pages - #773
Merged
Conversation
The rail's nav is a flex column with a max-height. Its entries carry `truncate`, and overflow:hidden zeroes a flex item's automatic minimum size, so the browser shrank all the entries to fit instead of letting the nav scroll. On a page with 60 headings every row collapsed to 12.5px and the text was clipped. `shrink-0` keeps each entry at its content height and sends the overflow to the nav's own scrollbar. Fixes #749
Confidence Score: 5/5Safe to merge; no actionable issues found. The bounded, overflow-enabled flex rail scrolls correctly, and the synchronized regression test exercises that behavior. Reviews (1): Last reviewed commit: "fix: stop the editor TOC rail squashing ..." | Re-trigger Greptile |
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.
closes #749
Problem
On a page with many headings, the editor's "On this page" rail renders every entry a few pixels tall, so the text is clipped and unreadable. Reported in #749.
Before: 60 headings, rows squashed to 12.5px, text clipped
Solution
The rail's
navis a flex column with amax-height, and its entries usetruncate.overflow: hiddenzeroes a flex item's automatic minimum size, so the entries shrink to fit instead of the nav scrolling.shrink-0on the entrieskeeps their content height and sends the overflow to the nav's scrollbar.
After: 29px rows, rail scrolls
The public reader's TOC uses the same flex column but no
truncate, so it already scrolls correctly. Not affected.Covered by a new e2e test in
editor-toc.spec.ts(60 headings; asserts row height and that the nav overflows). It fails on a temp revert of the fix.