You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ui): restore a green Frontend Quality job (#98)
* fix(ui): satisfy the react-hooks lint rules that break CI
The `Frontend Quality` job fails on main because `npm run lint` reports two
errors from the react-hooks rules that ship with eslint-config-next 16.3.x:
* `react-hooks/immutability` in `file-upload.tsx` - `formatSize` was declared
after the `handleFileSelect` callback that reads it.
* `react-hooks/set-state-in-effect` in the errors page - the effect called a
fetch helper that synchronously flipped the loading state.
`formatSize` was duplicated in `file-upload.tsx` and `file-browser.tsx`, so it
moves to `lib/utils.ts` as `formatBytes` (module scope, covered by tests) and
both components use it. The errors page moves to React Query, matching every
other data-loading page in the app, which removes the effect entirely.
* fix(ui): set explicit display names on the primitive wrappers
Recent Radix UI releases no longer assign `displayName` to their primitives, so
every wrapper that copied it (`Label.displayName = LabelPrimitive.Root.displayName`
and friends) ended up with `undefined`. That is invisible in the browser but
breaks eight assertions in the component suites and leaves React DevTools
showing anonymous `ForwardRef` nodes.
Each wrapper now declares its own name, which is what the rest of the ui
components already did. The scroll bar keeps the name of the exported
component, `ScrollBar`, instead of the Radix-internal `ScrollAreaScrollbar`.
* test(ui): simulate a full click when dismissing the popover
Radix now passes `deferPointerDownOutside: true` for popovers, so an outside
pointerdown no longer dismisses on its own - the layer waits for the click that
follows, which stops a drag that ends outside the popover from closing it. The
test fired only `pointerDown` and therefore never saw `onOpenChange`.
0 commit comments