Fix issues #399, #397, #396, #395: Code cleanups and performance/accessibility improvements - #439
Open
DeborahOlaboye wants to merge 3 commits into
Open
Conversation
…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.
|
@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! 🚀 |
Contributor
|
Both conflicting files ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
signal ? f(..., {signal}) : f(...)pattern into a single internalmutatehelper#396: RateTicker performance - align to 1000ms boundary
#397: RateTicker accessibility - remove aria-live from ticker
aria-live="polite"andaria-atomic="true"from the balance display#395: Replace manual debounce with useDebounce hook in create page
useDebouncehook fromhooks/useDebounce.tsTesting
All changes maintain existing functionality:
closes #395
closes #396
closes #397
closes #399