fix: address DataTable, Modal, and ErrorBoundary review feedback#9
Merged
intel352 merged 2 commits intofeat/issue-3-4-components-a11yfrom Feb 24, 2026
Merged
Conversation
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add shared React components with accessibility support
fix: address DataTable, Modal, and ErrorBoundary review feedback
Feb 24, 2026
intel352
added a commit
that referenced
this pull request
Feb 24, 2026
* feat: expand component library with StatusBadge, DataTable, Modal, LoadingSpinner, ErrorBoundary + accessibility (#3, #4) Add 5 new shared React components with full TypeScript types, unit tests, and accessibility support: - StatusBadge: color-coded workflow status indicator - DataTable: sortable, paginated data table - Modal: confirmation/error/info dialogs - LoadingSpinner: loading state indicator - ErrorBoundary: React error boundary wrapper All components use semantic HTML, ARIA labels, and support keyboard navigation (WCAG compliance). Closes #3, Closes #4 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: address DataTable, Modal, and ErrorBoundary review feedback (#9) * Initial plan * fix: address PR review comments for DataTable, Modal, and ErrorBoundary Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> * fix: address Copilot review feedback on component library - DataTable: type key as keyof T, import ReactNode, remove role="grid", clamp pagination, memoize sorting - Modal: fix double-escape, import event types, use useId for title - ErrorBoundary: remove mismatched aria-label on retry button - ErrorBoundary tests: import beforeEach/afterEach from vitest - LoadingSpinner: move keyframe injection to useEffect - StatusBadge: use strict types for size style records Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: remove useEffect setState for pagination clamping in DataTable Replace useEffect + setState pagination clamping with derived safePage value to satisfy react-hooks/set-state-in-effect lint rule. The flat DataTable already had safePage derived inline; remove the redundant effect. The directory-based DataTable now derives safePage from the raw page state and totalPages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: remove duplicate test assertion, use useEffect for SSR compat Remove duplicate 'has accessible form with aria-label' test that was identical to 'renders a <form> element for the login form'. Switch LoadingSpinner keyframe injection from useLayoutEffect to useEffect to avoid SSR warnings in Next.js/Remix consumers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
intel352
added a commit
that referenced
this pull request
Feb 26, 2026
…aceholder (#13) * feat: expand component library with StatusBadge, DataTable, Modal, LoadingSpinner, ErrorBoundary + accessibility (#3, #4) Add 5 new shared React components with full TypeScript types, unit tests, and accessibility support: - StatusBadge: color-coded workflow status indicator - DataTable: sortable, paginated data table - Modal: confirmation/error/info dialogs - LoadingSpinner: loading state indicator - ErrorBoundary: React error boundary wrapper All components use semantic HTML, ARIA labels, and support keyboard navigation (WCAG compliance). Closes #3, Closes #4 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: address DataTable, Modal, and ErrorBoundary review feedback (#9) * Initial plan * fix: address PR review comments for DataTable, Modal, and ErrorBoundary Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> * fix: address Copilot review feedback on component library - DataTable: type key as keyof T, import ReactNode, remove role="grid", clamp pagination, memoize sorting - Modal: fix double-escape, import event types, use useId for title - ErrorBoundary: remove mismatched aria-label on retry button - ErrorBoundary tests: import beforeEach/afterEach from vitest - LoadingSpinner: move keyframe injection to useEffect - StatusBadge: use strict types for size style records Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: remove useEffect setState for pagination clamping in DataTable Replace useEffect + setState pagination clamping with derived safePage value to satisfy react-hooks/set-state-in-effect lint rule. The flat DataTable already had safePage derived inline; remove the redundant effect. The directory-based DataTable now derives safePage from the raw page state and totalPages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: remove duplicate test assertion, use useEffect for SSR compat Remove duplicate 'has accessible form with aria-label' test that was identical to 'renders a <form> element for the login form'. Switch LoadingSpinner keyframe injection from useLayoutEffect to useEffect to avoid SSR warnings in Next.js/Remix consumers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix 1: Deduplicate DataTable component Delete the flat src/components/DataTable.tsx file (the stale implementation) and update the test file to use the subdirectory version at src/components/DataTable/DataTable.tsx. Changed column definitions from 'label' to 'header', added required 'rowKey' prop, and updated test assertions to match the subdirectory component's API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix 2: Remove hardcoded 'admin' placeholder from LoginPage Changed the default username placeholder from 'admin' to 'Enter username' for better UX and to avoid hardcoding test credentials in the UI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix 3: Abstract localStorage in authStore Added StorageAdapter interface and storage configuration option to AuthStoreConfig. The store now accepts an optional storage adapter (defaults to localStorage) allowing for testable storage behavior and SSR compatibility. All localStorage calls now use the configurable storage instance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix DataTable export and remove stale SortState/SortDirection type re-exports - Use named re-export from DataTable/index.ts (not default) in components/index.ts - Remove non-existent SortState and SortDirection from components/index.ts and src/index.ts - Fix DataTable.test.tsx button queries to use 'Next page'/'Previous page' matching aria-labels Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Fix lint: remove unused 'vi' import from DataTable.test.tsx Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Addresses 9 review comments from the component library PR: type safety gaps, duplicate ESC handling, duplicate
aria-labelledbyIDs, missing imports, and pagination state drift.DataTable
key: keyof T & string— wasstring, allowing keys that don't exist onT;rendervalue param,sortKeystate, andhandleSortupdated accordinglyrole="grid"— native<table>semantics are correct;gridimplies unimplemented arrow-key navigationuseEffectresetspageto0..totalPages-1whendata.length/pageSizechanges, preventing stuck empty viewsReactNodeimport — was referencingReact.ReactNodewithout importingReactModal
onKeyDownESC handler — ESC was handled by bothonKeyDownand the nativecancelevent, potentially callingonClosetwice; now relies solely on thecancellisteneruseId()for title id — hard-coded"modal-title"caused duplicate IDs with multiple Modal instances; replaced withuseId()soaria-labelledbyand<h2 id>are always paired and uniquetype MouseEventimport — was usingReact.MouseEventwithout importingReactErrorBoundary test
beforeEach/afterEachto vitest imports — were used but not imported, causing test suite failure at runtime💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.