Skip to content

FEAT: estimate card and swap timeline in the preflight dialog - #206

Merged
decay71 merged 1 commit into
mainfrom
feat/estimate-card
Oct 29, 2026
Merged

decay71 merged 1 commit into
mainfrom
feat/estimate-card

Conversation

@stefanodangelo

Copy link
Copy Markdown
Collaborator

Estimate lane, group 3 and 4 of the plan (#193). UI only: the estimate and timeline data already ship with the plans since #199, and nothing in the backend or the model changes.

What it adds

  • Estimate card in the preflight dialog (new design, dark and light): shown under the plan cards for the selected plan.
    • Slicer time next to the time with multiACE, and the delta.
    • Filament and purge, in grams and metres or mm.
    • Swap counts per kind (cross-MMU, background, head change) and the number of background swaps stamped without a known window.
    • A per-colour table (print, purge, total grams).
    • An "estimated" tag on every card. A "partial data" tag shows when the header could not be fully parsed.
    • The assumptions list, collapsed.
  • Swap timeline: a strip under the numbers, one segment per swap, sized by its seconds and coloured by kind. Hovering a segment shows the tool, the kind, the time and the purge length. First loads are left out, since they are not an added cost of a swap.
  • Live recompute: an edited mapping (multi), head target or copies (head mode) sends an estimate message to the browser worker for the plan being edited. The card dims while it runs and keeps the analysed numbers if the worker fails. The server path has no recompute, since the endpoint was removed in FEAT: preflight estimate data (timeline, estimate per plan, re-estimate) #199, so an edit there leaves the analysed numbers in place.
  • Classic theme: each plan header gets one line, ≈ time (+delta, estimated). Classic lists every plan at once, so a single card would not say which plan it describes.
  • i18n: new ui.preflight.est_* keys and two swap kinds (cross_ace_bg, head_change) in en, de and zh. The de and zh strings are my own translation and need a native check. The card reuses fmtDuration and swapKindLabel from the History tab.

Not in this PR

Testing

  • node --check on app.js is clean.
  • pytest tests/unit: 522 passed, 11 failed. The same 11 fail on main without this change (test_bg_pick_notice.py, test_web_golden.py). They come from stale local test files and golden data, not from this PR.
  • I added no unit tests: the change is template, CSS and a thin worker call.
  • The live recompute is not exercised yet. It needs Pyodide and a real printer, so I will run it on a preflight before this merges.

@decay71
decay71 merged commit 4e46554 into main Oct 29, 2026
@decay71
decay71 deleted the feat/estimate-card branch October 29, 2026 12:56
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