diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/AI_docs/TOMO_QUEUE_COMMAND_JOBS_PLAN.md b/csaxs_bec/bec_ipython_client/plugins/flomni/AI_docs/TOMO_QUEUE_COMMAND_JOBS_PLAN.md index 9e210ab..7adf640 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/AI_docs/TOMO_QUEUE_COMMAND_JOBS_PLAN.md +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/AI_docs/TOMO_QUEUE_COMMAND_JOBS_PLAN.md @@ -579,6 +579,35 @@ cell in a row still carries a tooltip with the full job detail — label, status added-at, and either the complete params dump (tomo job) or the numbered step list plus idempotent flag (command job). Hovering any cell in the row shows it. +### 6.8 Reusing a queued job's settings — "Load into editor" + +Motivating case: a tomogram from the queue finished, and later the operator wants +to rerun something similar. Select a single **tomo** job (command jobs have no +`params`, so they're excluded from selection eligibility) in the queue dialog and +click **"Load into editor"** to enter edit mode on the params panel, populated from +that job's saved snapshot instead of the live backend. + +**Deliberately not a third write path.** This only calls `_populate_fields()` with +the job's `params` instead of the live values `enter_edit_mode()` would normally +load — nothing is written anywhere by loading. From there, the operator uses the +same two paths every other edit already uses: Submit (writes live, hard-blocked +while busy, §6.1) or "Add to queue" (queue-only, always allowed). No new safety +gating needed because none of the existing gating is bypassed. + +**Guards against silently discarding an in-progress edit.** If the panel is already +in edit mode when "Load into editor" is clicked, a confirmation dialog fires first +(naming the job being loaded, if it has a label) — a stray click on a queue row +would otherwise throw away unsaved changes with no warning. + +Implementation: `enter_edit_mode()` was refactored to funnel through a new private +`_enter_edit_mode_with(params)` (the actual field-populate/enable/button-swap +logic), so `load_params_into_editor()` is a thin wrapper adding only the +params-source and confirm-before-discard behavior. `TomoQueueDialog` gates the +button's enabled state on "exactly one row selected, and it's a tomo job, and not +in sort mode" — re-evaluated on selection change and on every table refresh (a +selected row's underlying job can change identity if the queue was edited from +elsewhere while it stayed selected). + --- ## 7. Registry distribution: publish via global var diff --git a/csaxs_bec/bec_ipython_client/plugins/flomni/AI_docs/TOMO_QUEUE_GUI_TESTING.md b/csaxs_bec/bec_ipython_client/plugins/flomni/AI_docs/TOMO_QUEUE_GUI_TESTING.md index 6c77abf..10f36ed 100644 --- a/csaxs_bec/bec_ipython_client/plugins/flomni/AI_docs/TOMO_QUEUE_GUI_TESTING.md +++ b/csaxs_bec/bec_ipython_client/plugins/flomni/AI_docs/TOMO_QUEUE_GUI_TESTING.md @@ -12,8 +12,10 @@ gaps (all fixed, see section 6c below): a confusing duplicate row-number column, `tomo_parameters()`/the queue table/scilog/the PDF report/the progress-ring label not showing an active hook at all, and a clarification that `unregister_at_each_angle_hook()` doesn't clear `at_each_angle_hook` -(confirmed expected, now documented). **Section 6c is new and not yet -clicked through.** Companion docs: +(confirmed expected, now documented). **Sections 6c and 6d are new and not +yet clicked through** — 6c is the fixes above, 6d is the new "Load into +editor" feature (reuse a queued job's settings as a new edit). Companion +docs: `TOMO_QUEUE_COMMAND_JOBS_PLAN.md` section 6 (the design this implements), `TOMO_QUEUE_TESTING.md` (Steps 1 & 2, already sim-validated). @@ -121,6 +123,14 @@ support on top of it: PDF report additionally include the hook's actual source code when it is still registered, so what a tomogram did is part of the permanent record. See section 6c below for what's not yet click-tested. +11. **"Load into editor."** Select a single tomo job in the queue dialog + (command jobs are excluded — no `params`) and click **"Load into + editor"** to enter edit mode on the params panel populated from that + job's saved settings instead of live values. Loading never writes + anything itself — Submit/"Add to queue" from there work exactly as + they already do. Confirms before discarding an in-progress edit. + Disabled outside a valid single-tomo-job selection and during sort + mode. See section 6d below — not yet click-tested. --- @@ -368,6 +378,32 @@ GUI bug and reporting gaps for the hook feature. confirm the name still shows (flagged "NOT registered"), but no source code block appears anywhere. +## 6d. Test plan — new: "Load into editor" + +42. Queue a `done` tomo job (run one, or add one via CLI with `status` + hand-edited to `done`). Select it in the queue dialog and confirm + **"Load into editor"** is enabled. Select a command job (or multiple + rows, or nothing) and confirm it's **disabled** in each case. +43. Click **"Load into editor"** with nothing else in progress. Confirm the + params panel enters edit mode (Edit button hides, Submit/"Add to + queue"/Cancel appear) with every field populated from the *job's* + saved values, not the live ones — pick a job whose settings clearly + differ from current live params to make this obvious. +44. With the panel now in edit mode from step 43, change a value, then + click **"Load into editor"** again on a different (or the same) job. + Confirm a **confirmation dialog** appears naming the job before + discarding your edit; Cancel leaves your edit untouched, Yes reloads + from the newly selected job's settings. +45. After loading, click **Cancel** — confirm fields revert to the *live* + values (not back to the loaded job's values) since Cancel always + restores from the backend. +46. After loading, click **"Add to queue"** — confirm a new job is added + to the queue with the loaded (and any further tweaked) settings, and + that live params are untouched. Then repeat ending with **Submit** + instead (beamline idle) — confirm live params update to match. +47. Confirm "Load into editor" is also disabled while **Sort queue…** mode + is active, consistent with the other queue-mutating buttons. + ## 7. Known limitations of this first iteration (by design, not bugs) Worth knowing before you file something as broken: diff --git a/docs/user/ptychography/flomni.md b/docs/user/ptychography/flomni.md index 6eebf7d..e3457b2 100644 --- a/docs/user/ptychography/flomni.md +++ b/docs/user/ptychography/flomni.md @@ -358,6 +358,13 @@ flomni.tomo_queue_show() flomni.tomo_queue_execute() # runs both, in order, on this sample ``` +**GUI: reusing an earlier job's settings.** In the ☰ Queue control… dialog, select a +single tomo job (not a command job — those have no scan parameters) and click +**"Load into editor"** to pull its saved settings into the params panel's editor, +as if you'd just clicked Edit. Nothing is written yet — review or tweak the fields, +then Submit (writes live, blocked while the beamline is busy) or "Add to queue" (always +allowed) as usual. If you already had an edit in progress, it asks before discarding it. + #### Command jobs — reconfiguring the beamline between scans In addition to tomogram jobs, the same queue can hold **command jobs**: an ordered