fix(a2ui): improve preview generation status#2766
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughPreviewPanel now accepts a ChangesCharacter Count Tracking and Preview Info Hints
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly Related PRs
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
❌ 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/genui/a2ui-playground/src/pages/AIChatPage.tsx`:
- Around line 1389-1396: The character count is inconsistent because restored
messages use getGeneratedCharacterCount/safeStringifyPayload while live
streaming uses raw accumulated text; make them consistent by computing the same
pretty-printed payload length during streaming: in the streaming/finalization
path where generatedCharacterCountRef / createRenderedPreviewContent /
finalMessages are used, compute characterCount via
getGeneratedCharacterCount(payload) (or safeStringifyPayload(payload).length)
and set generatedCharacterCountRef.current to that value before calling
createRenderedPreviewContent; update the code in the streaming handler that
builds the final AI message (the block that assigns next[next.length - 1] and
calls createRenderedPreviewContent) so both live and restored flows rely on
getGeneratedCharacterCount.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 98f5ec33-59f1-4b60-bb9f-36969253af8e
📒 Files selected for processing (3)
packages/genui/a2ui-playground/src/components/PreviewPanel.tsxpackages/genui/a2ui-playground/src/pages/AIChatPage.tsxpackages/genui/a2ui-playground/src/styles.css
Merging this PR will not alter performance
Comparing Footnotes
|
d2514a0 to
8a3eb17
Compare
Summary
Test Plan
DPRINT_CACHE_DIR=/private/tmp/dprint-cache ./node_modules/.bin/dprint check packages/genui/a2ui-playground/src/pages/AIChatPage.tsx packages/genui/a2ui-playground/src/components/PreviewPanel.tsx packages/genui/a2ui-playground/src/styles.cssgit diff --checkCI=1 PATH=/private/tmp/codex-pnpm-bin:/Users/bytedance/.nvm/versions/node/v24.15.0/bin:$PATH /Users/bytedance/.nvm/versions/node/v24.15.0/bin/corepack pnpm exec turbo build --filter=a2ui-playgroundChecklist
Summary by CodeRabbit
New Features
Style