From be2275ec718a9e3d98d743e895dd6ba96d6f7d7a Mon Sep 17 00:00:00 2001 From: ecgang Date: Wed, 26 Aug 2026 10:02:52 -0600 Subject: [PATCH] Clear the sidebar latch on a panic wipe too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- bitchat/App/AppChromeModel.swift | 5 +++++ bitchatTests/AppArchitectureTests.swift | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/bitchat/App/AppChromeModel.swift b/bitchat/App/AppChromeModel.swift index bee6ad08..bfaa3bb8 100644 --- a/bitchat/App/AppChromeModel.swift +++ b/bitchat/App/AppChromeModel.swift @@ -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() diff --git a/bitchatTests/AppArchitectureTests.swift b/bitchatTests/AppArchitectureTests.swift index 747e737b..270ad76d 100644 --- a/bitchatTests/AppArchitectureTests.swift +++ b/bitchatTests/AppArchitectureTests.swift @@ -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")