1- import { type RuntimeRequestId } from "@t3tools/contracts" ;
1+ import { type RuntimeRequestId , type ScopedThreadRef } from "@t3tools/contracts" ;
22import { memo , useCallback , useEffect , useRef , useState } from "react" ;
33import { type PendingUserInput } from "../../session-logic" ;
44import {
@@ -9,9 +9,13 @@ import { CheckIcon } from "lucide-react";
99import { Collapsible , CollapsiblePanel , CollapsibleTrigger } from "../ui/collapsible" ;
1010import { cn } from "~/lib/utils" ;
1111import { ComposerBanner } from "./ComposerBanner" ;
12+ import ChatMarkdown from "../ChatMarkdown" ;
1213
1314interface PendingUserInputPanelProps {
1415 pendingUserInputs : PendingUserInput [ ] ;
16+ /** Resolves file links in the question text. */
17+ cwd : string | undefined ;
18+ threadRef : ScopedThreadRef ;
1519 disabled ?: boolean ;
1620 respondingRequestIds : RuntimeRequestId [ ] ;
1721 answers : Record < string , PendingUserInputDraftAnswer > ;
@@ -23,6 +27,8 @@ interface PendingUserInputPanelProps {
2327
2428export const ComposerPendingUserInputPanel = memo ( function ComposerPendingUserInputPanel ( {
2529 pendingUserInputs,
30+ cwd,
31+ threadRef,
2632 disabled = false ,
2733 respondingRequestIds,
2834 answers,
@@ -39,6 +45,8 @@ export const ComposerPendingUserInputPanel = memo(function ComposerPendingUserIn
3945 < ComposerPendingUserInputCard
4046 key = { activePrompt . requestId }
4147 prompt = { activePrompt }
48+ cwd = { cwd }
49+ threadRef = { threadRef }
4250 disabled = { disabled }
4351 isResponding = { respondingRequestIds . includes ( activePrompt . requestId ) }
4452 answers = { answers }
@@ -52,6 +60,8 @@ export const ComposerPendingUserInputPanel = memo(function ComposerPendingUserIn
5260
5361const ComposerPendingUserInputCard = memo ( function ComposerPendingUserInputCard ( {
5462 prompt,
63+ cwd,
64+ threadRef,
5565 disabled,
5666 isResponding,
5767 answers,
@@ -61,6 +71,8 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
6171 onDismiss,
6272} : {
6373 prompt : PendingUserInput ;
74+ cwd : string | undefined ;
75+ threadRef : ScopedThreadRef ;
6476 disabled : boolean ;
6577 isResponding : boolean ;
6678 answers : Record < string , PendingUserInputDraftAnswer > ;
@@ -242,7 +254,12 @@ const ComposerPendingUserInputCard = memo(function ComposerPendingUserInputCard(
242254 < CollapsiblePanel >
243255 < ComposerBanner . Scroll >
244256 < ComposerBanner . Body className = "pe-1 pb-1 wrap-anywhere" >
245- < p className = "text-sm text-foreground/85" > { activeQuestion . question } </ p >
257+ < ChatMarkdown
258+ text = { activeQuestion . question }
259+ cwd = { cwd }
260+ threadRef = { threadRef }
261+ className = "text-foreground/85"
262+ />
246263 { activeQuestion . multiSelect ? (
247264 < p className = "mt-1 text-secondary-label text-xs" > Select one or more options.</ p >
248265 ) : null }
0 commit comments