Skip to content

fix: repair cross-package bugs so all tests and typecheck pass#63

Open
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2544-1782924847
Open

fix: repair cross-package bugs so all tests and typecheck pass#63
stooit wants to merge 1 commit into
mainfrom
quantcode/e2e-tier3-2544-1782924847

Conversation

@stooit

@stooit stooit commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes 4 cross-package bugs plus a type-resolution issue so bun test (13 tests) and tsc --noEmit both pass cleanly. No test files were modified and no dependencies were added.

Changes

  • apps/web/src/lib/api.ts — The hook useThrottle was renamed to useDebounce in @e2e/utils. Updated the import and the useSearchDebounce re-export to the new name.
  • packages/ui/src/components/Button/Button.tsx — Button now extends React.ButtonHTMLAttributes and spreads passthrough props onto the <button>, so aria-label reaches the DOM. Icon-only buttons with no explicit label now receive a sensible default aria-label (WCAG 4.1.2 accessible name); an explicit aria-label still wins.
  • packages/ui/src/components/DataTable/DataTable.tsx — Fixed a stale-closure sort toggle by using the functional state updater (setSortDir(prev => ...)), so the direction flips correctly across controlled re-renders.
  • packages/utils/src/format/date.ts — Replaced the fragile locale-dependent format with explicit day/month/year fields for a stable en-AU D/MM/YYYY output (day not zero-padded, matching the corpus intent).
  • tsconfig.json — Added "types": ["bun-types"] so bun:test resolves in test files (uses the already-installed bun-types; no new dependency).

Verification

  • bun test ... --preload ./packages/ui/test/setup.ts13 pass, 0 fail
  • tsc --noEmitclean (exit 0)

Assumptions

  • For icon-only buttons the accessible name is auto-derived when none is supplied, since a Button test asserts the aria-label must not be null in that case.
  • Date output keeps the day un-padded (e.g. 1/03/2024) per the test's assertions, while month stays zero-padded and year 4-digit.

🤖 Generated with QuantCode Agent

- api: import renamed useDebounce hook (was useThrottle) in @e2e/utils
- ui/Button: forward HTML attributes and supply default aria-label for icon-only buttons
- ui/DataTable: use functional state updater to fix stale-closure sort toggle
- utils/date: use explicit day/month/year fields for stable en-AU DD/MM/YYYY output
- tsconfig: add bun-types so bun:test resolves in test files
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