Skip to content

fix(ui): Grid pan no longer turns into a browser drag when canvas text is selected (#4668) - #4669

Merged
vybe merged 1 commit into
Abilityai:devfrom
jordanallenlewis:fix/4668-grid-pan-native-drag
Nov 21, 2026
Merged

vybe merged 1 commit into
Abilityai:devfrom
jordanallenlewis:fix/4668-grid-pan-native-drag

Conversation

@jordanallenlewis

Copy link
Copy Markdown

Description

On the Dashboard Grid, a press on the empty canvas is meant to pan. If any canvas text was selected (a zone stat line, the legend, a label after a double-click), the next press-and-move inside it started the browser's native drag of that selection instead: no-drop cursor, pointercancel, and the pan stopped. Images and links inside a tile could start a native drag the same way.

FleetGrid.vue:

  • onCanvasPointerDown clears a non-empty selection once it has decided to pan.
  • @dragstart on the canvas root cancels native drags (text inside an input or textarea keeps its own drag).
  • .fleet-canvas.panning is user-select: none, so a pan that sweeps across zone headers and tiles selects nothing.

Related Issue

Fixes #4668

Journey Impact

Journey Impact: none: pointer handling of the Grid canvas pan, no user-facing promise changes

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Testing

  • I have tested this locally

  • New tests added (if applicable)

  • All existing tests pass

  • Every new test executes the changed path

  • e2e/grid-pan-native-drag.spec.js (all three @smoke, no agent needed): selects canvas text, drags the background 120x80 and asserts the whole move was applied with no dragstart and no pointercancel and the selection cleared; pans across zone and tile text and asserts nothing is selected; dispatches dragstart on the tile's images and links and asserts it is cancelled.

  • Reproduced first in headless Chromium against vite dev with a mocked API: with a selection, one dragstart, one pointercancel, 10px of a 60px pan applied; clean canvas: none of those. With the fix: 60 of 60px, no dragstart.

  • Frontend unit suite: 8220 passed. check:tokens passes. Not checked on Safari or Firefox.

Mutation: with FleetGrid.vue restored from dev, all three cases in grid-pan-native-drag.spec.js fail (pan applied 15 of 120px; selection left behind; dragstart not cancelled).

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review
  • My changes generate no new warnings

@vybe

vybe commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

merge-train (2026-11-21): on this train. Validated at 445122fa5: READY. The e2e spec drives the real handlers, and removing any one of the three fixes (the selection clear, the dragstart preventDefault, user-select: none) turns a test red.

Non-blocking, for a follow-up: headless Chromium does not reproduce the reported drag, so test 1's pan-distance / zero-dragstart checks (e2e/grid-pan-native-drag.spec.js:66-70) pass on the unfixed code and only its selection-cleared check goes red. Test 2 (:75) passes on the unfixed code and under every mutation. The bug itself is pinned by test 3's synthetic dragstart.

Your CI runs were waiting for maintainer approval; they are approved and running now.

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge-train: batch validated on train/20261121-1212 (#4705)

@vybe
vybe merged commit 2963c88 into Abilityai:dev Nov 21, 2026
24 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.

2 participants