Repository navigation
Show long code blocks in chat answers instead of hiding them behind an inner scroll - #33
Merged
Merged
Conversation
…er scroll A fenced code block in an answer was capped at about six rows with overflow: auto. On a phone that inner scroll has no visible scrollbar, so a long answer looked like it stopped halfway even though all of its text had arrived. Blocks now show whole. A block longer than 30 lines opens at its first 20 lines with a visible "Show all N lines" row; "Show less" folds it again and brings its top back into view. Wide lines still scroll sideways. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
Problem
A long Codex answer in the chat looked like it stopped halfway. All of the text had arrived (the
conversation API returns the answer whole). But a fenced code block was capped at about six rows
(
.markdown-code pre { max-height: calc(var(--row-h) * 6); overflow: auto }). On a phone thatinner scroll has no visible scrollbar. A 40-line block on an iPhone 13 viewport showed 336 px of
its 744 px and gave no hint that more was there.
On one of my Codex panes, 12 of 795 final answers had a code block over 7 lines, and the longest
was 382 lines.
Change
sideways.
row. Show less folds it again and brings the block's top back into view, since that row
sits at the bottom of a long block.
foldCode()insrc/lib/markdown.ts, with unit tests.the reader opened on purpose, not the answer.
Verification
bun run typecheck,bun test(304 pass),bun scripts/ui-regression.ts(all PASS)viewport and a 1280×900 desktop:
hidden; after "Show less", 20 lines with the block's top in view
🤖 Generated with Claude Code