From ac3d2d6cec5cec2ad6f531670f4ee3b1aefb8ae1 Mon Sep 17 00:00:00 2001 From: Ammar Date: Fri, 12 Dec 2025 12:38:49 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20fix:=20improve=20review=20UI=20v?= =?UTF-8?q?isual=20hierarchy=20and=20add=20action=20buttons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix section header styling in ReviewsBanner (remove font-medium/uppercase) - Add complete/detach/trash buttons to attached reviews in ChatInput - Trash button separated with margin as destructive action - Add onCheckReview and onDeleteReview callbacks to ChatInput types _Generated with mux_ --- src/browser/components/AIView.tsx | 2 + src/browser/components/ChatInput/index.tsx | 8 ++- src/browser/components/ChatInput/types.ts | 6 +- src/browser/components/ReviewsBanner.tsx | 8 +-- src/browser/components/shared/ReviewBlock.tsx | 65 +++++++++++++++---- 5 files changed, 67 insertions(+), 22 deletions(-) diff --git a/src/browser/components/AIView.tsx b/src/browser/components/AIView.tsx index cede3ad6a1..728c77ad82 100644 --- a/src/browser/components/AIView.tsx +++ b/src/browser/components/AIView.tsx @@ -749,7 +749,9 @@ const AIViewInner: React.FC = ({ attachedReviews={reviews.attachedReviews} onDetachReview={reviews.detachReview} onDetachAllReviews={reviews.detachAllAttached} + onCheckReview={reviews.checkReview} onCheckReviews={handleCheckReviews} + onDeleteReview={reviews.removeReview} onUpdateReviewNote={reviews.updateReviewNote} /> diff --git a/src/browser/components/ChatInput/index.tsx b/src/browser/components/ChatInput/index.tsx index 77505b7ab5..67ae836050 100644 --- a/src/browser/components/ChatInput/index.tsx +++ b/src/browser/components/ChatInput/index.tsx @@ -1420,9 +1420,15 @@ const ChatInputInner: React.FC = (props) => { props.onCheckReview!(review.id) : undefined + } + onDetach={ props.onDetachReview ? () => props.onDetachReview!(review.id) : undefined } + onDelete={ + props.onDeleteReview ? () => props.onDeleteReview!(review.id) : undefined + } onEditComment={ props.onUpdateReviewNote ? (newNote) => props.onUpdateReviewNote!(review.id, newNote) diff --git a/src/browser/components/ChatInput/types.ts b/src/browser/components/ChatInput/types.ts index 00d48fc403..ca21c0cc9b 100644 --- a/src/browser/components/ChatInput/types.ts +++ b/src/browser/components/ChatInput/types.ts @@ -36,8 +36,12 @@ export interface ChatInputWorkspaceVariant { onDetachReview?: (reviewId: string) => void; /** Detach all attached reviews from chat input */ onDetachAllReviews?: () => void; - /** Mark reviews as checked after sending */ + /** Mark a single review as checked (completed) */ + onCheckReview?: (reviewId: string) => void; + /** Mark multiple reviews as checked after sending */ onCheckReviews?: (reviewIds: string[]) => void; + /** Permanently delete a review */ + onDeleteReview?: (reviewId: string) => void; /** Update a review's comment/note */ onUpdateReviewNote?: (reviewId: string, newNote: string) => void; } diff --git a/src/browser/components/ReviewsBanner.tsx b/src/browser/components/ReviewsBanner.tsx index 8e65953a3d..71ae9f0c74 100644 --- a/src/browser/components/ReviewsBanner.tsx +++ b/src/browser/components/ReviewsBanner.tsx @@ -407,9 +407,7 @@ const ReviewsBannerInner: React.FC = ({ workspaceId }) {pendingList.length > 0 && (
-
- Pending ({pendingList.length}) -
+
Pending ({pendingList.length})
{pendingList.length > 1 && ( + )} + {onDetach && ( + + )} {filePath}:{lineRange} - {onRemove && ( + {/* Destructive action on right */} + {onDelete && ( )}
@@ -183,8 +212,12 @@ const ReviewBlockCore: React.FC = ({ interface ReviewBlockFromDataProps { /** Structured review data (no parsing needed) */ data: ReviewNoteDataForDisplay; - /** Optional callback to remove the review */ - onRemove?: () => void; + /** Detach from chat (sets status back to pending) */ + onDetach?: () => void; + /** Mark as complete (checked) */ + onComplete?: () => void; + /** Permanently delete the review */ + onDelete?: () => void; /** Optional callback to edit the comment */ onEditComment?: (newComment: string) => void; } @@ -195,7 +228,9 @@ interface ReviewBlockFromDataProps { */ export const ReviewBlockFromData: React.FC = ({ data, - onRemove, + onDetach, + onComplete, + onDelete, onEditComment, }) => { return ( @@ -204,7 +239,9 @@ export const ReviewBlockFromData: React.FC = ({ lineRange={data.lineRange} code={data.selectedCode} comment={data.userNote} - onRemove={onRemove} + onDetach={onDetach} + onComplete={onComplete} + onDelete={onDelete} onEditComment={onEditComment} /> );