Skip to content

fix(web): hooks-warnings batch 1 — static-components, purity, immutability to zero - #117

Merged
okieselbach merged 1 commit into
mainfrom
chore/web-hooks-warnings-batch1
Jul 30, 2026
Merged

fix(web): hooks-warnings batch 1 — static-components, purity, immutability to zero#117
okieselbach merged 1 commit into
mainfrom
chore/web-hooks-warnings-batch1

Conversation

@okieselbach

Copy link
Copy Markdown
Owner

Summary

First burn-down batch of the React-Compiler hooks warnings: 163 → 141, CI --max-warnings ratchet lowered to match. Targets the categories with real bug risk per finding, per the agreed prioritization.

static-components (14 → 0) — real remount bugs: SortIcon (geographic-performance), SortIndicator (VulnerabilityReportSection) and SearchIcon/ResultsDropdown (GlobalSearch) were defined inside render — a new component type on every render, so React unmounted and rebuilt their subtrees each time (GlobalSearch tore down its results dropdown on every keystroke). All hoisted to module level with explicit props.

purity (6 → 0): Date.now() during render replaced with mount-time clocks (useState lazy init) for the date-input caps (Maintenance sections) and trial-expiry checks (TenantManagement, SectionTenantConfigReport). FeedbackSection refreshes its clock per fetch so the "Xm ago" labels track the data they describe. DownloadProgress falls back to NaN instead of wall-clock for unparseable event timestamps (the rate calculation already guards via Number.isFinite).

immutability (5 → 0): fetch functions were declared below the effects that call them (diagnosis, fleet-health, DistressReports) — moved above the effects, no other changes.

Note: the immutability fixes unblocked deeper compiler analysis in those 3 files, surfacing 3 latent set-state-in-effect findings (93 → 96). They belong to the set-state category and stay for its own batch — nothing got worse, it just became visible.

Verification

  • eslint: 0 errors / exactly 141 warnings — gate command exits 0
  • tsc --noEmit clean, vitest 611/611, static export builds

🤖 Generated with Claude Code

…ility to zero

First burn-down batch of the React-Compiler hooks warnings (163 -> 141,
CI ratchet lowered to match).

static-components (14, real remount bugs): SortIcon (geographic-
performance), SortIndicator (VulnerabilityReportSection) and SearchIcon/
ResultsDropdown (GlobalSearch) were defined inside render — a new
component type every render, so React unmounted and rebuilt their
subtrees each time (GlobalSearch tore down its dropdown on every
keystroke). All hoisted to module level with explicit props.

purity (6): Date.now() during render replaced with mount-time clocks
(useState lazy init) for the date-input caps (Maintenance sections) and
trial-expiry checks (TenantManagement, SectionTenantConfigReport);
FeedbackSection refreshes its clock per fetch so "Xm ago" labels track
the data; DownloadProgress falls back to NaN instead of wall-clock for
unparseable event timestamps (rate calc already guards via
Number.isFinite).

immutability (5): fetch functions were declared below the effects that
call them — moved above (diagnosis, fleet-health, DistressReports).
This unblocked deeper compiler analysis, surfacing 3 latent
set-state-in-effect findings in those files (93 -> 96); they belong to
the set-state category and stay for its own batch.

Verified: eslint 0 errors / 141 warnings (gate exits 0), tsc clean,
vitest 611/611, static export builds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@okieselbach
okieselbach merged commit 5312216 into main Jul 30, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant