Skip to content

fix(examples): use 'renderUpdate' event in quads-rendered#24

Merged
chiefcll merged 1 commit into
mainfrom
fix/quads-rendered-event-name
May 21, 2026
Merged

fix(examples): use 'renderUpdate' event in quads-rendered#24
chiefcll merged 1 commit into
mainfrom
fix/quads-rendered-event-name

Conversation

@chiefcll
Copy link
Copy Markdown
Contributor

Summary

examples/tests/quads-rendered.ts listened for 'quadsUpdate', but the renderer never emits that event. The actual event name is 'renderUpdate' (interface RendererMainRenderUpdateEvent), queued from Stage.calculateRenderInfo with payload { quads, renderOps }.

Result: the listener never fired, and the on-screen counter stayed at the placeholder "Number of Quads Rendered: " — including in the captured visual-regression snapshots.

The payload shape (payload.quads) was already correct, so this is a one-token rename.

Why this isn't a timing issue

The renderUpdate event is queued during the frame and flushed once it completes, and settings.snapshot() already sleeps ~200 ms before capture — plenty of time for the listener to update the text and a follow-up frame to render. Fixing the event name is sufficient; no additional awaits or RAFs needed.

Test plan

  • pnpm start → open quads-rendered and confirm the header reads "Number of Quads Rendered: <N>" and updates on destroy.
  • Re-capture the two quads-rendered-*.png snapshots via pnpm test:visual --ci --capture and verify the number appears in each.

🤖 Generated with Claude Code

…rendered

The example registered a listener for 'quadsUpdate', which the renderer
never emits. The actual event is 'renderUpdate', defined as
RendererMainRenderUpdateEvent in src/main-api/Renderer.ts and queued from
Stage.calculateRenderInfo() with payload { quads, renderOps }. Because
the wrong name silently never fired, the quads counter text stayed at
its placeholder "Number of Quads Rendered: " forever - including in the
captured visual-regression snapshots.

The payload shape (payload.quads) was already correct, so no other
changes are needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chiefcll chiefcll merged commit 792034e into main May 21, 2026
1 check passed
@chiefcll chiefcll deleted the fix/quads-rendered-event-name branch May 21, 2026 19:39
chiefcll added a commit that referenced this pull request May 21, 2026
Pulls in #24 (renderUpdate event name) and #25 (VRT threshold + clip
shape) so this branch's CI runs against the tightened comparator. The
visual-regression diffs surfaced here should now reflect real layout
changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant