Skip to content

Fix/multi issue 568 569 570 571 - #589

Merged
ogazboiz merged 4 commits into
LabsCrypt:mainfrom
Joycejay17:fix/multi-issue-568-569-570-571
May 30, 2026
Merged

Fix/multi issue 568 569 570 571#589
ogazboiz merged 4 commits into
LabsCrypt:mainfrom
Joycejay17:fix/multi-issue-568-569-570-571

Conversation

@Joycejay17

Copy link
Copy Markdown
Contributor

Description

Four small, independent fixes across contracts and frontend: a duplicate doc comment, two accessibility gaps, and a duplicate utility function.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 🔧 Refactoring (no functional changes)

Related Issues

Closes #568 , Closes #569 , Closes #570 , Closes #571

Changes Made

#568contracts/stream_contract/src/events.rs

  • Removed the redundant first line (/// Emitted when a stream is paused.) from the StreamPausedEvent doc comment, keeping the more precise second line (/// Emitted when a sender pauses an active stream.).

#569frontend/src/components/ui/Button.tsx

  • Added aria-busy={loading} to the <button> element so screen readers announce the in-progress state.
  • Marked the spinner SVG aria-hidden="true" to suppress its meaningless announcement.
  • Added a <span className="sr-only">Loading</span> alongside the spinner so assistive technology reads a meaningful label when loading is true.

#570frontend/src/components/dashboard/StreamDetailsModal.tsx

  • Guarded the progress calculation: deposited > 0 ? Math.min(100, Math.max(0, (withdrawn / deposited) * 100)) : 0 — was NaN/Infinity when deposited === 0.
  • Added aria-label="Close" to the × close button, consistent with other modals in the app.

#571frontend/src/components/TransactionTracker.tsx

  • Imported formatAmount from the shared @/utils/amount utility.
  • Deleted the private formatAmount(raw, decimals) at the bottom of the file. The local copy used BigInt(10 ** decimals) which is fragile for decimals > 15; the shared util uses the safe 10n ** BigInt(decimals) form.

Testing

Test Coverage

  • Manual testing performed

Test Steps

#568

  1. cd contracts && cargo build — confirms the contract still compiles cleanly.

#569

  1. Trigger any loading button (create stream, withdraw, top-up, cancel).
  2. Inspect with browser DevTools: aria-busy="true" present on <button>, spinner has aria-hidden="true", and a .sr-only "Loading" span is in the DOM.
  3. Use VoiceOver / NVDA — "Loading" is announced when the button enters loading state.

#570

  1. Open Stream Details for a stream with deposited === 0 — progress bar renders at 0% (was broken/NaN width).
  2. Confirm the × button is announced as "Close" by a screen reader.

#571

  1. Trigger a transaction and let it reach the confirmed state — the "Summary of Changes" section renders amounts correctly.
  2. cd frontend && npm run build — no TypeScript errors in TransactionTracker.tsx.

Screenshots/Demo

No visual regression — the spinner appearance, modal layout, and transaction tracker UI are unchanged.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have checked for breaking changes and documented them if applicable

Additional Notes

Joycejay17 and others added 4 commits May 30, 2026 01:43
Collapse the two near-identical leading lines into a single clear sentence.

Closes LabsCrypt#568

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Set aria-busy={loading} on the button element, mark the spinner SVG
aria-hidden="true", and add a visually-hidden "Loading" span so screen
readers announce the in-progress state on every loading button.

Closes LabsCrypt#569

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Guard the progress calc against deposited === 0 (was NaN/Infinity) by
returning 0 and clamping the result to 0–100. Add aria-label="Close"
to the X button so screen readers announce it consistently with other
modals in the app.

Closes LabsCrypt#570

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the private formatAmount(raw, decimals) at the bottom of
TransactionTracker.tsx with the canonical helper from @/utils/amount.
The local copy used BigInt(10 ** decimals) which is fragile for
decimals > 15; the shared util uses the safe 10n ** BigInt(decimals)
form.

Closes LabsCrypt#571

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ogazboiz
ogazboiz merged commit 4f629a3 into LabsCrypt:main May 30, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants