diff --git a/apps/apollo-vertex/registry.json b/apps/apollo-vertex/registry.json index b5d85c435..baf2690b8 100644 --- a/apps/apollo-vertex/registry.json +++ b/apps/apollo-vertex/registry.json @@ -443,6 +443,11 @@ "type": "registry:ui", "target": "components/ui/ai-chat/components/ai-chat-message-actions.tsx" }, + { + "path": "registry/ai-chat/components/ai-chat-selection-menu.tsx", + "type": "registry:ui", + "target": "components/ui/ai-chat/components/ai-chat-selection-menu.tsx" + }, { "path": "registry/ai-chat/components/ai-chat-thinking.tsx", "type": "registry:ui", diff --git a/apps/apollo-vertex/registry/ai-chat/components/ai-chat-input.tsx b/apps/apollo-vertex/registry/ai-chat/components/ai-chat-input.tsx index d8df47b38..45c93514a 100644 --- a/apps/apollo-vertex/registry/ai-chat/components/ai-chat-input.tsx +++ b/apps/apollo-vertex/registry/ai-chat/components/ai-chat-input.tsx @@ -8,12 +8,12 @@ import { type FormEvent, type KeyboardEvent, type Ref, - createPortal, useEffect, useImperativeHandle, useRef, useState, } from "react"; +import { createPortal } from "react-dom"; import { useTranslation } from "react-i18next"; import { DropdownMenu, @@ -65,6 +65,10 @@ interface AiChatInputProps { placeholder?: string; hasMessages?: boolean; maxLength?: number; + /** Pre-filled quoted text shown as a chip above the input */ + quotedText?: string; + /** Called when the user dismisses the quoted text chip */ + onClearQuote?: () => void; ref?: Ref; } @@ -82,6 +86,8 @@ export function AiChatInput({ placeholder, hasMessages = false, maxLength, + quotedText, + onClearQuote, ref, }: AiChatInputProps) { const { t } = useTranslation(); @@ -246,6 +252,22 @@ export function AiChatInput({ ) : null; + const quoteChip = quotedText ? ( +
+
+ {quotedText} + +
+
+ ) : null; + const plusMenu = ( @@ -341,6 +363,7 @@ export function AiChatInput({ {hasMessages ? (
+ {quoteChip} {fileChips}
{plusMenu} @@ -362,6 +385,7 @@ export function AiChatInput({ ) : (
+ {quoteChip} {fileChips}