mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-05-18 06:04:36 +00:00
Two related bugs in the macOS menubar `AgentTabStrip`: 1. With more detected providers than fit at the default 360pt popover width (~7+), the off-screen provider chips were unreachable. SwiftUI's horizontal `ScrollView` does not scroll from click-drag, and there was no other affordance to reveal the hidden tabs. 2. Independent mouse wheels could not scroll the horizontal strip. Standard wheels emit only vertical `deltaY` with `hasPreciseScrollingDeltas == false`, and a horizontal SwiftUI `ScrollView` ignores vertical-only deltas. Trackpads (which emit horizontal deltas natively) already worked. Fix: - Wrap the strip in `ScrollViewReader` and add overflow-aware left/right chevron buttons that programmatically scroll to the next/previous visible provider via `proxy.scrollTo(_, anchor: .center)`. Buttons only appear when `stripContentWidth > stripViewportWidth - 30` and disable at the ends. - Install an `NSEvent.addLocalMonitorForEvents(matching: .scrollWheel)` in `.onAppear` (removed in `.onDisappear`). When the cursor is over the strip and the event is non-precise (`!hasPreciseScrollingDeltas`) with `deltaX≈0` and `deltaY≠0`, copy the `CGEvent` and transpose `scrollWheelEventDeltaAxis1` / `PointDeltaAxis1` / `FixedPtDeltaAxis1` onto axis 2 so the underlying NSScrollView receives a real horizontal delta. - Track strip hover via a `@MainActor` singleton `AgentTabStripScrollState` so the local-monitor closure can read the latest hover status without capturing stale SwiftUI state. Trackpad events are passed through untouched, so vertical scrolling elsewhere in the popover is unaffected. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|---|---|---|
| .. | ||
| CodeBurnMenubar | ||