Docs: Document the phase model and diagnose body side effects#62
Merged
Conversation
- Add a traversal window to AppState: main-thread invalidations raised while the render loop traverses the view tree report through a violation handler; background tasks and post-commit effect actions stay silent - Route violations into RuntimeDiagnostics with the mutating subtree's identity, deduplicated per frame - Honor the invalidation itself so rendering stays consistent (diagnose, never swallow)
- Add a conceptual "Render Phases and the Frame Commit" section: phases, the collector/pending-record split with the SwiftUI analogy, the one-question classification rule, and discarded-pass guarantees - Update the pipeline steps for per-pass collectors, the traversal diagnostics window, and the commit step - Correct onAppear timing (fires at frame commit, never during traversal) and document change-driven onPreferenceChange semantics
- Compare against the traversal thread's identity instead of Thread.isMainThread, which is not reliable under the Swift concurrency runtime on Linux
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.
Closes #58 and completes #13 (last sub-issue). Design spec:
.claude/openspec/render-phase-effect-commit.md(status set to Implemented in this PR).Summary
body: a traversal window onAppStatereports same-thread invalidations raised while the render loop traverses the tree intoRuntimeDiagnostics(identity-tagged, deduplicated per frame); the invalidation is still honored, and background tasks plus committed effect actions stay silentRenderCycle.mdfor the phase-separated pipeline: per-pass collectors, the traversal diagnostics window, the frame commit step, correctedonAppeartiming (fires at commit, never during traversal), and change-drivenonPreferenceChangesemanticsTest plan
./scripts/test-linux.shgreen on macOS (native, Swift 6.0.3) and Linux (Docker) — 1315 tests, only the pre-existing [P0-09] Preserve subtree liveness across EquatableView cache hits #14 marker remainsBodySideEffectDiagnosticTests— state and status-bar mutations during traversal are diagnosed once per frame; committed effect mutations stay silent