Skip to content

Preview: keep rendered HTML live when the page or its images change outside the watcher #2142

Closed

Description

@jacktrnr

Important

Problem — Preview reloads a file only on a watcher change event for that exact file. A dashboard regenerated by a script outside the project (the personal vault, a run directory) never fires one, and regenerating a plot without rewriting the page leaves a stale image.
Approach — For rendered HTML only: re-render when any inlined image changes on the watcher, and while the tab is visible re-read the page and its images every few seconds, re-rendering only when content actually changed.
Scope — in: HTML view refresh · out: other file types' reload behaviour.

Acceptance Criteria

  • Rewriting the page from outside the watcher's reach updates the visible view within the poll interval.
  • Rewriting a referenced image updates the view without the page itself changing.
  • An unchanged re-read does not re-render (no flicker, scroll untouched).
  • No polling happens while the Preview tab or the file's pane is hidden, or while Source has unsaved edits.

Testing Decisions

Unit-test the change detector (content fingerprint of page + assets) and the gating predicate (visible, no unsaved edits); reuse the existing stale-read guard.

Source

Part of #2140. Blocked by #2141.

Metadata

Metadata

Assignees

Labels

afkImplementable without human interactionarea:uienhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions