open-design/e2e
d 🔹 f8af2cd875
fix(web): exit PreviewModal fullscreen on first Esc press (#168)
Closes #141.

When the user clicked the Fullscreen button, requestFullscreen() put the
stage element into native browser fullscreen and React's `fullscreen`
state was set true. Pressing Esc was meant to exit the overlay, but in
browsers like Firefox the browser consumes Esc to drop its native
fullscreen element without delivering keydown to JS. The React state
stayed true, the `ds-modal-fullscreen` class lingered, and only a second
Esc reached the keydown handler that flipped the state.

Subscribe to `fullscreenchange` so the React state mirrors the native
state. When the browser exits its fullscreen element, the overlay drops
on the same keystroke. The keydown handler is still needed for the
fallback path (no native fullscreen API support, where requestFullscreen
is undefined and only React state is set).

Adds three regression tests in e2e/tests/preview-modal-fullscreen.test.tsx
covering the bug fix path, the keydown fallback, and a non-collapse
guard for transitions where another element is still fullscreen.

Co-authored-by: d 🔹 <258577966+voidborne-d@users.noreply.github.com>
2026-04-30 23:35:01 +08:00
..
cases Add shared contracts and migrate project code to TypeScript (#118) 2026-04-30 13:01:15 +08:00
reporters Add shared contracts and migrate project code to TypeScript (#118) 2026-04-30 13:01:15 +08:00
reports Align app directories and isolate e2e tests (#102) 2026-04-30 09:47:03 +08:00
scripts Add shared contracts and migrate project code to TypeScript (#118) 2026-04-30 13:01:15 +08:00
specs Fix chat runs surviving web disconnects (#146) 2026-04-30 20:16:46 +08:00
tests fix(web): exit PreviewModal fullscreen on first Esc press (#168) 2026-04-30 23:35:01 +08:00
package.json Refresh desktop integration control plane (#123) 2026-04-30 14:23:53 +08:00
playwright.config.ts Refresh desktop integration control plane (#123) 2026-04-30 14:23:53 +08:00
tsconfig.json Add shared contracts and migrate project code to TypeScript (#118) 2026-04-30 13:01:15 +08:00
vitest.config.ts Align app directories and isolate e2e tests (#102) 2026-04-30 09:47:03 +08:00