Address viewport placeholder review feedback - #29
Merged
Conversation
Follow-up to the merged #27, addressing KAdam's review: - Extract LazyBlockEdit so the placeholder hooks (useState, useSelect, useEffect) are no longer called after the HOC's early return for non-query blocks, satisfying the rules of hooks. - Tighten the QueryLoopPlaceholder doc block. No behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAvqR2G3Q3aJkTtePzmLg7
Playwright test resultsDetails
|
roborourke
marked this pull request as ready for review
July 27, 2026 09:36
svandragt
approved these changes
Jul 27, 2026
svandragt
left a comment
There was a problem hiding this comment.
Interesting to think if that's possible for all blocks loading lazily.
Collaborator
Author
|
Potentially. Are there other blocks that are heavy on requests you can think of? |
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
Follow-up to the merged #27, addressing @kadamwhite's post-merge review of the viewport-placeholder code. Two changes, no behavior change.
Changes
Rules of hooks (review comment)
withViewportPlaceholdercalleduseState/useSelect/useEffectafter the HOC's earlyreturnfor non-core/queryblocks — a rules-of-hooks violation (it worked in practice only becausenameis stable per block instance). Everything after the early return is now extracted into aLazyBlockEditcomponent whose hooks run unconditionally, so the HOC reduces to:Trim the doc block (review comment)
Applied KAdam's suggested tighter wording for the
QueryLoopPlaceholderdoc block, which conveys the same information more directly.Testing
npm run build— compiles cleanly.npm run lint:js— clean.tests/e2e/viewport-placeholder.spec.jscoverage is unchanged, since behavior is identical.🤖 Generated with Claude Code
Generated by Claude Code