Skip to content

fix: allow verification sheet in private chat via sidebar navigation#1046

Open
malkovitc wants to merge 1 commit intopermissionlesstech:mainfrom
malkovitc:fix/988-private-chat-verification-sheet-v2
Open

fix: allow verification sheet in private chat via sidebar navigation#1046
malkovitc wants to merge 1 commit intopermissionlesstech:mainfrom
malkovitc:fix/988-private-chat-verification-sheet-v2

Conversation

@malkovitc
Copy link

Summary

Fixes #988 — Clicking on a person's name in a private chat did not open the security verification (fingerprint) sheet.

Root cause: SwiftUI does not allow multiple .sheet() modifiers to be active simultaneously on the same view. When a private chat is open, the sidebar sheet is already presented, so the fingerprint sheet was silently ignored.

Changes

1. Guard the root-level fingerprint sheet (line 195)

Added conditions to prevent the root-level fingerprint .sheet from activating while the sidebar is open:

get: { viewModel.showingFingerprintFor != nil && !showSidebar && viewModel.selectedPrivateChatPeer == nil }

2. Present fingerprint inside the sidebar via NavigationStack

Wrapped peopleSheetView content in a NavigationStack and added .navigationDestination that pushes FingerprintView when the sidebar is active.

Context Before After
Sidebar open (private chat) Fingerprint sheet silently blocked Fingerprint pushed inside sidebar via navigation
Sidebar closed Root-level sheet opens Root-level sheet opens (unchanged)

Why navigation inside the sidebar instead of dismiss-then-present?

  • Dismissing the sidebar first would disrupt the chat context (jarring UX)
  • A single-sheet-with-enum approach would require refactoring all 9+ sheet modifiers (too invasive)
  • NavigationStack inside sheets is an established SwiftUI pattern

Test plan

  • Open a private chat → tap sender name → tap verify → fingerprint view opens inside sidebar
  • Navigate back from fingerprint → returns to private chat
  • Outside of private chat, fingerprint sheet still opens normally
  • No regression in sidebar open/close behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clicking Person Name in Private Chat Doesn't Open Security Verification Sheet

1 participant