feat(contacts): drive add-address confirmation via DiE (LIVE-36766) - #21440
feat(contacts): drive add-address confirmation via DiE (LIVE-36766)#21440claudiiafg wants to merge 1 commit into
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
Web Tools Build Status
|
There was a problem hiding this comment.
🟡 Changes recommended
Desktop Contacts add-address now renders an empty dialog while awaiting currency analytics before starting the device intent, delaying DIE mounting and causing a user-visible blank state.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR removes the web “Continue/success” placeholder confirmation UI for Contacts add-address and switches Desktop + Mobile flows (including Send/prefill entry points) to hand off confirmation to the real Device Intent Executor (DIE). It also moves Contacts device-intents mocks into a dedicated test export so production code paths no longer rely on mocked device results.
Changes:
- Remove the web completion/placeholder screens and make add-address confirmation/review steps render via DIE instead of in-flow buttons.
- Require explicit
deviceIntentsinjection for Contacts ports and relocate mock device intents into@features/platform-contacts/test. - Update Desktop/Mobile MVVM flows + integration tests to assert DIE handoff and the post-confirmation behavior.
File summaries
| File | Description |
|---|---|
| features/platform/contacts/src/contactEdit/createContactEditPort.web.test.ts | Updates port construction to pass required deviceIntents. |
| features/platform/contacts/src/contactEdit/createContactEditPort.ts | Makes deviceIntents dependency mandatory (no default mock). |
| features/platform/contacts/src/contactDeviceIntentsPort.ts | Removes in-module mock factory; keeps port + errors/types. |
| features/platform/contacts/src/contactDeviceIntentsPort.test.ts | Points tests at the new dedicated mock module. |
| features/platform/contacts/src/contactDeviceIntentsPort.mock.ts | Adds deterministic mock device-intents implementation for tests. |
| features/platform/contacts/src/contactAddressEdit/createContactAddressEditPort.web.test.ts | Uses new mock module import for tests. |
| features/platform/contacts/README.md | Documents test-only device intents export. |
| features/platform/contacts/package.json | Exposes ./test export for test-only mocks. |
| features/flow/flow-contacts-add-address/src/web.ts | Removes web completion screen export. |
| features/flow/flow-contacts-add-address/src/usePrefillAddAddressFlow.web.test.ts | Uses @features/platform-contacts/test mock export. |
| features/flow/flow-contacts-add-address/src/state/useAddAddressFlowViewModel.web.test.ts | Renames mock-completion API usage in tests. |
| features/flow/flow-contacts-add-address/src/state/useAddAddressFlowViewModel.ts | Renames completeMockConfirmation → completeConfirmation. |
| features/flow/flow-contacts-add-address/src/state/types.ts | Updates VM type + removes completion/placeholder view prop types. |
| features/flow/flow-contacts-add-address/src/screens/Flow/ContactsAddAddressFlowContent.web.tsx | Stops rendering confirmation/review/success placeholders on web (returns null). |
| features/flow/flow-contacts-add-address/src/screens/Flow/ContactsAddAddressFlowContent.web.test.tsx | Adjusts expectations to “no button rendered” for placeholder steps. |
| features/flow/flow-contacts-add-address/src/screens/Completion/ContactsAddAddressCompletion.web.tsx | Deletes the web placeholder completion component. |
| features/flow/flow-contacts-add-address/README.md | Updates structure docs to reflect removal of Completion screen. |
| apps/ledger-live-mobile/src/mvvm/features/Contacts/screens/ContactDetail/useContactDetailScreenViewModel.ts | Routes add-address confirmation through DIE and updates completion logic. |
| apps/ledger-live-mobile/src/mvvm/features/Contacts/screens/ContactDetail/hooks/useContactDetailEditDeleteAdapter.test.tsx | Imports mocks from @features/platform-contacts/test. |
| apps/ledger-live-mobile/src/mvvm/features/Contacts/hooks/useContactAddressDetailActionsAdapter.test.tsx | Imports mocks from @features/platform-contacts/test. |
| apps/ledger-live-mobile/src/mvvm/features/Contacts/hooks/prefillAddAddress/PrefillAddAddressFlowRoot.tsx | Uses contacts intents orchestrator + mounts DeviceIntentExecutorLWM when active. |
| apps/ledger-live-mobile/src/mvvm/features/Contacts/integrations/Contacts.integration.test.tsx | Renames test scenario to device confirmation expectations. |
| apps/ledger-live-mobile/mocks/@features/platform-contacts/device.ts | Updates mock to source test mock export. |
| apps/ledger-live-desktop/src/mvvm/features/Send/screens/AddToExistingContact/hooks/tests/useAddToExistingContactViewModel.test.tsx | Mocks contacts device orchestrator instead of mock port export. |
| apps/ledger-live-desktop/src/mvvm/features/Send/screens/AddNewContact/hooks/tests/useAddNewContactViewModel.test.tsx | Mocks contacts device orchestrator instead of mock port export. |
| apps/ledger-live-desktop/src/mvvm/features/Send/screens/AddNewContact/AddNewContactAddressView.tsx | Mounts DeviceIntentExecutorLWD when DIE is active. |
| apps/ledger-live-desktop/src/mvvm/features/Send/hooks/useSendPrefillAddAddressFlow.ts | Uses contacts intents orchestrator + threads dieProps through phase state. |
| apps/ledger-live-desktop/src/mvvm/features/Send/mocks/sendFlowTestUtils.tsx | Adds module mock for @features/platform-contacts/device. |
| apps/ledger-live-desktop/src/mvvm/features/Contacts/screens/Contacts/useContactsViewModel.ts | Drives add-address saving/confirmation with DIE and updated flow actions. |
| apps/ledger-live-desktop/src/mvvm/features/Contacts/screens/Contacts/components/ContactsAddAddressFlowDialog/types.ts | Removes completion/placeholder callbacks/labels from dialog props. |
| apps/ledger-live-desktop/src/mvvm/features/Contacts/screens/Contacts/components/ContactsAddAddressFlowDialog/ContactsAddAddressFlowDialog.tsx | Stops passing removed completion/placeholder props into flow content. |
| apps/ledger-live-desktop/src/mvvm/features/Contacts/hooks/prefillAddAddress/PrefillAddAddressFlowRoot.tsx | Uses contacts intents orchestrator + mounts DeviceIntentExecutorLWD when active. |
| apps/ledger-live-desktop/src/mvvm/features/Contacts/integrations/Contacts.integration.test.tsx | Updates integration expectations to dialog dismissal instead of placeholder screens. |
| apps/ledger-live-desktop/src/mvvm/features/Contacts/integrations/Contacts.deviceIntents.integration.test.tsx | Updates integration assertions to reflect DIE takeover. |
| apps/ledger-live-desktop/mocks/@features/platform-contacts/device.ts | Updates mock to source test mock export. |
| .changeset/calm-contacts-confirm.md | Adds changeset documenting the user-facing behavior change. |
Review details
- Files reviewed: 36/36 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const { network, asset } = await resolveContactsCurrencyAnalytics( | ||
| flowState.selectedCurrencyId, | ||
| { | ||
| findTokenById: currencyId => getCryptoAssetsStore().findTokenById(currencyId), | ||
| }, |
Rsdoctor Bundle Diff AnalysisFound 7 projects in monorepo, 2 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 desktop-rendererPath:
📦 Download Diff Report: desktop-renderer Bundle Diff 📁 mobilePath:
📦 Download Diff Report: mobile Bundle Diff Generated by Rsdoctor GitHub Action |
1521a40 to
b47ac6a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new package export uses a ./test subpath that appears inconsistent with existing ./testing test-entrypoint conventions in the monorepo and should be aligned before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 36/36 changed files
- Comments generated: 1
- Review effort level: Lite
| "./web": "./src/web.ts", | ||
| "./device": "./src/device/index.ts", | ||
| "./device/intents": "./src/device/intents/index.ts", | ||
| "./test": "./src/contactDeviceIntentsPort.mock.ts", |
b47ac6a to
3917561
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
It changes end-to-end confirmation flow behavior across Desktop and Mobile with device-intent orchestration, making it higher-risk to approve without a final human validation pass.
Review details
- Files reviewed: 33/33 changed files
- Comments generated: 0 new
- Review effort level: Lite
|


📝 Description
Remove the mocked Contacts add-address confirmation screens (placeholder Continue / completion UI) and drive confirmation through the real Device Intent Executor on Desktop and Mobile.
Previously, MAD add-address could show a Continue placeholder instead of device confirmation, Mobile auto-advanced via a mock confirmation path, and some prefill / Send entry points used
createMockContactDeviceIntentsPort. Users no longer see that placeholder: naming or review continue startsregisterExternalAddressand mounts DIE. Mock device intents stay test-only (@features/platform-contacts/test). Unit and integration tests assert the real confirmation handoff, not a mock Continue button.🔗 Context