feat(ui): add interactive hover focus and disabled states to loading … - #354
Open
iamTissan wants to merge 1 commit into
Open
feat(ui): add interactive hover focus and disabled states to loading …#354iamTissan wants to merge 1 commit into
iamTissan wants to merge 1 commit into
Conversation
…spinner skeleton closes Goldii-locks#274
|
@iamTissan 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! 🚀 |
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.
This PR implements interactive states (hover, focus-visible, and disabled) using Tailwind CSS utilities across the LoadingSkeleton and ButtonSpinner components, fulfilling the requirements outlined in #274. It also resolves a character encoding artifact in the skeleton live-region message and adds full Vitest/React Testing Library test coverage.
Key Changes
LoadingSkeleton.tsx:
Added optional interactive props: interactive, disabled, onClick, tabIndex, and aria-label.
Styled hover and focus states with smooth transitions (hover:border-gray-700, hover:bg-gray-900/90, hover:shadow-lg, focus-visible:ring-2, focus-visible:ring-blue-500, focus-visible:outline-none).
Implemented keyboard accessibility (Enter / Space keydown handlers) and dynamic ARIA roles (role="button" when interactive, role="status" default).
Handled disabled states (opacity-50, cursor-not-allowed, pointer-events-none, aria-disabled="true").
Fixed mojibake encoding string (Loading job data...).
ButtonSpinner.tsx:
Added disabled prop support with responsive opacity and cursor classes.
Added smooth transition tokens for hover and disabled states.
tests/loading_spinner_skeleton.test.tsx:
Added unit test suite verifying rendering, ARIA attributes, interactive classes, click/keyboard event handlers, and disabled state behavior for both components.
Closes #274
Type of Change
[ ] Bug fix (non-breaking change that fixes an issue)
[x] New feature (non-breaking change that adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Documentation update
[x] Refactor / code cleanup
[ ] CI / tooling / developer experience
How Has This Been Tested?
[x] Manual testing (verified interactive focus outlines and hover styles)
[x] Automated tests added (6/6 passing via Vitest)
Test steps:
Run pnpm vitest run loading_spinner_skeleton to verify all skeleton and spinner unit tests pass.
Render and verify keyboard focus produces a blue ring outline and hover elevates background/border styling.
Render and verify click events do not fire and disabled styles are applied.
Render and confirm disabled opacity is applied.
Checklist
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[x] I have commented on complex or non-obvious areas of the code
[x] I have updated documentation where necessary
[x] My changes generate no new warnings
[x] New and existing tests pass locally
[x] I have checked that no sensitive information (keys, passwords, tokens) is committed