Improve Spright chat message sizing for wide content - #3038
Open
jattasNI wants to merge 12 commits into
Open
Conversation
rajsite
reviewed
Aug 21, 2026
rajsite
reviewed
Aug 21, 2026
jattasNI
marked this pull request as ready for review
August 26, 2026 21:55
rajsite
reviewed
Aug 27, 2026
| @@ -0,0 +1,7 @@ | |||
| { | |||
Member
Contributor
Author
There was a problem hiding this comment.
I'm not sure what to do here and I'm open to inputs from regular Windows users about what would feel natural. On mac the overlay scrollbars tend to be translucent and not permanently visible so I'm not sure what typical conventions are for cases like this.
Some options:
- do nothing because, at the moment, outbound messages are the only ones with a border/background and all clients currently only populate them with text content which wraps rather than overflows
- inset the scrollbar something like in the screenshot below. I achieved this by moving the border/background rendering to the outer container, keeping the scrollbar on the inner content, and adding padding between them.
- other ideas?
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.

Pull Request
🤨 Rationale
Fixes #2607. Also addresses an issue where clients setting max-width on a message wasn't respected, causing content to grow the width of the conversation and show a horizontal scrollbar and whitespace.
👩💻 Implementation
The end result is that messages will default to never being wider than the conversation and the message (rather than the conversation) will show a horizontal scrollbar if their content is too wide. Clients can now configure what the max-width is if they want different behavior.
Changes to achieve this:
On all message types,
calc(90%)to90%because they are equivalent.align-selfstyling because this caused some inbound messages to no longer be right aligned.align-selfis a better way to align an item within its container.max-width: 100%to themessage-contentelement andwidth: 100%to thecontainerelement. This prevents messages with wide content from growing beyond the message max-width.On inbound message, change initial
max-widthto 100% as requested in #2607 and I agree in SystemLink it looks better for wide content like tables.🧪 Testing
In storybook you can see all messages (except the deprecated
chat-message) now respect the max-width and show a horizontal scrollbar.I see the same thing in a markdown table in SystemLink:

I changed one matrix story to include the conversation so that message positioning still worked.
✅ Checklist