Skip to content

Commit 6a695b8

Browse files
committed
Address review feedback
- e2e/drop-overlay.spec.ts: drive the resize-handle test with a real `click()` instead of `dispatchEvent("pointerdown")`. A synthetic pointer event carries no active pointer id, so `startLayerPanelResize`'s `setPointerCapture` could throw before the capture-phase recovery was exercised, and the gesture never reached `pointerup` to tear the resize down. Verified the test still fails when the listeners are moved back to the bubble phase, so it remains a real regression test. - DesktopShell.tsx: scope the "cannot occur during a real drag" claim to the pointer listener only. HTML5 drag-and-drop suppresses mouse events and a native drag holds an OS pointer grab, but neither spec promises keyboard events are withheld, and the inline comment on `onKeyDown` already assumed a keypress can arrive mid-drag. Escape is now described for what it is: a conventional request to cancel the stranded overlay or the drag itself.
1 parent 1899ca0 commit 6a695b8

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

apps/geolibre-desktop/src/components/layout/DesktopShell.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,12 +1823,11 @@ export function DesktopShell({
18231823
// has the same effect. The result is an overlay covering the map until the
18241824
// user happens to drag another file across the window.
18251825
//
1826-
// Rather than guess at every way the OS can swallow an event, recover on two
1827-
// signals that cannot occur while a real drag is in progress: a key press and
1828-
// a pointer button. Neither fires during an HTML5 drag (the spec suppresses
1829-
// mouse events for the duration) nor during a native one (the OS holds a
1830-
// pointer grab), so this can never dismiss the overlay out from under a drag
1831-
// the user is actually performing.
1826+
// Rather than guess at every way the OS can swallow an event, recover on a
1827+
// pointer button, which cannot occur while a real drag is in progress: HTML
1828+
// drag-and-drop suppresses mouse events and a native drag holds an OS pointer
1829+
// grab. Escape is a separate, conventional request to cancel either the
1830+
// stranded overlay or a genuine drag.
18321831
useEffect(() => {
18331832
if (!isDraggingFiles) return;
18341833

e2e/drop-overlay.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ test("a press on a control that stops propagation still dismisses the overlay",
6464
// The panel resize handles call stopPropagation() on pointerdown, so a bubble
6565
// phase listener on window would never see this press. The recovery listens
6666
// in the capture phase precisely so it does.
67-
await page.locator('[aria-label="Resize Layers panel"]').first().dispatchEvent("pointerdown");
67+
await page.locator('[aria-label="Resize Layers panel"]').first().click();
6868
await expect(page.locator(OVERLAY)).toBeHidden();
6969
});
7070

0 commit comments

Comments
 (0)