Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

MUL-8891: fix(views): slim the space panel scrollbar (#10229)

Jiayuan Zhang4810b4205847
diff --git a/packages/ui/styles/base.css b/packages/ui/styles/base.css
index b5da97aa82..d1f75a7475 100644
--- a/packages/ui/styles/base.css
+++ b/packages/ui/styles/base.css
@@ -36,6 +36,32 @@
bottom: calc(var(--chat-launcher-clearance) + var(--chat-launcher-inset));
}
+/* The 6px ::-webkit-scrollbar below is ignored by Chromium (Chrome 121+, so
+ * every Electron build we ship) on any element whose scrollbar-width or
+ * scrollbar-color is set, which the base layer does for all elements; with
+ * always-on macOS scrollbars that leaves the native `thin`, 11px wide. This
+ * resets both so the 6px bar applies. A styled scrollbar is never an overlay,
+ * so the thumb only shows while the pointer is over the scroller — trackpad
+ * users would otherwise get a permanent bar where they had none. The thumb
+ * colour goes through a custom property because Chromium does not repaint
+ * scrollbar pseudo-elements on the scroller's own :hover. Firefox keeps the
+ * standard properties. */
+@utility scrollbar-slim {
+ @supports selector(::-webkit-scrollbar) {
+ scrollbar-width: auto;
+ scrollbar-color: auto;
+ }
+ &:hover {
+ --scrollbar-slim-thumb: var(--scrollbar-thumb);
+ }
+ &::-webkit-scrollbar-thumb {
+ background: var(--scrollbar-slim-thumb, transparent);
+ }
+ &::-webkit-scrollbar-thumb:hover {
+ background: var(--scrollbar-thumb-hover);
+ }
+}
+
/* Shiki dual themes: CSS-only light/dark switching via CSS variables */
/* @see https://shiki.style/guide/dual-themes */
.shiki,
diff --git a/packages/views/layout/panel-nav.tsx b/packages/views/layout/panel-nav.tsx
index fc5f7cd039..af1b1e21dd 100644
--- a/packages/views/layout/panel-nav.tsx
+++ b/packages/views/layout/panel-nav.tsx
@@ -76,7 +76,7 @@ export function PanelBody({
ref={ref}
style={fadeStyle}
onClickCapture={onClickCapture}
- className="min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 pb-4 [&>section:first-child]:mt-0"
+ className="scrollbar-slim min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 pb-4 [&>section:first-child]:mt-0"
>
{children}
</div>