Skip to content

[Bug]: Local HTML file preview reloads on every new assistant message, resetting page state #20913

Closed as not planned

Description

@jameswasher

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. In a thread, have the agent write a local multi-page HTML file (e.g. a slide deck with Back/Next buttons) and link it in a reply.
  2. Open the link in the preview panel and move to slide 3.
  3. Send a message so the agent starts replying (streaming text into the thread).

Expected behavior

The preview keeps its page state. It reloads only when the file's contents change, or on an explicit refresh.

Actual behavior

The preview reloads each time new assistant text streams into the thread, even though the HTML file hasn't changed. All in-page state is lost: the deck jumps back to slide 1 while I'm reading it.

Impact

Minor bug or occasional failure

Version or commit

T3 Code (Nightly) 0.0.46-nightly.20261012.3021

Environment

macOS 27.0.1, Claude Code provider

Workaround

Make the page save its own state (e.g. current slide in sessionStorage) and restore it on load.

Activity

  1. juliusmarminge commented on Oct 17, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    The reload doesn't come from streamed text. It's the preview's deliberate workspace refresh.

    • ChatView.tsx builds a workspaceMutationId from two things: the thread's latest completed command_execution or file_change item, and the latest checkpoint.
    • FilePreviewPanel.tsx adds that id to the HTML frame's URL as workspace-revision. Whenever the agent finishes a command or a file edit, or a turn checkpoint lands, the page reloads, even if the open file didn't change.
    • Commands count because a shell command can change files without reporting which ones (see the code comment there). Your nightly (3021) has the same logic as current main, so this isn't a recent regression.

    Reloading only when the open file actually changes would be a change to that design, so I'm closing this as a feature request. Please raise it in Ideas.

    For context: the frame is keyed by its URL (BrowserDocumentFrame.tsx), so each new workspace-revision remounts it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequested improvement or new capability.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions