Skip to content

Show up to two lines per toc sidebar item#6502

Open
carlosabadia wants to merge 3 commits into
mainfrom
carlos/truncate-toc-second-line
Open

Show up to two lines per toc sidebar item#6502
carlosabadia wants to merge 3 commits into
mainfrom
carlos/truncate-toc-second-line

Conversation

@carlosabadia
Copy link
Copy Markdown
Contributor

No description provided.

@carlosabadia carlosabadia requested review from a team and Alek99 as code owners May 13, 2026 10:41
@carlosabadia carlosabadia added the documentation Improvements or additions to documentation label May 13, 2026
@carlosabadia carlosabadia requested a review from tgberkeley May 13, 2026 10:41
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 13, 2026

Greptile Summary

This PR updates the Table of Contents (TOC) sidebar on doc pages to show up to two lines of text per item instead of truncating at one line, and adds a scrollable container with a masked fade effect for long TOC lists.

  • truncate + block classes are replaced with line-clamp-2 on all three heading-level <a> elements, allowing wrapping text to render up to two lines.
  • The TOC <ul> container gains max-h-[60vh] overflow-y-auto with a hidden scrollbar and scroll-mask-y-10 fade from the new tailwindcss-scroll-mask@0.0.3 package; tailwindcss-animated is also now pinned to 2.0.0.

Confidence Score: 5/5

Safe to merge — changes are limited to TOC sidebar styling with no logic or data-flow impact.

All three changed files touch only CSS classes and frontend package declarations. The line-clamp-2 replacement is a straightforward Tailwind swap, and the scroll-mask setup follows standard patterns. The only thing worth a second glance is that tailwindcss-scroll-mask is at 0.0.3, but it is pinned and its usage is isolated to the TOC container.

No files require special attention.

Important Files Changed

Filename Overview
docs/app/reflex_docs/templates/docpage/docpage.py Replaces block truncate with line-clamp-2 on all three TOC anchor levels and adds scroll containment (max-h-[60vh] overflow-y-auto scroll-mask-y-10) to the TOC ul.
docs/app/assets/tailwind-theme.css Adds @import 'tailwindcss-scroll-mask' to expose the scroll-mask-* utility classes.
docs/app/rxconfig.py Pins tailwindcss-animated to 2.0.0 (previously unpinned) and adds tailwindcss-scroll-mask@0.0.3; the new package is still at version 0.0.3.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[TOC sidebar renders] --> B{heading level?}
    B -->|level == 1| C["a pl-4 line-clamp-2"]
    B -->|level == 2| D["a pl-4 line-clamp-2"]
    B -->|level >= 3| E["a pl-8 line-clamp-2"]
    C --> F["ul id=toc-navigation\nmax-h-60vh · overflow-y-auto\nscroll-mask-y-10 · scrollbar hidden"]
    D --> F
    E --> F
    F --> G{content taller than 60vh?}
    G -->|yes| H[Scrollable with fade mask]
    G -->|no| I[Static list]
Loading

Reviews (1): Last reviewed commit: "ok" | Re-trigger Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 13, 2026

Merging this PR will not alter performance

✅ 24 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing carlos/truncate-toc-second-line (7f628fd) with main (c3c720f)2

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (39c74cb) during the generation of this report, so c3c720f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Alek99
Alek99 previously approved these changes May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants