fix: prevent horizontal scrolling in the message viewport#11225
Open
mvanhorn wants to merge 1 commit into
Open
fix: prevent horizontal scrolling in the message viewport#11225mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
Contributor
|
Missing report label. Set exactly one of: |
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.
Contribution Summary
Linked Issue/Ticket: Fixes #11038
RFC / Technical Design (if applicable): N/A
Description
The message view allows a few pixels of horizontal scrolling: the rendered content ends up slightly wider than the screen and can be dragged left/right. As #11038 notes, ordinary messages were not horizontally scrollable before this regressed.
The cause is in the new message reader stylesheet. The main content rule sets
width: 100%together withpadding: 0 8px, but withoutbox-sizing: border-box:Under the default
content-boxmodel the 8px left/right padding is added on top of the full 100% width, so the body becomes 16px wider than the viewport, which is the small horizontal overflow the issue describes. (This also rules out the font-size theory raised on the thread: the reporter confirmed font size is at 100% and the overflow persists.)Adding
box-sizing: border-boxto that rule makes the padding count inside the 100% width instead of being added to it, so the content matches the viewport width again. The change is confined toDefaultGlobalCssStyleProvider(the current default path); the legacy provider does not emit this rule and is left untouched. The existingwidth: 100%,overflow-wrap, andpadding: 0 8pxdeclarations are preserved, so the 8px gutter is still rendered, now within the viewport.Screen Shots
This is a CSS box-model fix that removes a few pixels of horizontal overscroll; the difference is the absence of left/right drag rather than a visible layout change, so it is not meaningfully captured in a static screenshot. The behavior is covered instead by a unit test in
DefaultGlobalCssStyleProviderTest.AI Disclosure
Select one of the following (mandatory)
Contribution Checklist
gradlew spotlessCheckto check andgradlew spotlessApplyto format your source code; will be checked by CI).gradlew testDebugUnitTest; will be checked by CI).