fix: reconcile renamed hook, icon-only button a11y, and AU date format - #139
Open
stooit wants to merge 1 commit into
Open
fix: reconcile renamed hook, icon-only button a11y, and AU date format#139stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- apps/web: import useDebounce and re-export as useSearchDebounce (renamed hook was still imported under the old useThrottle name) - ui/Button: add aria-label for icon-only buttons with dev-only warning [WCAG-4.1.2] - utils/formatDate: emit standard Australian D/M/YYYY (unpadded day and month) - tsconfig: add bun-types to compilerOptions.types to resolve bun:test module Makes all 13 tests pass and clears all type errors. No test files or dependencies changed.
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 eliminates all type errors in the monorepo. Bugs spanned three packages (
packages/utils,packages/ui,apps/web) plus one config fix.Final state:
bun run test→ 13 pass / 0 fail,tsc --noEmit→ 0 errors.Changes
apps/web/src/lib/api.ts— renamed hook —packages/utilsexportsuseDebounce, butapi.tsstill imported the old nameuseThrottle(the source ofTS2305). Now importsuseDebounceand re-exports it asuseSearchDebounce(the public name the test asserts).packages/utilswas left unchanged; no back-compat alias added.packages/ui/src/components/Button/Button.tsx— icon-only accessibility — icon-only buttons had no accessible name (WCAG 4.1.2). Addedaria-labelforiconOnlybuttons, derived from string children with a fallback, plus a dev-onlyconsole.warnwhen a label is missing. Normal text buttons are unaffected —aria-label={undefined}is omitted by React, so their accessible name still comes from text content.packages/utils/src/format/date.ts— date format —formatDateemitted a non-standard hybrid (01/03/2024). Now produces standard AustralianD/M/YYYY(1/3/2024,15/6/2024) with day and month unpadded.formatDateTimeuntouched.tsconfig.json— type resolution — added"types": ["bun-types"]to clear the 4 pre-existingTS2307: Cannot find module 'bun:test'errors.bun-typeswas already an installed devDependency, so no dependency was added. Verified path aliases and React prop type-checking still catch real errors.Assumptions & notes
DataTablestale-closure area mentioned in the brief already had passing tests, so it was left unchanged.docs/planning artifacts generated during investigation were intentionally not committed.Verification
bun run test→ 13 pass / 0 failnpx tsc --noEmit→ 0 errorsapps/web/src/lib/api.ts,packages/ui/src/components/Button/Button.tsx,packages/utils/src/format/date.ts,tsconfig.json