Skip to content

page check doesn't catch a page script that resizes a block after load #4704

Closed

Description

@max-sixty

What happens

A page whose own script changes a block's height after load, on a timer or as an autoplaying figure steps between states, passes leaf page check and leaf page check --render. In a browser, everything below the block jumps each time it changes. keeps-first-box catches the same failure in a package widget, but page code has no equivalent, and page-behavior.md notes that code run from a timer isn't reached by the check.

What I expected

A check that a page's content keeps its place while the page's own code runs. For example, the render check could let the page run for a few seconds and report the browser's layout-shift entries with the nodes that moved, the way keeps-first-box names a widget.

Smallest repro

A page with this in main:

<h1 id="t">Shift</h1>
<div id="box">one line</div>
<p id="below">This paragraph moves every second and a half.</p>
<script>
  let n = 1;
  setInterval(() => {
    n = (n % 6) + 1;
    document.getElementById("box").innerHTML = "line<br>".repeat(n);
  }, 1500);
</script>

leaf page check <page> --render exits 0 with no findings. Opened in a browser, the paragraph moves every 1.5 s.

Seen on leaf 24cfac4, installed 2026-10-29T00:54:25-07:00.

This was written by Claude Code on behalf of max-sixty

Activity

  1. added
    enhancement
    on Oct 29, 2026
  2. leaf-agent commented on Oct 29, 2026

    @leaf-agent
    Collaborator

    #4708 adds a three-second passive observation to page check --render, reporting native layout shifts as advice with the moved nodes and their before/after boxes. It catches the reported 1.5-second timer; reserving the block's height removes the finding. Plain page check keeps its startup-only scope, and the render observation explicitly leaves later timers and gesture paths unverified.

    The full render regression fails on the unchanged base and passes with the change. Focused browser/model tests and pnpm run check passed; three shipped-page samples produced no advice. The PR is pushed and recorded for landing. With await_ci: false, the queued review and tend-land own the remaining review, CI and landing.

  3. added a commit that references this issue on Oct 29, 2026
    fa4a30a
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions