diff --git a/src/components/agent-inbox/components/inbox-item-input.tsx b/src/components/agent-inbox/components/inbox-item-input.tsx index e3f736b..804dae3 100644 --- a/src/components/agent-inbox/components/inbox-item-input.tsx +++ b/src/components/agent-inbox/components/inbox-item-input.tsx @@ -6,13 +6,17 @@ import { SubmitType, } from "../types"; import { Textarea } from "@/components/ui/textarea"; -import React from "react"; +import React, { useRef } from "react"; import { haveArgsChanged, prettifyText } from "../utils"; import { MarkdownText } from "@/components/ui/markdown-text"; import { Separator } from "@/components/ui/separator"; import { Button } from "@/components/ui/button"; import { CircleX, LoaderCircle, Undo2 } from "lucide-react"; import { useToast } from "@/hooks/use-toast"; +import { useAgentInboxShortcuts } from "@/hooks/use-keyboard-shortcuts"; + +// Assigning a CSS class for easy identification from keyboard shortcuts +const INBOX_ITEM_INPUT_CLASS = "InboxItemInput"; function ResetButton({ handleReset }: { handleReset: () => void }) { return ( @@ -89,6 +93,7 @@ function ResponseComponent({ interruptValue, onResponseChange, handleSubmit, + responseInputRef, }: { humanResponse: HumanResponseWithEdits[]; streaming: boolean; @@ -98,6 +103,7 @@ function ResponseComponent({ handleSubmit: ( e: React.MouseEvent | React.KeyboardEvent ) => Promise; + responseInputRef?: React.RefObject; }) { const res = humanResponse.find((r) => r.type === "response"); if (!res || typeof res.args !== "string") { @@ -131,6 +137,7 @@ function ResponseComponent({

Response