Conversation
- api: import renamed useDebounce hook and re-export as useSearchDebounce (was importing non-existent useThrottle, breaking api.test and typecheck) - Button: forward aria-label to the rendered button for icon-only buttons, with a dev warning + fallback so an accessible name is always present (WCAG 4.1.2) - DataTable: use functional state updater for sort direction to fix stale closure so asc→desc toggles on the second header click - date: strip zero-padding on the day part while keeping en-AU day-first ordering (1/03/2024 instead of 01/03/2024)
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 all 5 failing tests and all source-code type errors in the monorepo. Four bugs spanning
packages/utils,packages/ui, andapps/web— each isolated and fixed without touching test files or adding dependencies.Bugs fixed
apps/web/src/lib/api.tspackages/utilswas renamed touseDebounce;api.tswas importing a non-existentuseThrottle. Now importsuseDebounceand re-exports it asuseSearchDebounce(the nameapi.test.tsasserts on). Resolves both the test failure and theTS2305typecheck error.packages/ui/src/components/Button/Button.tsxButtondid not forwardaria-labelto the rendered element. Now forwarded, with a dev-mode warning and a fallback so an icon-only button always has a non-null accessible name (WCAG 2.2 SC 4.1.2).packages/ui/src/components/DataTable/DataTable.tsxsetSortDir(prev => ...)updater.packages/utils/src/format/date.tsformatDatezero-padded the day (01/03/2024). Now strips the day's leading zero while keepingen-AUday-first ordering and a 4-digit year (1/03/2024), satisfying all date assertions.Verification
bun run test-> 13 pass, 0 failbun run typecheck-> no source errors. The only remaining diagnostics are four pre-existingCannot find module 'bun:test'errors on test files (missing Bun test-runtime type declarations); left as-is because test files must not be modified and no dependencies may be added.Assumptions
useSearchDebounceis the canonical export name (the API test asserts on it); the underlying implementation is the renameduseDebounce.bun:testtypecheck errors are environmental (test-runtime types) and out of scope under the "do not modify test files / do not add dependencies" constraints.en-AU+formatToParts(to strip day zero-padding) was chosen overdateStyle:"short"(which yields a 2-digit year and breaks other assertions).