Repository navigation
Fix sidebar tab selection highlight timing - #6627
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughIn ChangesTab Selection Publisher Deduplication
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (22 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Integrate #6609 (Codex sidebar status lifecycle) and #6627 (sidebar tab selection highlight timing). ContentView auto-merged (no overlap with the font fix / pinResolutionContext). swift-file-length-budget.tsv regenerated via --write-budget. Shard partition verified identical to origin/main (weight 1267). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Closes #6626
Fixes the vertical-tab visual regression where selecting a workspace paints in two visible phases: first the translucent multi-selected background, then the solid active selected background a moment later.
Regression provenance
The last known-good tag is
v0.64.16(e647c3049c03786299d81f3c287571373d635269). Diff/blame against HEAD points to5ea81da1a5/ PR #6460 (Fix title-churn beachball in transcript adoption and sidebar rows) as the selection-highlight regression source.That PR intentionally moved active workspace selection out of the
VerticalTabsSidebarparent and into row-localTabItemViewstate so a selected-workspace change only invalidates the previous and new rows instead of every row under theForEach. The problem was the row-local state pipeline added.receive(on: RunLoop.main), while the click path still updatesselectedTabIdssynchronously. On a normal click, the row first rendered as merely multi-selected (opacity: 0.25), then the scheduled active-state update arrived and repainted the solid selected fill (opacity: 1).Fix
TabManageris@MainActorand sendsselectedTabIdPublisherfrom its selected-workspace will-change hook, so the row-local active-state update is already main-thread delivered. Removing the extra run-loop scheduler hop keeps #6460's scoped two-row invalidation, but lets the active-state change settle in the same interaction transaction as the sidebar selection set. The selected row now paints the solid selection highlight immediately in one phase.Verification
git diff --checkv0.64.16..HEADdiffs/blame forContentView.swift,SidebarAppearanceSupport.swift, andTabManager.swift.Localization
No user-facing strings were added or changed.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Fixes the sidebar vertical-tab highlight lag that briefly shows a translucent highlight before the solid active state when selecting a workspace (fixes #6626). Removes the extra
.receive(on: RunLoop.main)inTabItemViewsoTabManager’s main-threadselectedTabIdPublisherupdates the active state in the same interaction, preventing the two-phase paint.Written for commit e22a1ac. Summary will update on new commits.
Summary by CodeRabbit