YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
Fix live transcript ordering and summaries
Louis Beaumont1cd17639f81d
diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsxindex b13598461..54e0258b3 100644--- a/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsx+++ b/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsx@@ -361,6 +361,16 @@ export function NoteView({// meetings where the cached snapshot can be stale).const ctx = await fetchMeetingContext(fresh);setMeetingCtx(ctx);+ const transcriptStart = new Date(fresh.meeting_start).toISOString();+ const transcriptEnd = (+ fresh.meeting_end ? new Date(fresh.meeting_end) : new Date()+ ).toISOString();+ const transcript = await fetchMeetingAudio(+ transcriptStart,+ transcriptEnd,+ 5000,+ fresh.id,+ );// Use the user-picked summary pipe's body as the directive when one is// set. The chat path knows the meeting id so we prepend that and let@@ -386,6 +396,7 @@ export function NoteView({prompt: buildEnrichedSummarizePrompt({meeting: fresh,context: ctx,+ transcript,directiveOverride,}),autoSend: true,diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsxindex 284d690d1..7b82cfc71 100644--- a/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsx+++ b/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsx@@ -91,6 +91,8 @@ interface SpeakerBlock {startMs: number;text: string;segmentCount: number;+ source: "background" | "live";+ liveFinal?: boolean;// First chunk in the block — what SpeakerAssignPopover needs to play the// audio preview and call /speakers/reassign.firstAudioChunkId: number;@@ -112,13 +114,39 @@ function normalizeForDedupe(text: string) {return text.toLowerCase().replace(/\s+/g, " ").trim();}+function timestampMs(iso: string): number {+ const ms = new Date(iso).getTime();+ return Number.isFinite(ms) ? ms : 0;+}++function sortChunks(chunks: MeetingAudioChunk[]): MeetingAudioChunk[] {+ return [...chunks].sort((a, b) => {+ const byTime = timestampMs(a.timestamp) - timestampMs(b.timestamp);+ if (byTime !== 0) return byTime;+ const rank = (source?: string) => (source === "live" ? 0 : 1);+ const bySource = rank(a.source) - rank(b.source);+ if (bySource !== 0) return bySource;+ return a.audioChunkId - b.audioChunkId;+ });+}++function compareBlocks(a: SpeakerBlock, b: SpeakerBlock): number {+ const byTime = a.startMs - b.startMs;+ if (byTime !== 0) return byTime;+ const rank = (source: SpeakerBlock["source"]) =>+ source === "live" ? 0 : 1;+ const bySource = rank(a.source) - rank(b.source);+ if (bySource !== 0) return bySource;+ return a.key.localeCompare(b.key);+}+function groupBySpeaker(chunks: MeetingAudioChunk[]): SpeakerBlock[] {const out: SpeakerBlock[] = [];- for (const c of chunks) {+ for (const c of sortChunks(chunks)) {const text = (c.transcription ?? "").trim();if (!text) continue;- const ts = new Date(c.timestamp).getTime();- if (Number.isNaN(ts)) continue;+ const ts = timestampMs(c.timestamp);+ if (ts <= 0) continue;const speakerName = c.speakerName || (c.isInput ? "me" : "speaker");const speakerId = c.isInput ? null : c.speakerId;const last = out[out.length - 1];@@ -139,6 +167,7 @@ function groupBySpeaker(chunks: MeetingAudioChunk[]): SpeakerBlock[] {startMs: ts,text,segmentCount: 1,+ source: c.source ?? "background",firstAudioChunkId: c.audioChunkId,firstAudioFilePath: c.audioFilePath,});@@ -147,6 +176,27 @@ function groupBySpeaker(chunks: MeetingAudioChunk[]): SpeakerBlock[] {return out;}+function liveBlockToSpeakerBlock(+ block: LiveTranscriptBlock,+ index: number,+): SpeakerBlock | null {+ const text = block.text.trim();+ const startMs = timestampMs(block.capturedAt);+ if (!text || startMs <= 0) return null;+ return {+ key: `live-${block.key}-${index}`,+ speakerId: null,+ speakerName: block.deviceType.toLowerCase() === "input" ? "me" : "speaker",+ startMs,+ text,+ segmentCount: 1,+ source: "live",+ liveFinal: block.final,+ firstAudioChunkId: 0,+ firstAudioFilePath: "",+ };+}+function formatRelative(ms: number, startMs: number): string {const delta = Math.max(0, ms - startMs);const total = Math.floor(delta / 1000);@@ -404,6 +454,17 @@ export function TranscriptPanel({return !durableText.includes(normalized.slice(0, 80));});}, [chunks, liveBlocks]);+ const visibleLiveSpeakerBlocks = useMemo(+ () =>+ visibleLiveBlocks+ .map(liveBlockToSpeakerBlock)+ .filter((block): block is SpeakerBlock => Boolean(block)),+ [visibleLiveBlocks],+ );+ const displayBlocks = useMemo(+ () => [...blocks, ...visibleLiveSpeakerBlocks].sort(compareBlocks),+ [blocks, visibleLiveSpeakerBlocks],+ );const liveLabel = useMemo(() => {if (!isLive) return null;@@ -415,8 +476,8 @@ export function TranscriptPanel({// Plain-text dump of the whole transcript (not the filtered view) for// clipboard. Each block becomes a "[hh:mm] name\ntext" paragraph.const handleCopy = async () => {- if (blocks.length === 0) return;- const text = blocks+ if (displayBlocks.length === 0) return;+ const text = displayBlocks.map((b) => `[${formatClock(b.startMs)}] ${b.speakerName}\n${b.text}`).join("\n\n");try {@@ -433,15 +494,23 @@ export function TranscriptPanel({// count visible so empty results aren't confusing.const filteredBlocks = useMemo(() => {const q = query.trim().toLowerCase();- if (!q) return blocks;- return blocks.filter(+ if (!q) return displayBlocks;+ return displayBlocks.filter((b) =>b.text.toLowerCase().includes(q) ||b.speakerName.toLowerCase().includes(q),);- }, [blocks, query]);- const hasTranscriptContent =- visibleLiveBlocks.length > 0 || filteredBlocks.length > 0;+ }, [displayBlocks, query]);+ const hasTranscriptContent = displayBlocks.length > 0;++ useEffect(() => {+ if (!isOpen || !isLive || query.trim()) return;+ const el = containerRef.current;+ if (!el) return;+ requestAnimationFrame(() => {+ el.scrollTop = el.scrollHeight;+ });+ }, [displayBlocks.length, isLive, isOpen, query]);// Empty state copy depends on *why* the list is empty — the difference// matters: "still recording" vs "no audio captured" vs "no matches".@@ -471,8 +540,7 @@ export function TranscriptPanel({]);const compactEmptyState =Boolean(emptyCopy) && !loading && !hasTranscriptContent;- const showSearch =- chunks.length > 0 || visibleLiveBlocks.length > 0 || Boolean(query.trim());+ const showSearch = displayBlocks.length > 0 || Boolean(query.trim());return (<>@@ -511,10 +579,10 @@ export function TranscriptPanel({{liveLabel}</span>)}- {chunks.length > 0 && (+ {displayBlocks.length > 0 && (<span className="text-[11px] text-muted-foreground/70">{filteredBlocks.length}- {query.trim() ? ` / ${blocks.length}` : ""} segments+ {query.trim() ? ` / ${displayBlocks.length}` : ""} segments</span>)}</div>@@ -523,7 +591,7 @@ export function TranscriptPanel({variant="ghost"size="sm"onClick={handleCopy}- disabled={blocks.length === 0}+ disabled={displayBlocks.length === 0}className="h-7 w-7 p-0"title={copied ? "copied" : "copy transcript"}>@@ -582,14 +650,6 @@ export function TranscriptPanel({</div>)}- {visibleLiveBlocks.length > 0 && (- <ol className="divide-y divide-border/50 border-b border-border/50">- {visibleLiveBlocks.map((block) => (- <LiveParagraph key={block.key} block={block} />- ))}- </ol>- )}-{filteredBlocks.length > 0 && (<ol className="divide-y divide-border/50">{filteredBlocks.map((b) => (@@ -608,29 +668,6 @@ export function TranscriptPanel({);}-function LiveParagraph({ block }: { block: LiveTranscriptBlock }) {- const captured = new Date(block.capturedAt).getTime();- return (- <li className="px-4 py-2.5 bg-muted/30" style={{ contain: "layout paint" }}>- <div className="flex items-baseline gap-2 mb-1">- <span className="inline-flex items-center gap-1 text-[11px] font-medium tracking-tight text-foreground/80">- <User className="h-3 w-3" />- {block.deviceType === "input" ? "me" : "speaker"}- </span>- <span className="text-[10px] text-muted-foreground/60">- {Number.isNaN(captured) ? "live" : formatClock(captured)}- </span>- <span className="text-[10px] text-foreground/70">- {block.final ? "final" : "live"}- </span>- </div>- <p className="text-xs leading-relaxed whitespace-pre-wrap break-words">- {block.text}- </p>- </li>- );-}-function SpeakerParagraph({block,meetingStartMs,@@ -646,25 +683,32 @@ function SpeakerParagraph({style={{ contain: "layout paint" }}><div className="flex items-baseline gap-2 mb-1">- <SpeakerAssignPopover- audioChunkId={block.firstAudioChunkId}- speakerId={block.speakerId ?? undefined}- speakerName={block.speakerName}- audioFilePath={block.firstAudioFilePath}- onAssigned={onSpeakerAssigned}- >- <span- className="inline-flex items-center gap-1 text-[11px] font-medium tracking-tight text-foreground/80 hover:text-foreground hover:underline underline-offset-2 cursor-pointer"- title={- block.speakerId != null- ? `speaker #${block.speakerId} — click to rename or reassign`- : "click to assign a speaker"- }+ {block.firstAudioFilePath ? (+ <SpeakerAssignPopover+ audioChunkId={block.firstAudioChunkId}+ speakerId={block.speakerId ?? undefined}+ speakerName={block.speakerName}+ audioFilePath={block.firstAudioFilePath}+ onAssigned={onSpeakerAssigned}>+ <span+ className="inline-flex items-center gap-1 text-[11px] font-medium tracking-tight text-foreground/80 hover:text-foreground hover:underline underline-offset-2 cursor-pointer"+ title={+ block.speakerId != null+ ? `speaker #${block.speakerId} — click to rename or reassign`+ : "click to assign a speaker"+ }+ >+ <User className="h-3 w-3 text-muted-foreground/70 self-center" />+ {block.speakerName}+ </span>+ </SpeakerAssignPopover>+ ) : (+ <span className="inline-flex items-center gap-1 text-[11px] font-medium tracking-tight text-foreground/80"><User className="h-3 w-3 text-muted-foreground/70 self-center" />{block.speakerName}</span>- </SpeakerAssignPopover>+ )}<spanclassName="text-[10px] text-muted-foreground/60 font-mono tabular-nums"title={new Date(block.startMs).toLocaleString()}@@ -674,6 +718,12 @@ function SpeakerParagraph({{" · "}{formatClock(block.startMs)}</span>+ {block.source === "live" && (+ <span className="text-muted-foreground/50">+ {" · "}+ {block.liveFinal ? "final" : "live"}+ </span>+ )}</span></div><p className="text-xs leading-relaxed text-foreground/90 whitespace-pre-wrap break-words">diff --git a/apps/screenpipe-app-tauri/lib/utils/meeting-context.ts b/apps/screenpipe-app-tauri/lib/utils/meeting-context.tsindex ce443c4e0..d1a12065d 100644--- a/apps/screenpipe-app-tauri/lib/utils/meeting-context.ts+++ b/apps/screenpipe-app-tauri/lib/utils/meeting-context.ts@@ -62,6 +62,22 @@ interface MeetingTranscriptSegment {capturedAt: string;}+function timestampMs(iso: string): number {+ const ms = new Date(iso).getTime();+ return Number.isFinite(ms) ? ms : 0;+}++function sortAudioChunks(chunks: MeetingAudioChunk[]): MeetingAudioChunk[] {+ return [...chunks].sort((a, b) => {+ const byTime = timestampMs(a.timestamp) - timestampMs(b.timestamp);+ if (byTime !== 0) return byTime;+ const rank = (source?: string) => (source === "live" ? 0 : 1);+ const bySource = rank(a.source) - rank(b.source);+ if (bySource !== 0) return bySource;+ return a.audioChunkId - b.audioChunkId;+ });+}+export interface SpeakerSummary {name: string;segment_count: number;@@ -253,6 +269,7 @@ export function pathFromUrl(url: string): string {interface SummarizeInput {meeting: MeetingRecord;context: MeetingContext;+ transcript?: MeetingAudioChunk[] | null;/** Replace the built-in directive with the body of a user-chosen summary* pipe (e.g. one selected from the Meeting summary pipe picker). The* meeting id is prepended so the pipe body doesn't have to look it up. */@@ -268,6 +285,7 @@ interface SummarizeInput {export function buildEnrichedSummarizePrompt({meeting,context,+ transcript,directiveOverride,}: SummarizeInput): string {const start = new Date(meeting.meeting_start);@@ -319,7 +337,10 @@ export function buildEnrichedSummarizePrompt({);}- if (a.audio_summary.top_transcriptions.length > 0) {+ if (+ !transcript?.length &&+ a.audio_summary.top_transcriptions.length > 0+ ) {const lines = a.audio_summary.top_transcriptions.slice(0, 8).map((t) => {const ts = formatTimeShort(t.timestamp);const txt = t.transcription.replace(/\s+/g, " ").trim().slice(0, 240);@@ -330,6 +351,14 @@ export function buildEnrichedSummarizePrompt({}}+ const transcriptText = renderTranscript(transcript ?? null, null);+ if (transcriptText) {+ const segmentCount = transcript?.length ?? 0;+ sections.push(+ `meeting transcript (chronological${segmentCount > 0 ? `, ${segmentCount} segments` : ""}):\n${transcriptText}`,+ );+ }+if (context.clipboardCount > 0) {sections.push(`clipboard activity: ${context.clipboardCount} copy/paste events during meeting`);}@@ -365,6 +394,8 @@ export function buildMeetingSummarizeInstructions(`search screenpipe for what happened during this meeting and summarize it: key topics, decisions, action items.`,``,`meeting id: ${meetingId}`,+ `primary transcript source: GET "http://localhost:3030/meetings/${meetingId}/transcript" and use each row's "transcript", "speakerName", "capturedAt", and "source" fields. sort rows by capturedAt before summarizing.`,+ `fallback transcript source: /search?content_type=audio for the meeting time window. audio rows use content.transcription (not content.text); content.text may be missing for audio and should not be treated as an empty transcript.`,`if your summary is worth saving, append it to the meeting note (and refresh the title in the same call) via:`,` curl -s -X PATCH "http://localhost:3030/meetings/${meetingId}" \\`,` -H "Authorization: Bearer $SCREENPIPE_API_AUTH_KEY" \\`,@@ -514,7 +545,7 @@ function renderTranscript(activity: ActivitySummary | null,): string {if (full && full.length > 0) {- return full+ return sortAudioChunks(full).map((c) => {const ts = formatTimeShort(c.timestamp);const sp =@@ -680,8 +711,7 @@ export async function fetchMeetingAudio(break;}}- out.sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());- return out;+ return sortAudioChunks(out);}async function fetchRoutedMeetingTranscript(@@ -718,10 +748,7 @@ async function fetchRoutedMeetingTranscript(source,};})- .sort(- (a, b) =>- new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime(),- );+ .sort((a, b) => timestampMs(a.timestamp) - timestampMs(b.timestamp));} catch {return [];}diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lockindex 1f5b08cbd..92f012681 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock@@ -10580,7 +10580,7 @@ dependencies = [[[package]]name = "screenpipe-app"-version = "2.4.212"+version = "2.4.213"dependencies = ["aes","anyhow",diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml b/apps/screenpipe-app-tauri/src-tauri/Cargo.tomlindex 4a5fc5030..1334b34f8 100644--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.toml+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.toml@@ -1,6 +1,6 @@[package]name = "screenpipe-app"-version = "2.4.212"+version = "2.4.213"description = "24/7 memory for your desktop. 100% local."authors = ["you"]license = ""diff --git a/crates/screenpipe-db/src/db.rs b/crates/screenpipe-db/src/db.rsindex c25f18370..efc89ba53 100644--- a/crates/screenpipe-db/src/db.rs+++ b/crates/screenpipe-db/src/db.rs@@ -3586,7 +3586,7 @@ impl DatabaseManager {AND (?5 IS NULL OR LENGTH(transcript) <= ?5)AND (?6 IS NULL OR speaker_name LIKE '%' || ?6 || '%' COLLATE NOCASE)AND (?7 IS NULL OR device_name LIKE '%' || ?7 || '%' COLLATE NOCASE)- ORDER BY captured_at DESC, id DESC+ ORDER BY julianday(captured_at) DESC, id DESCLIMIT ?8 OFFSET ?9"#,)@@ -8210,8 +8210,8 @@ LIMIT ? OFFSET ?),live_bounds AS (SELECT- MIN(captured_at) AS first_live_at,- MAX(captured_at) AS last_live_at+ MIN(julianday(captured_at)) AS first_live_at_jd,+ MAX(julianday(captured_at)) AS last_live_at_jdFROM meeting_transcript_segmentsWHERE meeting_id = ?1),@@ -8268,15 +8268,19 @@ LIMIT ? OFFSET ?AND ac.file_path NOT LIKE 'cloud://%'AND (s.id IS NULL OR s.hallucination = 0)AND NOT (- lb.first_live_at IS NOT NULL- AND julianday(at.timestamp) >= julianday(datetime(lb.first_live_at, '-60 seconds'))- AND julianday(at.timestamp) <= julianday(datetime(lb.last_live_at, '+60 seconds'))+ lb.first_live_at_jd IS NOT NULL+ AND julianday(at.timestamp) >= lb.first_live_at_jd - (60.0 / 86400.0)+ AND julianday(at.timestamp) <= lb.last_live_at_jd + (60.0 / 86400.0)))- SELECT * FROM live_segments- UNION ALL- SELECT * FROM background_segments- ORDER BY captured_at ASC, source DESC, id ASC+ SELECT * FROM (+ SELECT * FROM live_segments+ UNION ALL+ SELECT * FROM background_segments+ )+ ORDER BY julianday(captured_at) ASC,+ CASE source WHEN 'live' THEN 0 ELSE 1 END ASC,+ id ASC"#,).bind(meeting_id)diff --git a/crates/screenpipe-db/tests/untranscribed_chunks_test.rs b/crates/screenpipe-db/tests/untranscribed_chunks_test.rsindex 2d462e6d8..214420da9 100644--- a/crates/screenpipe-db/tests/untranscribed_chunks_test.rs+++ b/crates/screenpipe-db/tests/untranscribed_chunks_test.rs@@ -562,6 +562,89 @@ mod tests {assert_eq!(total, 1);}+ #[tokio::test]+ async fn test_live_transcripts_order_by_actual_time_not_timestamp_text() {+ let db = setup_test_db().await;++ let meeting_start = chrono::DateTime::parse_from_rfc3339("2026-05-14T17:59:00Z")+ .unwrap()+ .with_timezone(&Utc);+ let meeting_end = chrono::DateTime::parse_from_rfc3339("2026-05-14T18:05:00Z")+ .unwrap()+ .with_timezone(&Utc);+ let meeting_id = sqlx::query(+ "INSERT INTO meetings (meeting_start, meeting_end, meeting_app, detection_source) \+ VALUES (?1, ?2, 'manual', 'manual')",+ )+ .bind(meeting_start.to_rfc3339())+ .bind(meeting_end.to_rfc3339())+ .execute(&db.pool)+ .await+ .unwrap()+ .last_insert_rowid();++ sqlx::query(+ "INSERT INTO meeting_transcript_segments \+ (meeting_id, provider, model, item_id, device_name, device_type, speaker_name, transcript, captured_at) \+ VALUES (?1, 'deepgram-live', 'nova-3', 'later-local-offset', 'test-mic', 'input', 'me', 'local offset later', ?2)",+ )+ .bind(meeting_id)+ .bind("2026-05-14T11:01:00-07:00")+ .execute(&db.pool)+ .await+ .unwrap();++ sqlx::query(+ "INSERT INTO meeting_transcript_segments \+ (meeting_id, provider, model, item_id, device_name, device_type, speaker_name, transcript, captured_at) \+ VALUES (?1, 'deepgram-live', 'nova-3', 'earlier-utc', 'test-mic', 'input', 'me', 'utc earlier', ?2)",+ )+ .bind(meeting_id)+ .bind("2026-05-14T18:00:30Z")+ .execute(&db.pool)+ .await+ .unwrap();++ let rows = db+ .list_meeting_transcript_segments(meeting_id)+ .await+ .unwrap();+ let transcripts = rows+ .iter()+ .map(|row| row.transcript.as_str())+ .collect::<Vec<_>>();+ assert_eq!(transcripts, vec!["utc earlier", "local offset later"]);++ let latest = db+ .search(+ "",+ ContentType::Audio,+ 1,+ 0,+ Some(meeting_start),+ Some(meeting_end),+ None,+ None,+ None,+ None,+ None,+ None,+ None,+ None,+ None,+ None,+ None,+ None,+ )+ .await+ .unwrap();+ assert_eq!(latest.len(), 1);+ let SearchResult::Audio(audio) = &latest[0] else {+ panic!("expected latest live transcript as audio result");+ };+ assert_eq!(audio.transcription, "local offset later");+ }+#[tokio::test]async fn test_returns_transcriptions_without_speaker() {let db = setup_test_db().await;diff --git a/crates/screenpipe-engine/src/routes/content.rs b/crates/screenpipe-engine/src/routes/content.rsindex 1df7b428e..762d9eb55 100644--- a/crates/screenpipe-engine/src/routes/content.rs+++ b/crates/screenpipe-engine/src/routes/content.rs@@ -75,6 +75,9 @@ pub struct OCRContent {pub struct AudioContent {pub chunk_id: i64,pub transcription: String,+ /// Convenience alias for generic clients and agents that read `text` on+ /// every content row. Same value as `transcription`.+ pub text: String,pub timestamp: DateTime<Utc>,pub file_path: String,pub offset_index: i64,diff --git a/crates/screenpipe-engine/src/routes/search.rs b/crates/screenpipe-engine/src/routes/search.rsindex 11c7dd5b9..7dd853456 100644--- a/crates/screenpipe-engine/src/routes/search.rs+++ b/crates/screenpipe-engine/src/routes/search.rs@@ -353,23 +353,27 @@ pub(crate) async fn search(focused: ocr.focused,device_name: ocr.device_name.clone(),}),- SearchResult::Audio(audio) => ContentItem::Audio(AudioContent {- chunk_id: audio.audio_chunk_id,- transcription: truncate(audio.transcription.clone()),- timestamp: audio.timestamp,- file_path: audio.file_path.clone(),- offset_index: audio.offset_index,- tags: audio.tags.clone(),- device_name: audio.device_name.clone(),- device_type: audio.device_type.clone().into(),- speaker: audio.speaker.clone(),- start_time: audio.start_time,- end_time: audio.end_time,- source: audio.source.clone(),- meeting_id: audio.meeting_id,- provider: audio.provider.clone(),- model: audio.model.clone(),- }),+ SearchResult::Audio(audio) => {+ let transcription = truncate(audio.transcription.clone());+ ContentItem::Audio(AudioContent {+ chunk_id: audio.audio_chunk_id,+ transcription: transcription.clone(),+ text: transcription,+ timestamp: audio.timestamp,+ file_path: audio.file_path.clone(),+ offset_index: audio.offset_index,+ tags: audio.tags.clone(),+ device_name: audio.device_name.clone(),+ device_type: audio.device_type.clone().into(),+ speaker: audio.speaker.clone(),+ start_time: audio.start_time,+ end_time: audio.end_time,+ source: audio.source.clone(),+ meeting_id: audio.meeting_id,+ provider: audio.provider.clone(),+ model: audio.model.clone(),+ })+ }SearchResult::UI(ui) => ContentItem::UI(UiContent {id: ui.id,text: truncate(ui.text.clone()),