fix: repair cross-package bugs so all tests and typecheck pass - #161
Open
stooit wants to merge 1 commit into
Open
fix: repair cross-package bugs so all tests and typecheck pass#161stooit wants to merge 1 commit into
stooit wants to merge 1 commit into
Conversation
- api.ts: import renamed hook useDebounce (was useThrottle), keep useSearchDebounce alias - Button: forward aria-label to DOM element and default it for icon-only buttons; dev-only WCAG 4.1.2 warning (guarded for browser/no-process environments) - DataTable: merge sort key/direction into a single atomically-updated state object to fix stale-closure bug on batched clicks - date.ts: format day-first with 4-digit year and a pinned timeZone so output is deterministic across timezones; align formatDateTime with formatDate - tsconfig: add bun-types and apps test globs so test files typecheck
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 5 failing tests and 5 type errors across the monorepo. After these changes
bun run testreports 13/13 pass andbun run typecheck(tsc --noEmit) exits 0. No test files orpackage.jsonwere modified.Changes
apps/web/src/lib/api.tsuseDebouncein@e2e/utilsbutapi.tsstill importeduseThrottle. Import the real export and keep theuseSearchDebouncealias the app/test expect.useDebounceis a genuine trailing-edge debounce, so this is a rename, not a semantic swap.packages/ui/src/components/Button/Button.tsxaria-labelwas never forwarded to the<button>element. Now forwarded; foriconOnlybuttons it defaults to an explicit label (explicitaria-labelis never clobbered), with a dev-only WCAG 2.2 SC 4.1.2 warning. Guard hardened withtypeof process !== "undefined"so it can't throw in browsers.packages/ui/src/components/DataTable/DataTable.tsxuseStateatoms; on batched clicks the toggle branch read stale state and never fired. Merged into onesortobject updated through a single functional updater so key/direction update atomically.packages/utils/src/format/date.tsformatDateproduced01/03/2024(leading-zero day); the test requires a day-first, unpadded day (1/03/2024). Switched toen-GBwith explicit field options.formatDateTimealigned to match (it had drifted to a 2-digit year).tsconfig.jsonapps/web/testtypechecks — mirrors the existing packages test pattern, and resolves thebun:testerrors.Assumptions & judgement calls
Testing
bun run test-> 13 pass, 0 failbun run typecheck-> exit 0