Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(llm): improve tool call style slightly
Elian Doran55df50253f8d
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsx b/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsxindex dc10c40d75..99a856fbd6 100644--- a/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsx+++ b/apps/client/src/widgets/type_widgets/llm_chat/ChatMessage.tsx@@ -30,6 +30,12 @@ interface Props {isStreaming?: boolean;}+function toolCallIcon(toolCall: ToolCall): string {+ if (toolCall.isError) return "bx bx-error-circle";+ if (toolCall.result) return "bx bx-check";+ return "bx bx-loader-alt bx-spin";+}+function ToolCallCard({ toolCall }: { toolCall: ToolCall }) {const classes = ["llm-chat-tool-call-inline",@@ -39,7 +45,7 @@ function ToolCallCard({ toolCall }: { toolCall: ToolCall }) {return (<details className={classes}><summary className="llm-chat-tool-call-inline-summary">- <span className={toolCall.isError ? "bx bx-error-circle" : "bx bx-wrench"} />+ <span className={toolCallIcon(toolCall)} />{t(`llm.tools.${toolCall.toolName}`, { defaultValue: toolCall.toolName })}{toolCall.isError && <span className="llm-chat-tool-call-error-badge">{t("llm_chat.tool_error")}</span>}</summary>diff --git a/apps/client/src/widgets/type_widgets/llm_chat/LlmChat.css b/apps/client/src/widgets/type_widgets/llm_chat/LlmChat.cssindex 567949e556..10fc2ccfe4 100644--- a/apps/client/src/widgets/type_widgets/llm_chat/LlmChat.css+++ b/apps/client/src/widgets/type_widgets/llm_chat/LlmChat.css@@ -514,7 +514,6 @@font-weight: 600;margin-bottom: 0.5rem;color: var(--main-text-color);- font-family: var(--monospace-font-family, monospace);}.llm-chat-tool-call-input,@@ -542,12 +541,11 @@overflow-y: auto;}-/* Inline tool call cards (timeline style) */+/* Inline tool call cards */.llm-chat-tool-call-inline {margin: 0.5rem 0;- background: var(--accented-background-color);- border-radius: 6px;- border-left: 3px solid var(--muted-text-color);+ border: 1px solid var(--main-border-color);+ border-radius: 8px;font-size: 0.85rem;}@@ -560,7 +558,6 @@list-style: none;font-weight: 500;color: var(--muted-text-color);- font-family: var(--monospace-font-family, monospace);}.llm-chat-tool-call-inline-summary::-webkit-details-marker {@@ -610,7 +607,7 @@/* Tool call error styling */.llm-chat-tool-call-error {- border-left-color: var(--danger-color, #dc3545);+ border-color: var(--danger-color, #dc3545);}.llm-chat-tool-call-error .llm-chat-tool-call-inline-summary {@@ -620,7 +617,6 @@.llm-chat-tool-call-error-badge {font-size: 0.75rem;font-weight: 400;- font-family: var(--main-font-family);color: var(--danger-color, #dc3545);opacity: 0.8;}