You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Effect and state identity is reconstructed rather than preserved:
.onAppear, .onDisappear, and .task allocate a new UUID on each body evaluation in Sources/TUIkit/Extensions/View+Events.swift:181-246.
LifecycleManager therefore treats a still-visible view as removed, restarts tasks, and retains disappear callbacks.
@State hydrates during construction through global unsafe context/counter state in Sources/TUIkitView/State/State.swift:155-203,355-364, before final keyed child identity is known.
Observation subscriptions are recreated without a stable per-identity registry.
Current .task lacks id: behavior and does not preserve current Swift actor-inheritance semantics.
Proposed solution
Derive identity from the committed structural path plus stable modifier slots and explicit child keys.
Bind DynamicProperty storage, Observation subscriptions, lifecycle callbacks, tasks, focus, handlers, and preferences to that identity.
Remove subscriptions and callbacks on true unmount.
Depends on the per-app runtime contract from P0-03 and characterization tests from P0-01.
Parallelization
After runtime boundaries are fixed, this can run beside P0-04 and the terminal surface issue. It should own identity, DynamicProperty hydration, lifecycle, and task-slot files.
Commit structure
Split this issue into small, thematic, independently revertible commits wherever the work can remain coherent.
Every commit must build and keep its applicable tests/gates green. Do not commit an intentionally failing regression test; use local/known-issue characterization or land the test with the smallest fix.
Keep characterization/fixtures, mechanical renames or moves, semantic changes, and documentation/migration updates separate when each step remains green.
The issue boundary is not a commit boundary; multiple commits are expected for independently reversible changes.
Problem
Effect and state identity is reconstructed rather than preserved:
.onAppear,.onDisappear, and.taskallocate a new UUID on each body evaluation inSources/TUIkit/Extensions/View+Events.swift:181-246.LifecycleManagertherefore treats a still-visible view as removed, restarts tasks, and retains disappear callbacks.@Statehydrates during construction through global unsafe context/counter state inSources/TUIkitView/State/State.swift:155-203,355-364, before final keyed child identity is known..tasklacksid:behavior and does not preserve current Swift actor-inheritance semantics.Proposed solution
.task(id:priority:)signatures plus compile fixtures are owned by [P1-16] Add environment-driven shared View modifiers with exact signatures #21.Acceptance criteria
onAppearoccurs once per mounted identity;onDisappearoccurs only on true removal.Dependencies
Depends on the per-app runtime contract from P0-03 and characterization tests from P0-01.
Parallelization
After runtime boundaries are fixed, this can run beside P0-04 and the terminal surface issue. It should own identity, DynamicProperty hydration, lifecycle, and task-slot files.
Commit structure