Skip to content

feat: escape to exit preview mode#5730

Merged
kof merged 3 commits intowebstudio-is:mainfrom
shreyanshkotak:annoying-things/escape-preview
Apr 27, 2026
Merged

feat: escape to exit preview mode#5730
kof merged 3 commits intowebstudio-is:mainfrom
shreyanshkotak:annoying-things/escape-preview

Conversation

@shreyanshkotak
Copy link
Copy Markdown
Contributor

Description

  1. Related to Annoying things #5501. This lets user escape exit preview mode when triggered from the builder UI, while preserving canvas-originated escape behavior so preview mode remains active when the canvas should handle the key event.

Steps for reproduction

  1. Open the builder and switch to preview mode.
  2. Press Escape from the builder UI.
  3. Expect preview mode to exit and the sidebar panel to return to auto.
  4. Switch to preview mode again.
  5. Press Escape while the focused inside the canvas.
  6. Expect preview mode to stay active and canvas/native page behavior to be preserved.

Code Review

  • hi @kof, I need you to do
    • conceptual review (architecture, feature-correctness)
    • detailed review (read every line)
    • test it on preview

Before requesting a review

  • made a self-review
  • added inline comments where things may be not obvious (the "why", not "what")

Before merging

  • tested locally and on preview environment (preview dev login: 0000)
  • updated test cases document
  • added tests
  • if any new env variables are added, added them to .env file

use that source in the escape handler to exit preview mode only when escape is
triggered outside the canvas. canvas-originated escape preserves native page behavior and keeps preview mode active.
@github-actions
Copy link
Copy Markdown

🚀 Deployed!

📍 Preview: https://pr-5730.development.webstudio.is

Note: Adding new commits will remove the safe-to-deploy label and require re-approval.

@kof kof temporarily deployed to development April 27, 2026 12:41 — with GitHub Actions Inactive
@kof kof temporarily deployed to development April 27, 2026 12:41 — with GitHub Actions Inactive
@kof kof merged commit 9570c4e into webstudio-is:main Apr 27, 2026
21 of 24 checks passed
@kof
Copy link
Copy Markdown
Member

kof commented Apr 27, 2026

Merged, thank you!

@shreyanshkotak shreyanshkotak deleted the annoying-things/escape-preview branch April 28, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants