Skip to content

feat(sidebar): widen content when the toc is hidden - #50

Merged
denolfe merged 1 commit into
mainfrom
feat/reflow-on-toc-hide
Aug 14, 2026
Merged

feat(sidebar): widen content when the toc is hidden#50
denolfe merged 1 commit into
mainfrom
feat/reflow-on-toc-hide

Conversation

@denolfe

@denolfe denolfe commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Hiding the TOC sidebar with t now widens the document text. Before, the freed columns became empty space, so the toggle looked inert on wide terminals.

Terminal 200 cols, content cap 100, sidebar 24

before, toc shown:   [ text 100 ][ empty 76 ][ toc 24 ]
before, toc hidden:  [ text 100 ][ empty 100          ]

after,  toc shown:   [ text 100 ][ empty 76 ][ toc 24 ]
after,  toc hidden:  [ text 124        ][ empty 76    ]

Key Changes

  • Content cap follows the sidebar
    • contentMaxForSidebar adds the sidebar width to the content max-width while the sidebar is hidden. Documents with no headings, and so no sidebar, keep the plain cap.
    • The new cap composes with the seam-drag override, the session-only width set by dragging the resize handle. A custom width gains the reclaimed columns too.

Hiding the toc handed its columns to dead space, so the toggle looked
inert on wide terminals. The content cap now rises by the reclaimed
sidebar width.
@github-actions

Copy link
Copy Markdown

Startup benchmark (--render test/exhaustive.md, linux-x64)

build mean ratio verdict
baseline (main@daae0b5) 707.4ms ± 15.0ms
PR 700.0ms ± 18.6ms 0.99× ✅ ok

Thresholds: warn ≥ 1.1×, fail ≥ 1.25×. Baseline built from main.

@denolfe
denolfe merged commit 6cce955 into main Aug 14, 2026
7 checks passed
@denolfe
denolfe deleted the feat/reflow-on-toc-hide branch August 14, 2026 21:50
denolfe added a commit that referenced this pull request Aug 15, 2026
- feat(sidebar): widen content when the toc is hidden (#50) (6cce955)
- feat(sidebar): drag-resize content width with a mouse handle (#49) (daae0b5)
- feat: render dot and graphviz fences as ascii diagrams (#48) (416931a)
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.

1 participant