Conversation
- apps/web/src/lib/api.ts: fix stale import — hook renamed to useDebounce in @e2e/utils; keep the public useSearchDebounce alias the test asserts on - packages/ui Button: apply aria-label to icon-only buttons (WCAG 4.1.2), with a dev warning when omitted - packages/utils formatDate: emit self-consistent day-first AU short date (1/3/2024) with 4-digit year, instead of month-first / mixed padding - tsconfig.json: add bun-types to types so bun:test resolves in typecheck
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 TypeScript errors across the monorepo.
bun run test→ 13 pass / 0 fail;npx tsc --noEmit→ clean (exit 0). No test files or dependencies were modified.The bugs spanned three packages plus a tsconfig gap:
apps/web/src/lib/api.ts— stale import. The hook was renamed touseDebouncein@e2e/utils, but this file still importeduseThrottle(TS2305). Fixed the import and kept the publicuseSearchDebouncealias thatapps/web/test/api.test.tsasserts on. Merged the duplicate@e2e/utilsimport while in there.packages/uiButton — theariaLabelprop was destructured but never applied to the element. Icon-only buttons now receive anaria-label(WCAG 4.1.2), with a non-productionconsole.warnwhen one is omitted. Text buttons resolve toundefined, so React omits the attribute and existing behaviour is unchanged.packages/utilsformatDate— was producing month-first / mixed-padding output. Now emits a self-consistent day-first AU short date (1/3/2024) with a 4-digit year.formatDateTimeleft untouched.tsconfig.json— added"types": ["bun-types"]sobun:testresolves during typecheck (removes 4 TS2307 errors).bun-typeswas already a devDependency — no new dependency added.Verification
Assumptions & notes
"Button"aria-label fallback guarantees a non-empty accessible name to satisfy the test that renders a label-less icon button (Button.test.tsx:28). A discriminated union making the label mandatory would break that unmodifiable test, so a runtime fallback + dev warning is the intended shape. Real call sites should still pass explicit labels.DataTable.tsxcarries aBUG: stale closurecomment but all its tests pass —handleSortis recreated each render and clicks flush separately, sosortDiris current. Left unchanged as it is not a live defect and no test requires it.Reviewed for correctness/minimality via the review agent; both the renamed public export and the permissive
typesarray were confirmed to suppress nothing legitimate.