Repository navigation
refactor: hold the bar weakly in edit mode, the Undo history and pinned popups - #493
Conversation
…ed popups A view or a queued task can keep edit mode, the Undo history or a pinned popup alive after its bar is gone, and reading an unowned bar then crashes the test run, as the package library did before #481. They now hold the bar weakly and have nothing left to change once it's gone. ArchitectureRulesTests now allows no unowned reference at all.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Before and after
50 unchanged screens
Visual review: 50 screens, none changed. |
|
🎉 This PR is included in version 0.12.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Problem
An
unownedreference toBarStorecrashes the whole test run when something outlives the store. A view or a task keeps the helper alive, and its next read of the store aborts with "Attempted to read an unowned reference but the object was already destroyed". #481 fixed that for the package library, which caused the crashes seen on CI. Edit mode (BarEditing), the Undo history (ConfigurationHistory) and pinned popups (PinnedPopupinWidgetPopup.swift) still held the storeunowned. The rule in AGENTS.md is that a helper pointing back at its owner holds itweak.Changes
BarEditing,ConfigurationHistoryandPinnedPopuphold the storeweak. While the store is there, nothing changes. Once it's gone, they have nothing left to change:ArchitectureRulesTestsnow allows nounownedreference at all:noUnownedReferencesreplaces the per-file allowance.StoreLifetimeTestsuses edit mode and the Undo history after their store is released.Testing
editModeAndUndoHistoryThatOutliveTheirStoreDoNothingaborted the test run with the unowned-reference crash. After it, the test passes.mainon this Mac (pinnedPopupsStayOnScreenAndReturnUnderTheirWidgetand the two package review tests). The pinned popup test fails at the same five lines withmain'sWidgetPopup.swift, so it's CI that checks the changedunpinpath.Merging
One commit; any merge method works.
Claude Opus 5.5 via Claude Code