Skip to content

refactor(ui): drop dead optional chains, unused reset and barrel exports - #222

Merged
jackchuma merged 1 commit into
mainfrom
toshi/cleanup-dead-chains-reset-barrel-exports-9c0dcbf0
Oct 30, 2026
Merged

jackchuma merged 1 commit into
mainfrom
toshi/cleanup-dead-chains-reset-barrel-exports-9c0dcbf0

Conversation

@jackchuma

@jackchuma jackchuma commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What changed? Why?

Removes dead code in the validation and signing UI. Behavior stays the same.

  • page.tsx, ValidationResults.tsx: drop ?. on ValidationData.expected and .actual. Both are required in the type, and every response from validation-service.ts sets them, so the chains never short-circuit. The ?. on the optional domainAndMessageHashes stays.
  • useValidationRunner: drop the two as ValidationData casts. The !validationResult.data guard already narrows the type.
  • HardwareSigning.tsx: drop disabled={loading} from the Sign button. Button already sets disabled={disabled || isLoading}, and the button passes isLoading={loading}.
  • ValidationResults.tsx: getIcon loses its size parameter. Both callers passed 24, so the icons now set size={24} directly.

Interfaces removed:

  • reset from useValidationRunner's return value. Its only consumer, ValidationResults.tsx, destructures error, result, isLoading, isInstallingDeps, runValidation and never reads reset. No other file references it. It came from the refactor in c4ab7f3 (chore: refactor ValidationResults.tsx #86), with no sign it was meant for later use.
  • The Badge, Button, Card, Header and SectionHeader re-exports from components/ui/index.ts. The barrel's only importer, page.tsx, takes PageShell and StepIndicator; every other file imports ./ui/<Component> directly.

Notes to reviewers

Found by the cleanup scanner. README, DEPENDENCY-OVERRIDES.md and test fixtures reference none of the removed code.

How has it been tested?

npm run build, npm run lint, npx tsc --noEmit, npm test (159 passed) and prettier on tracked files all pass. No tests were added: nothing here changes behavior, and the typecheck covers the removed references.

Why this cleanup

Production: 31 lines removed, 14 added, net −17 across 5 files. Tests: unchanged.

Interfaces removed: reset from useValidationRunner's return value, and the Badge, Button, Card, Header and SectionHeader re-exports from components/ui/index.ts.

A reader no longer has to wonder whether expected/actual can be missing, whether reset has a hidden caller, why two casts are there, whether the Sign button disables differently from Button's default, or why getIcon takes a size.

Keep-gate judge: safe dead-code removal with behavior unchanged; nothing removed is used or planned, and bundled together the items are worth a short review.

J-Engine-Session: toshi:27750643-050f-4c78-9efd-99679f5d4263
@cb-heimdall

cb-heimdall commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews ✅ 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@jackchuma

Copy link
Copy Markdown
Collaborator Author

Review round 1

Reviewers: cbhq-openai/gpt-6.1-sol

  • Dropped in triage: [P2] Spec check: criterion 1 untested (no component test pins the Sign button's disabled state or the 24px icon size) — the spec names tsc and eslint as the check for this behavior-preserving removal; the repo has no component test setup and adding one is out of scope. Equivalence is by inspection: Button sets disabled={disabled || isLoading}, and both getIcon callers passed 24.
    Synced with main: 2addf67 (already current)
    Validation: build, lint, tsc, 159 tests, prettier on tracked files all pass

🤖 Reply generated with Toshi

@jackchuma
jackchuma marked this pull request as ready for review October 30, 2026 18:04
@jackchuma
jackchuma merged commit bbc06f3 into main Oct 30, 2026
6 checks passed
@jackchuma
jackchuma deleted the toshi/cleanup-dead-chains-reset-barrel-exports-9c0dcbf0 branch October 30, 2026 18:15
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.

3 participants