mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-01 07:53:26 +00:00
Clear the sidebar latch on a panic wipe too
Moving showSidebar onto AppChromeModel (so launch restore could raise the conversation list) made it a fourth presentation latch on that model, and panicClearAllData resets the other three. ContentView presents the people sheet whenever showSidebar is set (isPeopleSheetPresented), so a wipe with it up leaves a sheet over the root timeline — which is where both the success message and the failed-wipe banner render. The one signal telling you whether your data is actually gone ends up behind a sheet. The launch path makes this reachable without anyone touching the screen: restore raises the sidebar, then a triple-tap wipes. Caught by a cross-model review pass on the merge, not by me. Test: extends panicWipeDismissesChromePresentation with the latch. Verified red-first against the unfixed model — the run failed at AppArchitectureTests.swift:516 with `showSidebar → true`, exit 65 — then passed after the fix, exit 0 (macOS scheme, 1 test). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ff4ec5dd3f
commit
be2275ec71
@ -146,6 +146,11 @@ final class AppChromeModel: ObservableObject {
|
||||
isLocationChannelsSheetPresented = false
|
||||
isNoticesSheetPresented = false
|
||||
showingFingerprintFor = nil
|
||||
// The people/conversation-list sheet is presented on this latch too
|
||||
// (`ContentView.isPeopleSheetPresented`), and launch restore can raise
|
||||
// it without anyone touching the screen — so it hides the outcome
|
||||
// exactly like the sheets above unless it is cleared here.
|
||||
showSidebar = false
|
||||
|
||||
prepareForPanic?()
|
||||
onPanicWipe()
|
||||
|
||||
@ -501,6 +501,11 @@ struct AppArchitectureTests {
|
||||
chromeModel.isLocationChannelsSheetPresented = true
|
||||
chromeModel.presentNotices()
|
||||
chromeModel.showFingerprint(for: PeerID(str: "peer-3"))
|
||||
// The people/conversation-list sheet counts: ContentView presents it
|
||||
// whenever `showSidebar || selectedPrivatePeerID != nil`, so a latch
|
||||
// left set covers the root timeline exactly like the others. Launch
|
||||
// restore (#1064) can raise it without the person touching anything.
|
||||
chromeModel.showSidebar = true
|
||||
|
||||
chromeModel.panicClearAllData()
|
||||
|
||||
@ -508,6 +513,7 @@ struct AppArchitectureTests {
|
||||
#expect(!chromeModel.isLocationChannelsSheetPresented)
|
||||
#expect(!chromeModel.isNoticesSheetPresented)
|
||||
#expect(chromeModel.showingFingerprintFor == nil)
|
||||
#expect(!chromeModel.showSidebar)
|
||||
}
|
||||
|
||||
@Test("Recent chats list direct conversations with people absent from the rosters")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user