Fix sidebar workspace close hover state

AU
6mo ago
+496-13

Summary

  • Adds a regression contract for workspace-row close hover visibility when context-menu lifecycle state is stale.
  • Separates pointer hover state from context-menu snapshot-freeze state so stale menu state cannot suppress the close affordance.
  • Replaces SwiftUI row .onHover with an AppKit row hover tracker that reconciles actual pointer position when menu tracking ends and hides the close button during right-click menu tracking.

Demo Video

Not recorded. This PR changes a narrow hover/context-menu interaction in the native macOS sidebar; regression coverage and CI are the validation surface for the fix.

Testing

  • Not run locally per repository policy; GitHub Actions and CircleCI are the validation surface for this PR.
  • CI must pass before the dev build is launched.

Checklist

  • Regression coverage added for stale context-menu state and close-button hover visibility.
  • Right-click menu tracking case covered so the close button does not stay visible during menu presentation.
  • Current CodeRabbit implementation comments addressed on the latest head.
  • No local xcodebuild or local tests run.

Fixes #3545


[!NOTE]
Medium Risk
Changes sidebar row hover and context-menu tracking by bridging to AppKit and adding new state logic, which could affect close-button visibility and pointer interaction edge cases.

Overview
Fixes a sidebar regression where the workspace-row close button could stay hidden or incorrectly visible due to stale SwiftUI context-menu/hover state.

This replaces the row’s SwiftUI .onHover handling with an AppKit-backed SidebarWorkspaceRowHoverTracker and introduces SidebarWorkspaceRowInteractionState to separate pointer hover from context-menu visibility/tracking, ensuring hover is reconciled when menu tracking ends and suppressed during right-click tracking. Adds focused unit tests covering stale menu lifecycle and hover/close-button visibility behavior.

Reviewed by Cursor Bugbot for commit 27526fe5d091afe2246dbf3e41ef2bf84c83dc9f. Bugbot is set up for automated code reviews on this repo. Configure here.