feat: enhance assistant status messages with more variants

This commit is contained in:
Bohdan Triapitsyn
2025-12-19 13:49:03 +02:00
parent f8b9ded3a4
commit 21139ba61f
+45 -3
View File
@@ -210,12 +210,54 @@ export function useAssistantStatus(): AssistantStatusSnapshot {
}
}
const TOOL_STATUS_PHRASES: Record<string, string> = {
read: 'reading file',
write: 'writing file',
edit: 'editing file',
multiedit: 'editing files',
bash: 'running command',
grep: 'searching content',
glob: 'finding files',
list: 'listing directory',
task: 'delegating task',
webfetch: 'fetching URL',
websearch: 'searching web',
codesearch: 'web code search',
todowrite: 'updating todos',
todoread: 'reading todos',
};
const WORKING_PHRASES = [
'working',
'processing',
'preparing',
'warming up',
'gears turning',
'computing',
'calculating',
'analyzing',
'wheels spinning',
'calibrating',
'synthesizing',
'connecting dots',
'inspecting logic',
'weighing options',
];
const getToolStatusPhrase = (toolName: string): string => {
return TOOL_STATUS_PHRASES[toolName] ?? `using ${toolName}`;
};
const getRandomWorkingPhrase = (): string => {
return WORKING_PHRASES[Math.floor(Math.random() * WORKING_PHRASES.length)];
};
const statusText = (() => {
if (activePartType === 'editing') return 'editing';
if (activePartType === 'tool' && activeToolName) return `using ${activeToolName}`;
if (activePartType === 'editing') return 'editing file';
if (activePartType === 'tool' && activeToolName) return getToolStatusPhrase(activeToolName);
if (activePartType === 'reasoning') return 'thinking';
if (activePartType === 'text') return 'composing';
return 'working';
return getRandomWorkingPhrase();
})();
return { activePartType, activeToolName, statusText };