gui-ts: prevent stale run overwrites and expose model mismatch

Guard async solve updates with run tokens and surface FDM/FEA card length mismatch in Results so users understand when overlays are intentionally reduced.

Made-with: Cursor
This commit is contained in:
2026-04-17 08:23:30 -06:00
parent 01710af161
commit 6a4380bf42
2 changed files with 23 additions and 1 deletions

View File

@@ -122,6 +122,12 @@ export function ResultsTab({
}
return [fdmSeries.position, fdmSeries.polished, fdmSeries.downhole] as AlignedData;
}, [fdm, fea]);
const hasCardLengthMismatch = useMemo(() => {
const fdmSeries = toSeries(fdm ?? undefined);
const feaSeries = toSeries(fea ?? undefined);
if (!fdmSeries || !feaSeries) return false;
return fdmSeries.position.length !== feaSeries.position.length;
}, [fdm, fea]);
const dynacardOptions = useMemo<Options>(() => {
const seriesCount = fea ? 5 : 3;
@@ -364,6 +370,11 @@ export function ResultsTab({
</Fieldset>
<Fieldset legend="Dynamometer Card">
{hasCardLengthMismatch && (
<div className="callout">
FDM and FEA card lengths differ; chart overlay is limited to FDM series for this run.
</div>
)}
{dynacardData ? (
<UPlotChart data={dynacardData} options={dynacardOptions} height={340} />
) : (