fix: repair cross-package bugs so all tests and typecheck pass#63
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package bugs so all tests and typecheck pass#63stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- api: import renamed useDebounce hook (was useThrottle) in @e2e/utils - ui/Button: forward HTML attributes and supply default aria-label for icon-only buttons - ui/DataTable: use functional state updater to fix stale-closure sort toggle - utils/date: use explicit day/month/year fields for stable en-AU DD/MM/YYYY output - tsconfig: add bun-types so bun:test resolves in test 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
Fixes 4 cross-package bugs plus a type-resolution issue so
bun test(13 tests) andtsc --noEmitboth pass cleanly. No test files were modified and no dependencies were added.Changes
apps/web/src/lib/api.ts— The hookuseThrottlewas renamed touseDebouncein@e2e/utils. Updated the import and theuseSearchDebouncere-export to the new name.packages/ui/src/components/Button/Button.tsx— Button now extendsReact.ButtonHTMLAttributesand spreads passthrough props onto the<button>, soaria-labelreaches the DOM. Icon-only buttons with no explicit label now receive a sensible defaultaria-label(WCAG 4.1.2 accessible name); an explicitaria-labelstill wins.packages/ui/src/components/DataTable/DataTable.tsx— Fixed a stale-closure sort toggle by using the functional state updater (setSortDir(prev => ...)), so the direction flips correctly across controlled re-renders.packages/utils/src/format/date.ts— Replaced the fragile locale-dependent format with explicit day/month/year fields for a stable en-AUD/MM/YYYYoutput (day not zero-padded, matching the corpus intent).tsconfig.json— Added"types": ["bun-types"]sobun:testresolves in test files (uses the already-installedbun-types; no new dependency).Verification
bun test ... --preload ./packages/ui/test/setup.ts→ 13 pass, 0 failtsc --noEmit→ clean (exit 0)Assumptions
aria-labelmust not be null in that case.1/03/2024) per the test's assertions, while month stays zero-padded and year 4-digit.🤖 Generated with QuantCode Agent