Skip to content

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

feat(meeting-notes): copy meeting + transcript to clipboard

Louis Beaumontb6730535d340
diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsx
index 3afa45875..7d410ad2c 100644
--- a/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsx
+++ b/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsx
@@ -9,6 +9,7 @@ import {
Calendar,
Check,
Clock,
+ Copy,
Loader2,
Sparkles,
Square,
@@ -38,6 +39,8 @@ import {
} from "@/lib/utils/meeting-format";
import {
buildEnrichedSummarizePrompt,
+ buildMeetingMarkdown,
+ fetchMeetingAudio,
fetchMeetingContext,
type MeetingContext,
} from "@/lib/utils/meeting-context";
@@ -79,6 +82,8 @@ export function NoteView({
const [note, setNote] = useState(meeting.note ?? "");
const [saveState, setSaveState] = useState<SaveState>({ kind: "idle" });
const [summarizing, setSummarizing] = useState(false);
+ const [copying, setCopying] = useState(false);
+ const [copied, setCopied] = useState(false);
const [meetingCtx, setMeetingCtx] = useState<MeetingContext | null>(null);
const lastSavedRef = useRef({
@@ -245,6 +250,52 @@ export function NoteView({
}
};
+ const handleCopy = async () => {
+ if (copying) return;
+ setCopying(true);
+ try {
+ const fresh: MeetingRecord = {
+ ...meeting,
+ title: title || null,
+ attendees: attendees || null,
+ note: note || null,
+ };
+ // Always re-fetch context + transcript on copy so the clipboard reflects
+ // what the user sees right now (live meetings update; speaker rename can
+ // happen without re-rendering ReplayStrip).
+ const [ctx, transcript] = await Promise.all([
+ fetchMeetingContext(fresh),
+ fetchMeetingAudio(
+ new Date(meeting.meeting_start).toISOString(),
+ (meeting.meeting_end
+ ? new Date(meeting.meeting_end)
+ : new Date()
+ ).toISOString(),
+ ).catch(() => []),
+ ]);
+ setMeetingCtx(ctx);
+
+ const md = buildMeetingMarkdown({
+ meeting: fresh,
+ context: ctx,
+ transcript,
+ });
+ await navigator.clipboard.writeText(md);
+ setCopied(true);
+ window.setTimeout(() => setCopied(false), 2000);
+ toast({ title: "copied to clipboard" });
+ } catch (err) {
+ console.error("failed to copy meeting", err);
+ toast({
+ title: "couldn't copy",
+ description: String(err),
+ variant: "destructive",
+ });
+ } finally {
+ setCopying(false);
+ }
+ };
+
const handleDelete = async () => {
try {
const res = await localFetch(`/meetings/${meeting.id}`, {
@@ -280,12 +331,29 @@ export function NoteView({
<ArrowLeft className="h-3.5 w-3.5" />
meetings
</Button>
- {isLive ? (
- <span className="flex items-center gap-2 text-xs uppercase tracking-[0.15em] text-foreground">
- <span className="h-1.5 w-1.5 rounded-full bg-foreground animate-pulse" />
- recording
- </span>
- ) : (
+ <div className="flex items-center gap-2">
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={handleCopy}
+ disabled={copying}
+ title="copy meeting + transcript to clipboard"
+ className="h-8 w-8 p-0"
+ >
+ {copying ? (
+ <Loader2 className="h-3.5 w-3.5 animate-spin" />
+ ) : copied ? (
+ <Check className="h-3.5 w-3.5" />
+ ) : (
+ <Copy className="h-3.5 w-3.5" />
+ )}
+ </Button>
+ {isLive ? (
+ <span className="flex items-center gap-2 text-xs uppercase tracking-[0.15em] text-foreground">
+ <span className="h-1.5 w-1.5 rounded-full bg-foreground animate-pulse" />
+ recording
+ </span>
+ ) : (
<Button
variant="default"
size="sm"
@@ -300,7 +368,8 @@ export function NoteView({
)}
summarize with AI
</Button>
- )}
+ )}
+ </div>
</div>
<input
diff --git a/apps/screenpipe-app-tauri/lib/utils/meeting-context.ts b/apps/screenpipe-app-tauri/lib/utils/meeting-context.ts
index 846851b54..8c2c301a6 100644
--- a/apps/screenpipe-app-tauri/lib/utils/meeting-context.ts
+++ b/apps/screenpipe-app-tauri/lib/utils/meeting-context.ts
@@ -340,6 +340,154 @@ function formatTimeShort(iso: string): string {
});
}
+// ─── Clipboard markdown ──────────────────────────────────────────────────
+
+interface MeetingMarkdownInput {
+ meeting: MeetingRecord;
+ context: MeetingContext | null;
+ /** Full transcript chunks for the meeting time range. Pass `null` if not
+ * fetched yet — the bundle falls back to the top fragments from context. */
+ transcript: MeetingAudioChunk[] | null;
+}
+
+/**
+ * Render a meeting + its context as a single markdown document fit for the
+ * clipboard. Pasteable into Notion, Obsidian, Linear, etc.
+ *
+ * Sections are emitted only when they have data — an empty meeting yields a
+ * lean header without empty "## Apps" stubs. Transcript is preferred from
+ * the full chunk list when supplied; otherwise falls back to the curated
+ * top fragments from the context bundle.
+ */
+export function buildMeetingMarkdown({
+ meeting,
+ context,
+ transcript,
+}: MeetingMarkdownInput): string {
+ const start = new Date(meeting.meeting_start);
+ const end = meeting.meeting_end ? new Date(meeting.meeting_end) : null;
+ const durationMin = end
+ ? Math.max(1, Math.round((end.getTime() - start.getTime()) / 60000))
+ : null;
+
+ const parts: string[] = [];
+
+ // Header
+ parts.push(`# ${meeting.title?.trim() || "untitled meeting"}`);
+
+ const meta: string[] = [];
+ meta.push(`**Time:** ${formatHumanRange(start, end)}`);
+ if (durationMin !== null) meta.push(`**Duration:** ${durationMin} min`);
+ if (meeting.attendees) meta.push(`**Attendees:** ${meeting.attendees}`);
+ if (meeting.meeting_app && meeting.meeting_app !== "manual") {
+ meta.push(`**App:** ${meeting.meeting_app}`);
+ }
+ parts.push(meta.join(" \n"));
+
+ // Notes
+ if (meeting.note?.trim()) {
+ parts.push(`## Notes\n\n${meeting.note.trim()}`);
+ }
+
+ // Activity-derived sections
+ const activity = context?.activity ?? null;
+ if (activity) {
+ const apps = topAppSummary(activity.apps, 6);
+ if (apps) parts.push(`## Apps used\n\n${formatAppsLines(activity.apps, 6)}`);
+
+ const urls = pickReceiptUrls(activity.windows, 10);
+ if (urls.length > 0) {
+ parts.push(
+ `## Tabs / docs visited\n\n${urls
+ .map(
+ (u) =>
+ `- [${u.window_name || hostFromUrl(u.browser_url)}](${u.browser_url}) — ${u.minutes}m`,
+ )
+ .join("\n")}`,
+ );
+ }
+
+ if (activity.audio_summary.speakers.length > 0) {
+ parts.push(
+ `## Speakers\n\n${activity.audio_summary.speakers
+ .map((s) => `- ${s.name} (${s.segment_count} segments)`)
+ .join("\n")}`,
+ );
+ }
+ }
+
+ // Transcript — prefer full chunk list, fall back to top fragments
+ const transcriptLines = renderTranscript(transcript, activity);
+ if (transcriptLines) parts.push(`## Transcript\n\n${transcriptLines}`);
+
+ if (context && context.clipboardCount > 0) {
+ parts.push(
+ `_${context.clipboardCount} clipboard event${
+ context.clipboardCount === 1 ? "" : "s"
+ } during meeting._`,
+ );
+ }
+
+ return parts.join("\n\n") + "\n";
+}
+
+function formatHumanRange(start: Date, end: Date | null): string {
+ const dateStr = start.toLocaleDateString(undefined, {
+ weekday: "short",
+ month: "short",
+ day: "numeric",
+ year: "numeric",
+ });
+ const startTime = start.toLocaleTimeString(undefined, {
+ hour: "2-digit",
+ minute: "2-digit",
+ });
+ if (!end) return `${dateStr}, ${startTime} (ongoing)`;
+ const endTime = end.toLocaleTimeString(undefined, {
+ hour: "2-digit",
+ minute: "2-digit",
+ });
+ return `${dateStr}, ${startTime} – ${endTime}`;
+}
+
+function formatAppsLines(apps: AppUsage[], limit: number): string {
+ return apps
+ .slice(0, limit)
+ .map((a) => `- ${a.name.toLowerCase()} (${a.minutes}m)`)
+ .join("\n");
+}
+
+function renderTranscript(
+ full: MeetingAudioChunk[] | null,
+ activity: ActivitySummary | null,
+): string {
+ if (full && full.length > 0) {
+ return full
+ .map((c) => {
+ const ts = formatTimeShort(c.timestamp);
+ const sp =
+ c.speakerName && c.speakerName !== "unknown"
+ ? `[${c.speakerName}] `
+ : "";
+ const txt = c.transcription.replace(/\s+/g, " ").trim();
+ return `- ${ts} ${sp}${txt}`;
+ })
+ .join("\n");
+ }
+ // Fallback: curated top fragments (already capped at 8 in the activity)
+ const top = activity?.audio_summary.top_transcriptions ?? [];
+ if (top.length === 0) return "";
+ return top
+ .map((t) => {
+ const ts = formatTimeShort(t.timestamp);
+ const sp =
+ t.speaker && t.speaker !== "unknown" ? `[${t.speaker}] ` : "";
+ const txt = t.transcription.replace(/\s+/g, " ").trim();
+ return `- ${ts} ${sp}${txt}`;
+ })
+ .join("\n");
+}
+
// ─── Frame lookup for replay-the-moment ──────────────────────────────────
interface SearchOcrItem {