fix(desktop): prevent tab close clicks from starting a drag

Merged
KI
2mo ago
+1-0

What & why

A small pointer movement while pressing a workspace tab’s × starts a native tab drag, suppressing the click and leaving the tab open. Cancel the close button’s default mousedown behavior so the same gesture delivers the close click.

Before/after screen recordings and measured input events (Superset organization access).

How I tested it

  • Reproduced in this worktree’s running Electron app via CDP: press ×, move 6 px while still inside the button, release. Before: mousedown → dragstart, tab remains. After: mousedown → mouseup → click, tab closes.
  • Eight additional close attempts with alternating ±6 px movements passed, with no captured console errors.
  • bun run lint — passed.
  • bun run typecheck — passed (42 tasks).
  • bun run --cwd packages/panes test — 114 passed, 0 failed.
  • bun run test — failed in desktop Git/worktree and shell-environment tests outside the changed component; the full suite is not green.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint and bun run typecheck pass (CI fails on lint warnings too)
  • "Allow edits from maintainers" is checked on fork PRs — not applicable; same-repository branch

Summary by cubic

Prevents a slight pointer movement while clicking a workspace tab's close button from starting a native tab drag, which previously suppressed the click and left the tab open. Canceling the default mousedown behavior on the close button ensures the same gesture delivers the close click.