← Dev log
EduQate·frontend

A "restyle only" pass that turned up real bugs

A restyle-only sweep surfaced a React Rules-of-Hooks violation: a useQuery sitting after an early `if (isLoading) return`, so hook order differed between renders.

The safety net had a hole

The test, the audit log, the scanner, the CI run — covering less than I assumed it did.

A multi-agent design sweep across all four apps — 127 files, roughly 10k lines, explicitly scoped as "don't change functionality." It surfaced genuine functional bugs hiding under the cosmetic debt.

A Rules-of-Hooks violation in super-admin's SchoolManagement.tsx: a useQuery had ended up textually after an early if (isLoading) return introduced earlier in the same restyle, so hook order differed between the loading and loaded renders. Moved above the early return.

Two orphaned React Query calls in SchoolDetail.tsx firing real network requests on every page view with no consumer anywhere in the app. Dead since well before that session, and only noticed because a lint sweep flagged the unused variables.

Six inaccessible modal backdrops across super-admin's queue-drawer pattern — <div onClick={close}> with no keyboard handler. The same copy-pasted pattern in six files, fixed once and propagated by pattern-matching rather than opening each file blind.

The lesson is about the class, not the three bugs: even a pure restyle pass needs a real lint and typecheck sweep afterwards. These only show up when something actually checks hook order or a11y semantics — a human eyeballing a diff won't catch any of them.