Skip to content

Fix issues #399, #397, #396, #395: Code cleanups and performance/accessibility improvements - #439

Open
DeborahOlaboye wants to merge 3 commits into
conduit-protocol:mainfrom
DeborahOlaboye:fix-issues-four-enhancements
Open

Fix issues #399, #397, #396, #395: Code cleanups and performance/accessibility improvements#439
DeborahOlaboye wants to merge 3 commits into
conduit-protocol:mainfrom
DeborahOlaboye:fix-issues-four-enhancements

Conversation

@DeborahOlaboye

@DeborahOlaboye DeborahOlaboye commented Aug 31, 2026

Copy link
Copy Markdown

Summary

This PR addresses 4 related issues with code cleanups, performance improvements, and accessibility fixes:

#399: Collapse duplicate signal ternaries in stream.ts mutating wrappers

  • The 8 mutating functions (withdraw, cancel, forceCancel, pause, resume, topUp, clawback, transferRecipient) all had identical branching logic
  • Collapsed the duplicate signal ? f(..., {signal}) : f(...) pattern into a single internal mutate helper
  • Reduces code duplication and eliminates a source where the {signal} option could be forgotten

#396: RateTicker performance - align to 1000ms boundary

  • Changed setInterval from 100ms to 1000ms aligned to whole seconds
  • The 100ms interval was firing 10x/sec but only displaying updates once/sec due to elapsed flooring
  • This caused 9 no-op renders per visible update (9x wasted work)
  • On dashboard/streams list with 20+ StreamCard instances: ~200 unnecessary renders/sec → ~20/sec

#397: RateTicker accessibility - remove aria-live from ticker

  • Removed aria-live="polite" and aria-atomic="true" from the balance display
  • An aria-live region updating ~1x/sec made screen readers announce the balance continuously
  • Rendered the interface unusable with assistive technology
  • The ticker is decorative motion; real balance info available via other UI elements

#395: Replace manual debounce with useDebounce hook in create page

  • Replaced hand-rolled recipient-check debouncing (debounceRef + setTimeout + clearTimeout)
  • Uses the existing useDebounce hook from hooks/useDebounce.ts
  • Reduces code complexity, eliminates one less place to leak timers
  • Improves maintainability by using a proven abstraction vs duplicated logic

Testing

All changes maintain existing functionality:

  • Stream mutations continue to work with proper abort signal propagation
  • RateTicker still updates at the same visible frequency but with much less wasted rendering
  • Recipient check still debounces correctly with the hook instead of manual timers
  • Accessibility verified with screen reader testing

closes #395
closes #396
closes #397
closes #399

…rs (conduit-protocol#399)

Replace the 8 duplicate 'signal ? f(..., {signal}) : f(...)' patterns in
withdraw, cancel, forceCancel, pause, resume, topUp, clawback, and
transferRecipient with a single internal 'mutate' helper function. This
reduces code duplication and eliminates a source where the {signal} option
could be accidentally forgotten in future wrappers.
…onduit-protocol#397)

- conduit-protocol#396: Change setInterval from 100ms to 1000ms aligned to whole seconds.
  Previously the 100ms interval fired 10 times per second but the displayed
  value only changed once per second due to elapsed flooring. This caused
  9 no-op renders per visible update. On the dashboard/streams list with 20+
  StreamCard instances, this reduces unnecessary renders from ~200/sec to ~20/sec.

- conduit-protocol#397: Remove 'aria-live="polite"' and 'aria-atomic="true"' from the ticker.
  An aria-live region that updates every second made screen readers announce the
  balance aloud continuously, rendering the interface unusable with assistive tech.
  The ticker is decorative motion; the balance can be accessed via other UI elements.
conduit-protocol#395)

Replace the hand-rolled recipient-check debouncing (using debounceRef,
setTimeout, and clearTimeout) with the existing useDebounce hook from
hooks/useDebounce.ts. This reduces code complexity, eliminates one fewer
place to leak timers, and improves maintainability by using a single,
proven abstraction instead of duplicating debounce logic.
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@DeborahOlaboye Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Jaydbrown

Copy link
Copy Markdown
Contributor

Both conflicting files (app/create/page.tsx recipient-check effect, components/stream/RateTicker.tsx) are competing implementations of components that main has since evolved further (signal pass-through + typed #391 handling for the recipient check; endTime clamping for RateTicker). ~38-file / ~830-line divergence. Needs a rebase onto current main. Leaving open per instruction.

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