[UI Bug] Code blocks missing horizontal scrollbar — long lines are clipped
Describe the bug
Code blocks in the chat UI do not show a horizontal scrollbar when the content exceeds the container width. Long lines are clipped, making them impossible to read in full.
To Reproduce
- Open OpenWork and start any conversation.
- Type or receive a message containing a code block with a line longer than the viewport (e.g., a long URL, a shell command with many flags, or a long JSON string).
- Observe that the long line is clipped at the right edge with no horizontal scrollbar to reveal the remainder.
Expected behavior
A horizontal scrollbar should appear when code block content overflows the container width, allowing the user to scroll and read the full line.
Actual behavior
Content is clipped. No horizontal scrollbar is visible. The user cannot access the overflowed portion.
Environment
- OpenWork version: v0.17.9
- Platform: Windows 11
- Device: Desktop
Workaround (DevTools Snippet)
Until this is fixed natively, you can apply the following CSS via a DevTools Snippet. Open DevTools (Ctrl + Shift + I) → Sources → Snippets, create a new snippet, paste the code below, save, and run it.
Note: This code below works best for dark theme in OpenWork.
const style = document.createElement('style');
style.id = 'code-block-horizontal-scrollbar';
style.textContent = `
.overflow-x-auto, .overflow-auto,
pre {
overflow-x: auto !important;
overflow-y: auto !important;
max-width: 100% !important;
white-space: pre !important;
word-wrap: normal !important;
word-break: normal !important;
}
pre code,
pre span,
.overflow-x-auto code,
.overflow-x-auto span {
display: inline !important;
white-space: inherit !important;
}
.overflow-x-auto::-webkit-scrollbar,
.overflow-auto::-webkit-scrollbar,
pre::-webkit-scrollbar {
height: 8px !important;
display: block !important;
}
.overflow-x-auto::-webkit-scrollbar-track,
.overflow-auto::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track {
background: transparent !important;
}
.overflow-x-auto::-webkit-scrollbar-thumb,
.overflow-auto::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb {
background: rgba(255,255,255,0.15) !important;
border-radius: 999px !important;
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1) !important;
}
`;
document.head.appendChild(style);
console.log('✅ Code block horizontal scrollbar applied!');
Additional context
The issue appears to be caused by the chat UI's CSS either missing overflow-x: auto on the code block containers, or the white-space being set to pre-wrap (which wraps long lines) instead of pre (which preserves them with scrolling). Affected containers include .overflow-x-auto, .overflow-auto, and <pre> elements used by Shiki for syntax highlighting.
I've created a fix for this layout bug and opened a PR to restore horizontal scrolling on clipped code blocks.
Thanks @SumanMadipeddi . Please take a look at this related feature request. https://github.com/different-ai/openwork/issues/2478