Skip to content

Visualizer: stop capability panels inflating in height; add drag-to-reposition - #1148

Merged
BioCam merged 2 commits into
PyLabRobot:mainfrom
BioCam:visualizer-machine-tool-panel-fixes
Jul 5, 2026
Merged

Visualizer: stop capability panels inflating in height; add drag-to-reposition#1148
BioCam merged 2 commits into
PyLabRobot:mainfrom
BioCam:visualizer-machine-tool-panel-fixes

Conversation

@BioCam

@BioCam BioCam commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

The machine-tool popups (now labeled "Capabilities") could balloon to nearly full-window height. positionPanels measured the single-channel panel while it sat at the button's horizontal center; parked near the right edge of main, a width:fit-content panel wraps its channel columns into a tall stack, and that inflated height was then copied onto the plate and arm panels. The measurement was wrong, not the panels.

  • Measure the single-channel panel at its natural width (left:0) so a right-parked panel can't wrap and inflate, and route all three panels through a shared applyMachineToolPanelPos that clamps each within main on every edge.
  • Make panels draggable by their background/edges, remembering positions in localStorage; each panel gains a top-right return indicator (the deck home icon) shown only once it has been moved, and panels re-clamp to the visible area on window resize / sidebar toggle.
  • Fold in: rename the navbar label "Machine Tools" -> "Capabilities" and the 96-head info panel to "96-Channel Head Pipette" / «Head96»; wrap the label toggle in an IIFE so it targets its own liquid handler instead of the last one.

Behavior: the default layout and panel sizes are unchanged - a panel only moves if you drag it, and never changes size. Positions persist per browser, and a corrupt stored value falls back to the default.

Screenshot 2026-07-04 at 22 10 15

🤖 Generated with Claude Code

BioCam and others added 2 commits July 5, 2026 00:36
…-reposition

- Measure the single-channel panel at its natural width so a panel parked near the right edge of main cannot wrap its channel columns into a tall stack and inflate the height the plate/arm panels inherit.
- Route all three panels through applyMachineToolPanelPos, clamping each within main on every edge.
- Add drag-to-reposition by a panel's background or edges, with positions remembered in localStorage; each panel carries a top-right return-to-default indicator (the deck home icon) shown only once it has been moved.
- Rename the navbar label "Machine Tools" to "Capabilities"; rename the 96-head info panel to "96-Channel Head Pipette" with type «Head96».

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…el edge cases

- Re-clamp open panels from the ResizeObserver so a remembered position cannot strand a panel off-screen after the drawing area shrinks (window resize, sidebar toggle); positions and sizes are unchanged when they fit.
- End a drag when the mouse button is released outside the window (no mouseup reaches the document) via an ev.buttons check and a window blur handler.
- Validate stored positions with Number.isFinite so a corrupt localStorage entry falls back to the default instead of NaN.
- Preserve the return indicator across state re-fills (clearPanelContent) instead of rebuilding it on every update.
- Wrap the Capabilities label toggle in an IIFE so it targets its own liquid handler instead of the last one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@BioCam
BioCam merged commit 1929a78 into PyLabRobot:main Jul 5, 2026
21 checks passed
@BioCam
BioCam deleted the visualizer-machine-tool-panel-fixes branch July 5, 2026 09:34
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