Skip to content

[P1] [arch] ResultsGrid.tsx is 916 LOC — god-component (split into header/footer/menu/save) #406

Closed

Description

@EVWorth

[P1] [arch] ResultsGrid.tsx is 916 LOC — god-component with two render paths, menu builder, and save handler

Context

ResultsGrid.tsx is 916 LOC containing downloadBlob, ExportToast, MIME, EXT, the ResultsGrid component itself, two parallel render paths (virtualized + non-virtualized, with 3× repeated header markup), the context menu builder, and the save handler.

Problem

Per docs/audits/results.md F13.

Same god-component pattern flagged in connection.md F3 / admin.md F4 / editor.md. Splitting enables unit testing without rendering the full grid; reduces per-change IDE/LSP parse cost.

Files

  • src/components/grid/ResultsGrid.tsx:1-916

Repro (if applicable)

Static analysis only.

Expected

Extract GridHeader.tsx (shared header + sort indicator + resize), GridFooter.tsx (export + row count + copy), useGridContextMenu.ts, useGridSave.ts.

Proposed fix

Scope M. Each extracted file ≤ 200 LOC; ResultsGrid.tsx ≤ 250 LOC orchestration only.

Acceptance

ResultsGrid.tsx ≤ 250 LOC; existing 66 browser tests + 24 unit tests pass.

Needs human verify

No (visual + tests)

Labels: audit, area/results, severity/p1, kind/arch

Activity

  1. added
    audit
    severity/p1
    kind/arch
    area/results
    on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/resultsauditkind/archseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions