From f1b57f53d3c2139efef2ce717a20ee24b9eb8c5d Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Tue, 2 Jun 2026 20:50:08 +0300 Subject: [PATCH] fix: mobile diff comment input placeholder and review comments pill Use a shorter comment placeholder on mobile (drop the Cmd+Enter hint that has no touch equivalent) so it no longer clips in the auto-sized textarea. Add a remove (x) button to the review comments pill, matching the annotation and dev-server-log pills, and stop the mobile touch-target min-height/width from inflating the pill close buttons. --- packages/ui/src/components/chat/ChatInput.tsx | 23 +++++++++++++++++++ .../comments/InlineCommentInput.tsx | 2 +- packages/ui/src/lib/i18n/messages/en.ts | 2 ++ packages/ui/src/lib/i18n/messages/es.ts | 2 ++ packages/ui/src/lib/i18n/messages/ko.ts | 2 ++ packages/ui/src/lib/i18n/messages/pl.ts | 2 ++ packages/ui/src/lib/i18n/messages/pt-BR.ts | 2 ++ packages/ui/src/lib/i18n/messages/uk.ts | 2 ++ packages/ui/src/lib/i18n/messages/zh-CN.ts | 2 ++ packages/ui/src/lib/i18n/messages/zh-TW.ts | 2 ++ 10 files changed, 40 insertions(+), 1 deletion(-) 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