Feat/pool distribution bar a11y#379
Closed
Devadakene wants to merge 2 commits into
Closed
Conversation
Contributor
|
Thanks for this — after resolving the merge, this ends up fully redundant with main: both the api.ts timeout/AbortSignal composition and the PoolDistributionBar hover-highlight accessibility feature already landed via #380 (that branch carried this same content). Zero net diff left, so closing as already covered rather than merging a duplicate. |
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.
Closes #143
Description
This PR enhances the accessibility and interactivity of the PoolDistributionBar component by making each legend entry focusable and visually highlighting the corresponding SVG segment on hover or focus.
Changes
Accessibility Upgrade: Wrapped the static legend items (
Visual Feedback: Added a stateful highlightedAsset hook to detect which legend entry is hovered/focused.
Segment Highlighting: SVG elements now visually dim (opacity reduces to 0.4) when another asset is active, keeping the highlighted segment fully visible.
DOM Metadata: Added data-highlighted="true"|"false" attributes to the SVG elements to aid testing and potential CSS target hook.
Coverage & Tests: Extended
PoolDistributionBar.test.tsx
with test assertions checking:
Button elements exist in the legend for focusability.
Hovering or focusing legend entries correctly updates the visual representation (opacity, custom attributes).
Verification
Ran the vitest test suite successfully:
bash
bun run vitest run src/components/PoolDistributionBar.test.tsx
Result: All tests passed.