Skip to content

Convert the Page, preload and alignment parsers to TypeScript - #508

Open
jtklein-agents wants to merge 71 commits into
AntonelliLab:masterfrom
jtklein-agents:spec/236-page-typescript
Open

jtklein-agents wants to merge 71 commits into
AntonelliLab:masterfrom
jtklein-agents:spec/236-page-typescript

Conversation

@jtklein-agents

Copy link
Copy Markdown
Contributor

Summary

The Page, the preload and the three alignment parsers move from JavaScript to TypeScript, one feature branch, no behaviour change.

src/
├── app/            # panels, app shell, page helpers: .js → .ts/.tsx (typed props, propTypes removed)
│   └── store/      # Page store: Option<Value, Owner> base, RunOptions, Run, Alignment, Partition…
├── common/         # fastaParser, phylipParser, typecheckAlignment → .ts; new rendererBridge.ts
├── main/           # additive exports of the crossing payload types
└── preload/        # index.js → index.ts, checked with `satisfies RendererBridge`
 yarn typecheck:baseline
+  pass 2: every .ts/.tsx file has zero diagnostics under --noImplicitAny
+  passes on an empty baseline
-scripts/page-store-coverage.js   (unused decorator-store script)
-prop-types dependency            (nothing imports it)

Evidence

  • Before: typecheck baseline held 26 diagnostics, all in the 40 Page/preload/parser files; the Page reached the bridge through an untyped cast.
    After: scripts/typecheck-baseline.txt is empty; the Build/release CI run on this branch is green, and the existing Jest suites pass.

Merge Danger

Door: two-way

A revert restores the JavaScript files; no data, config format or IPC channel changes.

Blast Radius: wide (78 files, ~1.7k lines), but types-only

Renames touch nearly every Page file, so any open branch editing those files will conflict. yarn.lock gains @types/lodash and @types/d3-array; the Electron build config drops its JSX-in-.js handling.

🤖 Generated with Claude Code

jtklein-agents and others added 30 commits November 16, 2026 22:31
…ll of it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
MUI icons take titleAccess, not title, so the label never showed on hover
and the icon had no accessible name.

Fixes #234

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Label the clear console icon with titleAccess
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
No-implicit-any check and lint rules for all TypeScript
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Return a validation error or null from MultistateNumber.error
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…and-typescript-preload

Renderer bridge type and TypeScript preload
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Event payloads the run subscribes to get named types in main and tighten
the RendererBridge listeners. Adds @types/lodash. Two args payloads and
the numSites sum keep their behaviour under @ts-expect-error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-entry

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nd-store-entry

TypeScript run list and store entry
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Explicit parameter, return and result types for the FASTA parser, the
PHYLIP parser and typecheckAlignment. No behaviour change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Option is generic over its value and owner, description and hoverInfo are
optional, the options argument is an OptionSettings interface and error is
ValidationError | boolean | null. Clears the yup and 'Expected 5-6 arguments'
baseline lines; the MultistateNumber error override gets a baseline line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
jtklein-agents and others added 30 commits November 17, 2026 13:19
#264 typed the alignment options' owner as AlignmentLike with a RunLike
run, while #266 typed InputFile's run as InputFileOwner. Merged
together, Alignment.js passing itself to those options fails tsc. The
still-JavaScript caller keeps its lines in the baseline until the
alignment store leaf (#247) types it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FinalPartition and Partition gain explicit member types, each reading its
owner through a module-local interface. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FinalAlignment passes its run to FinalPartition, which reads
haveAlignments and each alignment's partition. The owner types now
carry those members so the typed constructors agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Input, Model, Output, Raxml, Console and CitationModal export typed
props in place of propTypes, each reading the run, store or citation
through a module-local interface. The run's select options are cast at
the OptionSelect call site, since their classes miss notAvailable or
string titles. Bridge calls read window.rendererBridge with no cast.
No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The alignment, ASTRAL tree, tree and partition file cards and the
partition editor drop propTypes for exported Props interfaces. Each
store prop is a module-local interface holding only what the panel
reads. Two contract gaps keep their behaviour: the part start/end
options take a string from OptionTextField, so their setter widens to
string | number; and the matrix-name select spreads a modelExtra that
lacks notAvailable, hoverInfo and error, so its option prop carries a
@ts-expect-error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
The page, preload and alignment parsers are all TypeScript, so the
renderer build no longer treats .js as JSX: drop the dep scanner's
moduleTypes override and plugin-react's Babel plugins. Vite's own
transform emits native class fields under useDefineForClassFields.

Delete scripts/page-store-coverage.js. It reads store decorators
(line 50) from src/app/store/*.js (line 12); the store has neither and
nothing runs the script.

Part of #236. Closes #253.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-members

Give the matrix-name select its notAvailable, hoverInfo and error
…ver defines (#267)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…-flag-name

Delete FinalAlignment.modelFlagName (#267)
Nothing outside tests read the run's numSites, and it summed Alignment
objects instead of site counts. Remove the getter, its annotation and the
tests that exercised it. Closes #259.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
…282)

Make notAvailable optional and allow number choice titles, type the
select-option fields of ModelRun and RaxmlRun as OptionSelectOptionLike,
and drop the casts.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Only a test read it; it just aliased length.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* Delete unused Run.numSites

Nothing outside tests read the run's numSites, and it summed Alignment
objects instead of site counts. Remove the getter, its annotation and the
tests that exercised it. Closes #259.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* Delete unused Alignment.numSites

Only a test read it; it just aliased length.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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