Open
Conversation
Contributor
|
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the Canton PendingTransferProposals feature on ledger-live-mobile by extracting proposal processing into utilities and moving UI logic into dedicated view models, while adding Jest coverage for the new units.
Changes:
- Extracted proposal processing / grouping / restore-state validation into
utils/transferProposals.tsand centralized related types intypes.ts. - Introduced view models (
usePendingTransferProposalsViewModel, details + device modal VMs) and split UI into smaller components (e.g.,ProposalsSection,ProposalRow). - Added Jest tests for the new utilities, view models, and the extracted
Viewcomponent; added a changeset forlive-mobile.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/utils/transferProposals.ts | New shared utilities for instruction mapping, proposal processing, grouping, and restore-state validation. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/usePendingTransferProposalsViewModel.ts | New view model encapsulating modal/details state, grouping, and device confirmation flow. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/usePendingTransferProposalsDetailsViewModel.ts | New view model for details drawer actions (time remaining, copy, action handler). |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/useDeviceAppModalViewModel.ts | New view model for device app modal confirmation state machine. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/types.ts | New/expanded shared types for raw/processed proposals, grouping, and modal state. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/index.tsx | Refactored container to use the new view model and extracted View for testing. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/components/useProposalRowViewModel.ts | New view model for proposal row display data + callbacks. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/components/ProposalsSection.tsx | New section component rendering grouped proposals. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/components/ProposalRow.tsx | New row component using the row view model. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/PendingTransferProposalsDetails.tsx | Refactored details drawer to consume a processed proposal and a view model. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/DeviceAppModal.tsx | Refactored device modal to use the new device modal view model. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/tests/useProposalRowViewModel.test.ts | New unit tests for proposal row view model. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/tests/usePendingTransferProposalsViewModel.test.ts | New unit tests for main view model behaviors (grouping, modal, restore, device confirm). |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/tests/usePendingTransferProposalsDetailsViewModel.test.ts | New unit tests for details view model. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/tests/useDeviceAppModalViewModel.test.ts | New unit tests for device modal view model state transitions. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/tests/transferProposals.test.ts | New unit tests for proposal processing/grouping/restore validation utilities. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/tests/test-utils.ts | New shared test factories/mocks for Canton accounts and proposals. |
| apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/tests/index.test.tsx | New component test coverage for the extracted View. |
| .changeset/beige-readers-allow.md | Changeset for live-mobile release. |
apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/utils/transferProposals.ts
Outdated
Show resolved
Hide resolved
apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/utils/transferProposals.ts
Outdated
Show resolved
Hide resolved
...anton/PendingTransferProposals/__tests__/usePendingTransferProposalsDetailsViewModel.test.ts
Show resolved
Hide resolved
5627488 to
8c0bee5
Compare
8c0bee5 to
5c90260
Compare
apps/ledger-live-mobile/src/families/canton/PendingTransferProposals/types.ts
Outdated
Show resolved
Hide resolved
...ve-mobile/src/families/canton/PendingTransferProposals/components/useProposalRowViewModel.ts
Show resolved
Hide resolved
amaslakov
previously approved these changes
Mar 2, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




✅ Checklist
npx changesetwas attached.📝 Description
Refactor PendingTransferProposals mobile components
❓ Context
🧐 Checklist for the PR Reviewers