mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #22363] [CLOSED] fix: prevent code blocks from causing message bubble width inconsistency in widescreen #26634
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/22363
Author: @realsamrat
Created: 3/7/2026
Status: ❌ Closed
Base:
main← Head:fix/yaml-codeblock-bubble-width📝 Commits (1)
e0bc3e3fix: 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
When scrolling through a conversation in widescreen mode that contains YAML code blocks, the message bubble widths change inconsistently. This creates a jarring layout shift where bubbles appear to resize as you scroll up and down.
Root Cause
The message bubble containers were using
min-w-fullwhich forces the element to be at least as wide as its parent — but in a flex context, this prevented the bubbles from shrinking below their content's intrinsic size. When a YAML (or any wide) code block renders, it pushes the bubble out, causing layout reflow on scroll.The fix is
min-w-0, which is the correct Tailwind class for flex children that need to shrink properly. Without it, flexbox children don't shrink below their content width.Changes
ResponseMessage.svelte: replacedmin-w-fullwithmin-w-0on the message content container and addedmin-w-0to the flex wrapperUserMessage.svelte: same fix applied to user bubble containersTesting
Reproduced with the YAML preset from the issue:
https://github.com/ChatLunaLab/chatluna-character/blob/main/resources/presets/default.yml
Bubble widths remain consistent while scrolling in widescreen mode after the fix.
Fixes #5975
contributor license agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.