Skip to content

Fix InlineDiffBlock hook ordering for empty diffs#400

Merged
BunsDev merged 1 commit into
mainfrom
okcode/fix-hooks-render
Apr 10, 2026
Merged

Fix InlineDiffBlock hook ordering for empty diffs#400
BunsDev merged 1 commit into
mainfrom
okcode/fix-hooks-render

Conversation

@BunsDev
Copy link
Copy Markdown
Member

@BunsDev BunsDev commented Apr 10, 2026

Summary

  • Move the empty-diff early return until after hook setup in InlineDiffBlock.
  • Preserve hook call order while still rendering nothing for empty diffs.
  • Reduce the risk of hook-related render errors when diff data is empty.

Testing

  • Not run (PR body only).
  • Verified the change is limited to apps/web/src/components/chat/InlineDiffBlock.tsx.
  • Confirmed the empty-diff guard now happens after the hook declarations.

- Keep hook execution order stable in `InlineDiffBlock`
- Return early only after derived state and effects are initialized
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
okcode-marketing Ready Ready Preview Apr 10, 2026 2:15pm
v0-compute-the-platform-to-build Ready Ready Preview, Open in v0 Apr 10, 2026 2:15pm

@github-actions github-actions Bot added size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Apr 10, 2026
@BunsDev BunsDev merged commit 8baa39d into main Apr 10, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant