From d83f5fec8366b48eca2a440ddc7168b1ea1c7c9a Mon Sep 17 00:00:00 2001 From: Adeniji Adekunle James Date: Mon, 6 Oct 2025 20:55:21 +0100 Subject: [PATCH] fix: show dyad-command buttons within assistant responses instead of hiding tags (#1421) (#1432) ### Problem Users were confused because `` tags were being hidden, making it unclear what actions were available. ### Solution Render dyad-command tags as visible buttons, so users can see and interact with available commands (e.g., "restart"). Closes #1421 --- ## Summary by cubic Show dyad-command tags as visible buttons in assistant responses so users can see and trigger actions (e.g., restart). Closes #1421. - **Bug Fixes** - Render dyad-command tags to buttons in DyadMarkdownParser. - Export mapActionToButton from ChatInput for reuse. - Support id/action/path attributes; safely no-op if parsing fails. --- src/components/chat/ChatInput.tsx | 2 +- src/components/chat/DyadMarkdownParser.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsx index a1b0d05..53cb9e3 100644 --- a/src/components/chat/ChatInput.tsx +++ b/src/components/chat/ChatInput.tsx @@ -556,7 +556,7 @@ function KeepGoingButton() { ); } -function mapActionToButton(action: SuggestedAction) { +export function mapActionToButton(action: SuggestedAction) { switch (action.id) { case "summarize-in-new-chat": return ; diff --git a/src/components/chat/DyadMarkdownParser.tsx b/src/components/chat/DyadMarkdownParser.tsx index ba2c663..2c2596a 100644 --- a/src/components/chat/DyadMarkdownParser.tsx +++ b/src/components/chat/DyadMarkdownParser.tsx @@ -22,6 +22,8 @@ import { DyadMcpToolResult } from "./DyadMcpToolResult"; import { DyadWebSearchResult } from "./DyadWebSearchResult"; import { DyadWebSearch } from "./DyadWebSearch"; import { DyadRead } from "./DyadRead"; +import { mapActionToButton } from "./ChatInput"; +import { SuggestedAction } from "@/lib/schemas"; interface DyadMarkdownParserProps { content: string; @@ -498,7 +500,12 @@ function renderCustomTag( return null; case "dyad-command": - // Don't render anything for dyad-command + if (attributes.type) { + const action = { + id: attributes.type, + } as SuggestedAction; + return <>{mapActionToButton(action)}; + } return null; default: