Skip to content

fix(operate): restore eight controls that were rendering and doing nothing - #160

Merged
pskeshu merged 1 commit into
gently-project:developmentfrom
pskeshu:fix/restore-dead-operate-controls
Sep 6, 2026
Merged

fix(operate): restore eight controls that were rendering and doing nothing#160
pskeshu merged 1 commit into
gently-project:developmentfrom
pskeshu:fix/restore-dead-operate-controls

Conversation

@pskeshu

@pskeshu pskeshu commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

My regression, shipped in #157. Merge this ahead of anything else.

Consolidating the two roster renderers into one panel, the roster's own click/keydown listeners had to go — the panel owns the markup, so it owns the handlers. I removed them by slicing text between two landmarks, and the end landmark matched too late. The slice took eight unrelated handlers with it:

control
op-spim-toggle start/stop the light-sheet view
op-calibrate run the calibration
[data-gv] galvo nudges
[data-pz] piezo nudges
[data-backoff] the interlock banner's "Back off 100 µm"
op-modes the run-mode chooser
op-tl-stop the stop-condition select
op-lib-list pick a saved tactic

Every one still rendered and still looked enabled. [data-backoff] is the worst: a dead button on an interlock banner gets pressed at exactly the moment something is already wrong.

Nothing caught it

CI runs no JavaScript, and no test asserted that a control was connected to a function. There was no signal at all — I found it by noticing that clicking a run mode did not change the run mode.

tests/test_operate_controls_are_wired.py closes that gap. It checks every control inside wire(), not merely somewhere in the file: several of these ids are read elsewhere too (the SPIM toggle's label is updated in applySpim), so presence proves the control is mentioned, not that anything listens to it. Verified against the broken file — it flags all eight.

The helper anchors on _wired, which only the top-level wire() uses. My first attempt matched "function wire() {" and found the gauge factory's inner one instead — landmark-matching text is the mistake this file is about, so it isn't repeated inside it.

Verified live

Mode chooser switches panel and run verb · stop-condition select reveals its value field · back-off, galvo and piezo controls present and bound.

…thing

My regression, shipped in gently-project#157.

Consolidating the two roster renderers into one panel, the roster's own
click/keydown listeners had to go — the panel owns the markup, so it owns the
handlers. I removed them by slicing text between two landmarks, and the end
landmark matched too late. The slice took eight unrelated handlers with it:

    op-spim-toggle    start/stop the light-sheet view
    op-calibrate      run the calibration
    [data-gv]         galvo nudges
    [data-pz]         piezo nudges
    [data-backoff]    the interlock banner's "Back off 100 µm"
    op-modes          the run-mode chooser
    op-tl-stop        the stop-condition select
    op-lib-list       pick a saved tactic

Every one still rendered and still looked enabled. `[data-backoff]` is the
worst of them: a dead button on an interlock banner is pressed at exactly the
moment something is already wrong.

Nothing caught it. CI runs no JavaScript, and no test asserted that a control
was connected to a function, so there was no signal — I found it only by
noticing that clicking a run mode did not change the run mode.

`tests/test_operate_controls_are_wired.py` closes that. It checks every control
inside `wire()` specifically, not merely somewhere in the file: several of these
ids are also read elsewhere (the SPIM toggle's label is updated in
`applySpim`), so presence proves the control is mentioned, not that anything
listens to it. Verified against the broken file — it flags all eight.

The helper anchors on `_wired`, which only the top-level `wire()` uses. My
first attempt matched "function wire() {" and found the gauge factory's inner
one — landmark-matching text is the mistake this file is about, so it is not
repeated in it.

Verified live: the mode chooser switches panel and run verb, the stop-condition
select reveals its value field, and the back-off, galvo and piezo controls are
present and bound.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pskeshu
pskeshu merged commit 87c6c6c into gently-project:development Sep 6, 2026
2 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.

1 participant