Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

feat: inline note cards in chat, recording-style input indicators

Gabriel Stein84dca04a8174
diff --git a/src/components/agent/AgentInput.tsx b/src/components/agent/AgentInput.tsx
index b8ce2d6a4..99aebc208 100644
--- a/src/components/agent/AgentInput.tsx
+++ b/src/components/agent/AgentInput.tsx
@@ -77,27 +77,38 @@ function HotkeyKeys({ hotkey }: { hotkey: string }) {
);
}
-function WaveBars() {
+function RecordingIndicator() {
return (
- <div className="flex items-center justify-center gap-0.75 h-4">
- {[0, 1, 2].map((i) => (
- <div
- key={i}
- className="w-0.75 bg-primary/70 rounded-full origin-center"
- style={{
- animation: `waveform-bar 0.8s ease-in-out ${i * 0.15}s infinite`,
- height: "14px",
- }}
- />
- ))}
+ <div className="relative flex items-center justify-center w-5 h-5 shrink-0">
+ <div className="absolute inset-0 rounded-full border-2 border-primary/40 animate-pulse" />
+ <div className="w-2.5 h-2.5 rounded-full bg-primary" />
</div>
);
}
-function ThinkingBar() {
+function ProcessingIndicator() {
+ return (
+ <div className="flex items-center justify-center w-5 h-5 shrink-0">
+ <div className="flex items-center gap-0.5">
+ {[0, 1, 2, 3].map((i) => (
+ <div
+ key={i}
+ className="w-0.5 bg-accent rounded-full"
+ style={{
+ height: "8px",
+ animation: `waveform-bar 0.6s ease-in-out ${i * 0.1}s infinite`,
+ }}
+ />
+ ))}
+ </div>
+ </div>
+ );
+}
+
+function ThinkingIndicator() {
return (
<div
- className="w-12 h-0.75 rounded-full"
+ className="w-10 h-0.75 rounded-full shrink-0"
style={{
background: "linear-gradient(90deg, transparent, oklch(0.65 0.2 260 / 0.4), transparent)",
backgroundSize: "200% 100%",
@@ -189,7 +200,7 @@ export function AgentInput({
{agentState === "listening" && (
<>
- <WaveBars />
+ <RecordingIndicator />
<span className="text-[12px] text-foreground/80 truncate flex-1">
{partialTranscript || t("agentMode.input.listening")}
</span>
@@ -198,7 +209,7 @@ export function AgentInput({
{agentState === "transcribing" && (
<>
- <ThinkingBar />
+ <ProcessingIndicator />
<span className="text-[12px] text-muted-foreground select-none">
{t("agentMode.input.transcribing")}
</span>
@@ -207,7 +218,7 @@ export function AgentInput({
{(agentState === "thinking" || agentState === "streaming") && (
<>
- <ThinkingBar />
+ <ThinkingIndicator />
<span className="text-[12px] text-muted-foreground select-none">
{t("agentMode.input.thinking")}
</span>
@@ -216,7 +227,11 @@ export function AgentInput({
{agentState === "tool-executing" && (
<>
- {ToolIcon ? <ToolIcon size={12} className="text-primary/60 shrink-0" /> : <ThinkingBar />}
+ {ToolIcon ? (
+ <ToolIcon size={12} className="text-primary/60 shrink-0" />
+ ) : (
+ <ThinkingIndicator />
+ )}
<span className="text-[12px] text-muted-foreground select-none truncate">
{toolStatus || t("agentMode.input.thinking")}
</span>
diff --git a/src/components/agent/AgentMessage.tsx b/src/components/agent/AgentMessage.tsx
index 992cebb42..73524d0c9 100644
--- a/src/components/agent/AgentMessage.tsx
+++ b/src/components/agent/AgentMessage.tsx
@@ -46,32 +46,16 @@ function ToolCallStep({ toolCall }: { toolCall: ToolCallInfo }) {
const isCompleted = toolCall.status === "completed";
const isClipboard = toolCall.name === "copy_to_clipboard" && isCompleted;
- const noteId =
- isCompleted && NOTE_TOOLS.has(toolCall.name) && toolCall.metadata?.id
- ? Number(toolCall.metadata.id)
- : null;
-
const resultLines = toolCall.result?.split("\n") ?? [];
const hasDetail = resultLines.length > 1 && !isClipboard;
- const handleClick = () => {
- if (noteId) {
- window.electronAPI?.agentOpenNote?.(noteId);
- } else if (hasDetail && !isExecuting) {
- setExpanded((v) => !v);
- }
- };
-
- const isClickable = (noteId || hasDetail) && !isExecuting;
-
return (
<div
className={cn(
"relative rounded-md mb-1 overflow-hidden",
"border-l-2 transition-colors duration-300",
isExecuting && "border-l-primary/60",
- isCompleted && !isError && !noteId && "border-l-muted-foreground/20",
- isCompleted && !isError && noteId && "border-l-primary/30",
+ isCompleted && !isError && "border-l-muted-foreground/20",
isClipboard && "border-l-emerald-500/50",
isError && "border-l-destructive/50"
)}
@@ -87,10 +71,9 @@ function ToolCallStep({ toolCall }: { toolCall: ToolCallInfo }) {
className={cn(
"flex items-center gap-1.5 px-2.5 py-1.5",
"bg-surface-1/60",
- isClickable && "cursor-pointer",
- noteId && "hover:bg-surface-1 transition-colors duration-150"
+ hasDetail && !isExecuting && "cursor-pointer"
)}
- onClick={isClickable ? handleClick : undefined}
+ onClick={hasDetail && !isExecuting ? () => setExpanded((v) => !v) : undefined}
>
<Icon
size={12}
@@ -126,17 +109,12 @@ function ToolCallStep({ toolCall }: { toolCall: ToolCallInfo }) {
/>
</div>
) : (
- <span
- className={cn("text-[11px]", noteId ? "text-primary/70" : "text-muted-foreground/70")}
- >
+ <span className="text-[11px] text-muted-foreground/70">
{toolCall.result || toolCall.name}
</span>
)}
- {noteId && !isExecuting && (
- <ChevronRight size={10} className="ml-auto text-primary/40 shrink-0" />
- )}
- {hasDetail && !noteId && !isExecuting && (
+ {hasDetail && !isExecuting && (
<ChevronDown
size={10}
className={cn(
@@ -161,6 +139,55 @@ function ToolCallStep({ toolCall }: { toolCall: ToolCallInfo }) {
);
}
+function NoteCard({ noteId, title }: { noteId: number; title: string }) {
+ const { t } = useTranslation();
+
+ return (
+ <button
+ onClick={() => window.electronAPI?.agentOpenNote?.(noteId)}
+ className={cn(
+ "flex items-center gap-2 w-full mt-2 px-2.5 py-2 rounded-md",
+ "bg-primary/6 border border-primary/12",
+ "hover:bg-primary/10 hover:border-primary/20",
+ "active:scale-[0.99]",
+ "transition-all duration-150",
+ "text-left group/note"
+ )}
+ >
+ <div className={cn("shrink-0 p-1 rounded", "bg-primary/10")}>
+ <FileText size={12} className="text-primary/70" />
+ </div>
+ <div className="min-w-0 flex-1">
+ <p className="text-[12px] font-medium text-foreground truncate">{title}</p>
+ <p className="text-[10px] text-muted-foreground/50">{t("agentMode.tools.openNote")}</p>
+ </div>
+ <ChevronRight
+ size={12}
+ className="text-muted-foreground/30 group-hover/note:text-primary/50 shrink-0 transition-colors duration-150"
+ />
+ </button>
+ );
+}
+
+function extractNoteCards(toolCalls?: ToolCallInfo[]): Array<{ noteId: number; title: string }> {
+ if (!toolCalls) return [];
+ const cards: Array<{ noteId: number; title: string }> = [];
+ const seen = new Set<number>();
+
+ for (const tc of toolCalls) {
+ if (tc.status !== "completed" || !NOTE_TOOLS.has(tc.name) || !tc.metadata?.id) continue;
+ const noteId = Number(tc.metadata.id);
+ if (seen.has(noteId)) continue;
+ seen.add(noteId);
+ const title =
+ (tc.metadata.title as string) ||
+ tc.result?.replace(/^(Created|Updated|Retrieved) note: "(.+)"$/, "$2") ||
+ "Note";
+ cards.push({ noteId, title });
+ }
+ return cards;
+}
+
export function AgentMessage({ role, content, isStreaming, toolCalls }: AgentMessageProps) {
const [copied, setCopied] = useState(false);
@@ -195,6 +222,7 @@ export function AgentMessage({ role, content, isStreaming, toolCalls }: AgentMes
const hasToolCalls = toolCalls && toolCalls.length > 0;
const hasContent = content.length > 0;
+ const noteCards = extractNoteCards(toolCalls);
return (
<div
@@ -209,7 +237,11 @@ export function AgentMessage({ role, content, isStreaming, toolCalls }: AgentMes
)}
>
{hasToolCalls && (
- <div className={cn(hasContent && "mb-2 pb-1.5 border-b border-border/15")}>
+ <div
+ className={cn(
+ (hasContent || noteCards.length > 0) && "mb-2 pb-1.5 border-b border-border/15"
+ )}
+ >
{toolCalls.map((tc) => (
<ToolCallStep key={tc.id} toolCall={tc} />
))}
@@ -230,6 +262,14 @@ export function AgentMessage({ role, content, isStreaming, toolCalls }: AgentMes
/>
)}
+ {noteCards.length > 0 && !isStreaming && (
+ <div>
+ {noteCards.map((card) => (
+ <NoteCard key={card.noteId} noteId={card.noteId} title={card.title} />
+ ))}
+ </div>
+ )}
+
{hasContent && !isStreaming && (
<button
onClick={handleCopy}
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index be5e4930c..4f243f514 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -1830,7 +1830,7 @@
"foundNotes_plural": "{{count}} Notizen gefunden",
"searchResults": "{{count}} Ergebnis gefunden",
"searchResults_plural": "{{count}} Ergebnisse gefunden",
- "copiedToClipboard": "In Zwischenablage kopiert",
+ "openNote": "Notiz öffnen",
"calendarEvents": "{{count}} Termin gefunden",
"calendarEvents_plural": "{{count}} Termine gefunden",
"noResults": "Keine Ergebnisse",
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index cd574283a..6414f8bd0 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -1900,7 +1900,7 @@
"foundNotes_plural": "Found {{count}} notes",
"searchResults": "Found {{count}} result",
"searchResults_plural": "Found {{count}} results",
- "copiedToClipboard": "Copied to clipboard",
+ "openNote": "Open note",
"calendarEvents": "Found {{count}} event",
"calendarEvents_plural": "Found {{count}} events",
"noResults": "No results found",
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index e58602ea2..e80d623ba 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -1830,7 +1830,7 @@
"foundNotes_plural": "{{count}} notas encontradas",
"searchResults": "{{count}} resultado encontrado",
"searchResults_plural": "{{count}} resultados encontrados",
- "copiedToClipboard": "Copiado al portapapeles",
+ "openNote": "Abrir nota",
"calendarEvents": "{{count}} evento encontrado",
"calendarEvents_plural": "{{count}} eventos encontrados",
"noResults": "Sin resultados",
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index c3aaf5f32..fc6b4980f 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -1830,7 +1830,7 @@
"foundNotes_plural": "{{count}} notes trouvées",
"searchResults": "{{count}} résultat trouvé",
"searchResults_plural": "{{count}} résultats trouvés",
- "copiedToClipboard": "Copié dans le presse-papiers",
+ "openNote": "Ouvrir la note",
"calendarEvents": "{{count}} événement trouvé",
"calendarEvents_plural": "{{count}} événements trouvés",
"noResults": "Aucun résultat",
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index 476467fa9..dde92aab6 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -1830,7 +1830,7 @@
"foundNotes_plural": "{{count}} note trovate",
"searchResults": "{{count}} risultato trovato",
"searchResults_plural": "{{count}} risultati trovati",
- "copiedToClipboard": "Copiato negli appunti",
+ "openNote": "Apri nota",
"calendarEvents": "{{count}} evento trovato",
"calendarEvents_plural": "{{count}} eventi trovati",
"noResults": "Nessun risultato",
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index 537a56984..06a9b19b4 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -1830,7 +1830,7 @@
"foundNotes_plural": "{{count}}件のノートが見つかりました",
"searchResults": "{{count}}件の結果が見つかりました",
"searchResults_plural": "{{count}}件の結果が見つかりました",
- "copiedToClipboard": "クリップボードにコピーしました",
+ "openNote": "ノートを開く",
"calendarEvents": "{{count}}件の予定が見つかりました",
"calendarEvents_plural": "{{count}}件の予定が見つかりました",
"noResults": "結果が見つかりません",
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index 25033d377..aa236fee7 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -1830,7 +1830,7 @@
"foundNotes_plural": "{{count}} notas encontradas",
"searchResults": "{{count}} resultado encontrado",
"searchResults_plural": "{{count}} resultados encontrados",
- "copiedToClipboard": "Copiado para a área de transferência",
+ "openNote": "Abrir nota",
"calendarEvents": "{{count}} evento encontrado",
"calendarEvents_plural": "{{count}} eventos encontrados",
"noResults": "Nenhum resultado",
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index ba7797c4c..b1131d29b 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -1830,7 +1830,7 @@
"foundNotes_plural": "Найдено {{count}} заметок",
"searchResults": "Найден {{count}} результат",
"searchResults_plural": "Найдено {{count}} результатов",
- "copiedToClipboard": "Скопировано в буфер обмена",
+ "openNote": "Открыть заметку",
"calendarEvents": "Найдено {{count}} событие",
"calendarEvents_plural": "Найдено {{count}} событий",
"noResults": "Ничего не найдено",
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index 34076684a..71f930daf 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -1830,7 +1830,7 @@
"foundNotes_plural": "找到 {{count}} 条笔记",
"searchResults": "找到 {{count}} 条结果",
"searchResults_plural": "找到 {{count}} 条结果",
- "copiedToClipboard": "已复制到剪贴板",
+ "openNote": "打开笔记",
"calendarEvents": "找到 {{count}} 个日程",
"calendarEvents_plural": "找到 {{count}} 个日程",
"noResults": "未找到结果",
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 30f7d69c8..e503bf18d 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -1830,7 +1830,7 @@
"foundNotes_plural": "找到 {{count}} 則筆記",
"searchResults": "找到 {{count}} 項結果",
"searchResults_plural": "找到 {{count}} 項結果",
- "copiedToClipboard": "已複製到剪貼簿",
+ "openNote": "開啟筆記",
"calendarEvents": "找到 {{count}} 個行程",
"calendarEvents_plural": "找到 {{count}} 個行程",
"noResults": "未找到結果",