Skip to content

feat(compare): the Compare workspace absorbs the catalog - #67

Merged
obvious-autobuild[bot] merged 3 commits into
release/task-mode-ia-redesign-20261011-170103from
feat/tmia-compare
Oct 11, 2026
Merged

obvious-autobuild[bot] merged 3 commits into
release/task-mode-ia-redesign-20261011-170103from
feat/tmia-compare

Conversation

@obvious-autobuild

Copy link
Copy Markdown
Contributor

Human author: Tapan Ganatma Nakkina ([email protected])

Why

The redesign's three workspaces name the three jobs — Replay, Compare, Explore — but "Compare" did not yet exist as a place: comparison was an overlay that re-carved the Replay grid, and the shot catalog lived in its own "Shot database" tab under a fourth name. Picking shots to compare required bouncing between two tabs, and the same quantity (stored energy) was labeled kJ on one surface and MJ on the other.

What

One Compare workspace owns the whole comparison job (web/replay.js, web/index.html, web/style.css):

  • The catalog moved in. The old #tab-db markup, search panel, results table and the two catalog clouds (τ_E vs IPB98, Greenwald × β_N) plus the surrogate holdout now live in #tab-compare, below the comparison read. The "Shot database" tab is gone from the header; the surface is named the catalog everywhere.
  • The comparison reads in place. The compare bar (chips, Share, Exit compare) and the side-by-side read — W (MJ · measured EFIT), worst limit, ΔW vs reference, Thomson Tₑ at the cursor, one measured trace per shot with the shared cursor — render above the catalog instead of replacing Replay's panels. Replay keeps its single-shot instrument room untouched.
  • Entry points converge on the route. Replay's "Compare…" navigates to #/compare/{id} with the on-screen shot preloaded as the reference (its chip resolves through the shared shot-load machine; the read shows the reference's own curves until a second shot joins). Legacy ?compare=a,b links canonicalize into the route. Share copies the full view URL — route, filters and selection; the srchSel mirror stays as the ?compare= twin for checkbox restoration.
  • State machine work the handoff asked for: a stale-reference supersede no longer leaves a failed header on an already-ready shot (re-point to a ready shot repaints "ready"); "Retry failed" retries every failed chip; the #/db fetch failure now replaces only the catalog-clouds panel, so the bar, read and search survive a statistics outage (asserted in test_web_checks.py).
  • Units and naming: stored energy is MJ on every visible surface (the table's W_min/W_max filters and the read strips); the last "database" label in lesson copy now says scaling-law fits / catalog.

Kept untouched on purpose: compare semantics that work — per-shot queued→fetching→ready/error chips with cancel/retry/drop, reference-first URL ordering, the selection Set, row-link and checkbox interactions, the shared time cursor. Lesson anchors (db-tau, db-ops, holdout), the W_kJ event-hook name (test-locked) and the window.FusionLab / fusionlab:* contracts are unchanged.

Acceptance criteria

  • V2 deep link — /#/compare/30166,30192 boots straight into Compare; both chips resolve; the side-by-side read draws (tc-1)
  • V3 Share + history — Back/Forward restore Replay ↔ Compare with state; Share copies a URL that reproduces the view (tc-2; headless Chrome refuses clipboard writes, so the capture shows the honest "Copy refused" feedback and the URL itself is booted fresh as the reproduction check)
  • V9 naming/units — grep -Rni "database" web/ → 0 hits; every stored-energy surface shows MJ
  • V1 gates — uv run pytest -q 352 passed, 1 skipped (also re-run by the pre-push hook); uv run ruff check clean; uv run mypy fusionlab clean
  • Guided-study contract — lesson anchors and the guide driver untouched; guided walkthrough unaffected (overlay targets unchanged)
  • Capability parity — every former db-tab control is reachable in the Compare workspace at the same depth (search panel + table + clouds + holdout)

How to Review

  • web/replay.js carries the move: the db template now mounts in #tab-compare, startCompare draws the read below the bar, and the router's MOUNT map points compare at both. web/index.html loses the db tab; web/style.css extends the existing tokens for the read layout. Lesson copy changes are in web/lessons.json.
  • Intentionally excluded: any backend change (none — pytest/ruff/mypy untouched and green), the Explore workspace, and renaming the W_kJ event hook (locked by test_guide.py; the display unit is MJ).

Test Evidence

Browser evidence recorded via obvious autobuild upload against tested head f9946889ac1432b97563a9d63b37aab331812078:

  • tc-1 (V2): fl_cmmbVhSo (chips fetching) → fl_elCizScU (2/2 ready, W/limit/ΔW/Tₑ side by side)
  • tc-2 (V3): fl_lyPWQjyE (Share click recording, 1440×900) + fl_KTrFa9HH (the view URL booted fresh: 2/2 ready, traces restored)
  • tc-3 (preload): fl_rjDC3kWd (Replay before) → fl_3CAYEfp1 (one-shot compare: reference chip ready, reference curves in the read)
  • tc-4 (error path): fl_o4NfuiHs (#99999999 — failed with the server's honest error + "Retry failed") → fl_jvS1Vkjv (Drop converges to a 1/1 reference compare)

Sibling PRs

🔗 Obvious Project · 🧵 Obvious Thread · 🔀 Obvious PR Artifact

ObviousApp and others added 3 commits October 11, 2026 22:11
Fold the comparison read into #tab-compare: the compare bar, the chips
and a new "Side by side" panel (W, worst limit, dW difference, compared
Thomson profiles) render in the Compare workspace, above the catalog
search and clouds; the Replay room keeps its four single-shot strips
and loses the in-grid compare chrome (bar row, dW strip, cmp-on grid).
Replay's "Compare..." action navigates to #/compare with the shot on
screen preloaded as the reference chip; one-id compare routes mount
the reference and prompt for more; legacy ?compare= links canonicalize
into the hash grammar and land here. The bar gains Share (copies the
URL - the route, filters and selection) and "Retry failed" now refetches
every failed chip; re-pointing the reference to an already-ready shot
repaints the bar so a stale failure header cannot survive the move.

Single-shot picking no longer re-points a live compare - the two
workspaces are independent. The /db failure catch now blanks only the
catalog-clouds panel so the bar, search and side-by-side read survive
a /db outage (JS-07 assertion updated to the targeted handler).

NO SEMANTIC CHANGES to the compare flow: per-shot chip states, abort-
on-supersede, reference semantics, 2-6 shot limit and the shared time
cursor are unchanged; the cursor now spans both workspaces' time panels.

Co-authored-by: Tapan Ganatma Nakkina <[email protected]>
The guided-study prose still said "the machines in that database" for
the scaling-law fits' source catalog; the surface itself is already the
catalog. Lesson tab values and data-guide anchors (db, db-tau, db-ops,
holdout) are untouched - the router normalizes them and the anchors are
the guided-study compatibility contract.

Co-authored-by: Tapan Ganatma Nakkina <[email protected]>
startCompare's sub-two-shot early return painted the bar but never drew
the read panel, so a "Compare..." preload or a one-id deep link showed
three empty labelled boxes. Below two shots the read now shows the
reference's own measured curves (W, worst limit, Thomson at the cursor);
the dW difference strip stays hidden until a second shot makes a
difference to read. Verified in the browser against this head.

Co-authored-by: Tapan Ganatma Nakkina <[email protected]>
@obvious-autobuild
obvious-autobuild Bot marked this pull request as ready for review October 11, 2026 22:30
@obvious-autobuild
obvious-autobuild Bot merged commit e53fd63 into release/task-mode-ia-redesign-20261011-170103 Oct 11, 2026
3 checks passed
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.

2 participants