Skip to content

fix: keep viewer access banners hidden when closed by user - WPB-28348 - #5168

Open
jullianm wants to merge 5 commits into
developfrom
fix/show-viewer-banner-only-once
Open

fix: keep viewer access banners hidden when closed by user - WPB-28348#5168
jullianm wants to merge 5 commits into
developfrom
fix/show-viewer-banner-only-once

Conversation

@jullianm

@jullianm jullianm commented Aug 27, 2026

Copy link
Copy Markdown
Contributor
TaskWPB-28348 [iOS] Show viewer permission banner only once

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

  • open a Shared Drive screen as a guest (viewer only)
  • Close banner at the top
  • go back to conversation
  • observe the banner is hidden
  • go back to conversation list
  • then go to that conversation again
  • observe the banner remains hidden here and in the Shared Drive as well

Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Test Results

2 293 tests   2 261 ✅  4m 2s ⏱️
  369 suites     27 💤
    2 files        5 ❌

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
Allure report (download zip): html-report-33248-fix_show-viewer-banner-only-once

Comment thread wire-ios/Wire-iOS/Sources/UserInterface/Conversation/InputBar/InputBar.swift Outdated
@jullianm
jullianm requested a review from findms September 2, 2026 12:37
@jullianm
jullianm requested review from caldrian and removed request for johnxnguyen September 9, 2026 08:44
@datadog-wireapp

datadog-wireapp Bot commented Sep 9, 2026

Copy link
Copy Markdown

Tests

⚠️ Warnings

⚠️ Your PR has warnings. Tests failed — unable to determine if these are from required jobs.

🧪 5 Tests failed in 1 job

Test Pull Request Changes | upload-test-results-datadadog — ❌ 5 tests failed

View in GitHub Actions

❌ testNotClassifiedNormalState() from Wire-iOS-Tests.ConversationInputBarViewControllerTests   View in Datadog
ConversationInputBarViewControllerTests.swift:272: XCTAssertNil failed: "Snapshot "414.0" does not match reference.

@−
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/Wire-iOS Tests/ReferenceImages/ConversationInputBarViewControllerTests/testNotClassifiedNormalState.414-0.png"
@+
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/SnapshotResults/ConversationInputBarViewControllerTests/testNotClassifiedNormalState.414-0.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
...
❌ testForInitState() from Wire-iOS-Tests.ConversationViewControllerSnapshotTests   View in Datadog
ConversationViewControllerSnapshotTests.swift:72: XCTAssertNil failed: "Snapshot does not match reference.

@−
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/Wire-iOS Tests/ReferenceImages/ConversationViewControllerSnapshotTests/testForInitState.1.png"
@+
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/SnapshotResults/ConversationViewControllerSnapshotTests/testForInitState.1.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
...
❌ testThatGuestsBarControllerIsVisibleIfExternalsAndServicesArePresent() from Wire-iOS-Tests.ConversationViewControllerSnapshotTests   View in Datadog
ConversationViewControllerSnapshotTests.swift:189: XCTAssertNil failed: "Snapshot does not match reference.

@−
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/Wire-iOS Tests/ReferenceImages/ConversationViewControllerSnapshotTests/testThatGuestsBarControllerIsVisibleIfExternalsAndServicesArePresent.1.png"
@+
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/SnapshotResults/ConversationViewControllerSnapshotTests/testThatGuestsBarControllerIsVisibleIfExternalsAndServicesArePresent.1.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
...
❌ testThatGuestsBarControllerIsVisibleIfExternalsArePresent() from Wire-iOS-Tests.ConversationViewControllerSnapshotTests   View in Datadog
ConversationViewControllerSnapshotTests.swift:152: XCTAssertNil failed: "Snapshot does not match reference.

@−
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/Wire-iOS Tests/ReferenceImages/ConversationViewControllerSnapshotTests/testThatGuestsBarControllerIsVisibleIfExternalsArePresent.1.png"
@+
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/SnapshotResults/ConversationViewControllerSnapshotTests/testThatGuestsBarControllerIsVisibleIfExternalsArePresent.1.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
...
❌ testThatGuestsBarControllerIsVisibleIfServicesArePresent() from Wire-iOS-Tests.ConversationViewControllerSnapshotTests   View in Datadog
ConversationViewControllerSnapshotTests.swift:168: XCTAssertNil failed: "Snapshot does not match reference.

@−
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/Wire-iOS Tests/ReferenceImages/ConversationViewControllerSnapshotTests/testThatGuestsBarControllerIsVisibleIfServicesArePresent.1.png"
@+
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/SnapshotResults/ConversationViewControllerSnapshotTests/testThatGuestsBarControllerIsVisibleIfServicesArePresent.1.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
...

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f5262f1 | Docs | View more details | Give us feedback!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 ConversationViewerAccessBannerDismissalStore keyed by conversation cellName.
  • Updated the Shared Drive FilesViewModel/FilesContentView to respect and record banner dismissal.
  • Updated the conversation InputBar to 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.

Comment on lines 189 to +194
lazy var inputBar: InputBar = {
let driveConfiguration: InputBar.DriveConfiguration? = if conversation.isWireDriveEnabled {
.init(cellName: conversation.wireDriveCellName, showBanner: showDriveViewerBanner)
} else {
nil
}
Comment on lines +375 to 377
if let driveConfiguration, !driveConfiguration.showBanner {
addBorder(for: .top)
}
Comment on lines +28 to +30
typealias CellName = String

private var dismissedCellNames: Set<String> = []
Comment on lines +276 to +280
let isDismissed = cellName
.map(ConversationViewerAccessBannerDismissalStore.shared.isDismissed(forCellName:)) ?? false
let isViewer = selfUser.role == .viewer
showReadOnlyBanner = isDrivePermissionsFlagEnabled && !isBrowsing && isViewer && !isDismissed &&
!isRecycleBin
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.

4 participants