Skip to content

perf(ui): the book reads payroll lines in one read on the web (#949) - #951

Merged
danielgorgonha merged 2 commits into
stagingfrom
perf/ledger-single-read
Nov 13, 2026
Merged

danielgorgonha merged 2 commits into
stagingfrom
perf/ledger-single-read

Conversation

@danielgorgonha

Copy link
Copy Markdown
Member

What & why

Closes #949.

On the web, getProposalDetail(id) reads the vault's whole proposal list and picks one proposal from it, with no cache. The Ledger called it once per payroll in three places: the book by beneficiary, opening a payroll row, and the export. On a vault with many payrolls that is N reads of the whole list in sequence.

readPayrollLines(ids) (new, ui/src/payroll-lines.ts) gives the Ledger the lines of the payrolls it asks for:

  • on the web, from ONE read through the existing getBookWithLines (no second "book with lines" reader);
  • on the local bridge, one detail read per payroll, as before, and with no cap (getBookWithLines stops at the newest 12 settled payrolls on the bridge, which the Ledger cannot afford).

What the Ledger shows is unchanged: the book by beneficiary keeps only payrolls with lines and does not ask again until reopened; a payroll row that answered no lines shows nothing (not "loading"); the export uses an empty list for a payroll that did not answer. One difference on the bridge: the book by beneficiary now stores the payrolls' lines when all are read, rather than one by one; the final state is the same.

Tests:

  • ui/src/payroll-lines.dom.test.ts: through the real reader with a counted fetch: 20 payrolls on the web = 1 fetch; 15 on the bridge = 15 detail reads; an empty payroll answers [], an unreadable book answers nothing; a source pin that the Ledger no longer calls getProposalDetail.
  • ui/src/ledger-reads.dom.test.tsx: the real Ledger: on the web, the book by beneficiary and the export each add exactly one read of the proposals (against the previous Ledger: 21); on the bridge, 20 detail reads each, past the cap.

Follow-up worth an issue: the bridge's per-id loop now exists in getBookWithLines (capped, for the proposal screen's note) and in readPayrollLines (uncapped); moving readPayrollLines into api.ts and having getBookWithLines use it would leave one loop.

Verify-before-finishing checklist

  • cargo fmt --check + cargo clippy -- -D warnings: not applicable (no Rust change)
  • cargo test: not applicable
  • ui/: lint + vitest (263 files, 3034 tests) + tsc pass
  • No secret, key share, seed, or passphrase in code, logs, URLs, or query strings
  • Every fund-moving path keeps preview + explicit confirmation (none touched)
  • FROST signer, PCZT, loopback bridge: not touched
  • User-facing strings: none added
  • Docs/comments in English; commits are type(scope): description
  • AI disclosure: written with Claude Code (the change, the tests, and the review and test runs), reviewed by a code audit and a test audit; the commits carry Co-Authored-By: Claude <noreply@anthropic.com>, no session link

danielgorgonha and others added 2 commits November 13, 2026 08:25
Co-Authored-By: Claude <noreply@anthropic.com>
…s a fix (#949)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
konclave-demo Ready Ready Preview Nov 13, 2026 11:38am UTC

Request Review

@danielgorgonha danielgorgonha self-assigned this Nov 13, 2026
@danielgorgonha danielgorgonha added enhancement New feature or request ui Interface and interaction labels Nov 13, 2026
@danielgorgonha
danielgorgonha merged commit 7e9ec53 into staging Nov 13, 2026
10 checks passed

This branch was successfully deployed

1 active deployment
Preview — b667a3e3 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ui Interface and interaction

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant