Skip to content

fix: repair four cross-package bugs surfaced by failing tests#49

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2528-1781802772
Open

fix: repair four cross-package bugs surfaced by failing tests#49
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2528-1781802772

Conversation

@stooit

@stooit stooit commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all failing tests and the one product-code type error in the monorepo. Four distinct bugs spanning packages/utils, packages/ui, and apps/web:

  • apps/web/src/lib/api.ts — the hook useThrottle was renamed to useDebounce in @e2e/utils, but api.ts still imported the old name (the cause of the export 'useSearchDebounce' not found failure and a TS2305 error). Now imports useDebounce and re-exports it under the public alias useSearchDebounce.
  • packages/utils/src/format/date.tsformatDate used explicit { month, day, year: "numeric" } options producing month-first 01/03/2024. Switched to { dateStyle: "short" } with the en-AU locale so dates are day-first (1/03/2024).
  • packages/ui/src/components/Button/Button.tsx — the icon-only <button> branch did not forward aria-label, so icon-only buttons had no accessible name. Now forwards aria-label.
  • packages/ui/src/components/DataTable/DataTable.tsxhandleSort read stale sortDir from the closure. Switched to the functional state updater setSortDir(prev => ...).

Verification

  • bun run test13 pass, 0 fail.
  • npx tsc --noEmit → the one real product-code error (useThrottle not exported) is gone. The remaining TS2307: Cannot find module 'bun:test' errors are pre-existing (present on the base commit 7e2198e) and confined to test files; the task constraints forbid modifying test files, and they are unrelated to the four bugs.

Notes / assumptions

  • No test files were modified and no dependencies were added, per the task constraints.
  • dateStyle: "short" was chosen over hand-rolled options because it lets the en-AU locale drive day-first ordering, matching the test's expectation.

- api.ts: import renamed hook useDebounce (was useThrottle) and
  re-export as useSearchDebounce
- formatDate: use { dateStyle: "short" } so en-AU yields day-first dates
- Button: forward aria-label on icon-only buttons for an accessible name
- DataTable: use functional state updater in handleSort to fix stale closure
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