mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #22361] [CLOSED] fix: prevent code blocks from causing message bubble width inconsistency #49680
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22361
Author: @realsamrat
Created: 3/7/2026
Status: ❌ Closed
Base:
main← Head:fix/yaml-codeblock-bubble-width📝 Commits (1)
64169c7fix: prevent code blocks from causing message bubble width inconsistency📊 Changes
2 files changed (+5 additions, -5 deletions)
View changed files
📝
src/lib/components/chat/Messages/ResponseMessage.svelte(+2 -2)📝
src/lib/components/chat/Messages/UserMessage.svelte(+3 -3)📄 Description
Description
While testing the chat interface in widescreen mode, I noticed that message bubbles containing code blocks (particularly YAML) would change width inconsistently when scrolling. The bubbles would appear to resize as different messages came into view, creating a jarring visual effect.
Root Cause
The issue was caused by missing
min-w-0on flex containers in the message components. In CSS flexbox, withoutmin-w-0, flex children refuse to shrink below their intrinsic content width. When code blocks rendered wide content, they would force their parent containers to expand beyond the intended max-width, causing the layout reflow.Additionally, some containers used
min-w-fullwhich explicitly prevented proper flex shrinking behavior.Changes
UserMessage.svelte:
min-w-fulltomin-w-0on the.chat-usercontainermin-w-0to parent flex containers wrapping message contentResponseMessage.svelte:
min-w-0to theflex-autocontainer that wraps assistant messagesmin-w-fulltomin-w-0on the.chat-assistantcontainerTesting
Tested in widescreen mode with various code block types (YAML, JSON, Python) containing long lines. Message bubble widths now remain consistent when scrolling up and down through the conversation.
Fixes #5975
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.