Skip to content

fix: reconcile renamed hook, icon-only button a11y, and AU date format - #139

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2150-1787872384
Open

fix: reconcile renamed hook, icon-only button a11y, and AU date format#139
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2150-1787872384

Conversation

@stooit

@stooit stooit commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

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

  1. apps/web/src/lib/api.ts — renamed hookpackages/utils exports useDebounce, but api.ts still imported the old name useThrottle (the source of TS2305). Now imports useDebounce and re-exports it as useSearchDebounce (the public name the test asserts). packages/utils was left unchanged; no back-compat alias added.

  2. packages/ui/src/components/Button/Button.tsx — icon-only accessibility — icon-only buttons had no accessible name (WCAG 4.1.2). Added aria-label for iconOnly buttons, derived from string children with a fallback, plus a dev-only console.warn when 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.

  3. packages/utils/src/format/date.ts — date formatformatDate emitted a non-standard hybrid (01/03/2024). Now produces standard Australian D/M/YYYY (1/3/2024, 15/6/2024) with day and month unpadded. formatDateTime untouched.

  4. tsconfig.json — type resolution — added "types": ["bun-types"] to clear the 4 pre-existing TS2307: Cannot find module 'bun:test' errors. bun-types was already an installed devDependency, so no dependency was added. Verified path aliases and React prop type-checking still catch real errors.

Assumptions & notes

  • The DataTable stale-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.
  • No test files were modified and no dependencies were added, per the constraints.

Verification

  • bun run test → 13 pass / 0 fail
  • npx tsc --noEmit → 0 errors
  • Changed files: apps/web/src/lib/api.ts, packages/ui/src/components/Button/Button.tsx, packages/utils/src/format/date.ts, tsconfig.json

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant