Skip to content

fix: introducing laziness in Transaction Group Details data collection#2430

Merged
jbair06 merged 11 commits intomainfrom
2410_lazy_sign_state_calculation
Mar 10, 2026
Merged

fix: introducing laziness in Transaction Group Details data collection#2430
jbair06 merged 11 commits intomainfrom
2410_lazy_sign_state_calculation

Conversation

@ericleponner
Copy link
Contributor

@ericleponner ericleponner commented Mar 5, 2026

Description:

Changes below:

  • move some logic from TransactionGroupDetails to new TransactionGroupRow and SignGroupItemButton to divide complexity
  • introduce some laziness when computing Sign button state : computation starts only when row becomes visible
  • optimize Sign All state computation (it checks that at least one group item is signable ; that's enough)
  • temporarily disable calls to GET /transactions/approve/<transactionId> until Approval feature is fully backed

With those changes:

  • Sign button flickering is fully removed
  • Sign All button flickering is substantially reduced (but still visible when notification arrives and triggers a full page refresh)

Related issue(s):

Fixes #2410

Notes for reviewer:

M   front-end/src/renderer/pages/TransactionGroupDetails/TransactionGroupDetails.vue
    # Now delegates display and update of a row to TransactionGroupRow view.
    # Call to getUserShouldApprove() in fetchGroups() is temporarily disabled
    # to avoid unneeded call to backend (Approve feature is not backed yet).

A   front-end/src/renderer/pages/TransactionGroupDetails/TransactionGroupRow.vue
    # TransactionGroupRow now handles transaction group item display and update.
    # It uses useRevealed() composable to  start state computation only
    # when the row becomes visible in viewport.
    # It also delegate signing status computation to isSignableTransaction().

A   front-end/src/renderer/pages/TransactionGroupDetails/SignGroupItemButton.vue
    # Handle Sign action. Makes sure to emit('transactionSigned') once
    # transaction is signed *and* new transaction data have been retrieved from server.
    # This prevents Sign button to flicker.

M   front-end/src/renderer/utils/transactionSignatureModels/index.ts
    # Added isSignableTransaction() and used it from TransactionGroupRow and TransactionGroupDetails

A   front-end/src/renderer/composables/useRevealed.ts
    # New composable which monitors an html element and invokes a callback
    # when this element becomes visible in the viewport

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@ericleponner ericleponner changed the title 2410 lazy sign state calculation fix: introduce laziness in Transaction Group Details data collection Mar 5, 2026
@ericleponner ericleponner changed the title fix: introduce laziness in Transaction Group Details data collection fix: introducing laziness in Transaction Group Details data collection Mar 5, 2026
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.94%. Comparing base (4087338) to head (85d168d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2430   +/-   ##
=======================================
  Coverage   99.94%   99.94%           
=======================================
  Files         180      180           
  Lines        7017     7017           
  Branches     1420     1416    -4     
=======================================
  Hits         7013     7013           
  Misses          4        4           

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ericleponner ericleponner force-pushed the 2410_lazy_sign_state_calculation branch from ed3b11a to f7f4c62 Compare March 6, 2026 09:22
@ericleponner ericleponner force-pushed the 2410_lazy_sign_state_calculation branch from f7f4c62 to 4bb9fcc Compare March 9, 2026 16:12
@ericleponner ericleponner marked this pull request as ready for review March 9, 2026 18:39
@ericleponner ericleponner requested a review from a team as a code owner March 9, 2026 18:39
@jbair06 jbair06 requested a review from Copilot March 9, 2026 23:30
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

This PR refactors the Transaction Group Details page to reduce UI lag/flicker by moving row-level signing logic into dedicated components and deferring expensive “can sign?” computation until rows are visible.

Changes:

  • Introduces TransactionGroupRow and SignGroupItemButton to split responsibilities from TransactionGroupDetails.
  • Adds useRevealed() composable to lazily start per-row signing-state computation when a row enters the viewport.
  • Changes “Sign All” enablement logic to depend on whether at least one signable item exists, instead of tracking signability for every item.

Reviewed changes

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

File Description
front-end/src/renderer/pages/TransactionGroupDetails/TransactionGroupDetails.vue Delegates row rendering, adds “first signable item” tracking for Sign All, and updates state after a row signs.
front-end/src/renderer/pages/TransactionGroupDetails/TransactionGroupRow.vue New row component that lazily computes canSign when revealed and emits row events upward.
front-end/src/renderer/pages/TransactionGroupDetails/SignGroupItemButton.vue New sign button component that signs a transaction and re-fetches updated transaction data.
front-end/src/renderer/composables/useRevealed.ts New composable wrapping an IntersectionObserver to trigger callbacks when an element becomes visible.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
@ericleponner ericleponner force-pushed the 2410_lazy_sign_state_calculation branch from eaa3d27 to e913e81 Compare March 10, 2026 10:27
@jbair06 jbair06 requested a review from Copilot March 10, 2026 14:36
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 5 out of 5 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# Conflicts:
#	front-end/src/renderer/pages/TransactionGroupDetails/TransactionGroupDetails.vue
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
…upItemAfterSign().

Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
Copy link
Member

@jbair06 jbair06 left a comment

Choose a reason for hiding this comment

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

LGTM - manual testing shows a huge improvement in responsiveness - near instant.

@jbair06 jbair06 merged commit 5772fc6 into main Mar 10, 2026
24 checks passed
@jbair06 jbair06 deleted the 2410_lazy_sign_state_calculation branch March 10, 2026 15:41
@steven-sheehy steven-sheehy added this to the v0.26.0 milestone Mar 10, 2026
@steven-sheehy steven-sheehy added Bug A error that causes the feature to behave differently than what was expected based on design docs Frontend Frontend development work Performance labels Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug A error that causes the feature to behave differently than what was expected based on design docs Frontend Frontend development work Performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix transaction group details loading delay

4 participants