diff --git a/packages/ui/src/components/chat/ChatInput.tsx b/packages/ui/src/components/chat/ChatInput.tsx index a2b7cace..059c5d73 100644 --- a/packages/ui/src/components/chat/ChatInput.tsx +++ b/packages/ui/src/components/chat/ChatInput.tsx @@ -1394,6 +1394,17 @@ const ChatInputComponent: React.FC = ({ onOpenSettings, scrollTo } } }, [currentSessionId, newSessionDraftOpen, removeInlineCommentDraft]); + // Review comments are the inline-comment drafts that aren't preview sources. + const removeReviewDrafts = React.useCallback(() => { + const sessionKey = currentSessionId ?? (newSessionDraftOpen ? 'draft' : ''); + if (!sessionKey) return; + const drafts = useInlineCommentDraftStore.getState().drafts[sessionKey] ?? []; + for (const draft of drafts) { + if (draft.source !== 'preview-console' && draft.source !== 'preview-annotation') { + removeInlineCommentDraft(sessionKey, draft.id); + } + } + }, [currentSessionId, newSessionDraftOpen, removeInlineCommentDraft]); // User message history for up/down arrow navigation. // Keep this on a narrow hook instead of full session message records. @@ -3973,6 +3984,16 @@ const ChatInputComponent: React.FC = ({ onOpenSettings, scrollTo > {t('chat.chatInput.reviewComments')} {reviewCount} + ) : null} {previewConsoleCount > 0 ? ( @@ -3988,6 +4009,7 @@ const ChatInputComponent: React.FC = ({ onOpenSettings, scrollTo