Skip to content

[bug] Browser Preview does not keep alive when switching tabs (full reload on return) #1834

@n1203

Description

@n1203

Describe the bug

In Browser Preview, switching away from the preview tab and then coming back causes a full page reload every time.

This breaks the development workflow because runtime state is lost, pages re-enter from scratch, and debugging becomes much slower.

To Reproduce

  1. Start a local dev server and open the app in Browser Preview.
  2. Navigate to any page and interact until there is visible in-memory UI state.
  3. Switch to another tab (editor/file/terminal/other workspace tab).
  4. Switch back to Browser Preview.
  5. Observe that the preview page reloads completely.

Expected behavior

Browser Preview should stay alive in the background (keepalive), so switching back does not trigger a full reload and existing state is preserved.

Actual behavior

Browser Preview refreshes and re-enters the app on every tab switch.

Impact

  • Significantly interrupts iterative debugging.
  • Loses temporary UI/form state.
  • Triggers repeated network requests/reconnections.

Suggested improvement

  • Keep the preview session/WebView alive while inactive.
  • Optionally add a toggle like: Keep preview alive in background.
  • If suspension is required for resources, restore state/session instead of a hard reload.

Environment

  • Version: latest
  • OS: macOS
  • Reproducibility: 100%

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions