Skip to content

Commit fa691df

Browse files
committed
refactor(ui): clean up components and improve thinking widget design
- Remove debug console.log from StreamMessage component - Simplify ThinkingWidget by removing unused signature parameter - Update ThinkingWidget color scheme from purple to gray for subtlety - Add italic styling to thinking content for better visual distinction - Trim whitespace from thinking content display - Streamline ThinkingWidget layout by removing unnecessary prose wrapper
1 parent 0a70ac0 commit fa691df

File tree

2 files changed

+14
-27
lines changed

2 files changed

+14
-27
lines changed

src/components/StreamMessage.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,6 @@ const StreamMessageComponent: React.FC<StreamMessageProps> = ({ message, classNa
7575
return toolResults.get(toolId) || null;
7676
};
7777

78-
// Debug logging to understand message structure
79-
console.log('[StreamMessage] Rendering message:', {
80-
type: message.type,
81-
hasMessage: !!message.message,
82-
messageStructure: message.message ? Object.keys(message.message) : 'no message field',
83-
fullMessage: message
84-
});
85-
8678
try {
8779
// Skip rendering for meta messages that don't have meaningful content
8880
if (message.isMeta && !message.leafUuid && !message.summary) {

src/components/ToolWidgets.tsx

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,43 +1877,38 @@ export const TaskWidget: React.FC<{
18771877
export const ThinkingWidget: React.FC<{
18781878
thinking: string;
18791879
signature?: string;
1880-
}> = ({ thinking, signature }) => {
1880+
}> = ({ thinking }) => {
18811881
const [isExpanded, setIsExpanded] = useState(false);
18821882

1883+
// Strip whitespace from thinking content
1884+
const trimmedThinking = thinking.trim();
1885+
18831886
return (
1884-
<div className="rounded-lg border border-purple-500/20 bg-gradient-to-br from-purple-500/5 to-violet-500/5 overflow-hidden">
1887+
<div className="rounded-lg border border-gray-500/20 bg-gray-500/5 overflow-hidden">
18851888
<button
18861889
onClick={() => setIsExpanded(!isExpanded)}
1887-
className="w-full px-4 py-3 flex items-center justify-between hover:bg-purple-500/10 transition-colors"
1890+
className="w-full px-4 py-3 flex items-center justify-between hover:bg-gray-500/10 transition-colors"
18881891
>
18891892
<div className="flex items-center gap-2">
18901893
<div className="relative">
1891-
<Bot className="h-4 w-4 text-purple-500" />
1892-
<Sparkles className="h-2.5 w-2.5 text-purple-400 absolute -top-1 -right-1 animate-pulse" />
1894+
<Bot className="h-4 w-4 text-gray-500" />
1895+
<Sparkles className="h-2.5 w-2.5 text-gray-400 absolute -top-1 -right-1 animate-pulse" />
18931896
</div>
1894-
<span className="text-sm font-medium text-purple-600 dark:text-purple-400">
1897+
<span className="text-sm font-medium text-gray-600 dark:text-gray-400 italic">
18951898
Thinking...
18961899
</span>
18971900
</div>
18981901
<ChevronRight className={cn(
1899-
"h-4 w-4 text-purple-500 transition-transform",
1902+
"h-4 w-4 text-gray-500 transition-transform",
19001903
isExpanded && "rotate-90"
19011904
)} />
19021905
</button>
19031906

19041907
{isExpanded && (
1905-
<div className="px-4 pb-4 pt-2 space-y-3 border-t border-purple-500/20">
1906-
<div className="prose prose-sm dark:prose-invert max-w-none">
1907-
<pre className="text-xs font-mono text-purple-700 dark:text-purple-300 whitespace-pre-wrap bg-purple-500/5 p-3 rounded-lg">
1908-
{thinking}
1909-
</pre>
1910-
</div>
1911-
1912-
{signature && (
1913-
<div className="text-xs text-purple-600/60 dark:text-purple-400/60 font-mono truncate">
1914-
Signature: {signature.slice(0, 16)}...
1915-
</div>
1916-
)}
1908+
<div className="px-4 pb-4 pt-2 border-t border-gray-500/20">
1909+
<pre className="text-xs font-mono text-gray-600 dark:text-gray-400 whitespace-pre-wrap bg-gray-500/5 p-3 rounded-lg italic">
1910+
{trimmedThinking}
1911+
</pre>
19171912
</div>
19181913
)}
19191914
</div>

0 commit comments

Comments
 (0)