Skip to content

TypeScript app shell - #277

Merged
jtklein-agents merged 2 commits into
spec/236-page-typescriptfrom
252-typescript-app-shell
Nov 17, 2026
Merged

jtklein-agents merged 2 commits into
spec/236-page-typescriptfrom
252-typescript-app-shell

Conversation

@jtklein-agents

@jtklein-agents jtklein-agents commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #252. Part of #236.

Summary

The last conversion leaf: no production file of the Page is JavaScript, and the typecheck baseline is empty.

 src/app/
-├── App.js
+├── App.tsx                    # SnackRun / SnackStore local interfaces
-├── index.js
+├── index.tsx
 ├── components/
-│   └── ErrorDialog.js         # propTypes
+│   └── ErrorDialog.tsx        # ErrorDialogProps; reload via window.rendererBridge, no cast
 ├── Input.tsx                  # run type reuses the card props it passes on
 ├── TreeCard.tsx               # loading?: boolean
 └── AlignmentCard.tsx          # CardFinalAlignment.numSequencesParsed?: number
 package.json                   # direct prop-types line removed (lock stanza stays)
 scripts/typecheck-baseline.txt # empty
export interface ErrorDialogProps {
  error?: unknown;          // RunList.error is unknown; Run.error is ErrorObject | null
  onClose: () => void;      // was isRequired
  needReload?: boolean;
  title?: string | null;    // RunList.errorTitle is string | null
}

Both call sites in App.tsx that omit optional props now type-check without any change at the call site.

Notes:

  • Clear console icon passes title, which the MUI icon does not accept #234: already closed. The clear-console icon uses titleAccess on the spec branch, so it needs no @ts-expect-error.
  • Input.tsx: the spec branch tip already failed tsc here. TypeScript run panels #251 typed Input against the cards' old shape, and TypeScript input-file cards #250 then typed the cards. Once App became TypeScript, <Input run={run}> was also checked against the real Run. Input's run type now reuses PartitionFileCardProps['run'], AlignmentCardProps['alignment'], TreeCardProps['tree'] and the other card props it passes on.
  • Bug typing exposed: the store Tree has no loading field, so TreeCard's spinner never shows. CardTree.loading is widened to optional and the behaviour is unchanged. Filed as Tree card reads a loading flag the store Tree never sets #278.
  • CardFinalAlignment.numSequencesParsed is widened to optional too. FinalAlignment doesn't have the field, but its parsingComplete is always true, so the branch that reads it is dead. Not a bug.
  • App.test.js gets // @ts-nocheck, as nine other test files already have, which clears its two Jest-globals baseline lines. An unused { theme } argument in App.tsx was removed because lint failed on it.

Evidence

  • Before (spec tip e3f2795): scripts/typecheck-baseline.txt has 4 lines (2 App.js, 2 App.test.js), and tsc --noEmit reports 7 × TS2769 in src/app/Input.tsx.
    After: the baseline file is 0 bytes.
    tsc --noEmit                                  → no diagnostics
    tsc --noEmit --noImplicitAny | grep App|index|ErrorDialog|Input|TreeCard|AlignmentCard → none
    yarn typecheck:baseline                       → exit 0
    yarn lint                                     → exit 0
    yarn react-test                               → 66 suites, 474 tests passed
    yarn build                                    → out/main, out/preload, out/renderer
    

Merge Danger

Door: two-way

The change only adds types and renames files. Runtime behaviour is unchanged.

Blast Radius: small

Reverting this PR brings back the old baseline lines. The renamed page entry is still found because src/index.tsx imports ./app/ without an extension.

🤖 Generated with Claude Code

jtklein-agents and others added 2 commits November 17, 2026 15:24
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The error dialog, the app and the page entry gain explicit types; the
error dialog's propTypes and the direct prop-types dependency go. The
typecheck baseline is now empty.

Input's run type reuses the card props it passes on, so the real Run
checks against it. Two card fields the store does not have are widened
to optional: the tree's loading flag (never set) and the final
alignment's numSequencesParsed (parsing is always complete there).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jtklein-agents
jtklein-agents merged commit bea7308 into spec/236-page-typescript Nov 17, 2026
7 of 9 checks passed
@jtklein-agents jtklein-agents mentioned this pull request Nov 17, 2026
17 tasks
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