Commit ab7ed0d4b for llama.cpp
commit ab7ed0d4b517c96d181dc96874d6ba259182881c
Author: A-Raphie <60940271+A-Raphie@users.noreply.github.com>
Date: Mon Oct 19 23:22:14 2026 +0100
ui : fix attachment text preview clipped when a line is longer than the container (#30806)
In the attachment preview, SyntaxHighlightedCode's wrapper (overflow-auto) was not the element that ended up owning horizontal overflow: the inner code box kept its content clipped at the wrapper's width, so a single line longer than the preview pane was cut off with no scrollbar (scrollWidth == clientWidth while the code's own content measured tens of thousands of px).
Give the pre/code boxes their intrinsic width (width: max-content, min-width: 100%) so long-line overflow propagates to the scrolling wrapper. Verified in the running WebUI: with a 6000-char line, wrapper scrollWidth goes from 990 (clipped, unscrollable) to 50449 with a working horizontal scrollbar; short content still fills the container exactly as before (min-width: 100%).
Fixes #30796
diff --git a/tools/ui/src/lib/components/app/content/SyntaxHighlightedCode.svelte b/tools/ui/src/lib/components/app/content/SyntaxHighlightedCode.svelte
index e88e0d4cd..68c23ca6c 100644
--- a/tools/ui/src/lib/components/app/content/SyntaxHighlightedCode.svelte
+++ b/tools/ui/src/lib/components/app/content/SyntaxHighlightedCode.svelte
@@ -147,12 +147,19 @@
.code-preview-wrapper pre {
background: transparent;
padding: 0;
+ /* Stretch to the content's intrinsic width so a single long line
+ propagates its overflow to this scrolling wrapper instead of being
+ clipped at the wrapper's width with no way to scroll to it. */
+ width: max-content;
+ min-width: 100%;
}
.code-preview-wrapper code {
background: transparent;
display: block;
padding: 0.5rem;
+ width: max-content;
+ min-width: 100%;
}
:global(.dark) .code-preview-wrapper {