Skip to content

feat(layout): show pending transaction count spinner badge on wallet button (#791) - #852

Open
Emmycivity wants to merge 5 commits into
conduit-protocol:mainfrom
Emmycivity:feat/791-pending-tx-badge
Open

Emmycivity wants to merge 5 commits into
conduit-protocol:mainfrom
Emmycivity:feat/791-pending-tx-badge

Conversation

@Emmycivity

Copy link
Copy Markdown

Shows an animated ring with the number of pending (submitted but not yet confirmed) transactions over the wallet button in the Navbar. A pending ledger submit stays visible after you navigate away.

Changes

File Change
lib/store.ts Adds a pendingSubmissions counter, plus a trackPendingSubmission() wrapper that always releases the count, even when a submission fails
lib/soroban.ts invokeContract, which every contract call goes through, wraps the send and the confirmation poll with that tracker
components/Navbar.tsx Badge over ConnectButton with a spinning ring that stops for users who prefer reduced motion. It uses black/white/gray only and caps at "9+". Screen readers announce "2 transactions pending"
components/__tests__/Navbar.test.tsx Tests: badge hidden at 0, shows the count with the ring, singular label, "9+" cap, removed once settled
lib/store.test.ts Tests: count released on success and rejection, concurrent submissions, never below zero, not reset on disconnect
CHANGELOG.md Entry under [Unreleased]

Notes for reviewers

  • This touches lib/soroban.ts, so it needs the extra maintainer approval. The send and submit logic itself is unchanged.
  • The count isn't reset on wallet disconnect, because a transaction that's already submitted is still in flight.
  • CI on main is already red: lint errors in 3 other files, 28 failing test files, and the dependency audit. This PR adds no new failures, and all of its new tests pass.

Closes #791

Emmycivity and others added 5 commits October 23, 2026 00:08
The Navbar has no indicator for submitted-but-unconfirmed transactions, so
these tests describe the expected behaviour first: the store counter is
released on success, rejection and concurrent submissions and never drops
below zero, and the Navbar shows a count (capped at 9+) over the wallet
button only while something is pending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Users who navigate away from the page that submitted a transaction lose
any sign that the ledger submit is still in flight. invokeContract is the
single submit point for all contract calls, so wrapping its send and
confirmation poll in trackPendingSubmission gives one global count. The
release happens in a finally block so confirmed, reverted, aborted and
timed-out submissions all clear the count.

Closes conduit-protocol#791

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The count needs to be visible from every page, and the Navbar is the only
persistent element, so the wallet button is wrapped in a relative
container and the badge renders over it whenever the count is above zero.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bare number is easy to miss and is not announced to assistive tech. The
badge gets an animated ring (motion-safe, so it stays still for users who
prefer reduced motion), black/white/gray colours per the design rules, and
an always-mounted polite live region so count changes are announced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…badge

Records the new indicator under [Unreleased] as the contributing guide
requires and confirms the change is typecheck and lint clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

components/Navbar.tsx: show pending transaction count spinner badge on wallet button

1 participant