feat(content-preview): forward comparison flags so Preview can own the banners - #4882
zhirongwang wants to merge 1 commit into
Conversation
…e banners Stamp isComparing and isComparedPreview on show() and on an already-open current pane so BCP can render comparison chrome without a reload. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughContentPreview now distinguishes the compared pane from the active pane. It passes comparison flags when creating a preview and updates an existing preview when comparison starts without requiring a reload. ChangesComparison Preview Mode
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The comparison preview changes are mergeable after normal checks; no actionable issue remains from this review. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The inspected changes preserve file-version selection and token handling; they do not establish an expanded access path. Compatibility with the separately delivered Preview changes remains unverified, so correct comparison banners during live transitions and rollback cannot yet be confirmed. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ast-grep (0.45.3)src/elements/content-preview/__tests__/ContentPreview.test.jsast-grep timed out on this file 🔧 Biome (2.5.13)src/elements/content-preview/ContentPreview.jsFile contains syntax errors that prevent linting: Line 22: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 37: 'import { type x ident }' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 68: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 69: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 70: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 71: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 72: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 73: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.; Line 74: ' ... [truncated 18839 characters] ... expected 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. A rabbit checks the preview panes, Comment |
Summary
isComparedPreviewso the compared pane can stay out of the host layout slot (isComparing={false}) while still telling Preview it is the older version.isComparingandisComparedPreviewonpreview.show(), and callsetComparisonModewhen comparison starts on an already-open current pane (no reload).Test plan
Made with Cursor
Summary by CodeRabbit