Skip to content

fix(workbench): keep the sidebar scrollbar off the conversation rows - #7568

Merged
M4n5ter merged 2 commits into
mainfrom
fix/sidebar-scrollbar-gutter
Dec 3, 2026
Merged

M4n5ter merged 2 commits into
mainfrom
fix/sidebar-scrollbar-gutter

Conversation

@UncertaintyDeterminesYou4ndMe

@UncertaintyDeterminesYou4ndMe UncertaintyDeterminesYou4ndMe commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On macOS the sidebar's overlay scrollbar ran over the conversation rows: the list stopped at the sidebar's 12pt padding, and the 6pt indicator sits 2pt in from the list's trailing edge, which is where the rows' relative times and the per-project new-conversation buttons end.

The list now extends 12pt to the sidebar's trailing edge (marginRight: -12) and pads its content by the same amount (contentStyle), so the rows keep their position and the scrollbar runs in the padding. A 2pt scrollbarInset keeps the thumb out of the docked sidebar's resize band, which covers the last 4pt. The terminal idiom is unchanged.

Checked in a local macOS release build with a real root, before the 2pt inset was added: the rows look as before, and the scrollbar no longer covers them while scrolling.

AI use

Claude Code (Claude Opus 5.5) found the cause and wrote the change. The author reported the problem and checked the result in the app.

The conversation list stopped at the sidebar's 12pt padding, so the
overlay scrollbar ran over the rows' relative times and new-conversation
buttons. The list now reaches the sidebar edge and pads its content
instead, so the scrollbar runs in that padding.

Generated-by: Claude Code

@M4n5ter M4n5ter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

English

Clean fix overall—checked nsh-core's List layout (column() and full_width()), and contentStyle={{ paddingRight: 12 }} keeps items, empty, and footer aligned as before while sidebarHover (overflow: 'hidden') and terminal stay unaffected.

Two things worth flagging:

  1. Hit-test overlap with ResizablePanelGroup's resize handle (docked sidebar)
    In products/maka/workbench/app/Workbench.tsx, the docked sidebar and main panel sit in a horizontal ResizablePanelGroup (GAP = 0, boundary at x = W). ResizablePanelGroup (third-party/nsh/crates/nsh-base/src/resizable/panel.rs, resize_handle.rs) renders a 9pt resize band (HANDLE_SIZE = 1, HANDLE_PADDING = 4) on top of the panels spanning [W - 4, W + 5].

    Because grabs_thumb checks ancestors of hit.view (nsh-platform-{macos,windows,linux}/src/input.rs), pointer events inside [W - 4, W] hit the sibling resize handle instead of <List>, showing the col-resize cursor and resizing the sidebar instead of dragging the scrollbar thumb:

    • macOS (INDICATOR_THICK = 6, EDGE = 2): the visible thumb sits at [W - 8, W - 2], so its trailing 2pt (1/3) overlaps the resize band.
    • Windows / Linux (INDICATOR_THICK = 3, EDGE = 2 in nsh-core/src/scroll.rs): the visible thumb sits at [W - 5, W - 2], so 2pt out of 3pt (including its center at W - 3.5) falls under the resize handle.

    Adding scrollbarInset={platform.idiom === 'terminal' ? undefined : { right: 2 }} moves the visible thumb completely clear of [W - 4, W] on all three desktop platforms ([W - 10, W - 4] on macOS, [W - 7, W - 4] on Windows/Linux) while keeping 2pt/5pt clearance from the rows (W - 12). The trade-off is that THUMB_GRAB (12pt) extends 2pt into the trailing edge of the row ([W - 14, W - 2]), which is minimal against the 32pt trailing action buttons. If keeping THUMB_GRAB strictly outside the row bounds is preferred over direct thumb dragging on Windows/Linux, leaving it as-is is fine—just worth an explicit trade-off call.

  2. Minor nit
    The 12 sidebar padding is now repeated in four coupled places in WorkspaceBrowser.tsx (root padding: 12, divider marginHorizontal: -12, and the new paddingRight: 12 / marginRight: -12). Extracting a local const sidebarPadding = 12 would keep them tied to one source of truth.

简体中文

整体改法很干净克制。核对过 nsh-core 里 List 的 column() 和 full_width() 实现,contentStyle={{ paddingRight: 12 }} 能保证行项、empty 占位和 footer 的位置宽度不变,浮层侧边栏(sidebarHover)和 terminal 端也不受影响。

有两点建议确认一下:

  1. 停靠态下滚动条与 ResizablePanelGroup 拖拽手柄存在命中重叠
    在 products/maka/workbench/app/Workbench.tsx 中,停靠态侧边栏与主面板同属水平 ResizablePanelGroup(桌面端 GAP = 0,分界线在 x = W)。ResizablePanelGroup(third-party/nsh/crates/nsh-base/src/resizable/panel.rs、resize_handle.rs)会在面板之上绝对定位一条宽 9pt 的透明热区(HANDLE_SIZE = 1,HANDLE_PADDING = 4),覆盖 [W - 4, W + 5]。

    由于三端桌面输入逻辑里的 grabs_thumb 只沿 hit.view 的祖先链查找(nsh-platform-{macos,windows,linux}/src/input.rs),落在 [W - 4, W] 的指针会优先命中兄弟节点 resize handle 而不是 <List>,触发 col-resize 光标并拖拽侧边栏宽度:

    • macOS(INDICATOR_THICK = 6、EDGE = 2):视觉滑块在 [W - 8, W - 2],右侧 2pt(1/3 宽度)落入 resize 热区。
    • Windows / Linux(nsh-core/src/scroll.rs 中 INDICATOR_THICK = 3、EDGE = 2):视觉滑块在 [W - 5, W - 2],有 2pt / 3pt(包含滑块正中心 W - 3.5)被 resize handle 盖住,直接拖滑块容易误触调宽。

    如果顺手加上 scrollbarInset={platform.idiom === 'terminal' ? undefined : { right: 2 }},三端可见滑块(macOS [W - 10, W - 4]、Win/Linux [W - 7, W - 4])就能完全避开 [W - 4, W],同时与行尾(W - 12)还保留 2pt/5pt 间距。代价仅是 THUMB_GRAB(12pt)会往行尾边沿多探 2pt([W - 14, W - 2]),对 32pt 宽的行尾按钮基本无感。如果更看重 THUMB_GRAB 严丝合缝不碰行尾且可接受上述重叠,按现状保留也行,明确权衡过就好。

  2. 小建议(非阻塞)
    12 这个侧边栏水平间距现在在 WorkspaceBrowser.tsx 中耦合出现了 4 处(根容器 padding: 12、分隔线 marginHorizontal: -12 以及本次新增的 paddingRight: 12 / marginRight: -12),抽一个局部 const sidebarPadding = 12 可以避免后续改间距漏改。

The docked sidebar's resize band covers its last 4pt, where the
scrollbar's trailing edge now ran. Inset the scrollbar 2pt so the thumb
ends 4pt in from the edge, and name the sidebar padding.

Generated-by: Claude Code
@UncertaintyDeterminesYou4ndMe

Copy link
Copy Markdown
Contributor Author

Thanks, both points taken in d164b5f:

  1. Added scrollbarInset={{ right: 2 }} (desktop only). I checked the constants you cited (HANDLE_PADDING = 4, INDICATOR_THICK 6 on macOS and 3 in nsh-core): the visible thumb now ends at W - 4, so it no longer reaches the resize band, and it stays 2pt (macOS) / 5pt (Windows, Linux) clear of the rows.
  2. The sidebar padding is now sidebarPadding, used by the root padding, the divider and the list.

The first version was checked in the macOS app with a real root. This 2pt follow-up has passed type checking but has not been checked in the app.

Posted by Claude Opus 5.5 (AI).

@M4n5ter M4n5ter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the quick follow-up!

@M4n5ter
M4n5ter merged commit 34b41d4 into main Dec 3, 2026
1 check passed
@M4n5ter
M4n5ter deleted the fix/sidebar-scrollbar-gutter branch December 3, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants