Sidebar: request an authoritative apply when a deferred row click parks - #9691
Conversation
A click landing while row actions are detached is deferred (#9225) but the replay only runs from the next authoritative apply, and nothing requests one: the park mutates no SwiftUI-tracked state, the sidebar body is Equatable-gated, and an idle app never re-arms the rows. The click stays parked until unrelated invalidation, historically an app deactivate/ reactivate cycle. The test drives the reveal gap (suspend + reveal without an apply), sends the row click, and asserts the controller fires the new onDeferredRowClickAwaitingApply seam exactly once; the seam is inert in this commit so CI shows the test red. Refs #9690 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tions Fixes #9690: infrequently, sidebar row taps did nothing until an app deactivate/reactivate cycle. A click landing on a presentation-snapshot row (live action captures released) is deferred and replayed from the next authoritative apply (#9225). But the replay was passive: applies only happen when the Equatable-gated sidebar body re-evaluates, and the park itself mutates no SwiftUI-tracked state, so an idle app never re-armed the rows. The parked click waited for unrelated invalidation, which an app focus cycle eventually provided via window-key row repaints. The controller now fires onDeferredRowClickAwaitingApply when it parks a click; SidebarWorkspaceTableView forwards it to VerticalTabsSidebar, which bumps a @State token read by appKitWorkspaceScrollArea (same pattern as appKitPostResizeRefreshToken). The body re-evaluates, updateNSView re-applies fresh action-carrying rows, and the parked click replays immediately. The request fires only from a physical click, never from a replay re-park, so a request per click is the ceiling and it cannot loop. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe sidebar now requests a SwiftUI reevaluation when a physical row click is deferred during presentation suspension. The next authoritative table apply replays the click. A regression test verifies one request and successful workspace selection. ChangesDeferred sidebar click application
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 inconclusive)
✅ Passed checks (24 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 |
Fixes #9690.
Infrequently, sidebar row taps did nothing until an app deactivate/reactivate cycle. #9225 made a click that lands on a presentation-snapshot row (live action captures released) survive as
deferredRowClick, replayed from the next authoritative apply. The replay was passive: applies only happen when the Equatable-gatedVerticalTabsSidebarbody re-evaluates, and the park itself mutates no SwiftUI-tracked state, so an idle app never re-armed the rows. The parked click waited on unrelated invalidation, which a focus cycle eventually provided via window-key row repaints.The controller now fires
onDeferredRowClickAwaitingApplywhen it parks a click.SidebarWorkspaceTableViewforwards it toVerticalTabsSidebar, which bumps a@Statetoken read byappKitWorkspaceScrollArea(theappKitPostResizeRefreshTokenpattern), so the body re-evaluates,updateNSViewre-applies fresh action-carrying rows, and the parked click replays immediately. The request fires only from a physical click, never from a replay re-park, so one request per click is the ceiling and it cannot loop; a fresh apply always carries live actions (appKitRowSnapshotCachecaches display snapshots only).Two commits: the first adds the regression test against an inert seam (red), the second wires the seam (green). The test drives the exact reveal gap (suspend, reveal, no apply), sends the row click, asserts the apply request fires once, then answers it like production and asserts the parked selection lands.
Localization audit: no user-facing strings added or changed.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes sidebar row clicks that sometimes did nothing until app refocus by requesting an authoritative apply when a deferred click parks, so the click replays immediately. Fixes #9690.
onDeferredRowClickAwaitingApplyinSidebarWorkspaceTableController, fired when a click is deferred on snapshot rows.SidebarWorkspaceTableViewtoVerticalTabsSidebar, which bumpsappKitTableApplyRequestTokento re-evaluate and re-apply rows.Written for commit df21c4d. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests