Skip to content

A framed file reloads from a new token on any event in its folder, even when the file is unchanged #775

Closed

Description

@SSFSKIM

What happens

A file drawn in a frame (a PDF, an HTML page, a video or a sound opened by its path, UX wave U6b-2) is drawn again from a new token whenever any watch event reaches its folder, even when the file itself did not change. The frame element is replaced, an HTML page's scripts run again and its state is lost, and the PDF viewer starts over at its first page.

An agent that writes files next to an open page (a build writing its output beside index.html, a script saving a log in the same folder) reloads that page on every write.

Why

  • applyChanged in src/renderer/src/tools/code/viewer/viewer-store.ts re-reads every entry of the event's folder when the event names only the folder (event.kind === 'changed' on the directory), or when the folder is invalidated (re-watched after a link reconnect, for example). For a text file the re-read is absorbed by its hash.
  • A framed kind is read for its size and type only, with no hash. sameUnhashed treats it as unchanged only on a revisit, so after an event the re-read always lands.
  • After a load lands, a framed entry asks main for a new token (if (entry?.kind === 'frame') ask(tabId)), and the iframe is re-made from it.

Evidence

The remote scene "A reaches B's mawsd over RL2 …" (step M5a, B's HTML page drawn from a copy) failed twice on the Mac host, at two different moments. Each time the frame first found by its token's URL was gone or detached under the check. B writes three files into the same folder just before the page opens. The scene now reads the page through the iframe as it currently is, and on a failure it prints the iframe's src against the first one, which will confirm or rule out a second token.

Possible directions (to be decided)

  • Keep the token when a re-read after an event shows the same size and modification time (the read already answers both), or only when the event names the file itself.
  • Or accept the reload and say so in the U6b-2 plan's decision 6.

Done when

An event in a framed file's folder that does not change the file leaves its frame, its token and the page's state as they were. A unit case in viewer-store pins this, and the remote scene's M5a step passes repeatedly on the Mac host.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P2
    on Nov 19, 2026
  2. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 20, 2026
  3. SSFSKIM commented on Nov 20, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: batch 8, group b8-bugs

  4. added
    status:in-review
    and removed
    status:in-progress
    on Nov 20, 2026
  5. added a commit that references this issue on Nov 20, 2026
  6. removed
    status:in-review
    on Nov 20, 2026
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

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions