Skip to content

Commit 3668af9

Browse files
committed
feat(web): enhance PromptSection with markdown rendering and cwd support
1 parent c916d11 commit 3668af9

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

apps/web/src/components/chat/SubagentDetailDrawer.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,19 @@ const ProgressTimeline = memo(function ProgressTimeline(props: { task: AgentTask
277277
);
278278
});
279279

280-
const PromptSection = memo(function PromptSection(props: { prompt: string }) {
280+
const PromptSection = memo(function PromptSection(props: {
281+
prompt: string;
282+
markdownCwd: string | undefined;
283+
}) {
281284
return (
282285
<Section
283286
label="Prompt"
284287
icon={<MessageSquareTextIcon className="size-3.5" />}
285288
copyText={props.prompt}
286289
>
287-
<pre className="whitespace-pre-wrap break-words rounded-lg bg-muted/40 p-3 font-mono text-xs leading-relaxed text-foreground/80">
288-
{props.prompt}
289-
</pre>
290+
<div className="rounded-lg bg-muted/40 p-3 text-sm">
291+
<ChatMarkdown text={props.prompt} cwd={props.markdownCwd} />
292+
</div>
290293
</Section>
291294
);
292295
});
@@ -429,7 +432,7 @@ export const SubagentDetailDrawer = memo(function SubagentDetailDrawer(
429432
<DrawerHeader task={task} />
430433
<SheetPanel>
431434
<div className="space-y-6">
432-
{task.prompt && <PromptSection prompt={task.prompt} />}
435+
{task.prompt && <PromptSection prompt={task.prompt} markdownCwd={markdownCwd} />}
433436
<ProgressTimeline task={task} />
434437
<ResponseSection
435438
response={task.response}

0 commit comments

Comments
 (0)