Repository navigation
fix(ui): wrap code blocks instead of scrolling them, in every view - #37
Merged
Merged
Conversation
A long curl in a chat code block forced horizontal scrolling. Code blocks were set to scroll inside their own box, a deliberate choice in the chat-overflow fix (#16) that the operator has now reversed: code wraps. Measured, not inferred. chat-overflow.spec.ts was tightened first so it reproduces the bug, then the CSS was fixed against it: before: CODE.hljs scrollWidth 2834 in a 378px box -> test FAILS after: no element wider than the 408px bubble -> test PASSES The offender was the inner <code>, not the <pre>. highlight.js styles .hljs, and text inside a non-wrapping <code> ignores its parent's white-space, so the rule has to name the code element too. overflow-wrap:anywhere breaks unbroken tokens (URLs, base64, long flags) that pre-wrap alone would leave hanging. Same bug, fixed in every renderer of markdown code: desktop chat .chat-msg-body pre (two conflicting rules, both scrolled) mobile chat .mob-msg .bubble pre desktop notes/wiki .notes-editor .toastui-editor-contents pre mobile notes .mob-note-body .toastui-editor-contents pre action run detail .action-run-detail pre (wrapped, but URLs escaped) One block appended to each stylesheet rather than five edits in place: equal or higher specificity and placed last, so it wins over the per-view rules and over any highlight.js theme's lower-specificity .hljs rule. Corrected the earlier comment that still said code blocks "cannot wrap". The spec no longer exempts PRE/CODE from the no-horizontal-overflow check (only TABLE may scroll inside itself), and asserts the 400-char line actually spans several rendered lines unclipped. That second check exists because an earlier overflow-x:hidden "passed" a no-scroll check by cutting the text off. Only desktop chat is measured directly; the other four share the identical rule. CI's mobile pixel baselines are the broader check on them.
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.
A long curl in a chat code block forced horizontal scrolling. Code blocks were
set to scroll inside their own box, a deliberate choice in the chat-overflow
fix (#16) that the operator has now reversed: code wraps.
Measured, not inferred. chat-overflow.spec.ts was tightened first so it
reproduces the bug, then the CSS was fixed against it:
before: CODE.hljs scrollWidth 2834 in a 378px box -> test FAILS
after: no element wider than the 408px bubble -> test PASSES
The offender was the inner
, not the