Skip to content

Stabilize GitHub diff rendering keys - #2006

Open
open-inspect[bot] wants to merge 1 commit into
mainfrom
open-inspect/1766ae36c20266c2de8a656e8199b416
Open

open-inspect[bot] wants to merge 1 commit into
mainfrom
open-inspect/1766ae36c20266c2de8a656e8199b416

Conversation

@open-inspect

@open-inspect open-inspect Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes 1 root-cause task from the nightly React Doctor scan. Parsed GitHub diff rows now use stable semantic keys based on line type, old/new line coordinates, and content instead of their array position.

Tasks fixed

  1. react-doctor/no-array-index-as-key — packages/web/src/components/github-autofix-feedback.tsx:297 — Diff rows used the array index as part of their React key. When diff content changes, position-based identity can make React retain the wrong row instance. The stable line identity prevents incorrect reconciliation and makes future stateful row behavior safe. Human severity: medium (correctness warning).

Counting

This PR fixes 1 task unit. The selected diagnostic has no fixGroupId, so it counts as one ungrouped root-cause task. No fixGroupId was split, and no additional findings were fixed opportunistically.

React Doctor results

Scanner: React Doctor 0.9.14, schema version 3, full packages/web scope, complete coverage.

  • Before: 104 total diagnostics (3 errors, 101 warnings), 64 affected files, score 62
  • After: 103 total diagnostics (3 errors, 100 warnings), 63 affected files, score 63
  • Relevant rule: no-array-index-as-key decreased from 5 to 4
  • Raw diagnostics cleared: 1
  • New diagnostic IDs introduced: 0
  • Changed-scope scan against origin/main: score 100, no findings

Validation

  • npm run build -w @open-inspect/shared — passed before editing
  • npm run typecheck -w @open-inspect/web — passed
  • npx prettier --check packages/web — passed
  • npm run lint -w @open-inspect/web — passed
  • npx vitest run src/components/github-autofix-feedback.test.tsx src/lib/github-autofix-feedback.test.ts — passed, 36 tests
  • npm test -w @open-inspect/web — passed after editing, 206 files and 1,805 tests
  • npx -y react-doctor@latest . --json --json-out /tmp/react-doctor-after.json --yes --blocking none — complete; selected diagnostic removed and no new findings
  • npx -y react-doctor@latest . --verbose --scope changed --base origin/main --yes --blocking none — passed with no findings

Pre-existing failures

  • Baseline full tests had two 5-second ESLint-boundary test timeouts; the unchanged full suite passed after editing, so these were transient baseline failures.
  • npm run build -w @open-inspect/web still fails while prerendering /_global-error with TypeError: Cannot read properties of null (reading 'useContext'), digest 338000915. The same failure, digest, and framework-generated missing-key warnings occurred before editing. This PR does not touch the failing route or build configuration.

Deferred findings

  • Three effect-needs-cleanup errors are canonical false positives: the two effects already clear their timers/listeners, and the WebSocket is closed by its owning effect teardown. Suppression and artificial rewrites were intentionally avoided.
  • Four remaining index-key warnings need stable IDs or state-model changes; they are not safe mechanical edits.
  • Auth/permission redirects were deferred as sensitive-flow changes.
  • The terminal iframe sandbox finding requires a capability and origin decision because removing allow-same-origin can break the authenticated terminal.
  • Locale formatting findings require an explicit timezone/locale or post-hydration UX decision.
  • Performance findings require runtime measurement; broad complexity, giant-component, state synchronization, and duplicate-subtree findings remain migration-scale or non-mechanical work for later review.

Visual verification

Not run. This change only alters React reconciliation keys and does not alter rendered markup, styling, or interaction behavior.


Created with Open-Inspect

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: db8d12f0-de13-4db6-b100-245fd8055602

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@open-inspect open-inspect Bot added the react-doctor Opened by react-doctor label Sep 21, 2026
@github-actions

Copy link
Copy Markdown

Terraform Validation Results

Step Status
Format ✅
Init ✅
Validate ✅
Tests ✅

Note: Terraform plan was skipped because secrets are not configured. This is expected for external contributors. See docs/GETTING_STARTED.md for setup instructions.

Pushed by: @open-inspect[bot], Action: pull_request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

react-doctor Opened by react-doctor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant