fix: react-doctor sweep — accessibility, correctness, perf & key fixes#409
Merged
Merged
Conversation
Run of `npx react-doctor@latest` flagged 616 issues (score 45/100). This commit clears all blocking errors in the Accessibility and Correctness categories plus the mechanical `button-has-type` warnings, raising the score to 57/100 (591 issues). Behavior-preserving only — the State & Effects errors and perf/architecture warnings are left for follow-up PRs since they require deeper, behavior-sensitive review. Fixes: - no-nested-component-definition: hoist `SortHeader` out of `SubmissionsTable` to module scope and pass sort state via props, so it keeps a stable identity instead of remounting every render. - alt-text (×2): add `alt` to the OG-image circuit tiles (decorative, `alt=""`) and the logo (`alt="SemiAnalysis"`). - role-has-required-aria-props (×2): add `aria-controls` to the `role="combobox"` triggers in multi-select / searchable-select, wired to a `useId()`-generated listbox id on the popup. - button-has-type (×20): add explicit `type="button"` to chart/UI buttons (none are form submits). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 50407eb. Configure here.
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.

What
Ran
npx react-doctor@latest(https://react.doctor) against the app and worked the findings down across two commits. The initial scan reported 616 issues / 45→100 (Critical); this PR brings it to 415 issues / 63→100 (Needs work) — 201 issues resolved, all behavior-preserving.Commit 1 — blocking errors (a11y + correctness)
no-nested-component-definition: hoistedSortHeaderout ofSubmissionsTableto module scope (stable identity instead of remount-per-render).alt-text(2),role-has-required-aria-props(2): OG-image alt text;aria-controlson combobox triggers.button-has-type(20): explicittype="button"on chart/UI buttons.Commit 2 — warning sweep (~187 fixes, 83 files)
Run as a 15-agent parallel workflow partitioned by file (each file owned by exactly one agent — no edit collisions). Every agent fetched the canonical fix recipe per rule and stayed strictly behavior-preserving.
js-combine-iterations(48),js-set-map-lookups(10),js-flatmap-filter(7),js-index-maps(5),js-hoist-intl(2),js-batch-dom-css(2) — single-pass loops / Set lookups, identical output.design-no-space-on-flex-children(21, space-y/x → gap),design-no-redundant-size-axes(4, h-4 w-4 → size-4),design-no-redundant-padding-axes(3).no-react19-deprecated-apis(17, e.g.useContext→use).exhaustive-deps(12) — added stable setters/callbacks (no-op) or genuinely missing deps; removed unused deps.control-has-associated-label(9),click-events-have-key-events(5),interactive-supports-focus(4),prefer-tag-over-role(3),label-has-associated-control(2),no-static-element-interactions(1).no-array-index-key(10),no-array-index-as-key(7) → stable data-derived keys.no-derived-state-effect+no-chain-state-updates— movedsetError('')from an effect into the open-change handler.client-localstorage-no-version(3),rerender-memo-with-default-value(2),no-usememo-simple-expression(2),no-generic-handler-names(2),prefer-module-scope-static-value(1),rendering-hydration-mismatch-time(1).Deliberately NOT changed (387 findings skipped, each with a recorded reason)
no-event-handlerfiring onuseChartDatahook args) or carry real behavior risk in the inference/eval/global context providers and the D3 render/zoom lifecycle. react-doctor itself warns against blindly adding deps — these are left for targeted human review.nextjs-no-img-element: the agents converted 4<img>→next/image; I reverted all 4. The logos are SVGs with varied aspect ratios and the watermark is 552×228 —next/imageforces a single width/height (distortion) and SVG needsdangerouslyAllowSVG. Kept raw<img>; the rule is a perf nicety, not correctness.only-export-components) — out of scope; need a content or architecture decision.Verification
pnpm typecheck✅ ·pnpm lint(app src, 0/0) ✅ ·pnpm fmt✅pnpm test:unit✅ — 2201 tests pass (1944 app + 212 db + 25 mcp + 20 constants)js-combine-iterationsrewrites preserve order/output; the 16 effect/dep changes are no-ops or genuinely-missing deps).Overlay support
The touched code is shared UI primitives, perf/a11y cleanups, and context plumbing used by both the official and
?unofficialrun=paths — no inference/eval chart-data feature was added or branched, so overlay behavior is unchanged. Verified via the existing overlay unit/E2E tests (all green).🤖 Generated with Claude Code