[PM-26063] Add Flight Recorder toast banner to Authenticator's item list#2151
Conversation
|
Claude finished @matt-livefront's task —— View job PR Review for PM-26063PR Title and Description QualityThe PR title and description are clear and effective:
Summary of ChangesThis PR adds the Flight Recorder toast banner to the Authenticator app's item list view, matching similar functionality in the Password Manager app. The implementation follows established patterns and integrates with BitwardenKit's Key Changes:
FindingsFinding 1: Duplicated toast binding in ItemListView❌ Major - Lines 48-51 and 55-58 in The view has two identical toast bindings. The second one (originally at lines 59-62 before the Flight Recorder banner was added) should have been removed when the banner code was inserted. Resolution: Remove the duplicate toast binding at lines 55-58. Keep only the first one at lines 48-51. Location: Finding 2: Missing test coverage for new functionalityMissing Coverage Breakdown:
Recommended Test Additions
Locations:
Finding 3: Potential navigation state inconsistency💭 Inquiry - How is navigation handled when the Settings tab doesn't exist? The Questions:
Location: Finding 4: Architecture pattern compliance🎨 Improvement - Consider adding DocC documentation for public delegate protocol The
Location: Good Practices Observed
Action ItemsRequired Before Merge:
Recommended: |
| .toast(store.binding( | ||
| get: \.toast, | ||
| send: ItemListAction.toastShown, | ||
| )) |
There was a problem hiding this comment.
This was duplicated from here:
ios/AuthenticatorShared/UI/Vault/ItemList/ItemList/ItemListView.swift
Lines 48 to 51 in 01c20e8
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2151 +/- ##
==========================================
- Coverage 85.38% 84.04% -1.35%
==========================================
Files 1726 1982 +256
Lines 145621 161180 +15559
==========================================
+ Hits 124345 135459 +11114
- Misses 21276 25721 +4445 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| // MARK: Tests | ||
|
|
||
| @MainActor | ||
| func disabletest_snapshot_flightRecorderToastBanner() { |
There was a problem hiding this comment.
This snapshot test is disabled (prefixed with disable). It should be enabled to provide visual regression coverage for the Flight Recorder banner.
| func disabletest_snapshot_flightRecorderToastBanner() { | |
| func test_snapshot_flightRecorderToastBanner() { |
After enabling, run the snapshot tests to record the baseline image.
| case .flightRecorderSettings: | ||
| delegate?.switchToSettingsTab(route: .settings) |
There was a problem hiding this comment.
💭 Navigation edge case consideration
If delegate is nil, this navigation silently fails. Consider whether this is acceptable behavior or if it should log a warning/error for debugging purposes.
Options:
- Keep as-is (silent failure)
- Add assertion in debug builds:
assert(delegate != nil) - Add error logging:
if delegate == nil { errorReporter.log(...) }
This is likely fine as-is since the delegate should always be set during initialization, but worth considering for debugging.
| public protocol ItemListCoordinatorDelegate: AnyObject { | ||
| /// Called when the user needs to switch to the settings tab and navigate to a `SettingsRoute`. | ||
| /// | ||
| /// - Parameter route: The route to navigate to in the settings tab. | ||
| /// | ||
| func switchToSettingsTab(route: SettingsRoute) |
There was a problem hiding this comment.
🎨 Documentation enhancement suggestion
Consider expanding the documentation to explain:
- When called: User taps "Go to Settings" in the Flight Recorder toast banner
- Expected behavior: The app should switch to the Settings tab and navigate to the specified route
- Context: Used for cross-tab navigation from the item list
| public protocol ItemListCoordinatorDelegate: AnyObject { | |
| /// Called when the user needs to switch to the settings tab and navigate to a `SettingsRoute`. | |
| /// | |
| /// - Parameter route: The route to navigate to in the settings tab. | |
| /// | |
| func switchToSettingsTab(route: SettingsRoute) | |
| /// A delegate of `ItemListCoordinator` that is notified when navigation events occur that | |
| /// require coordination with other parts of the app. | |
| /// | |
| /// This delegate is typically implemented by `AppCoordinator` to handle navigation | |
| /// that crosses tab boundaries. | |
| /// | |
| @MainActor | |
| public protocol ItemListCoordinatorDelegate: AnyObject { | |
| /// Called when the user needs to switch to the settings tab and navigate to a `SettingsRoute`. | |
| /// | |
| /// This is primarily used when the user taps "Go to Settings" from the Flight Recorder | |
| /// toast banner in the item list. | |
| /// | |
| /// - Parameter route: The route to navigate to in the settings tab. | |
| /// | |
| func switchToSettingsTab(route: SettingsRoute) | |
| } |
| goToSettingsAction: { | ||
| store.send(.navigateToFlightRecorderSettings) | ||
| }, | ||
| ) |
There was a problem hiding this comment.
❌ Duplicate toast binding
There are two identical .toast() modifiers in this view (lines 48-51 and 55-58 in the final code). The second one at lines 55-58 should be removed since the toast binding is already applied at lines 48-51.
This duplication causes the same toast to be applied twice, which is unnecessary and could potentially cause issues.
🎟️ Tracking
PM-26063
📔 Objective
Adds the Flight Recorder's toast banner to Authenticator's item list when the Flight Recorder has been enabled.
📸 Screenshots
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2025-11-18.at.11.48.31.mov
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes