On the first successful chartread exit, chartread.js calls wizardState.setTarget and setStage3Result. verify_stage_artefacts then sees {basename}.ti3 and enables Stage 4 in the stepper.
The operator can jump to colprof while the averaging panel is still offering Measure Another Sheet. Combined with issue 01, Stage 4 may profile a single overwritten pass and never wait for average.
Current behaviour
In the process:exit handler for chartread_${basename} when code === 0:
State is set to FINISHED.
The pass is pushed onto recordedPasses.
The averaging panel is shown.
wizardState.setTarget(basename, cwd) and setStage3Result(basename, cwd) run immediately.
Step 4 of the wizard therefore unlocks as soon as the first .ti3 exists, which is before Finish / Average.
Proposed solution
Treat Stage 3 as incomplete until the operator clicks Finish and Average (or an explicit Accept single pass control).
Do not call setStage3Result or wizardState.setTarget from the per-pass process:exit handler.
Call them only from:
#btnFinishAndAverage after a successful average (or the single-pass short-circuit), or
an explicit Use this pass button if auto-advance is kept as an option.
Keep the averaging panel visible after pass 1.
Keep step 4 disabled until finish.
Keep advanceToStage4() on the finish path only.
Optional UX: stepper tooltip Complete measurement (Finish) before profiling.
If issue 01 snapshots passes to _passN.ti3 and only writes {basename}.ti3 at Finish, this ticket is mostly free: verify_stage_artefacts already keys Stage 3 on {basename}.ti3. Implement them together.
Prefer not to add a new stage3_accepted flag in state.js unless the canonical-file rule cannot be used.
Files
src/js/chartread.js
src/js/state.js — only if a new flag is required
src/index.html — optional tooltip / button label
Acceptance criteria
After pass 1, Stage 4 sidebar step remains disabled.
After Finish (one pass or N averaged passes), Stage 4 unlocks and {basename}.ti3 exists.
Cancelling a pass does not unlock Stage 4.
Reloading the app with only _passN.ti3 files and no {basename}.ti3 does not unlock Stage 4.
Single-pass Finish still advances to Stage 4 without calling average.
Dependencies
Depends on issue 01 (unique pass files and canonical {basename}.ti3 written only at Finish). Same PR.
| Field | Value |
|---|---|
| Labels | `Kind/Bug`, `Priority/High` |
| Priority | High |
| Milestone | v0.3.3 hotfix |
| Related | #87, issue 01 |
| Branch | `fix/averaging-unique-ti3` (from `development`) |
| Pair with | [01-averaging-overwrite.md](01-averaging-overwrite.md) — same PR |
## Description
On the first successful `chartread` exit, `chartread.js` calls `wizardState.setTarget` and `setStage3Result`. `verify_stage_artefacts` then sees `{basename}.ti3` and enables Stage 4 in the stepper.
The operator can jump to `colprof` while the averaging panel is still offering **Measure Another Sheet**. Combined with issue 01, Stage 4 may profile a single overwritten pass and never wait for `average`.
## Current behaviour
In the `process:exit` handler for `chartread_${basename}` when `code === 0`:
1. State is set to `FINISHED`.
2. The pass is pushed onto `recordedPasses`.
3. The averaging panel is shown.
4. `wizardState.setTarget(basename, cwd)` and `setStage3Result(basename, cwd)` run immediately.
Step 4 of the wizard therefore unlocks as soon as the first `.ti3` exists, which is before Finish / Average.
## Proposed solution
Treat Stage 3 as incomplete until the operator clicks **Finish and Average** (or an explicit **Accept single pass** control).
- Do **not** call `setStage3Result` or `wizardState.setTarget` from the per-pass `process:exit` handler.
- Call them only from:
- `#btnFinishAndAverage` after a successful average (or the single-pass short-circuit), or
- an explicit **Use this pass** button if auto-advance is kept as an option.
- Keep the averaging panel visible after pass 1.
- Keep step 4 `disabled` until finish.
- Keep `advanceToStage4()` on the finish path only.
Optional UX: stepper tooltip `Complete measurement (Finish) before profiling`.
If issue 01 snapshots passes to `_passN.ti3` and only writes `{basename}.ti3` at Finish, this ticket is mostly free: `verify_stage_artefacts` already keys Stage 3 on `{basename}.ti3`. Implement them together.
Prefer not to add a new `stage3_accepted` flag in `state.js` unless the canonical-file rule cannot be used.
## Files
- `src/js/chartread.js`
- `src/js/state.js` — only if a new flag is required
- `src/index.html` — optional tooltip / button label
## Acceptance criteria
- [ ] After pass 1, Stage 4 sidebar step remains `disabled`.
- [ ] After Finish (one pass or N averaged passes), Stage 4 unlocks and `{basename}.ti3` exists.
- [ ] Cancelling a pass does not unlock Stage 4.
- [ ] Reloading the app with only `_passN.ti3` files and no `{basename}.ti3` does not unlock Stage 4.
- [ ] Single-pass Finish still advances to Stage 4 without calling `average`.
## Dependencies
Depends on issue 01 (unique pass files and canonical `{basename}.ti3` written only at Finish). Same PR.
gronod
added this to the v0.3.3 Hot fixes milestone 2026-08-26 15:03:59 +01:00
gronod
changed title from # bug(wizard): Stage 4 unlocks on first chartread pass before averaging to bug(wizard): Stage 4 unlocks on first chartread pass before averaging2026-08-27 15:30:03 +01:00
Resolved and verified in milestone v0.3.3 Hot fixes via PR #118 (Fix/averaging unique ti3).
Resolution Summary:
Stage 3 measurement workflow now keeps Stage 4 locked until the user explicitly completes the measurement session via Finish and Average or accepts a single pass.
Deferred wizardState.setTarget and setStage3Result until final measurement acceptance/averaging completes.
Resolved and verified in milestone `v0.3.3 Hot fixes` via PR #118 (`Fix/averaging unique ti3`).
### Resolution Summary:
- Stage 3 measurement workflow now keeps Stage 4 locked until the user explicitly completes the measurement session via **Finish and Average** or accepts a single pass.
- Deferred `wizardState.setTarget` and `setStage3Result` until final measurement acceptance/averaging completes.
- Stage 4 sidebar step enablement remains properly gated on canonical `{basename}.ti3` generation.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Kind/Bug,Priority/Highfix/averaging-unique-ti3(fromdevelopment)Description
On the first successful
chartreadexit,chartread.jscallswizardState.setTargetandsetStage3Result.verify_stage_artefactsthen sees{basename}.ti3and enables Stage 4 in the stepper.The operator can jump to
colprofwhile the averaging panel is still offering Measure Another Sheet. Combined with issue 01, Stage 4 may profile a single overwritten pass and never wait foraverage.Current behaviour
In the
process:exithandler forchartread_${basename}whencode === 0:FINISHED.recordedPasses.wizardState.setTarget(basename, cwd)andsetStage3Result(basename, cwd)run immediately.Step 4 of the wizard therefore unlocks as soon as the first
.ti3exists, which is before Finish / Average.Proposed solution
Treat Stage 3 as incomplete until the operator clicks Finish and Average (or an explicit Accept single pass control).
setStage3ResultorwizardState.setTargetfrom the per-passprocess:exithandler.#btnFinishAndAverageafter a successful average (or the single-pass short-circuit), ordisableduntil finish.advanceToStage4()on the finish path only.Optional UX: stepper tooltip
Complete measurement (Finish) before profiling.If issue 01 snapshots passes to
_passN.ti3and only writes{basename}.ti3at Finish, this ticket is mostly free:verify_stage_artefactsalready keys Stage 3 on{basename}.ti3. Implement them together.Prefer not to add a new
stage3_acceptedflag instate.jsunless the canonical-file rule cannot be used.Files
src/js/chartread.jssrc/js/state.js— only if a new flag is requiredsrc/index.html— optional tooltip / button labelAcceptance criteria
disabled.{basename}.ti3exists._passN.ti3files and no{basename}.ti3does not unlock Stage 4.average.Dependencies
Depends on issue 01 (unique pass files and canonical
{basename}.ti3written only at Finish). Same PR.# bug(wizard): Stage 4 unlocks on first chartread pass before averagingto bug(wizard): Stage 4 unlocks on first chartread pass before averagingResolved and verified in milestone
v0.3.3 Hot fixesvia PR #118 (Fix/averaging unique ti3).Resolution Summary:
wizardState.setTargetandsetStage3Resultuntil final measurement acceptance/averaging completes.{basename}.ti3generation.