Skip to content

Build your personal knowledge base with Trilium Notes

style(llm): let a tool call's name lead its line and its parameters recede

Elian Doran7aa80032ffd7
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index c8890673c9..f30207fe78 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2661,8 +2661,8 @@
},
"show_tool_call_details": "Show input and output",
"tool_call_no_result": "No result yet.",
- "search_notes_count_one": "{{count}} note",
- "search_notes_count_other": "{{count}} notes",
+ "search_notes_count_one": "({{count}} note)",
+ "search_notes_count_other": "({{count}} notes)",
"search_notes_limited_one": "{{count}} total result, limited to {{limit}}",
"search_notes_limited_other": "{{count}} total results, limited to {{limit}}",
"search_notes_scope": "Searched in <Note/>"
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/ExpandableCard.css b/apps/client/src/widgets/type_widgets/llm_chat/ExpandableCard.css
index 51c534dafe..447cb60bee 100644
--- a/apps/client/src/widgets/type_widgets/llm_chat/ExpandableCard.css
+++ b/apps/client/src/widgets/type_widgets/llm_chat/ExpandableCard.css
@@ -86,6 +86,11 @@
font-size: 1rem;
margin-left: 0;
}
+
+ /* Smaller text in the label, such as a tool call's query, sits on the label's baseline. */
+ > .expandable-section-label {
+ align-items: baseline;
+ }
}
/* `:where()` keeps the hover below a variant's own color, such as an errored tool call's. */
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/ToolCallCard.css b/apps/client/src/widgets/type_widgets/llm_chat/ToolCallCard.css
index bf634687dc..8a3e6372cf 100644
--- a/apps/client/src/widgets/type_widgets/llm_chat/ToolCallCard.css
+++ b/apps/client/src/widgets/type_widgets/llm_chat/ToolCallCard.css
@@ -3,9 +3,17 @@
margin: 0.25rem 0;
}
-.llm-chat-tool-call-detail {
+/* The name reads stronger than the line and its parameters fainter. Both derive from the inherited
+ color, so they follow the summary's hover. */
+.llm-chat-tool-call:not(.llm-chat-tool-call-error) > :is(.expandable-section-summary, .expandable-line-header) .llm-chat-tool-call-name {
+ color: color-mix(in srgb, currentColor, var(--main-text-color) 45%);
+}
+
+.llm-chat-tool-call-detail,
+.llm-chat-tool-call-result-count {
+ font-size: 0.75rem;
font-weight: 400;
- color: var(--muted-text-color);
+ opacity: 0.75;
}
.llm-chat-tool-call-count {
@@ -81,8 +89,3 @@
@keyframes llm-chat-tool-call-caret {
50% { opacity: 0; }
}
-
-.llm-chat-tool-call-result-count {
- font-size: 0.75rem;
- opacity: 0.8;
-}
diff --git a/apps/client/src/widgets/type_widgets/llm_chat/ToolCallCard.tsx b/apps/client/src/widgets/type_widgets/llm_chat/ToolCallCard.tsx
index 492895bd26..ec169e56e7 100644
--- a/apps/client/src/widgets/type_widgets/llm_chat/ToolCallCard.tsx
+++ b/apps/client/src/widgets/type_widgets/llm_chat/ToolCallCard.tsx
@@ -94,7 +94,7 @@ function ToolCallLabel({ toolCall, summary }: { toolCall: ToolCall; summary?: st
return (
<>
- {t(`llm.tools.${toolCall.toolName}`, { defaultValue: toolCall.toolName })}
+ <span className="llm-chat-tool-call-name">{t(`llm.tools.${toolCall.toolName}`, { defaultValue: toolCall.toolName })}</span>
{detailText && (
<span className="llm-chat-tool-call-detail">{detailText}</span>
)}
@@ -200,7 +200,7 @@ function ToolCallGroupSection({ toolCalls }: { toolCalls: ToolCall[] }) {
const friendlyName = t(`llm.tools.${first.toolName}`, { defaultValue: first.toolName });
const label = (
<>
- {friendlyName}
+ <span className="llm-chat-tool-call-name">{friendlyName}</span>
<span className="llm-chat-tool-call-count">×{toolCalls.length}</span>
{anyError && <span className="llm-chat-tool-call-error-badge">{t("llm_chat.tool_error")}</span>}
</>