Skip to content

fix(ui): op-picker modal — tools weren't clickable (form never opened)#35

Merged
yultyyev merged 1 commit into
mainfrom
fix/ui-op-picker-form
Jun 18, 2026
Merged

fix(ui): op-picker modal — tools weren't clickable (form never opened)#35
yultyyev merged 1 commit into
mainfrom
fix/ui-op-picker-form

Conversation

@yultyyev

Copy link
Copy Markdown
Collaborator

The bug

In clip ui, opening + New op and clicking any tool (Trim, Split, …) dismissed the dialog without opening the tool's form — so no form-based op could be created from the browser. Found while dogfooding v0.2.0.

Root cause

The "New operation" dialog (ToolPickerModal.tsx) renders a full-bleed close button as a sibling of the modal content:

.modal-backdrop-button  →  position: absolute; inset: 0;   (transparent, onClick=onClose)
.modal                  →  (unpositioned / static)

A positioned element paints above a static sibling regardless of DOM order, so the transparent backdrop button overlaid the entire modal and intercepted every click → onClose. The tool buttons never received the click, so onPick never fired and App.tsx never set activeTool to render the form. (The e.stopPropagation() on .modal was dead code — clicks never reached it.)

Fix

Give .modal position: relative; z-index: 1 so it stacks above the backdrop button. Tool clicks now register (the form mounts); clicking the visible backdrop outside the modal still closes it. One-rule CSS change.

Verification

This is a CSS hit-testing bug — jsdom can't model it (a unit test clicking the button element directly would fire onClick and pass despite the bug), and the repo has no browser-test harness, so no meaningful unit test exists for it. Verified in a real browser via the extension instead:

  • Before: clicking Trim closed the modal; the accessibility tree showed no form inputs / Run button.
  • After: + New opTrim mounts the form (Input / Start / End / Run); filling it (clip + 00:00:002) and clicking Run produced a trim op and a new TRIM output (op count 3 → 4).

Merging cuts a v0.2.1 patch (fix → patch) on push to main.

🤖 Generated with Claude Code

…are clickable

The "New operation" dialog's `.modal-backdrop-button` is `position:absolute; inset:0`
(a full-bleed close-on-click target), but `.modal` was unpositioned. A positioned
sibling paints above a static one regardless of DOM order, so the transparent
backdrop button overlaid every click in the dialog: selecting any tool hit the
backdrop's onClose and dismissed the modal instead of opening the tool's form. No
form ever mounted — the picker was effectively unusable (the `.modal`
stopPropagation was dead code because clicks never reached it).

Give `.modal` `position:relative` + `z-index:1` so it stacks above the backdrop
button; clicks on the tool buttons now register (the form opens) while clicking the
visible backdrop outside the modal still closes it.

Verified in a real browser — this is a CSS hit-testing bug jsdom can't model, and
the repo has no browser-test harness, so a unit test would pass despite the bug:
"+ New op" → Trim now mounts the form, and filling it + Run produces a trim op.
@yultyyev yultyyev merged commit 32f850a into main Jun 18, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant