From 00acc57161083ba8608677c38868310dfe20a54f Mon Sep 17 00:00:00 2001 From: simos Date: Sat, 12 Jul 2025 21:43:47 +0000 Subject: [PATCH] Formatting properly exit_plan_mose --- src/components/ChatInterface.jsx | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/src/components/ChatInterface.jsx b/src/components/ChatInterface.jsx index b0caae7..f730153 100755 --- a/src/components/ChatInterface.jsx +++ b/src/components/ChatInterface.jsx @@ -451,6 +451,32 @@ const MessageComponent = memo(({ message, index, prevMessage, createDiff, onFile } } + // Special handling for exit_plan_mode tool + if (message.toolName === 'exit_plan_mode') { + try { + const input = JSON.parse(message.toolInput); + if (input.plan) { + // Replace escaped newlines with actual newlines + const planContent = input.plan.replace(/\\n/g, '\n'); + return ( +
+ + + + + 📋 View implementation plan + +
+ {planContent} +
+
+ ); + } + } catch (e) { + // Fall back to regular display + } + } + // Regular tool input display for other tools return (
@@ -537,6 +563,30 @@ const MessageComponent = memo(({ message, index, prevMessage, createDiff, onFile } } + // Special handling for exit_plan_mode tool results + if (message.toolName === 'exit_plan_mode') { + try { + // The content should be JSON with a "plan" field + const parsed = JSON.parse(content); + if (parsed.plan) { + // Replace escaped newlines with actual newlines + const planContent = parsed.plan.replace(/\\n/g, '\n'); + return ( +
+
+ Implementation Plan +
+
+ {planContent} +
+
+ ); + } + } catch (e) { + // Fall through to regular handling + } + } + // Special handling for interactive prompts if (content.includes('Do you want to proceed?') && message.toolName === 'Bash') { const lines = content.split('\n');