Conversation
…abel, and bun:test types - api.ts: import useDebounce (renamed from useThrottle) from @e2e/utils - date.ts: emit day-first with no leading zero on day (en-AU, d/mm/yyyy) - Button: expose accessible name for icon-only buttons via aria-label, with dev-mode WCAG 2.2 SC 4.1.2 warning when no aria-label is supplied - tsconfig.json: add bun-types to types so bun:test resolves - remove stale/misleading BUG comments in DataTable and useDebounce
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 and eliminates all type errors across the monorepo. Baseline was 8 pass / 5 fail with 5 type errors; now 13 pass / 0 fail with 0 type errors (
bun run testandtsc --noEmit).Four cross-package bugs plus one tsconfig issue:
apps/web/src/lib/api.ts— the hook was renameduseThrottle→useDebouncein@e2e/utils, butapi.tsstill imported the old name (runtimeSyntaxError+ TS2305). Updated the import and theuseSearchDebouncere-export to the real export. Confirmed the hook body is genuinely a debounce, so renaming the consumer (rather than re-adding auseThrottlealias) is the correct direction.packages/utils/src/format/date.ts—formatDatereturned01/03/2024; the test contract is day-first with no leading zero on the day (1/03/2024). Keeps theen-AUlocale and strips only the day's leading zero. Verified across multiple dates (incl.2024-02-29) that only the day part is affected, never the month.packages/ui/src/components/Button/Button.tsx— icon-only buttons had no accessible name. Now exposes one viaaria-label(an explicit caller-suppliedaria-labelalways wins), with a dev-modeconsole.warnciting WCAG 2.2 SC 4.1.2 when an icon-only button is rendered without a label. Text and icon+text buttons emit noaria-label(verified).tsconfig.json— addedbun-typestocompilerOptions.typessobun:testresolves (TS2307 in the test files). No dependency added —bun-typeswas already a devDependency;skipLibCheckretained.Also removed stale/misleading
BUG:comments inDataTable.tsxanduseDebounce.tsthat described defects which no longer (or never) existed.Investigated but deliberately not changed
handleSortis a plain inline function recreated every render (nouseCallback/useMemo), so it always reads current state. The test passes untouched; no edit made.document is not defined— this only occurs with a barebun testthat skips the--preload ./packages/ui/test/setup.tsin the project'stestscript. It is an invocation artefact, not a source bug;setup.tsregisters happy-dom correctly. No change needed — run viabun run test.Assumptions
d/mm/yyyyday-first, no-leading-zero-day format is the intendedformatDatecontract (asserted directly bydate.test.ts).package.jsonwere not modified, and no dependencies were added, per task constraints.Verification
Follow-ups (out of scope, not blocking)
Propstype makingaria-labelmandatory wheniconOnly: true— turns the runtime warning into a compile error, but requires editingButton.test.tsx(out of scope here).formatToPartsmapping would remove that implicit assumption.🤖 Generated with QuantCode