Skip to content

[PM-38153] feat: Add Passport add/edit screens#2763

Merged
SaintPatrck merged 4 commits into
mainfrom
vault/pm-38153-ios-passport-add-edit
Jun 15, 2026
Merged

[PM-38153] feat: Add Passport add/edit screens#2763
SaintPatrck merged 4 commits into
mainfrom
vault/pm-38153-ios-passport-add-edit

Conversation

@SaintPatrck

@SaintPatrck SaintPatrck commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

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

📔 Objective

Adds the add/edit screen for Passport vault items: all passport fields in design order, with passport number and national identification number as hidden fields with reveal toggles, and date of birth, issue date, and expiration date shown as read-only localized dates. Passport is available in the add-item picker behind the newItemTypes feature flag and round-trips through the SDK on save.

📸 Screenshots

Edit passport

Figma Actual

Add passport

Figma Actual

@SaintPatrck SaintPatrck added the ai-review Request a Claude code review label Jun 5, 2026
@SaintPatrck SaintPatrck force-pushed the vault/pm-38153-ios-passport-add-edit branch from 57081fb to 6c00a53 Compare June 5, 2026 17:29
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:feature labels Jun 5, 2026
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the Passport add/edit screens implementation, including the new PassportItemState, action/view/state files, the SDK round-trip wiring (CipherView+Update, BitwardenSdk+Vault, CipherItemState), the feature-flag gating in CipherType/VaultGroupState, and the localization additions. The implementation faithfully mirrors the recently merged Driver's License feature (PR #2758) and carries strong test coverage across state mapping, SDK round-tripping, view actions, and date display formatting.

Code Review Details

No findings. The change is consistent with established patterns:

  • Passport is correctly added to both canCreateCases and newItemTypesGatedCases, keeping creation behind the newItemTypes feature flag.
  • Sensitive fields (passport number, national identification number) use hidden fields with reveal toggles, matching the password field treatment.
  • Date fields round-trip raw ISO strings verbatim through the SDK and render UTC-fixed display strings, identical to the Driver's License approach, with the TODO: PM-38360 marker for the future shared DateFieldPicker.
  • SDK Passport mapping, passportView, and passportItemState() are each covered by field-by-field tests.

The minor nits (docs, TODO reference, formatter extraction) were already raised and resolved in existing review threads.

@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.54279% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.96%. Comparing base (4636583) to head (6c00a53).

Files with missing lines Patch % Lines
...rtItem/AddEditPassportItemView+SnapshotTests.swift 0.00% 44 Missing ⚠️
.../AddEditPassportItem/AddEditPassportItemView.swift 88.35% 17 Missing ⚠️
Additional details and impacted files
@@                            Coverage Diff                             @@
##           vault/pm-38152-ios-passport-vault-list    #2763      +/-   ##
==========================================================================
+ Coverage                                   86.94%   86.96%   +0.01%     
==========================================================================
  Files                                        1896     1901       +5     
  Lines                                      180095   180903     +808     
==========================================================================
+ Hits                                       156592   157318     +726     
- Misses                                      23503    23585      +82     

☔ 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.

Base automatically changed from vault/pm-38152-ios-passport-vault-list to main June 8, 2026 13:50
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.
@SaintPatrck SaintPatrck force-pushed the vault/pm-38153-ios-passport-add-edit branch from 6c00a53 to 51079e5 Compare June 9, 2026 13:51
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Warning

@SaintPatrck Uploading code coverage report failed. Please check the "Upload to codecov.io" step of Process Test Reports job for more details.

@SaintPatrck SaintPatrck marked this pull request as ready for review June 9, 2026 14:17
@SaintPatrck SaintPatrck requested review from a team and matt-livefront as code owners June 9, 2026 14:17
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Warning

@SaintPatrck Uploading code coverage report failed. Please check the "Upload to codecov.io" step of Process Test Reports job for more details.

Comment thread BitwardenResources/Localizations/en.lproj/Localizable.strings
@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.51534% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.01%. Comparing base (8c9d9eb) to head (1aa8713).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...rtItem/AddEditPassportItemView+SnapshotTests.swift 0.00% 44 Missing ⚠️
.../AddEditPassportItem/AddEditPassportItemView.swift 88.35% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2763      +/-   ##
==========================================
- Coverage   87.93%   87.01%   -0.92%     
==========================================
  Files        1728     1920     +192     
  Lines      168727   182989   +14262     
==========================================
+ Hits       148365   159236   +10871     
- Misses      20362    23753    +3391     

☔ 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.

fedemkr
fedemkr previously approved these changes Jun 11, 2026
…ssport-add-edit

# Conflicts:
#	BitwardenResources/Localizations/en.lproj/Localizable.strings
#	BitwardenShared/Core/Vault/Models/Enum/CipherType.swift
#	BitwardenShared/Core/Vault/Models/Enum/CipherTypeTests.swift
#	BitwardenShared/UI/Vault/Vault/VaultGroup/VaultGroupState.swift
#	BitwardenShared/UI/Vault/VaultItem/CipherItemStateTests.swift

@fedemkr fedemkr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good, just one really small ⛏️

? addEditState.driversLicenseItemState.driversLicenseView
: nil,
passport: passport, // TODO: PM-32805
passport: (addEditState.type == .passport) ? addEditState.passportItemState.passportView : nil,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

⛏️ No need for the parenthesis here.

Suggested change
passport: (addEditState.type == .passport) ? addEditState.passportItemState.passportView : nil,
passport: addEditState.type == .passport ? addEditState.passportItemState.passportView : nil,

@SaintPatrck SaintPatrck Jun 15, 2026

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.

@fedemkr This follows the pattern used by surrounding types; login, identity, card, etc.. Unless there's a strong argument for passport being different I think we should maintain consistency. If we don't want the unnecessary parenthesis, we can open a follow-up PR to remove them for all the types above.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Interesting, I hadn't noticed that. Yes, I'll create a tech-debt task for it ♻️, thanks for spotting it Patrick!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@SaintPatrck SaintPatrck merged commit 7fb4d19 into main Jun 15, 2026
46 checks passed
@SaintPatrck SaintPatrck deleted the vault/pm-38153-ios-passport-add-edit branch June 15, 2026 17:06
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:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants