Stop per-frame whole-board re-evaluation - #71
Merged
Merged
Conversation
body wrapped the board in anyview and threaded it through toolbar, sheet, and observer helpers that each took and returned anyview, erasing the tree's structural identity and forcing swiftui to diff the whole scene through an opaque box on every update. the helpers are generic over their content now; their bodies are unchanged.
the drag gesture wrote dragtranslation and activetarget into contentview state on every frame, re-evaluating the entire board tree at gesture rate. the drag cluster now lives in an observable draginteractioncontroller read only by dragoverlayview, so per-frame writes re-render just the overlay; activetarget keeps its crossing-only invalidation through a guarded setter. the waste-return anchor frame fusion moves into the overlay with the state it reads, and the overlay's unused cardtilts parameter is dropped.
the celebration task mutates its cards array every frame while the cascade flies, and contentview's body read it — re-evaluating the whole board per tick. the overlay reads the controller itself now, so the ticks re-render only the flying cards.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This was referenced Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
AnyViewdecoration chain inContentView:sceneDecorations/applyToolbar/applySheets/applyObserversare generic over their content now, so SwiftUI can structurally diff the scene instead of comparing through an opaque box. Helper bodies are unchanged.DragInteractionControllerread only byDragOverlayView. Per-frame translation writes now re-render just the overlay instead of the entire board;activeTargetkeeps its crossing-only invalidation through an equality-guarded setter. The waste-return anchor frame fusion moved into the overlay with the state it reads, and the overlay's unusedcardTiltsparameter is gone.WinCascadeOverlayViewreads the celebration controller itself, so the cascade's per-frame card mutations re-render only the flying cards, not the board underneath.Why
Dragging a card wrote
dragTranslationandactiveTargetintoContentViewstate on every gesture frame, and the whole board tree lives inContentView.body— so every drag frame re-evaluated every pile, foundation, and card, through anAnyViewwrapper that defeated diffing. The win cascade had the same shape at ~60 fps. This is the container half of the follow-up to #70; the value-slicing half (per-pile pruning) comes next as its own PR.Validation