Skip to content

[PM-38154] feat: Add Passport view screen#2770

Open
SaintPatrck wants to merge 12 commits into
mainfrom
vault/pm-38154-ios-passport-view
Open

[PM-38154] feat: Add Passport view screen#2770
SaintPatrck wants to merge 12 commits into
mainfrom
vault/pm-38154-ios-passport-view

Conversation

@SaintPatrck

@SaintPatrck SaintPatrck commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-38154

📔 Objective

Adds the read-only detail view for passport vault items. The passport details section renders given name, surname, date of birth, sex, birth place, nationality, passport number, passport type, national identification number, issuing country, issuing authority/office, issue date, and expiration date. Each field is hidden when empty, and the section is hidden entirely when the passport has no details.

The passport number and national identification number are masked with a reveal toggle; the name and number fields support copy to clipboard.

📸 Screenshots

Figma Actual

Surface synced Passport ciphers in the vault list and search, gated
behind the pm-32009-new-item-types feature flag, mirroring the Driver's
License integration: passport group filtering, id-card icon, type-section
row, and the Copy passport number overflow action. Add/Edit/View screens
remain stubbed pending PM-38153/PM-38154.
Adds the add/edit SwiftUI surface for Passport items: 13 fields in the
Figma order, with passport number and national identification number as
hidden fields with reveal toggles, and date of birth, issue date, and
expiration date rendered read-only (long localized display, raw ISO
round-trip) pending the shared DateFieldPicker (PM-38360).

Exposes Passport in the add-item picker gated behind the newItemTypes
flag, injects ConfigService into VaultRepository for that gating, wires
the state to SDK PassportView round-trip, and shows the add-item FAB on
the Passports group screen.
Wire passport through both response-model BitwardenSdk.Cipher inits so a
synced passport's fields survive sync-to-store and populate the edit form.
Adds the read-only detail view for passport items, rendering the passport
details section: given name, surname, dates, sex, birth place, nationality,
issuing country/authority, and passport type. The passport number and national
identification number are masked with reveal toggles; the name and number
fields support copy. Wires the view into the per-type dispatch in
ViewItemDetailsView.
@SaintPatrck SaintPatrck added ai-review Request a Claude code review app:password-manager Bitwarden Password Manager app context t:feature labels Jun 9, 2026
Base automatically changed from vault/pm-38153-ios-passport-add-edit to main June 15, 2026 17:06
…ssport-view

# Conflicts:
#	BitwardenResources/Localizations/en.lproj/Localizable.strings
#	BitwardenShared/Core/Vault/Models/Enum/CipherType.swift
#	BitwardenShared/Core/Vault/Models/Enum/CipherTypeTests.swift
#	BitwardenShared/UI/Vault/PreviewContent/BitwardenSdk+VaultFixtures.swift
#	BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupState.swift
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditPassportItem/AddEditPassportItemState.swift
#	BitwardenShared/UI/Vault/VaultItem/AddEditItem/AddEditPassportItem/PassportItemState.swift
#	BitwardenShared/UI/Vault/VaultItem/CipherItemStateTests.swift
#	BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemAction.swift
#	BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemActionTests.swift
#	BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemProcessorTests.swift
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the read-only passport detail view added for passport vault items, including the new ViewPassportItemView, the ViewPassportItemAction enum, the ViewItemProcessor passport action handler, the isPassportDetailsSectionEmpty state helper, and the new CopyableField cases. The implementation closely mirrors the existing ViewDriversLicenseItemView pattern: sensitive fields (passport number, national identification number) are masked behind reveal toggles via PasswordText/PasswordVisibilityButton, each field hides when empty, and the section hides when fully empty. Test coverage is strong across ViewInspector interaction tests, processor toggle/error-path tests, and (disabled) snapshot tests.

Code Review Details

No findings at or above the reporting threshold. The processor's handlePassportAction correctly guards both loaded-data and passport-type with error reporting (consistent with the SSH key handler), state wiring through CipherItemState is complete, and no plaintext sensitive data is logged or persisted.

Existing review threads (build artifacts, private-view docs, moving section-empty into state, test alphabetization) are already addressed by the author or are active human-reviewer discussions, so no duplicate comments were posted.

Comment thread export/build.xcresult/Info.plist Outdated
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>

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.

⚠️ IMPORTANT: Build artifacts committed to the repository

Details and fix

This PR adds the entire export/build.xcresult/ bundle (binary Data/* blobs plus this Info.plist). These are Xcode test/build result artifacts that should not be tracked in git — they bloat the repository and history permanently, and are unrelated to the passport view feature.

Fix:

  • git rm -r --cached export/ and remove the directory from the commit
  • Add export/ (or *.xcresult) to .gitignore so it cannot be re-added accidentally

Confirmed these paths do not exist on origin/main and are not currently covered by .gitignore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Resolved in 6d243a7

@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.52569% with 53 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.94%. Comparing base (8c9d9eb) to head (55a2e26).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...sportItem/ViewPassportItemView+SnapshotTests.swift 0.00% 46 Missing ⚠️
...Vault/VaultItem/ViewItem/ViewItemDetailsView.swift 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2770      +/-   ##
==========================================
+ Coverage   87.93%   87.94%   +0.01%     
==========================================
  Files        1728     1741      +13     
  Lines      168727   170489    +1762     
==========================================
+ Hits       148365   149938    +1573     
- Misses      20362    20551     +189     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SaintPatrck SaintPatrck marked this pull request as ready for review June 16, 2026 13:11
@SaintPatrck SaintPatrck requested review from a team and matt-livefront as code owners June 16, 2026 13:11
Comment thread BitwardenShared/UI/Vault/VaultItem/ViewItem/ViewItemProcessorTests.swift Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review app:password-manager Bitwarden Password Manager app context t:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants