mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-29 08:29:22 +00:00
The bitchat/ logo triple-tap performs a panic wipe. Since #1588 it always raises a confirmation dialog, which closed the accidental-wipe hole but removed the instant duress path for people who want it. Issue #152's remaining ask was a preference for the gesture only. This adds one: confirm - the shipped default; a triple-tap asks first (unchanged) instant - the third tap wipes with no dialog (the seizure path) off - the gesture does nothing; only the settings button wipes Design follows the maintainer review of the competing PR #1575: - The decision lives in AppChromeModel.requestPanicWipe(), the one choke point ContentHeaderView already calls. The gesture site is untouched and there is still exactly one gesture dialog, hosted on ContentView. - Default is confirm, so an existing install keeps #1588's behaviour on update. An unreadable stored value also reads as confirm. - Off is not silent: a triple-tap while disabled shows a "logo wipe is off - nothing was wiped" alert, and switching the gesture off asks first in settings. Silence would read as "it worked". - A completed wipe sets the mode to instant (endorsed twice on #1575; that PR later dropped it). Because the install default is confirm, resetForPanicWipe() writes instant rather than clearing the key. - The reset runs only after the panic transaction commits. The other preference resets in that block fail safe; this one fails armed, and a wipe that leaves data on disk must not also leave a deliberately disabled gesture one accidental tap from destroying it. The preference store is injected into AppChromeModel so every branch is tested through the real read path with an isolated suite; the one test that must write UserDefaults.standard (ChatViewModel's store is fixed) restores it. Copy is mode-aware: panic_note, the privacy-pane row, and the danger-zone captions can no longer promise behaviour the gesture does not have. Thirteen new catalog keys and one retranslation cover all 30 locales. Also closes three unrelated gaps: the two panic modals now count as root presentations (a Bluetooth alert could stack on a pending wipe dialog), the settings-pane danger zone is finally rendered by a smoke test (the pane picker defaults to Info), and README and the in-source panic_note default no longer claim an "instant" wipe. Verified: macOS Debug build; swift test (2029 tests, 220 suites); iOS simulator suite on iPhone 17 (2262 tests); SwiftLint --strict via the CI image (0 violations); Periphery --strict (no unused code); catalog coverage 30 locales x 533 keys. Refs #152. Relates to #1588 and #1575.