Repository navigation
feat(clean): usable clean-tubings dialog + status-bar step progress - #71
Conversation
…atus-bar progress Four usability fixes to the tubing-cleaning procedure (ahead of a release): 1. Dialog size: it opened at the tiny QTableWidget size hint, needing a manual resize to read the content. It now sizes to its content (capped), so it opens readable. 2. Actionable default: a meaningful clean needs a liquid to flush with, so with no cleaning_rounds configured the Clean button was disabled unless you switched to Custom and set a >0 pre-empty. The dialog now always offers the setup's flush/wash buffer (flushbuffer_a) as a selectable rinse liquid — checked by default when there are no dedicated cleaning rounds — so a start-of-experiment rinse runs straight from the Default view (0 pre-empty, no retraction). cleaning_plan() exposes the wash buffer; rigs that configure their own cleaning rounds are unchanged (the buffer is offered unchecked). 3. Preamble: a short note at the top explaining what the procedure does. 4. Status-bar progress: clean_tubings takes a `progress` callback (threaded through the pre-empty / chain / individual helpers, with friendly reservoir labels); the Fluid tab marshals it to the main-window status bar via a Qt signal so each step shows while the clean runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirror the clean-tubings usability pass for fill:
- Clicking "Fill tubings" now first shows a short confirmation explaining what
it does (prime each reservoir's tubing up to its valve, then flush the
central tubing with the flush buffer), so it never moves liquid unannounced.
- fill_tubings() takes a `progress` callback and reports each step ("Filling
from <reservoir>…", "Filling central tubing with flush buffer…") with
friendly reservoir labels; the Fluid tab marshals it to the main-window
status bar.
The per-op status plumbing added for clean is generalized (_op_step signal +
_op_progress(what) helper), so clean and fill share one thread-safe status-bar
path.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… hardware `cleaning_plan()` tested `wash_id in reservoir_a`, but on a connected rig `reservoir_a` is a `ReservoirDict`, which has no `__contains__` — so the `in` raised `TypeError`. `_on_clean` swallows plan errors (`except: plan = None`), so the whole new per-reservoir clean dialog (table, wash-buffer rinse option, proper sizing) silently never appeared on real hardware; the app fell back to the old whole-system confirm. The unit test missed it because its fake used a plain dict. Test membership against `reservoir_a.keys()` instead, and make the regression test use a real `ReservoirDict` so the production shape is exercised. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code review (high-effort, correctness + cross-file + removed-behavior + cleanup/altitude) → fixed in 4b1a2a8🐛 Confirmed & fixed (would have broken the feature on real hardware): Reviewed and verified safe (no change):
Low-severity notes left as-is (minimal-change): Full suite 1094 passed (only the known monet dev-container flake). |
Four usability fixes to the tubing-cleaning procedure, ahead of a release.
1. Dialog opened too small
It opened at the tiny
QTableWidgetsize hint — you always had to resize to read it. It now sizes to its content (820 wide, height scaled to the table + liquids, capped), so it opens readable.2. Default view wasn't runnable
A meaningful clean pumps a cleaning liquid through the tubing; the pre-empty (retract) is just an optional preliminary. With no
cleaning_roundsconfigured, the Clean button was disabled unless you switched to Custom and set a>0pre-empty — wrong for a start-of-experiment rinse where you don't want to retract.The dialog now always offers the setup's flush/wash buffer (
flushbuffer_a, e.g. PBS) as a selectable rinse liquid, checked by default when no dedicated cleaning rounds exist. So a rinse runs straight from the Default view (0 pre-empty, no retraction).cleaning_plan()exposes the wash buffer (only when it's wired and not already a cleaning tank); rigs that configure their own cleaning rounds are unchanged — the buffer is offered unchecked there.3. Preamble
A short note at the top explains what the procedure does (pumps the selected liquid through each selected reservoir's path and out the needle; Default = just rinse).
4. Status-bar step progress
clean_tubingstakes aprogress(msg)callback, threaded through the pre-empty / chain / individual helpers with friendly reservoir labels ("Pre-emptying PBS…", "Cleaning with PBS…", "Flushing out to waste…"). The Fluid tab marshals it to the main-window status bar via a queued Qt signal, so each step shows while the clean runs (and a self-clearing "done" at the end).Screenshot
A no-cleaning-rounds rig: readable size, preamble, full table, and "Wash buffer: PBS" checked → Clean enabled in Default view.
Tests
cleaning_plan()exposes a wired wash buffer;SystemService.clean_tubingsforwardsprogress;clean_tubingsreports step messages.Full suite passes bar the known monet dev-container flake.
🤖 Generated with Claude Code