Flag-gated AppKit sidebar list (NSTableView rows + headers)
Rewrites the workspace sidebar list in AppKit behind the feature flag sidebar-appkit-list-experiment (default OFF; PostHog-overridable, local override via Internal Flags).
Flag OFF (default): the existing SwiftUI LazyVStack sidebar and DragGesture resizer, unchanged.
Flag ON: pure-AppKit NSTableView list. Virtualized rows with a measured-once height cache (fixes the scrollbar stutter from LazyVStack height re-estimation and the seconds-long tap latency after flinging a 100-workspace sidebar). Native cells render every row slot without NSHostingView: title wrap + inline rename, unread badges, GPU spinner, media glyphs, close button, description/notification preview, remote SSH line + reconnect, metadata entries + markdown blocks, log line, progress bar, three branch/directory layouts with width-adaptive candidates, custom-vector PR icons, ports, checklist section (respecting the popover setting), shortcut hint pills, drop indicators. Context menus are NSMenu with item-for-item SwiftUI parity (groups, status lanes, colors with swatches, move-to-window, notifications submenu). Hover/middle-click/drag are table-owned; rows rebuild from the container-observed SidebarWorkspaceRowInput projections so workspace churn repaints single cells without container re-renders.
Flag ON also replaces the sidebar resizer's SwiftUI DragGesture with a native tracking view (SidebarDividerTrackingView) using NSSplitView's technique: a synchronous nextEvent(matching:) loop in .eventTracking mode that applies the width, spins the runloop once so SwiftUI/CA commit, and presents via displayIfNeeded inside the same mouse event. It accepts first mouse and owns its cursor rect. Selection paints optimistically on mouse-down and reconciles from the authoritative configure pass.
Verification (all on tag sbak, LG HDR 4K):
- Synthetic HID divider drag (+80px one-way): sidebar hairline moved exactly 239.5pt -> 319.5pt, app responsive after, cursor released.
- Fling storm (25x400px wheel) + click, 3 trials per flag state, measured click epoch ->
sidebar.selectdebug-log timestamp: flag ON 30/32/38 ms (source=appKitRow), flag OFF 25/27/27 ms. Click latency is at parity; the AppKit win is scroll/render cost (no LazyVStack height re-estimation livelock), not click dispatch. scripts/check-sidebar-lazy-layout.pyandSidebarLazyLayoutScaleTestsremain main's originals and pass (legacy path untouched).- Localization: en/ja entries for the two new flag strings in
Resources/Localizable.xcstrings; no other user-visible strings added (AppKit cells reuse existing localized keys, verified item-for-item against the SwiftUI menus).
Branch is merged with current main (post-#8211/#8240 row-projection and resize-coalescing refactors adopted).
🤖 Generated with Claude Code
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.
Summary by cubic
Adds a feature-flagged AppKit sidebar list that replaces the SwiftUI list with an NSTableView for smoother scrolling and lower tap latency with many workspaces. With the flag on, divider drags use a native tracker that sticks to the cursor and now coalesce portal updates to cut drag cost; flag-off behavior is unchanged. Off by default; enable sidebar-appkit-list-experiment in Internal Flags.
-
New Features
- New
NSTableViewsidebar behindsidebar-appkit-list-experiment(off by default). Virtualized rows with measured-once height caching replaceLazyVStackre-measure churn. - Native AppKit cells for workspace rows and group headers with full UI parity and
NSMenu; table-owned hover/middle-click/drag. Selection via table target/action; double-click to inline rename. - Integrated with the projected row API (
SidebarWorkspaceRowInput): container-observed projections replace the prior per-row Combine pump and snapshot memo; AppKit row actions renamed to avoid type conflicts. - Divider resize (flag ON): native tracking view flushes layout/display inside each event; portal fan-out is coalesced to one deferred pass per tick, and rows freeze during drags to avoid rebuilds. Flushes are paced to the screen’s refresh; failsafe clears a stuck resize cursor. Selection paints optimistically on mouse-down.
- Localized flag strings (en/ja); Settings title is “Lawrence Sidebar.”
- New
-
Bug Fixes
- Reduced divider-drag overhead: anchor callbacks sync only their hosted view; interactive-resize session ends from the cursor failsafe; drag layout logging avoids pasteboard XPC unless an app-owned drag is active.
- Interaction/UI polish: group headers are excluded from middle-click close and row drags; context menus no longer disappear without a notification store (only that section hides); closed-PR icon tint renders correctly; port controls wrap at the trailing edge; O(1) group lookup in row building; bulk mark read/unread respects per-workspace filters.
Summary by CodeRabbit
-
New Features
- Added an optional AppKit-based sidebar list experience behind a feature flag, including enhanced workspace/group rows (inline rename, rich status/details, checklists, shortcuts, and improved context menus).
- Added English and Japanese localized labels for the new sidebar option.
-
Bug Fixes
- Improved divider resizing reliability with detection of canceled drag events to prevent stuck resize behavior.
- Stabilized sidebar workspace scrolling, hover/selection behavior, row height rendering, and drag-and-drop target handling.