Skip to content

UI groundwork: task totals, results matched by output uuid, results opened once, index.html no-cache - #2570

Merged
grzanka merged 6 commits into
masterfrom
szuk/yap-95-p-u1-ui-groundwork
Nov 29, 2026
Merged

grzanka merged 6 commits into
masterfrom
szuk/yap-95-p-u1-ui-groundwork

Conversation

@lythx

@lythx lythx commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Closes #2528

Small UI fixes the later results-pipeline PRs build on. It needs output_uuid in the backend's results, which yaptide/yaptide#1724 added (merged).

Docs: yaptide/for_developers#115 (simulation services: polling loop, matching results to outputs)

Changes

  • Task totals:
    • The simulation card and the status cache read progress through taskTotals(). It takes the server's jobTasksSummary when a status has one and adds up jobTasksStatus otherwise.
    • jobTasksStatus is optional in the status types. Saved simulation files with either field load.
    • Today's backend still sends the task list, so what the card shows doesn't change. A later backend PR sends the summary instead; asking for it (tasks=false) is left out here, because today's backend answers an unknown parameter with 400.
  • Results matched to editor outputs by uuid:
    • Estimators were paired with the editor's scoring outputs by array index. Whenever the two orders differed, an output showed another output's results.
    • They're now matched by the output_uuid the backend sends, and by output name for results without it. An estimator that matches no output is logged.
  • Current simulation, reopening results, hidden tabs:
    • The search for the simulation whose input is in the editor used find() with an async callback, so it always took the first simulation on the page. It now awaits each input, skips a failed request, and a late older search doesn't overwrite a newer one.
    • A finished run opens its results once, so the Simulations tab can be reopened without jumping back to the results.
    • A hidden browser tab doesn't poll the status.
  • Loaded simulation found by its input hash:
    • After "Load to editor", serializing the editor again doesn't give the hash stored with the simulation's input, so the fixed search found no match.
    • The editor now keeps the hash of the input it was loaded from until the first edit, and the search accepts either hash.
    • The results found this way are attached to the editor and used by the Save dialog. "Load to editor" doesn't open the Results tab, before or after this PR.
  • index.html served with Cache-Control: no-cache, so a deploy reaches browsers on the next load. The hashed scripts stay cacheable.

Tests

  • New: taskTotals.test.ts (3 tests). 2 tests added to __tests__/RemoteWorkerSimulationService.test.ts: outputs in any order are matched by uuid; the fallback matches by name and logs a mismatch.
  • All 59 tests in src/util, src/services, src/ThreeEditor and Results pass, and tsc is clean. The rest of the suite has the same 10 Selenium/converter failures as master, caused by ChromeDriver and missing submodules in the test environment.

Checks on yap-dev

Deployed on yap-dev together with the backend's object-storage PR, on a copy of the production database, and tested by hand.

Check Result
Direct and Ares batch runs: card progress, primaries and ntask, results pass
Results stored in object storage (Zarr pages) pass
Old simulations from the production copy pass
Save to file and load from file pass
A simulation with a failed input pass
Error log of a failed direct run same as master
"Load to editor": the editor gets the loaded simulation's results (master took the first simulation on the page) pass

Generated by Claude Code

lythx and others added 5 commits November 23, 2026 13:08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJ9KD35iAW6g4FnGoBkxTo

The simulation card and the status cache read totals through taskTotals(),
which takes the server's jobTasksSummary when present and the task list
otherwise. jobTasksStatus becomes optional in the status types, and saved
simulations with either field load.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJ9KD35iAW6g4FnGoBkxTo

Estimators were paired with scoring outputs by array index, so an output got
another one's results whenever the order differed. The backend now sends each
estimator's output_uuid; results without it are matched by output name, and
an estimator no output matches is reported.
…ip polling hidden tabs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJ9KD35iAW6g4FnGoBkxTo

- find() with an async callback always matched the first simulation; the
  search now awaits each input, survives a failed request, and a slower
  older run no longer overwrites a newer one.
- A finished tracked run opens its results once, so the Simulations tab can
  be reopened without jumping back to the results.
- A hidden tab does not poll the status.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJ9KD35iAW6g4FnGoBkxTo

The page is checked on every load, so a deploy reaches browsers at once; the
hashed scripts it loads may stay cached.
…aded from

After Load to editor, the editor serialized again may not give the hash
stored with the simulation's input, so the search for the current
simulation found nothing and its results never loaded. Before the search
was fixed, find() with an async callback took the first simulation on the
page, which hid this. The editor now keeps the hash of the input it was
loaded from until the first change, and the search matches either hash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJ9KD35iAW6g4FnGoBkxTo
@lythx lythx self-assigned this Nov 27, 2026
Comment thread nginx.conf Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SJ9KD35iAW6g4FnGoBkxTo
@grzanka
grzanka enabled auto-merge November 29, 2026 21:06
@grzanka
grzanka self-requested a review November 29, 2026 21:07
@grzanka
grzanka added this pull request to the merge queue Nov 29, 2026
Merged via the queue into master with commit 58a332d Nov 29, 2026
13 of 14 checks passed
@grzanka
grzanka deleted the szuk/yap-95-p-u1-ui-groundwork branch November 29, 2026 21:07
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.

[P-U1] UI groundwork

2 participants