fix: repair 4 cross-package bugs and resolve type errors - #112
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: import renamed hook useDebounce from @e2e/utils, re-export as useSearchDebounce - Button: add accessible name for icon-only buttons (WCAG 4.1.2) with neutral fallback and once-per-label dev warning - DataTable: use functional setState for sort-direction toggle - date: format en-AU day-first without leading zero, pin timeZone for deterministic output - tsconfig: reference bun-types and include apps test dir so all sources type-check
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 type errors in the monorepo.
bun run test→ 13 pass / 0 fail;bunx tsc --noEmit→ 0 errors (also verified green underTZ=America/New_York). No test files modified, no dependencies added.Bugs fixed
apps/web/src/lib/api.ts— renamed hook. The hook inpackages/utilswas renamed touseDebounce(correctly exported), butapi.tsstill imported the olduseSearchDebounce/useThrottlenames. Now importsuseDebounceand re-exports it asuseSearchDebounce(the nameapi.test.tsasserts). VerifieduseThrottlehad no other consumers.packages/ui/.../Button.tsx— accessibility (WCAG 4.1.2). Icon-only buttons now always expose an accessible name viaaria-label. Explicit label used as-is; otherwise falls back to plain-stringchildren, else a neutral"Button"label (deliberately not purpose-specific, to avoid mislabelling e.g. a delete button). Dev-only warning fires at most once per distinct label.packages/ui/.../DataTable.tsx— sort toggle. Uses a functionalsetSortDirupdater so ascending→descending toggling is correct across re-renders.packages/utils/.../date.ts— en-AU formatting.formatDatenow renders day-first with no leading zero on the day (1/03/2024, not01/03/2024) viaformatToParts, and pinstimeZone: "Australia/Sydney"for deterministic output regardless of host TZ.Supporting change
tsconfig.json— added"types": ["bun-types"](already a devDependency) sobun:testresolves, and addedapps/*/test/**/*toincludeso the web app's tests are type-checked. Eliminated the pre-existingCannot find module 'bun:test'errors without editing any test file or adding a dependency.Assumptions
bun:testtype errors were pre-existing config gaps; resolving them via tsconfig (not test-file edits) was treated as in-scope for "eliminate all type errors".aria-labelremains optional; discriminated-union enforcement would require changing a test's deliberately-unlabelled case, so it was left out of scope.Verification
bun run test→ 13 pass / 0 failbunx tsc --noEmit→ exit 0TZ=America/New_York→ still greenreviewsubagent; the flagged blocker (misleading fallback label) was addressed.