Skip to content

Commit c90f28d

Browse files
committed
fix(webview): use VS Code-style scrollbar for expanded task prompt box
The expanded prompt box used a default always-visible Chromium scrollbar while the message list uses the hover-reveal .scrollable style, so two differently-styled scrollbars stacked in the same column. Add the shared .scrollable class so both behave consistently.
1 parent 155ac1c commit c90f28d

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎webview-ui/src/components/chat/TaskHeader.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ const TaskHeader = ({
326326
className="text-vscode-font-size overflow-y-auto break-words break-anywhere relative">
327327
<div
328328
ref={textRef}
329-
className="overflow-auto max-h-80 break-words break-anywhere cursor-text py-0.5"
329+
className="scrollable overflow-auto max-h-80 break-words break-anywhere cursor-text py-0.5"
330330
style={{
331331
display: "-webkit-box",
332332
WebkitLineClamp: "unset",

‎webview-ui/src/components/chat/__tests__/TaskHeader.spec.tsx‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,5 +351,20 @@ describe("TaskHeader", () => {
351351
// The raw markdown source must not be displayed verbatim in the expanded view.
352352
expect(screen.queryByText("**bold** and `code`")).not.toBeInTheDocument()
353353
})
354+
355+
it("uses the shared scrollable style for the expanded prompt box", () => {
356+
const { container } = renderTaskHeader({
357+
task: { type: "say", ts: Date.now(), text: "prompt", images: [] },
358+
})
359+
360+
// Expand the header.
361+
fireEvent.click(screen.getByText("prompt"))
362+
363+
// The prompt box must use the VS Code-style .scrollable scrollbar (hover-reveal),
364+
// not a default always-visible Chromium scrollbar, so it matches the message list.
365+
const scrollBox = container.querySelector(".scrollable")
366+
expect(scrollBox).not.toBeNull()
367+
expect(scrollBox?.className).toContain("max-h-80")
368+
})
354369
})
355370
})

0 commit comments

Comments
 (0)