Skip to content

The transcript box could only grow, so the only scrollbar was the horizontal one - #89

Merged
arpanghoshal merged 1 commit into
mainfrom
fix/try-it-vertical-scroll
Sep 6, 2026
Merged

The transcript box could only grow, so the only scrollbar was the horizontal one#89
arpanghoshal merged 1 commit into
mainfrom
fix/try-it-vertical-scroll

Conversation

@arpanghoshal

Copy link
Copy Markdown
Contributor

The bug

The Try-it page's output box had minHeight: "180px" and no maxHeight, no overflowY. So as the reveal appended lines the box got taller and pushed the page down. It never scrolled vertically, because there was no vertical overflow to scroll — which also made output.scrollTop = output.scrollHeight in try-it.js dead code. The only scrollbar the reader got was the horizontal one the demo's long lines need.

Measured in a headless browser at 820px wide, running the real script against a real transcript:

before after
Box height at the end 910px, still growing 452px, fixed
scrollHeight vs clientHeight 910 = 910, no overflow 910 > 452
scrollTop at the end 0 458
Page height (700px viewport) 956, page grew 700, page did not grow
scrollLeft during the reveal 0 0, no horizontal jump

The fix

  • overflowY: "auto" and maxHeight: "min(60vh, 440px)" on the box, so it is a terminal that scrolls rather than a block that grows. overflowX: "auto" and whiteSpace: "pre" stay: the demo's columns are aligned and must not wrap, so the few long lines scroll inside the box. The page body never scrolls horizontally.
  • The reveal follows the newest line only for a reader already within 40px of the bottom, and resumes when they scroll back down. Yanking somebody away from a scenario they are re-reading is worse than not following.

Verified in a browser: scrolling up mid-reveal held position at 0 for six seconds, and scrolling back to the bottom resumed following.

Mutation table

Mutation Result
Remove maxHeight (the shipped state) 1 failed
Remove overflowY 1 failed
Restore the unconditional follow 1 failed
Restored 20 passed

Test note

The full suite is 3902 passed, 45 skipped, with one unrelated failure: test_the_cli_reference_matches_clicks_help_text. It fails identically on a pristine origin/main checkout, because the shared virtualenv resolves ctrlrun to the main working tree, where another branch has uncommitted verify --url help text. Not from this change, and CI installs from the branch.

🤖 Generated with Claude Code

…izontal one

The Try-it page's output box had a min-height and no max-height. As the reveal
appended lines the box got taller and pushed the page down; it never scrolled,
because there was no vertical overflow to scroll. The follow-the-newest-line
in try-it.js was dead code against it — scrollTop stayed 0 — and the one
scrollbar the reader did get was the horizontal one the demo's long lines need.
Measured in a browser at 820px wide: the box grew to 910px with scrollHeight
equal to clientHeight, and the page grew from 700 to 956.

The box now has overflow-y and a max-height of min(60vh, 440px), which makes it
a terminal that scrolls rather than a block that grows: it holds at 452px and
scrolls to 458, and the page stops growing. The long lines still scroll
horizontally inside it, which is what a transcript with aligned columns needs.

Following the output is right up until somebody scrolls up to re-read, so the
reveal now follows only a reader already within 40px of the bottom, and resumes
when they scroll back down. Both verified in a browser.
@mintlify

mintlify Bot commented Sep 6, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
ctrlrun 🟢 Ready View Preview Sep 6, 2026, 4:32 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@arpanghoshal
arpanghoshal merged commit 28e8a9a into main Sep 6, 2026
8 checks passed
@arpanghoshal
arpanghoshal deleted the fix/try-it-vertical-scroll branch September 6, 2026 16:39
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