fix(examples): use 'renderUpdate' event in quads-rendered#24
Merged
Conversation
…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>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/tests/quads-rendered.ts listened for
'quadsUpdate', but the renderer never emits that event. The actual event name is'renderUpdate'(interfaceRendererMainRenderUpdateEvent), queued fromStage.calculateRenderInfowith 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
renderUpdateevent is queued during the frame and flushed once it completes, andsettings.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 additionalawaits or RAFs needed.Test plan
pnpm start→ openquads-renderedand confirm the header reads"Number of Quads Rendered: <N>"and updates on destroy.quads-rendered-*.pngsnapshots viapnpm test:visual --ci --captureand verify the number appears in each.🤖 Generated with Claude Code