Conversation
- api.ts: import current useDebounce export (was stale useThrottle) - Button: apply aria-label with icon-only fallback + dev warning (WCAG 4.1.2) - DataTable: fix stale-closure sort via functional state updater - date.ts: day-first, non-zero-padded day via formatToParts - bunfig.toml: preload happy-dom setup for bare 'bun test' from root - tsconfig.json: add bun-types to resolve bun:test
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 failing tests (was 4 pass / 9 fail → now 13 pass / 0 fail) and all type errors (was 5 → now 0) across the monorepo. Verified with
bun test && tsc --noEmitfrom the repo root.Bugs spanned all three packages plus a root test/type config gap that made a bare
bun test(as opposed to thenpm testscript) fail to register the DOM environment.Fixes
apps/web/src/lib/api.ts— theuseThrottlehook was renamed inpackages/utils; aligned the consumer to the currentuseDebounceexport (TS2305). Consumer updated, hook not renamed back.packages/ui/.../Button.tsx— icon-only buttons now receive an accessible name viaaria-label, with a dev-modeconsole.warnwhen omitted (WCAG 2.2 SC 4.1.2).packages/ui/.../DataTable.tsx— fixed a stale-closure bug in the sort handler (functionalsetSortDirupdater) so a second click sorts descending.packages/utils/.../date.ts— produce a day-first, non-zero-padded day (e.g.1/03/2024) viaformatToParts, so day 1 isn't confused with month 1.bunfig.toml— addedpreloadof the happy-dom setup so a barebun testfrom root definesdocument.tsconfig.json— addedbun-types(already installed) to resolvebun:test(TS2307).Constraints honoured
setup.tsmodified.bun-typeswas already innode_modules).Assumptions / notes worth review
en-AUand controlled zero-padding explicitly rather than switching toen-NZ(which happens to emit the exact string via an ICU quirk) — more stable across ICU updates.aria-labelis non-null even when no label is passed, forcing a fallback string. That's a correctness floor, not a meaningful accessible name — the dev warning surfaces the real omission at the call site.An accessibility-focused review pass would be a reasonable follow-up.