Note to first-time contributors: Please open a discussion post in
Discussions and describe your changes before submitting a pull
request.
Before submitting, make sure you've checked the following:
Target branch: Please verify that the pull request targets the dev branch.
Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is
added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or
other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests to validate the changes?
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring
adherence to the project's coding standards?
Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
fix: Fixes a bug or resolves an issue in the codebase
Changelog Entry
Description
This PR fixes the conversation bubble width jumping issue with YAML code blocks in widescreen mode. The problem occurred
when long YAML content caused automatic width expansion, leading to inconsistent bubble sizes during scrolling. The solution
implements strict width controls and forces horizontal overflow instead of automatic width adjustment.
Fixed
Fixed conversation bubble width jumping when scrolling with YAML code blocks containing long lines
Fixed automatic width expansion logic that caused inconsistent bubble sizes in widescreen mode
Fixed CodeMirror line wrapping behavior that triggered layout shifts with wide content
Fixed lack of horizontal scrolling in code blocks with overflow content
Changed
Implemented strict width control system for message bubbles with fixed 1152px default width
Removed CodeMirror line wrapping to force horizontal overflow instead of width expansion
Added CSS containment rules and !important declarations to lock bubble dimensions
Enhanced code block containers with immutable width constraints
Preserved manual resize functionality for user control while preventing automatic changes
Technical Details
Removed EditorView.lineWrapping from CodeMirror configuration
Added white-space: nowrap and overflow-x: auto to force horizontal scrolling
Implemented contain: layout to prevent child elements from affecting parent dimensions
Added strict CSS rules with !important to lock width properties
Enhanced resize handlers to only allow manual width changes
Create a chat with YAML content containing long lines (e.g., long URLs, configuration strings)
Verify that conversation bubbles maintain consistent width while scrolling
Test that horizontal scrollbars appear in code blocks for overflow content
Verify manual resize functionality still works for adjusting bubble width
Test behavior in both widescreen and normal modes
Confirm no width jumping occurs when YAML code blocks come into view during scrolling
Testing Steps
Take the exact YAML provided in the issue and paste in a chat. Trying moving around vertically to try to trigger unwanted width expansions. Should not happen.
Use width expansion bars to change width of messages.
Notice that the Collapse/Expand button and Copy button stay apparent even though the user is scrolling down. This removes the hindrance of having to scroll all the to the top to collapse or copy.
Verify the fix:
- Paste the YAML content in a chat message
- Scroll down until the code block is out of view
- Scroll back up and observe that the bubble width remains consistent
- Check that horizontal scrollbars appear in the code block
- Test manual resize functionality by dragging bubble edges
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to
the /CONTRIBUTOR_LICENSE_AGREEMENT, and
I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/16554
**Author:** [@Rain6435](https://github.com/Rain6435)
**Created:** 8/13/2025
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `fix/issue-5975-conversation-bubble-sizing-clean`
---
### 📝 Commits (6)
- [`83268d2`](https://github.com/open-webui/open-webui/commit/83268d2b6ea45565b3e88c410751eb701bf612bf) fix: Conversation bubble width jumping with YAML code blocks in widescreen mode
- [`61e3aaa`](https://github.com/open-webui/open-webui/commit/61e3aaafcf79675f2569e065c1460ec7b16c4ced) fix formatting
- [`d242716`](https://github.com/open-webui/open-webui/commit/d242716258a8647608b743b880bd9b778d17a2cf) Small change to trigger github actions.
- [`0d76942`](https://github.com/open-webui/open-webui/commit/0d76942b9576605da3a2b94c89d020a5afbdfcf3) fix: correct formatting issues in translation files for English and Portuguese
- [`91cdd1b`](https://github.com/open-webui/open-webui/commit/91cdd1bf6be2bbfa622dec10f385d97e1b6cbaea) fix: apply formatting to upstream files
- [`b4b7574`](https://github.com/open-webui/open-webui/commit/b4b7574c46bc077f926cc375f55b6107daff3e8a) fix: resolve translation formatting inconsistencies
### 📊 Changes
**8 files changed** (+593 additions, -156 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/components/chat/Messages/CodeBlock.svelte` (+223 -74)
📝 `src/lib/components/chat/Messages/Message.svelte` (+249 -74)
📝 `src/lib/components/chat/Messages/UserMessage.svelte` (+27 -2)
📝 `src/lib/components/common/CodeEditor.svelte` (+84 -1)
📝 `src/lib/components/layout/Sidebar/Folders/FolderModal.svelte` (+3 -1)
📝 `src/lib/components/workspace/Models/ModelEditor.svelte` (+3 -1)
📝 `src/lib/i18n/locales/kab-DZ/translation.json` (+1 -0)
📝 `src/lib/i18n/locales/pt-BR/translation.json` (+3 -3)
</details>
### 📄 Description
# Pull Request Checklist
### Note to first-time contributors: Please open a discussion post in
[Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull
request.
**Before submitting, make sure you've checked the following:**
* [x] **Target branch:** Please verify that the pull request targets the `dev` branch.
* [x] **Description:** Provide a concise description of the changes made in this pull request.
* [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is
added at the bottom of the PR description.
* [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or
other documentation sources?
* [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
* [x] **Testing:** Have you written and run sufficient tests to validate the changes?
* [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring
adherence to the project's coding standards?
* [x] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following:
* **fix**: Fixes a bug or resolves an issue in the codebase
# Changelog Entry
### Description
This PR fixes the conversation bubble width jumping issue with YAML code blocks in widescreen mode. The problem occurred
when long YAML content caused automatic width expansion, leading to inconsistent bubble sizes during scrolling. The solution
implements strict width controls and forces horizontal overflow instead of automatic width adjustment.
### Fixed
* Fixed conversation bubble width jumping when scrolling with YAML code blocks containing long lines
* Fixed automatic width expansion logic that caused inconsistent bubble sizes in widescreen mode
* Fixed CodeMirror line wrapping behavior that triggered layout shifts with wide content
* Fixed lack of horizontal scrolling in code blocks with overflow content
### Changed
* Implemented strict width control system for message bubbles with fixed 1152px default width
* Removed CodeMirror line wrapping to force horizontal overflow instead of width expansion
* Added CSS containment rules and `!important` declarations to lock bubble dimensions
* Enhanced code block containers with immutable width constraints
* Preserved manual resize functionality for user control while preventing automatic changes
### Technical Details
* Removed `EditorView.lineWrapping` from CodeMirror configuration
* Added `white-space: nowrap` and `overflow-x: auto` to force horizontal scrolling
* Implemented `contain: layout` to prevent child elements from affecting parent dimensions
* Added strict CSS rules with `!important` to lock width properties
* Enhanced resize handlers to only allow manual width changes
### Additional Information
Fixes #5975
### Test Plan
* Create a chat with YAML content containing long lines (e.g., long URLs, configuration strings)
* Verify that conversation bubbles maintain consistent width while scrolling
* Test that horizontal scrollbars appear in code blocks for overflow content
* Verify manual resize functionality still works for adjusting bubble width
* Test behavior in both widescreen and normal modes
* Confirm no width jumping occurs when YAML code blocks come into view during scrolling
### Testing Steps
* Take the exact YAML provided in the issue and paste in a chat. Trying moving around vertically to try to trigger unwanted width expansions. Should not happen.
* Use width expansion bars to change width of messages.
* Notice that the Collapse/Expand button and Copy button stay apparent even though the user is scrolling down. This removes the hindrance of having to scroll all the to the top to collapse or copy.
2. Verify the fix:
- Paste the YAML content in a chat message
- Scroll down until the code block is out of view
- Scroll back up and observe that the bubble width remains consistent
- Check that horizontal scrollbars appear in the code block
- Test manual resize functionality by dragging bubble edges
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to
the /CONTRIBUTOR_LICENSE_AGREEMENT, and
I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/16554
Author: @Rain6435
Created: 8/13/2025
Status: ❌ Closed
Base:
dev← Head:fix/issue-5975-conversation-bubble-sizing-clean📝 Commits (6)
83268d2fix: Conversation bubble width jumping with YAML code blocks in widescreen mode61e3aaafix formattingd242716Small change to trigger github actions.0d76942fix: correct formatting issues in translation files for English and Portuguese91cdd1bfix: apply formatting to upstream filesb4b7574fix: resolve translation formatting inconsistencies📊 Changes
8 files changed (+593 additions, -156 deletions)
View changed files
📝
src/lib/components/chat/Messages/CodeBlock.svelte(+223 -74)📝
src/lib/components/chat/Messages/Message.svelte(+249 -74)📝
src/lib/components/chat/Messages/UserMessage.svelte(+27 -2)📝
src/lib/components/common/CodeEditor.svelte(+84 -1)📝
src/lib/components/layout/Sidebar/Folders/FolderModal.svelte(+3 -1)📝
src/lib/components/workspace/Models/ModelEditor.svelte(+3 -1)📝
src/lib/i18n/locales/kab-DZ/translation.json(+1 -0)📝
src/lib/i18n/locales/pt-BR/translation.json(+3 -3)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in
Discussions and describe your changes before submitting a pull
request.
Before submitting, make sure you've checked the following:
Target branch: Please verify that the pull request targets the
devbranch.Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is
added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or
other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests to validate the changes?
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring
adherence to the project's coding standards?
Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
Changelog Entry
Description
This PR fixes the conversation bubble width jumping issue with YAML code blocks in widescreen mode. The problem occurred
when long YAML content caused automatic width expansion, leading to inconsistent bubble sizes during scrolling. The solution
implements strict width controls and forces horizontal overflow instead of automatic width adjustment.
Fixed
Changed
!importantdeclarations to lock bubble dimensionsTechnical Details
EditorView.lineWrappingfrom CodeMirror configurationwhite-space: nowrapandoverflow-x: autoto force horizontal scrollingcontain: layoutto prevent child elements from affecting parent dimensions!importantto lock width propertiesAdditional Information
Fixes #5975
Test Plan
Testing Steps
- Paste the YAML content in a chat message
- Scroll down until the code block is out of view
- Scroll back up and observe that the bubble width remains consistent
- Check that horizontal scrollbars appear in the code block
- Test manual resize functionality by dragging bubble edges
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to
the /CONTRIBUTOR_LICENSE_AGREEMENT, and
I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.