Skip to content

refactor: canton offers desktop#14942

Open
ishaba wants to merge 2 commits intodevelopfrom
refactor/canton-offers-desktop
Open

refactor: canton offers desktop#14942
ishaba wants to merge 2 commits intodevelopfrom
refactor/canton-offers-desktop

Conversation

@ishaba
Copy link
Contributor

@ishaba ishaba commented Mar 2, 2026

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ledger-live-desktop

📝 Description

Refactor PendingTransferProposals desktop components

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@ishaba ishaba requested a review from a team as a code owner March 2, 2026 17:42
Copilot AI review requested due to automatic review settings March 2, 2026 17:42
@live-github-bot live-github-bot bot added the desktop Has changes in LLD label Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

⚠️ E2E tests are required

Changes detected require e2e testing before merge (even before asking for any review).

🖥️ Desktop

-> Run Desktop E2E

  • Select "Run workflow"
  • Branch: refactor/canton-offers-desktop
  • Device: nanoSP or stax

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the Canton “PendingTransferProposals” desktop feature by separating proposal processing, view-model logic, and presentational UI, while updating tests and adding a changeset for the desktop package.

Changes:

  • Extracted transfer-proposal processing/grouping into reusable utilities.
  • Introduced usePendingTransferProposalsViewModel and a View component to decouple logic from UI.
  • Split table/row UI into dedicated components and refreshed unit tests accordingly.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
apps/ledger-live-desktop/src/renderer/families/canton/PendingTransferProposals/utils/transferProposals.ts New utilities to process raw proposals and group them by day.
apps/ledger-live-desktop/src/renderer/families/canton/PendingTransferProposals/usePendingTransferProposalsViewModel.ts New hook encapsulating modal state, proposal derivation, and action handling/sync.
apps/ledger-live-desktop/src/renderer/families/canton/PendingTransferProposals/usePendingTransferProposalsViewModel.test.ts New tests covering view-model behavior (sync + topology-change flow).
apps/ledger-live-desktop/src/renderer/families/canton/PendingTransferProposals/types.ts Centralized types for raw/processed/grouped proposals and modal state.
apps/ledger-live-desktop/src/renderer/families/canton/PendingTransferProposals/index.tsx Refactored entrypoint to render View using the new view-model hook and extracted table component.
apps/ledger-live-desktop/src/renderer/families/canton/PendingTransferProposals/index.test.tsx Updated tests to validate View behavior with a view-model-shaped prop object.
apps/ledger-live-desktop/src/renderer/families/canton/PendingTransferProposals/components/ProposalsTable.tsx New presentational table component for grouped proposals.
apps/ledger-live-desktop/src/renderer/families/canton/PendingTransferProposals/components/ProposalRow.tsx New presentational row component rendering proposal details/actions.
.changeset/unlucky-pianos-smash.md Adds a desktop changeset entry for the refactor.

amaslakov
amaslakov previously approved these changes Mar 2, 2026
@ishaba ishaba force-pushed the refactor/canton-offers-desktop branch from f029ef9 to fdd9f36 Compare March 2, 2026 22:02
Copilot AI review requested due to automatic review settings March 3, 2026 01:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.

@ishaba ishaba force-pushed the refactor/canton-offers-desktop branch from 5540b47 to 9054a91 Compare March 3, 2026 01:36
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
5.0% Duplication on New Code (required ≤ 3%)
8 New Code Smells (required ≤ 1)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Has changes in LLD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants