feat(forms): add skeleton loading state - #1090
Open
khaylebfortune wants to merge 3 commits into
Open
Conversation
- Improve loading skeleton to mirror loaded layout exactly, preventing layout shift (add export button placeholders, match row structure with title + id + copy button skeletons) - Skeleton announces loading to AT via role=status, aria-label, aria-live=polite, aria-busy=true, and sr-only span - Add 9 comprehensive tests covering: toolbar mirroring, row structure matching, placeholder contents, axe accessibility, skeleton→content transitions, and state exclusivity during loading Closes Talenttrust#1025
Extract FormsListSkeleton component that mirrors the FormsList layout (filter buttons, export buttons, form rows with title + ID + copy button) to prevent layout shift during loading. - Use SkeletonContainer for accessible loading announcement (role=status, aria-busy=true, aria-live=polite) - Extend SkeletonContainerProps to accept HTML div attributes (data-testid) - Guard ARIA attributes from accidental override via rest props - Add 20 comprehensive tests for skeleton rendering, accessibility, transitions, and axe compliance - Loading skeleton now takes precedence over error prop Closes Talenttrust#1025
- Add forms-skeleton-filters and forms-skeleton-export test IDs - Use <span> for right group in skeleton rows (matches loaded layout) - Support error-in-loading: show error banner inside skeleton container - Update tests to match new error-in-loading behavior
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
Extracts a dedicated
FormsListSkeletoncomponent that mirrors the FormsList layout to prevent layout shift during loading. UsesSkeletonContainerfor accessible loading announcements to assistive technology.Changes
src/components/FormsList.tsxFormsListSkeletoncomponent with filter buttons, export buttons, and 10 form rows with title + ID + copy button placeholders. Error-in-loading support: error banner shown inside skeleton container. UsesSkeletonContainerfor accessibility.src/components/Skeleton.tsxSkeletonContainerPropsto inheritReact.HTMLAttributes<HTMLDivElement>. Guards ARIA attributes from accidental override.src/components/__tests__/FormsListSkeleton.test.tsxsrc/components/__tests__/FormsList.test.tsxTest Results
Key Design Decisions
CreateStreamFormSkeletonpattern (role=status,aria-busy=true,aria-live=polite,sr-onlylabel)isLoadinganderrorare set, the loading container shows an error banner inside (skeleton rows hidden); AT still hears "Loading forms" while sighted users see the errorSkeletonContainerdestructures ARIA attributes from rest props to prevent overridesCloses #1025