mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-12 21:29:47 +00:00
Label Todos
This commit is contained in:
@@ -580,7 +580,7 @@ class ClaudeChatProvider {
|
|||||||
const toolName = lastToolUse?.data?.toolName;
|
const toolName = lastToolUse?.data?.toolName;
|
||||||
|
|
||||||
// Don't send tool result for Read and Edit tools unless there's an error
|
// Don't send tool result for Read and Edit tools unless there's an error
|
||||||
if ((toolName === 'Read' || toolName === 'Edit') && !isError) {
|
if ((toolName === 'Read' || toolName === 'Edit' || toolName === 'TodoWrite') && !isError) {
|
||||||
// Still send to UI to hide loading state, but mark it as hidden
|
// Still send to UI to hide loading state, but mark it as hidden
|
||||||
this._sendAndSaveMessage({
|
this._sendAndSaveMessage({
|
||||||
type: 'toolResult',
|
type: 'toolResult',
|
||||||
|
|||||||
27
src/ui.ts
27
src/ui.ts
@@ -611,7 +611,12 @@ const html = `<!DOCTYPE html>
|
|||||||
|
|
||||||
const toolInfoElement = document.createElement('div');
|
const toolInfoElement = document.createElement('div');
|
||||||
toolInfoElement.className = 'tool-info';
|
toolInfoElement.className = 'tool-info';
|
||||||
toolInfoElement.textContent = data.toolInfo.replace('🔧 Executing: ', '');
|
let toolName = data.toolInfo.replace('🔧 Executing: ', '');
|
||||||
|
// Replace TodoWrite with more user-friendly name
|
||||||
|
if (toolName === 'TodoWrite') {
|
||||||
|
toolName = 'Update Todos';
|
||||||
|
}
|
||||||
|
toolInfoElement.textContent = toolName;
|
||||||
|
|
||||||
headerDiv.appendChild(iconDiv);
|
headerDiv.appendChild(iconDiv);
|
||||||
headerDiv.appendChild(toolInfoElement);
|
headerDiv.appendChild(toolInfoElement);
|
||||||
@@ -723,10 +728,19 @@ const html = `<!DOCTYPE html>
|
|||||||
|
|
||||||
function addToolResultMessage(data) {
|
function addToolResultMessage(data) {
|
||||||
// For Read and Edit tools with hidden flag, just hide loading state and show completion message
|
// For Read and Edit tools with hidden flag, just hide loading state and show completion message
|
||||||
if (data.hidden && (data.toolName === 'Read' || data.toolName === 'Edit') && !data.isError) {
|
if (data.hidden && (data.toolName === 'Read' || data.toolName === 'Edit' || data.toolName === 'TodoWrite') && !data.isError) {
|
||||||
// Show completion message
|
// Show completion message
|
||||||
const toolName = data.toolName;
|
const toolName = data.toolName;
|
||||||
const completionText = toolName === 'Read' ? '✅ Read completed' : '✅ Edit completed';
|
let completionText;
|
||||||
|
if (toolName === 'Read') {
|
||||||
|
completionText = '✅ Read completed';
|
||||||
|
} else if (toolName === 'Edit') {
|
||||||
|
completionText = '✅ Edit completed';
|
||||||
|
} else if (toolName === 'TodoWrite') {
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
completionText = '✅ ' + toolName + ' completed';
|
||||||
|
}
|
||||||
addMessage(completionText, 'system');
|
addMessage(completionText, 'system');
|
||||||
return; // Don't show the result message
|
return; // Don't show the result message
|
||||||
}
|
}
|
||||||
@@ -1512,14 +1526,7 @@ const html = `<!DOCTYPE html>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'toolResult':
|
case 'toolResult':
|
||||||
if (message.data.content.trim()) {
|
|
||||||
// Don't show result for TodoWrite tool (it's redundant with the tool execution display)
|
|
||||||
const isTodoWrite = message.data.content.includes('Todos have been modified successfully. Ensure that you continue to use the todo list to track your progress. Please proceed with the current tasks if applicable')
|
|
||||||
|
|
||||||
if (!isTodoWrite) {
|
|
||||||
addToolResultMessage(message.data);
|
addToolResultMessage(message.data);
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'thinking':
|
case 'thinking':
|
||||||
|
|||||||
Reference in New Issue
Block a user