Repository navigation
fix(workbench): keep the sidebar scrollbar off the conversation rows - #7568
Conversation
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
left a comment
There was a problem hiding this comment.
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:
-
Hit-test overlap with
ResizablePanelGroup's resize handle (docked sidebar)
Inproducts/maka/workbench/app/Workbench.tsx, the docked sidebar and main panel sit in a horizontalResizablePanelGroup(GAP = 0, boundary atx = W).ResizablePanelGroup(third-party/nsh/crates/nsh-base/src/resizable/panel.rs,resize_handle.rs) renders a9ptresize band (HANDLE_SIZE = 1,HANDLE_PADDING = 4) on top of the panels spanning[W - 4, W + 5].Because
grabs_thumbchecks ancestors ofhit.view(nsh-platform-{macos,windows,linux}/src/input.rs), pointer events inside[W - 4, W]hit the sibling resize handle instead of<List>, showing thecol-resizecursor 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 trailing2pt(1/3) overlaps the resize band. - Windows / Linux (
INDICATOR_THICK = 3,EDGE = 2innsh-core/src/scroll.rs): the visible thumb sits at[W - 5, W - 2], so2ptout of3pt(including its center atW - 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 keeping2pt/5ptclearance from the rows (W - 12). The trade-off is thatTHUMB_GRAB(12pt) extends2ptinto the trailing edge of the row ([W - 14, W - 2]), which is minimal against the32pttrailing action buttons. If keepingTHUMB_GRABstrictly 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. - macOS (
-
Minor nit
The12sidebar padding is now repeated in four coupled places inWorkspaceBrowser.tsx(rootpadding: 12, dividermarginHorizontal: -12, and the newpaddingRight: 12/marginRight: -12). Extracting a localconst sidebarPadding = 12would keep them tied to one source of truth.
简体中文
整体改法很干净克制。核对过 nsh-core 里 List 的 column() 和 full_width() 实现,contentStyle={{ paddingRight: 12 }} 能保证行项、empty 占位和 footer 的位置宽度不变,浮层侧边栏(sidebarHover)和 terminal 端也不受影响。
有两点建议确认一下:
-
停靠态下滚动条与
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严丝合缝不碰行尾且可接受上述重叠,按现状保留也行,明确权衡过就好。 - macOS(
-
小建议(非阻塞)
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
|
Thanks, both points taken in d164b5f:
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
left a comment
There was a problem hiding this comment.
LGTM, thanks for the quick follow-up!
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 2ptscrollbarInsetkeeps 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.