Skip to content

Auth/Innovation/PM-34210 - Desktop - Add devices dialog#19797

Merged
JaredSnider-Bitwarden merged 18 commits intomainfrom
auth/pm-34210/desktop-device-management
Apr 20, 2026
Merged

Auth/Innovation/PM-34210 - Desktop - Add devices dialog#19797
JaredSnider-Bitwarden merged 18 commits intomainfrom
auth/pm-34210/desktop-device-management

Conversation

@JaredSnider-Bitwarden
Copy link
Copy Markdown
Contributor

@JaredSnider-Bitwarden JaredSnider-Bitwarden commented Mar 26, 2026

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-34210
Server feature flag PR: bitwarden/server#7361

Reminder ⚠️ : if. #19784 merges first, we must add any new translations to the desktop before merging this. - Done ✅

📔 Objective

Add devices page in a dialog to the desktop.

📸 Screenshots

Basic usage:

PM-34210.-.Desktop.-.Add.devices.in.a.dialog.mov

Pending auth request usages:

PM-34210.-.Desktop.-.pending.auth.request.scenarios.mov

…vicesModule

The provider was incorrectly registered only in the web app's core.module.ts.
Moving it to JslibServicesModule makes it available to all clients (web, desktop,
CLI) without each needing to register it explicitly. Browser extension keeps its
own ExtensionDeviceManagementComponentService override which takes DI precedence.
Adds the PM34210_DesktopAddDevices flag to gate the new Devices menu item
on the desktop Account menu. Defaults to true locally for development.
…tions

- Adds DeviceManagementDialogComponent as a temporary dialog wrapper around
  the shared DeviceManagementComponent, matching the ChangePasswordDialog pattern
- Adds DesktopDeviceManagementComponentService with showHeaderInformation=false
  since the dialog provides its own header via bit-dialog
- Registers the desktop service in services.module.ts to override the jslib default
- Adds 13 missing device management i18n keys to the desktop en/messages.json
Wires the feature-flagged Devices menu item into the desktop Electron Account
menu, positioned after Change Password. When clicked, sends openDevicesDialog
to the renderer which opens DeviceManagementDialogComponent via DialogService.
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 26, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.92%. Comparing base (0ae0653) to head (4fa075d).
⚠️ Report is 9 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/desktop/src/main/menu/menu.account.ts 0.00% 6 Missing ⚠️
...e-management/device-management-dialog.component.ts 0.00% 5 Missing ⚠️
apps/desktop/src/app/app.component.ts 0.00% 3 Missing ⚠️
apps/desktop/src/app/services/services.module.ts 0.00% 2 Missing ⚠️
...ces/desktop-device-management-component.service.ts 0.00% 2 Missing ⚠️
libs/angular/src/services/jslib-services.module.ts 0.00% 2 Missing ⚠️
apps/desktop/src/main/menu/menubar.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19797      +/-   ##
==========================================
+ Coverage   46.89%   46.92%   +0.02%     
==========================================
  Files        3909     3911       +2     
  Lines      118263   118288      +25     
  Branches    18092    18096       +4     
==========================================
+ Hits        55465    55502      +37     
+ Misses      58626    58614      -12     
  Partials     4172     4172              

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 26, 2026

Logo
Checkmarx One – Scan Summary & Details60b62013-7ec4-436c-80c5-2be68aae04da


New Issues (1) Checkmarx found the following issues in this Pull Request
# Severity Issue Source File / Package Checkmarx Insight
1 MEDIUM Missing_HSTS_Header apps/browser/src/dirt/phishing-detection/services/phishing-data.service.ts: 304
detailsThe web-application does not define an HSTS header, leaving it vulnerable to attack.
Attack Vector

@JaredSnider-Bitwarden JaredSnider-Bitwarden added the ai-review-vnext Request a Claude code review using the vNext workflow label Mar 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 30, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the desktop Devices dialog wiring gated by the PM34210_DesktopAddDevices feature flag. Changes include a new DeviceManagementDialogComponent wrapper, DesktopDeviceManagementComponentService, an Account menu item, a feature-flag-gated notificationId forwarded in openLoginApproval, and 13 new i18n keys. The previous reviewer feedback about relocating DefaultDeviceManagementComponentService to jslib-services.module.ts was incorporated, and the browser extension's ExtensionDeviceManagementComponentService override remains intact.

Code Review Details

No actionable findings. The change follows the existing ChangePasswordDialogComponent pattern, preserves fail-closed defaults (feature flag default FALSE, constructor params default false, ?? false in menubar.ts), and correctly forwards notificationId only when the flag is enabled so DeviceManagementComponent.messageListener can upsert the pending device inline. All TODOs are tracked under PM-34438 for post-rollout cleanup.

@JaredSnider-Bitwarden JaredSnider-Bitwarden marked this pull request as ready for review March 30, 2026 23:35
@JaredSnider-Bitwarden JaredSnider-Bitwarden requested review from a team as code owners March 30, 2026 23:35
Comment on lines -448 to -452
safeProvider({
provide: DeviceManagementComponentServiceAbstraction,
useClass: DefaultDeviceManagementComponentService,
deps: [],
}),
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.

The DefaultDeviceManagementComponentService should have always been put on libs/angular/src/services/jslib-services.module.ts

coroiu
coroiu previously approved these changes Mar 31, 2026
…uth request id so that the device management page can upsert the device w/ the pending auth request.
ike-kottlowski
ike-kottlowski previously approved these changes Mar 31, 2026
Copy link
Copy Markdown
Contributor

@ike-kottlowski ike-kottlowski left a comment

Choose a reason for hiding this comment

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

Thank you for testing the auth request flows.

An excellent addition.

@sonarqubecloud
Copy link
Copy Markdown

@JaredSnider-Bitwarden JaredSnider-Bitwarden merged commit 9962193 into main Apr 20, 2026
124 of 138 checks passed
@JaredSnider-Bitwarden JaredSnider-Bitwarden deleted the auth/pm-34210/desktop-device-management branch April 20, 2026 16:50
jaasen-livefront pushed a commit that referenced this pull request Apr 22, 2026
* [PM-34210] Move DeviceManagementComponentService provider to JslibServicesModule

The provider was incorrectly registered only in the web app's core.module.ts.
Moving it to JslibServicesModule makes it available to all clients (web, desktop,
CLI) without each needing to register it explicitly. Browser extension keeps its
own ExtensionDeviceManagementComponentService override which takes DI precedence.

* [PM-34210] Add pm-34210-desktop-add-devices feature flag

Adds the PM34210_DesktopAddDevices flag to gate the new Devices menu item
on the desktop Account menu. Defaults to true locally for development.

* [PM-34210] Add desktop device management dialog, service, and translations

- Adds DeviceManagementDialogComponent as a temporary dialog wrapper around
  the shared DeviceManagementComponent, matching the ChangePasswordDialog pattern
- Adds DesktopDeviceManagementComponentService with showHeaderInformation=false
  since the dialog provides its own header via bit-dialog
- Registers the desktop service in services.module.ts to override the jslib default
- Adds 13 missing device management i18n keys to the desktop en/messages.json

* [PM-34210] Add Devices item to desktop Account menu

Wires the feature-flagged Devices menu item into the desktop Electron Account
menu, positioned after Change Password. When clicked, sends openDevicesDialog
to the renderer which opens DeviceManagementDialogComponent via DialogService.

* Move device-management dialog on desktop to correct auth owned file.

* PM-34210 - Update all TODOs with proper ticket

* PM-34210 - Feature flag - don't check in true. duh

* PM-34210 - clean up incorrect todo

* PM-34210 - Fix desktop auth request answering service not including auth request id so that the device management page can upsert the device w/ the pending auth request.

* PM-34210 - Per PR feedback clean up dialog component of unused stuff.

* PM-34210 - Add new translations for devices screen to desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review-vnext Request a Claude code review using the vNext workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants