fix: keep viewer access banners hidden when closed by user - WPB-28348 - #5168
fix: keep viewer access banners hidden when closed by user - WPB-28348#5168jullianm wants to merge 5 commits into
Conversation
Test Results2 293 tests 2 261 ✅ 4m 2s ⏱️ For more details on these failures, see this check. Results for commit f5262f1. ♻️ This comment has been updated with latest results. Summary: workflow run #34331663234 |
|
There was a problem hiding this comment.
🟡 Changes recommended
There are concrete UI/logic regressions (banner config not using dismissal-aware flag; border not added when drive is disabled) that should be corrected before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR addresses WPB-28348 by introducing an in-memory dismissal store so the “viewer access” banner stays hidden after the user closes it, across both Shared Drive and conversation views during the same app session.
Changes:
- Added a shared, in-memory
ConversationViewerAccessBannerDismissalStorekeyed by conversationcellName. - Updated the Shared Drive
FilesViewModel/FilesContentViewto respect and record banner dismissal. - Updated the conversation
InputBarto record dismissal and to hide the banner if it was dismissed elsewhere.
File summaries
| File | Description |
|---|---|
| WireMessaging/Sources/WireMessagingUI/WireDrive/Components/Files/FilesViewModel.swift | Reads dismissal state when deciding whether to show the viewer banner; adds a dedicated dismiss method that records dismissal. |
| WireMessaging/Sources/WireMessagingUI/WireDrive/Components/Files/FilesContentView.swift | Uses the new view model dismiss method instead of directly toggling the flag. |
| WireMessaging/Sources/WireMessagingUI/Conversation/ConversationViewerAccessBannerDismissalStore.swift | New shared in-memory store for per-conversation banner dismissal state. |
| wire-ios/Wire-iOS/Sources/UserInterface/Conversation/InputBar/InputBar.swift | Replaces booleans with a DriveConfiguration and records/hides viewer banner dismissal. |
| wire-ios/Wire-iOS/Sources/UserInterface/Conversation/InputBar/ConversationInputBarViewController/ConversationInputBarViewController.swift | Creates DriveConfiguration and triggers hiding the banner on appearance. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| lazy var inputBar: InputBar = { | ||
| let driveConfiguration: InputBar.DriveConfiguration? = if conversation.isWireDriveEnabled { | ||
| .init(cellName: conversation.wireDriveCellName, showBanner: showDriveViewerBanner) | ||
| } else { | ||
| nil | ||
| } |
| if let driveConfiguration, !driveConfiguration.showBanner { | ||
| addBorder(for: .top) | ||
| } |
| typealias CellName = String | ||
|
|
||
| private var dismissedCellNames: Set<String> = [] |
| let isDismissed = cellName | ||
| .map(ConversationViewerAccessBannerDismissalStore.shared.isDismissed(forCellName:)) ?? false | ||
| let isViewer = selfUser.role == .viewer | ||
| showReadOnlyBanner = isDrivePermissionsFlagEnabled && !isBrowsing && isViewer && !isDismissed && | ||
| !isRecycleBin |
Issue
This PR ensures the viewer access banners remain hidden when user closes it whether from the Shared Drive view or in the conversation view.
Testing
Checklist
[WPB-XXX].UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: