[RFC] Plan review annotations#2865
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 52f5740. Configure here.
| planReviewAnnotationsByPlanId, | ||
| reviewingProposedPlan, | ||
| setComposerDraftPrompt, | ||
| ]); |
There was a problem hiding this comment.
Annotations not cleared after finishing plan review
Medium Severity
finishPlanReview appends annotation feedback to the composer draft but never clears the annotations from planReviewAnnotationsByPlanId for the finished plan. If the user re-opens the review for the same plan, the old annotations are still present and clicking "Done" again will duplicate the feedback in the composer.
Reviewed by Cursor Bugbot for commit 52f5740. Configure here.
| export interface PlanReviewAnnotationDraft { | ||
| quote: string; | ||
| comment: string; | ||
| } |
There was a problem hiding this comment.
Exported interface PlanReviewAnnotationDraft is never used
Low Severity
PlanReviewAnnotationDraft is exported but never imported or referenced anywhere in the codebase. It appears to be leftover dead code that adds unnecessary noise to the module's public API.
Reviewed by Cursor Bugbot for commit 52f5740. Configure here.
| > | ||
| {commentEditorPanel} | ||
| </div> | ||
| ) : null} |
There was a problem hiding this comment.
Fixed-position popups misaligned inside sheet mode
Medium Severity
The selection action button and floating comment editor use position: fixed with viewport-relative coordinates from getBoundingClientRect / window.innerWidth. When PlanReviewPanel renders inside the RightPanelSheet path, the SheetPrimitive.Popup ancestor has will-change-transform, which per CSS spec creates a new containing block for fixed-positioned descendants. This causes both floating elements to be offset by the sheet's own viewport position, making them appear in the wrong location on narrow screens.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 52f5740. Configure here.
| useEffect(() => { | ||
| if (!commentEditor) { | ||
| return; | ||
| } | ||
| window.requestAnimationFrame(() => { | ||
| commentTextareaRef.current?.focus(); | ||
| }); | ||
| }, [commentEditor?.annotationId, commentEditor?.mode]); |
There was a problem hiding this comment.
🟢 Low components/PlanReviewPanel.tsx:174
When a user opens the comment editor, selects different text, and clicks Comment again, the useEffect at line 174-181 does not re-run because both commentEditor?.annotationId (still undefined) and commentEditor?.mode (still "create") are unchanged. The textarea fails to auto-focus even though the editor now contains a new quote. Consider adding commentEditor?.quote to the dependency array so the effect triggers whenever the quote changes.
useEffect(() => {
if (!commentEditor) {
return;
}
window.requestAnimationFrame(() => {
commentTextareaRef.current?.focus();
});
- }, [commentEditor?.annotationId, commentEditor?.mode]);
+ }, [commentEditor?.annotationId, commentEditor?.mode, commentEditor?.quote]);🤖 Copy this AI Prompt to have your agent fix this:
In file apps/web/src/components/PlanReviewPanel.tsx around lines 174-181:
When a user opens the comment editor, selects different text, and clicks Comment again, the `useEffect` at line 174-181 does not re-run because both `commentEditor?.annotationId` (still `undefined`) and `commentEditor?.mode` (still `"create"`) are unchanged. The textarea fails to auto-focus even though the editor now contains a new quote. Consider adding `commentEditor?.quote` to the dependency array so the effect triggers whenever the quote changes.
Evidence trail:
apps/web/src/components/PlanReviewPanel.tsx lines 29-38 (CommentEditorState interface: mode, quote, annotationId?, comment, position?), lines 160-172 (handleStartComment: sets commentEditor with mode='create', no annotationId), lines 174-181 (useEffect with deps [commentEditor?.annotationId, commentEditor?.mode] — both remain [undefined, 'create'] on re-open), line 179 (only .focus() call for commentTextareaRef), lines 240-256 (Textarea has no autoFocus prop, ref={commentTextareaRef}).
ApprovabilityVerdict: Needs human review This PR introduces a new plan review annotations feature with new UI components and workflows. New features introducing user-facing behavior warrant human review. Additionally, there are unresolved medium-severity bugs (annotations not cleared after review, popup positioning issues) that should be addressed. You can customize Macroscope's approvability policy. Learn more. |


What Changed
Why
Original prompt to Claude:
> quotation commentAdditional context
Right now my main issue when going through the plan is that I think of edit as an editorial process in which you read what's there and you just want to inline on it or check some of the other details. The problem as of now is that it continues to feel like a simple text chat experience instead of an improvement of a review process which the planning phase should also be
UI Changes
Screen.Recording.2026-05-29.at.3.38.36.PM.mov
Note
Low Risk
Client-only UI and composer draft formatting; no server persistence or auth changes.
Overview
Adds an inline plan review flow in the existing plan right panel (desktop sidebar and mobile sheet): users open review from proposed-plan cards, the plan sidebar, or timeline cards, select plan text, attach comments, then Done merges feedback into the composer as blockquoted excerpts plus comments for plan refinement.
Introduces
PlanReviewPanelwith selection-based commenting, a comments list (edit/delete), andproposedPlanReviewhelpers to normalize selections and format/append that markdown. Review state and annotations stay client-side and reset when the thread changes; sidebar open/close is preserved when entering and leaving review.Reviewed by Cursor Bugbot for commit 52f5740. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add plan review annotations flow to proposed plan cards
PlanReviewPanelcomponent that renders plan markdown with text-selection-driven comment creation, allowing users to quote sections and attach comments as annotations.ProposedPlanCardandPlanSidebarthat opens the review panel in place of the plan sidebar inChatView.proposedPlanReview.tswith utilities for normalizing selection text, formatting quoted comments, and appending feedback to an existing draft.📊 Macroscope summarized 52f5740. 8 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.