Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
refactor(meeting): simplify speaker picker and remove integrations beta section
Gabriel Steinab72bdc44ee6
diff --git a/src/components/IntegrationsView.tsx b/src/components/IntegrationsView.tsxindex 55aa645cc..b9f44f27b 100644--- a/src/components/IntegrationsView.tsx+++ b/src/components/IntegrationsView.tsx@@ -1,6 +1,6 @@import { useState, useEffect, useCallback } from "react";import { useTranslation } from "react-i18next";-import { FlaskConical, Info, Loader2, Mail, Plus, Unlink } from "lucide-react";+import { Info, Loader2, Mail, Plus, Unlink } from "lucide-react";import { Button } from "./ui/button";import { Badge } from "./ui/badge";import { SettingsPanel, SettingsPanelRow } from "./ui/SettingsSection";@@ -183,23 +183,6 @@ export default function IntegrationsView() {</div>)}- <div className="rounded-lg border border-border/40 dark:border-border-subtle/40 bg-muted/20 dark:bg-surface-2/30 p-4 flex items-start gap-3">- <FlaskConical size={15} className="text-primary/60 shrink-0 mt-0.5" />- <div className="flex-1 min-w-0">- <p className="text-xs font-medium text-foreground/80">{t("integrations.beta.title")}</p>- <p className="text-xs text-muted-foreground/60 mt-0.5 leading-relaxed">- {t("integrations.beta.description")}- </p>- <div className="mt-2 space-y-1">- <p className="text-xs text-muted-foreground/60">{t("integrations.beta.freeTier")}</p>- <p className="text-xs text-muted-foreground/60">{t("integrations.beta.proTier")}</p>- </div>- <p className="text-xs text-muted-foreground/50 mt-2 leading-relaxed">- {t("integrations.beta.feedback")}- </p>- </div>- </div>-<ConfirmDialogopen={!!confirmDisconnectEmail}onOpenChange={(open) => {diff --git a/src/components/notes/MeetingTranscriptChat.tsx b/src/components/notes/MeetingTranscriptChat.tsxindex cf28dc324..50a1909e6 100644--- a/src/components/notes/MeetingTranscriptChat.tsx+++ b/src/components/notes/MeetingTranscriptChat.tsx@@ -1,6 +1,6 @@-import { useState, useEffect, useLayoutEffect, useMemo, useRef } from "react";+import { useState, useEffect, useLayoutEffect, useRef } from "react";import { useTranslation } from "react-i18next";-import { Check, Lock, Sparkles, X } from "lucide-react";+import { Check, Sparkles, Users, X } from "lucide-react";import { Popover, PopoverTrigger, PopoverContent } from "../ui/popover";import { cn } from "../lib/utils";import type { TranscriptSegment } from "../../hooks/useMeetingTranscription";@@ -9,11 +9,6 @@ import {type TranscriptSpeakerStatus,} from "../../utils/transcriptSpeakerState";-interface SpeakerOption {- speakerId: string;- label: string;-}-const BUBBLE_STYLES = {mic: {align: "justify-start",@@ -65,6 +60,20 @@ const getSpeakerNumber = (speakerId: string) => {return match ? Number(match[1]) + 1 : 1;};+const getSpeakerStateLabel = (state: TranscriptSpeakerStatus, t: (key: string) => string) => {+ switch (state) {+ case "locked":+ return t("notes.speaker.state.locked");+ case "provisional":+ return t("notes.speaker.state.provisional");+ case "suggested":+ return t("notes.speaker.state.suggested");+ case "confirmed":+ default:+ return t("notes.speaker.state.confirmed");+ }+};+function PartialBubble({text,source,@@ -94,12 +103,6 @@ function PartialBubble({{getSpeakerStateLabel("provisional", t)}</span>)}- {speakerState === "locked" && (- <span className="inline-flex items-center gap-0.5 text-[10px] font-medium text-muted-foreground/40">- <Lock size={9} />- {getSpeakerStateLabel("locked", t)}- </span>- )}</div>)}<div@@ -121,19 +124,99 @@ function PartialBubble({);}-const getSpeakerStateLabel = (state: TranscriptSpeakerStatus, t: (key: string) => string) => {- switch (state) {- case "locked":- return t("notes.speaker.state.locked");- case "provisional":- return t("notes.speaker.state.provisional");- case "suggested":- return t("notes.speaker.state.suggested");- case "confirmed":- default:- return t("notes.speaker.state.confirmed");- }-};+interface SpeakerPickerProps {+ speakerProfiles?: Array<{ id?: number; display_name: string; email: string | null }>;+ participants?: Array<{ email: string; displayName: string | null }>;+ onSelectName: (name: string, email?: string | null, profileId?: number) => void;+ t: (key: string, opts?: Record<string, unknown>) => string;+}++function SpeakerPicker({+ speakerProfiles,+ participants,+ onSelectName,+ t,+}: SpeakerPickerProps) {+ const [search, setSearch] = useState("");+ const lower = search.toLowerCase();++ const filteredParticipants = (participants || []).filter(+ (p) => !search || (p.displayName || p.email).toLowerCase().includes(lower)+ );+ const filteredProfiles = (speakerProfiles || []).filter(+ (p) =>+ !search ||+ p.display_name.toLowerCase().includes(lower) ||+ (p.email && p.email.toLowerCase().includes(lower))+ );++ const handleKeyDown = (e: React.KeyboardEvent) => {+ if (e.key === "Enter" && search.trim()) {+ e.preventDefault();+ onSelectName(search.trim());+ setSearch("");+ }+ };++ const isEmpty = !filteredParticipants.length && !filteredProfiles.length;++ return (+ <>+ <div className="p-2 border-b border-border/50">+ <input+ value={search}+ onChange={(e) => setSearch(e.target.value)}+ onKeyDown={handleKeyDown}+ placeholder={t("notes.speaker.typeNamePlaceholder")}+ className="w-full px-2 py-1.5 rounded-md bg-transparent text-xs text-foreground placeholder:text-foreground/20 outline-none border-none appearance-none"+ autoFocus+ />+ </div>+ <div className="max-h-40 overflow-y-auto">+ {filteredParticipants.length > 0 && (+ <div className="p-1 border-b border-border/30">+ <div className="px-2 py-1 text-[11px] font-medium text-muted-foreground">+ {t("notes.speaker.meetingAttendees")}+ </div>+ {filteredParticipants.slice(0, 5).map((p) => (+ <button+ key={p.email}+ onClick={() => onSelectName(p.displayName || p.email.split("@")[0], p.email)}+ className="flex items-center gap-2 w-full px-2 py-1.5 rounded-md text-xs text-foreground/70 hover:bg-foreground/5 transition-colors cursor-pointer"+ >+ <span className="truncate">{p.displayName || p.email}</span>+ </button>+ ))}+ </div>+ )}+ {filteredProfiles.length > 0 && (+ <div className="p-1">+ <div className="px-2 py-1 text-[11px] font-medium text-muted-foreground">+ {t("notes.speaker.knownSpeakers")}+ </div>+ {filteredProfiles.slice(0, 5).map((p) => (+ <button+ key={p.id ?? `name-${p.display_name}`}+ onClick={() => onSelectName(p.display_name, p.email, p.id)}+ className="flex items-center gap-2 w-full px-2 py-1.5 rounded-md text-xs text-foreground/70 hover:bg-foreground/5 transition-colors cursor-pointer"+ >+ <span className="truncate">{p.display_name}</span>+ {p.email && (+ <span className="text-foreground/30 truncate text-[11px]">{p.email}</span>+ )}+ </button>+ ))}+ </div>+ )}+ {isEmpty && (+ <div className="px-3 py-4 text-center text-[11px] text-foreground/30">+ {t("notes.speaker.typeNamePlaceholder")}+ </div>+ )}+ </div>+ </>+ );+}function SpeakerLabel({speakerId,@@ -143,10 +226,7 @@ function SpeakerLabel({participants,colorIdx,isYou,- availableSpeakers,onMap,- onReassignBubble,- onReassignRun,onConfirm,onDismiss,t,@@ -154,20 +234,16 @@ function SpeakerLabel({speakerId: string;segment: TranscriptSegment;mappedName?: string;- speakerProfiles?: Array<{ id: number; display_name: string; email: string | null }>;+ speakerProfiles?: Array<{ id?: number; display_name: string; email: string | null }>;participants?: Array<{ email: string; displayName: string | null }>;colorIdx: number;isYou: boolean;- availableSpeakers?: SpeakerOption[];onMap?: (speakerId: string, name: string, email?: string | null, profileId?: number) => void;- onReassignBubble?: (segmentId: string, targetSpeakerId: string) => void;- onReassignRun?: (segmentId: string, targetSpeakerId: string) => void;onConfirm?: (speakerId: string, name: string, profileId: number) => void;onDismiss?: (speakerId: string) => void;t: (key: string, opts?: Record<string, unknown>) => string;}) {const [open, setOpen] = useState(false);- const [search, setSearch] = useState("");const speakerState =segment.speakerLocked || isTranscriptSpeakerLocked(segment)? "locked"@@ -219,165 +295,121 @@ function SpeakerLabel({segment.speakerName ||t("notes.speaker.label", { n: getSpeakerNumber(speakerId) });const isUnmapped = !mappedName && !segment.speakerName;- const reassignmentTargets = (availableSpeakers || []).filter(- (candidate) => candidate.speakerId !== speakerId- );-- const filteredParticipants = participants?.filter(- (p) => search === "" || (p.displayName || p.email).toLowerCase().includes(search.toLowerCase())- );-- const filteredProfiles = speakerProfiles?.filter(- (p) =>- search === "" ||- p.display_name.toLowerCase().includes(search.toLowerCase()) ||- (p.email && p.email.toLowerCase().includes(search.toLowerCase()))- );-- const handleSelect = (name: string, email?: string | null, profileId?: number) => {- onMap?.(speakerId, name, email, profileId);- setOpen(false);- setSearch("");- };-- const handleKeyDown = (e: React.KeyboardEvent) => {- if (e.key === "Enter" && search.trim()) {- e.preventDefault();- handleSelect(search.trim());- }- };return (- <Popover- open={open}- onOpenChange={(o) => {- setOpen(o);- if (!o) setSearch("");- }}- >+ <Popover open={open} onOpenChange={setOpen}><PopoverTrigger asChild><buttonclassName={cn(- "group inline-flex items-center gap-1 text-[11px] font-medium mb-0.5 px-1 transition-colors duration-100 cursor-pointer rounded-sm outline-none focus-visible:ring-1 focus-visible:ring-ring",+ "inline-flex items-center gap-1 text-[11px] font-medium mb-0.5 px-1.5 py-0.5 rounded-md outline-none cursor-pointer",+ "border border-border/60 dark:border-white/20",+ "hover:bg-foreground/5 hover:border-border/90 dark:hover:border-white/30",+ "transition-colors duration-150 focus-visible:ring-1 focus-visible:ring-ring",SPEAKER_COLORS[colorIdx],- isUnmapped && "border-b border-dotted border-current",- speakerState === "provisional" && "italic text-foreground/55",- speakerState === "locked" && "text-foreground/70",- "hover:bg-muted/50"+ isUnmapped && "border-dashed",+ speakerState === "provisional" && "italic")}>- <span>{displayLabel}</span>- {speakerState === "provisional" && (- <span className="inline-flex items-center gap-0.5 rounded border border-border/50 bg-background/80 px-1 py-0.5 text-[10px] font-medium text-muted-foreground/50">- <Sparkles size={8} />- {t("notes.speaker.state.provisional")}- </span>- )}- {speakerState === "locked" && (- <span className="inline-flex items-center gap-0.5 rounded border border-border/50 bg-background/80 px-1 py-0.5 text-[10px] font-medium text-muted-foreground/50">- <Lock size={8} />- {t("notes.speaker.state.locked")}- </span>- )}+ {displayLabel}</button></PopoverTrigger><PopoverContent className="w-72 p-0">- <div className="p-2 border-b border-border/50">- <input- value={search}- onChange={(e) => setSearch(e.target.value)}- onKeyDown={handleKeyDown}- placeholder={t("notes.speaker.typeNamePlaceholder")}- className="w-full px-2 py-1.5 rounded-md bg-transparent text-xs text-foreground placeholder:text-foreground/20 outline-none border-none appearance-none"- autoFocus- />- </div>- <div className="max-h-40 overflow-y-auto">- {filteredParticipants && filteredParticipants.length > 0 && (- <div className="p-1 border-b border-border/30">- <div className="px-2 py-1 text-[11px] font-medium text-muted-foreground">- {t("notes.speaker.meetingAttendees")}- </div>- {filteredParticipants.slice(0, 5).map((p) => (- <button- key={p.email}- onClick={() => handleSelect(p.displayName || p.email.split("@")[0], p.email)}- className="flex items-center gap-2 w-full px-2 py-1.5 rounded-md text-xs text-foreground/70 hover:bg-foreground/5 transition-colors cursor-pointer"- >- <span className="truncate">{p.displayName || p.email}</span>- </button>- ))}- </div>- )}- {filteredProfiles && filteredProfiles.length > 0 && (- <div- className={cn("p-1", reassignmentTargets.length > 0 && "border-b border-border/30")}- >- <div className="px-2 py-1 text-[11px] font-medium text-muted-foreground">- {t("notes.speaker.knownSpeakers")}- </div>- {filteredProfiles.slice(0, 5).map((p) => (- <button- key={p.id}- onClick={() => handleSelect(p.display_name, p.email, p.id)}- className="flex items-center gap-2 w-full px-2 py-1.5 rounded-md text-xs text-foreground/70 hover:bg-foreground/5 transition-colors cursor-pointer"- >- <span className="truncate">{p.display_name}</span>- {p.email && (- <span className="text-foreground/30 truncate text-[11px]">{p.email}</span>- )}- </button>- ))}- </div>- )}- {reassignmentTargets.length > 0 && (- <div className="p-1">- <div className="px-2 py-1 text-[11px] font-medium text-muted-foreground">- {t("notes.speaker.moveBubble")}- </div>- {reassignmentTargets.map((candidate) => (- <button- key={`bubble-${candidate.speakerId}`}- onClick={() => {- onReassignBubble?.(segment.id, candidate.speakerId);- setOpen(false);- }}- className="flex items-center gap-2 w-full px-2 py-1.5 rounded-md text-xs text-foreground/70 hover:bg-foreground/5 transition-colors cursor-pointer"- >- <span className="truncate">{candidate.label}</span>- </button>- ))}- <div className="px-2 pt-2 pb-1 text-[11px] font-medium text-muted-foreground">- {t("notes.speaker.moveRun")}- </div>- {reassignmentTargets.map((candidate) => (- <button- key={`run-${candidate.speakerId}`}- onClick={() => {- onReassignRun?.(segment.id, candidate.speakerId);- setOpen(false);- }}- className="flex items-center gap-2 w-full px-2 py-1.5 rounded-md text-xs text-foreground/70 hover:bg-foreground/5 transition-colors cursor-pointer"- >- <span className="truncate">{candidate.label}</span>- </button>- ))}- </div>- )}- {(!filteredParticipants || filteredParticipants.length === 0) &&- (!filteredProfiles || filteredProfiles.length === 0) &&- reassignmentTargets.length === 0 &&- !search && (- <div className="px-3 py-4 text-center text-[11px] text-foreground/30">- {t("notes.speaker.typeNamePlaceholder")}- </div>- )}- </div>+ <SpeakerPicker+ speakerProfiles={speakerProfiles}+ participants={participants}+ onSelectName={(name, email, profileId) => {+ onMap?.(speakerId, name, email, profileId);+ setOpen(false);+ }}+ t={t}+ /></PopoverContent></Popover>);}+function SelectCheckbox({+ isSelected,+ onToggle,+ className,+}: {+ isSelected: boolean;+ onToggle: () => void;+ className?: string;+}) {+ return (+ <button+ onClick={(e) => {+ e.stopPropagation();+ onToggle();+ }}+ aria-pressed={isSelected}+ className={cn(+ "w-4 h-4 rounded-full border flex items-center justify-center transition-all cursor-pointer",+ isSelected+ ? "border-primary bg-primary text-primary-foreground opacity-100"+ : "border-border/60 bg-background/80 opacity-0 group-hover:opacity-100 hover:border-foreground/50",+ className+ )}+ >+ {isSelected && <Check size={10} strokeWidth={3} />}+ </button>+ );+}++export function SelectionBar({+ count,+ onClear,+ speakerProfiles,+ participants,+ onAssignName,+ t,+}: {+ count: number;+ onClear: () => void;+ speakerProfiles?: Array<{ id?: number; display_name: string; email: string | null }>;+ participants?: Array<{ email: string; displayName: string | null }>;+ onAssignName: (name: string, email?: string | null, profileId?: number) => void;+ t: (key: string, opts?: Record<string, unknown>) => string;+}) {+ const [open, setOpen] = useState(false);+ return (+ <div+ className="flex items-center gap-3 rounded-md border border-border/40 bg-surface-2/95 backdrop-blur px-3 py-1.5 text-xs shadow-lg"+ style={{ animation: "agent-message-in 150ms ease-out both" }}+ >+ <span className="text-foreground/70 tabular-nums">+ {t("notes.speaker.selected", { n: count })}+ </span>+ <Popover open={open} onOpenChange={setOpen}>+ <PopoverTrigger asChild>+ <button className="inline-flex items-center gap-1 px-2 py-1 rounded text-foreground hover:bg-foreground/10 transition-colors cursor-pointer">+ <Users size={12} />+ {t("notes.speaker.assignTo")}+ </button>+ </PopoverTrigger>+ <PopoverContent className="w-72 p-0">+ <SpeakerPicker+ speakerProfiles={speakerProfiles}+ participants={participants}+ onSelectName={(name, email, profileId) => {+ onAssignName(name, email, profileId);+ setOpen(false);+ }}+ t={t}+ />+ </PopoverContent>+ </Popover>+ <button+ onClick={onClear}+ className="px-2 py-1 rounded text-muted-foreground hover:bg-foreground/5 hover:text-foreground transition-colors cursor-pointer"+ >+ {t("notes.speaker.deselectAll")}+ </button>+ </div>+ );+}+interface MeetingTranscriptChatProps {segments: TranscriptSegment[];micPartial?: string;@@ -385,18 +417,18 @@ interface MeetingTranscriptChatProps {systemPartialSpeakerId?: string | null;systemPartialSpeakerName?: string | null;speakerMappings?: Record<string, string>;- speakerProfiles?: Array<{ id: number; display_name: string; email: string | null }>;+ speakerProfiles?: Array<{ id?: number; display_name: string; email: string | null }>;participants?: Array<{ email: string; displayName: string | null }>;+ selectedSegmentIds?: Set<string>;onMapSpeaker?: (speakerId: string,displayName: string,email?: string | null,profileId?: number) => void;- onReassignBubble?: (segmentId: string, targetSpeakerId: string) => void;- onReassignRun?: (segmentId: string, targetSpeakerId: string) => void;onConfirmSuggestion?: (speakerId: string, suggestedName: string, profileId: number) => void;onDismissSuggestion?: (speakerId: string) => void;+ onToggleSelect?: (segmentId: string) => void;}export function MeetingTranscriptChat({@@ -408,37 +440,15 @@ export function MeetingTranscriptChat({speakerMappings,speakerProfiles,participants,+ selectedSegmentIds,onMapSpeaker,- onReassignBubble,- onReassignRun,onConfirmSuggestion,onDismissSuggestion,+ onToggleSelect,}: MeetingTranscriptChatProps) {const { t } = useTranslation();const scrollRef = useRef<HTMLDivElement>(null);const shouldStickToBottomRef = useRef(true);- const availableSpeakers = useMemo(- () =>- segments.reduce<SpeakerOption[]>((acc, segment) => {- if (!segment.speaker || segment.speaker === "you") {- return acc;- }-- if (acc.some((candidate) => candidate.speakerId === segment.speaker)) {- return acc;- }-- acc.push({- speakerId: segment.speaker,- label:- speakerMappings?.[segment.speaker] ||- segment.speakerName ||- t("notes.speaker.label", { n: getSpeakerNumber(segment.speaker) }),- });- return acc;- }, []),- [segments, speakerMappings, t]- );useEffect(() => {const el = scrollRef.current;@@ -486,88 +496,110 @@ export function MeetingTranscriptChat({ref={scrollRef}className="h-full overflow-y-auto px-4 pt-3 pb-24 flex flex-col gap-1.5 agent-chat-scroll">- {segments.map((segment, i) => {- const isMic = segment.source === "mic";- const prevSegment = i > 0 ? segments[i - 1] : null;- const sameSpeaker = prevSegment- ? getSpeakerKey(prevSegment) === getSpeakerKey(segment)- : false;-- const hasSpeaker = !!segment.speaker;- const isYou = segment.speaker === "you";- const isSystemSpeaker = hasSpeaker && !isYou;- const colorIdx = isSystemSpeaker ? getSpeakerColorIndex(segment.speaker!) : 0;-- return (- <div- key={segment.id}- className={cn(- "flex flex-col",- isMic ? "items-start" : "items-end",- !sameSpeaker && i > 0 && "mt-2"- )}- style={{ animation: "agent-message-in 200ms ease-out both" }}- >- {hasSpeaker && !sameSpeaker && (- <SpeakerLabel- speakerId={segment.speaker!}- segment={segment}- mappedName={speakerMappings?.[segment.speaker!]}- speakerProfiles={speakerProfiles}- participants={participants}- colorIdx={colorIdx}- isYou={isYou}- availableSpeakers={availableSpeakers}- onMap={onMapSpeaker}- onReassignBubble={onReassignBubble}- onReassignRun={onReassignRun}- onConfirm={onConfirmSuggestion}- onDismiss={onDismissSuggestion}- t={t}- />- )}+ {segments.map((segment, i) => {+ const isMic = segment.source === "mic";+ const prevSegment = i > 0 ? segments[i - 1] : null;+ const sameSpeaker = prevSegment+ ? getSpeakerKey(prevSegment) === getSpeakerKey(segment)+ : false;++ const hasSpeaker = !!segment.speaker;+ const isYou = segment.speaker === "you";+ const isSystemSpeaker = hasSpeaker && !isYou;+ const colorIdx = isSystemSpeaker ? getSpeakerColorIndex(segment.speaker!) : 0;+ const isSelected = selectedSegmentIds?.has(segment.id) ?? false;+ const selectable = !!onToggleSelect;++ const labelElement = hasSpeaker && (+ <SpeakerLabel+ speakerId={segment.speaker!}+ segment={segment}+ mappedName={speakerMappings?.[segment.speaker!]}+ speakerProfiles={speakerProfiles}+ participants={participants}+ colorIdx={colorIdx}+ isYou={isYou}+ onMap={onMapSpeaker}+ onConfirm={onConfirmSuggestion}+ onDismiss={onDismissSuggestion}+ t={t}+ />+ );++ return (<div+ key={segment.id}className={cn(- "max-w-[80%] px-3 py-1.5",- "text-[13px] leading-relaxed",- isMic- ? cn(- "bg-primary/90 text-primary-foreground",- sameSpeaker ? "rounded-lg rounded-tl-sm" : "rounded-lg rounded-bl-sm"- )- : cn(- "bg-surface-2 border border-border/30 text-foreground",- sameSpeaker ? "rounded-lg rounded-tr-sm" : "rounded-lg rounded-br-sm",- isSystemSpeaker && cn("border-l-2", SPEAKER_BORDER_COLORS[colorIdx])- )+ "group flex flex-col",+ isMic ? "items-start" : "items-end",+ !sameSpeaker && i > 0 && "mt-2",+ selectable && (isMic ? "pl-6" : "pr-6"))}+ style={{ animation: "agent-message-in 200ms ease-out both" }}>- {segment.text}+ {labelElement && !sameSpeaker && labelElement}+ {labelElement && sameSpeaker && (+ <div+ className={cn(+ "grid grid-rows-[0fr] opacity-0 pointer-events-none transition-[grid-template-rows,opacity] duration-150 ease-out",+ "group-hover:grid-rows-[1fr] group-hover:opacity-100 group-hover:pointer-events-auto"+ )}+ >+ <div className="overflow-hidden">{labelElement}</div>+ </div>+ )}+ <div className="relative max-w-[80%]">+ <div+ className={cn(+ "px-3 py-1.5 cursor-default",+ "text-[13px] leading-relaxed",+ isMic+ ? cn(+ "bg-primary/90 text-primary-foreground",+ sameSpeaker ? "rounded-lg rounded-tl-sm" : "rounded-lg rounded-bl-sm"+ )+ : cn(+ "bg-surface-2 border border-border/30 text-foreground",+ sameSpeaker ? "rounded-lg rounded-tr-sm" : "rounded-lg rounded-br-sm",+ isSystemSpeaker && cn("border-l-2", SPEAKER_BORDER_COLORS[colorIdx])+ ),+ isSelected && "ring-2 ring-primary/60"+ )}+ >+ {segment.text}+ </div>+ {selectable && (+ <SelectCheckbox+ isSelected={isSelected}+ onToggle={() => onToggleSelect?.(segment.id)}+ className={cn("absolute top-1.5", isMic ? "-left-6" : "-right-6")}+ />+ )}+ </div></div>- </div>- );- })}-- {[- { text: micPartial, source: "mic" as const, speakerLabel: undefined },- {- text: systemPartial,- source: "system" as const,- speakerLabel: systemPartialSpeakerLabel,- },- ].map(- ({ text, source, speakerLabel }) =>- text && (- <PartialBubble- key={source}- text={text}- source={source}- speakerLabel={speakerLabel}- speakerState={source === "system" ? systemPartialSpeakerState : undefined}- t={t}- />- )- )}+ );+ })}++ {[+ { text: micPartial, source: "mic" as const, speakerLabel: undefined },+ {+ text: systemPartial,+ source: "system" as const,+ speakerLabel: systemPartialSpeakerLabel,+ },+ ].map(+ ({ text, source, speakerLabel }) =>+ text && (+ <PartialBubble+ key={source}+ text={text}+ source={source}+ speakerLabel={speakerLabel}+ speakerState={source === "system" ? systemPartialSpeakerState : undefined}+ t={t}+ />+ )+ )}</div>);}diff --git a/src/components/notes/NoteEditor.tsx b/src/components/notes/NoteEditor.tsxindex 7dbe3fc37..3311167ba 100644--- a/src/components/notes/NoteEditor.tsx+++ b/src/components/notes/NoteEditor.tsx@@ -16,7 +16,7 @@ import {} from "lucide-react";import { RichTextEditor } from "../ui/RichTextEditor";import type { Editor } from "@tiptap/react";-import { MeetingTranscriptChat } from "./MeetingTranscriptChat";+import { MeetingTranscriptChat, SelectionBar } from "./MeetingTranscriptChat";import type { TranscriptSegment } from "../../hooks/useMeetingTranscription";import {DropdownMenu,@@ -191,6 +191,27 @@ export default function NoteEditor({const hasChatSegments = displaySegments.length > 0;+ const knownSpeakers = useMemo(() => {+ const seen = new Set<string>();+ const list: Array<{ id?: number; display_name: string; email: string | null }> = [];+ for (const p of speakerProfiles) {+ const key = p.display_name.toLowerCase();+ if (seen.has(key)) continue;+ seen.add(key);+ list.push(p);+ }+ for (const segment of displaySegments) {+ if (!segment.speaker) continue;+ const name = speakerMappings[segment.speaker] || segment.speakerName;+ if (!name) continue;+ const key = name.toLowerCase();+ if (seen.has(key)) continue;+ seen.add(key);+ list.push({ display_name: name, email: null });+ }+ return list;+ }, [displaySegments, speakerMappings, speakerProfiles]);+const parsedParticipants = useMemo<CalendarAttendee[]>(() => {try {return note.participants ? JSON.parse(note.participants) : [];@@ -354,18 +375,6 @@ export default function NoteEditor({[note.id]);- const getSpeakerAssignmentState = useCallback(- (speakerId: string, sourceSegments: TranscriptSegment[]) => {- const representativeSegment = sourceSegments.find((segment) => segment.speaker === speakerId);- const speakerName = speakerMappings[speakerId] || representativeSegment?.speakerName;- return {- speakerName,- speakerIsPlaceholder: !speakerName && !!representativeSegment?.speakerIsPlaceholder,- };- },- [speakerMappings]- );-const handleMapSpeaker = useCallback(async (speakerId: string,@@ -437,70 +446,52 @@ export default function NoteEditor({[displaySegments, diarizedSegments, isMeetingRecording, persistDisplaySegments]);- const handleReassignBubble = useCallback(- async (segmentId: string, targetSpeakerId: string) => {- const targetState = getSpeakerAssignmentState(targetSpeakerId, displaySegments);- const nextSegments = displaySegments.map((segment) =>- segment.id === segmentId- ? lockTranscriptSpeaker(segment, {- speaker: targetSpeakerId,- speakerName: targetState.speakerName,- speakerIsPlaceholder: targetState.speakerIsPlaceholder,- suggestedName: undefined,- suggestedProfileId: undefined,- })- : segment- );- await persistDisplaySegments(nextSegments);- },- [displaySegments, getSpeakerAssignmentState, persistDisplaySegments]- );-- const handleReassignRun = useCallback(- async (segmentId: string, targetSpeakerId: string) => {- const segmentIndex = displaySegments.findIndex((segment) => segment.id === segmentId);- if (segmentIndex === -1) {- return;- }-- const sourceSegment = displaySegments[segmentIndex];- const sourceSpeaker = sourceSegment.speaker;- if (!sourceSpeaker) {- return;- }-- let runStart = segmentIndex;- while (runStart > 0 && displaySegments[runStart - 1].speaker === sourceSpeaker) {- runStart -= 1;- }+ const [selectedSegmentIds, setSelectedSegmentIds] = useState<Set<string>>(new Set());+ const [selectionNoteId, setSelectionNoteId] = useState(note.id);+ if (selectionNoteId !== note.id) {+ setSelectionNoteId(note.id);+ setSelectedSegmentIds(new Set());+ }++ const handleToggleSelect = useCallback((segmentId: string) => {+ setSelectedSegmentIds((prev) => {+ const next = new Set(prev);+ if (next.has(segmentId)) next.delete(segmentId);+ else next.add(segmentId);+ return next;+ });+ }, []);- let runEnd = segmentIndex;- while (- runEnd + 1 < displaySegments.length &&- displaySegments[runEnd + 1].speaker === sourceSpeaker- ) {- runEnd += 1;- }+ const handleClearSelection = useCallback(() => {+ setSelectedSegmentIds(new Set());+ }, []);- const runSegmentIds = new Set(- displaySegments.slice(runStart, runEnd + 1).map((segment) => segment.id)- );- const targetState = getSpeakerAssignmentState(targetSpeakerId, displaySegments);+ useEffect(() => {+ if (selectedSegmentIds.size === 0) return;+ const onKey = (e: KeyboardEvent) => {+ if (e.key === "Escape") handleClearSelection();+ };+ window.addEventListener("keydown", onKey);+ return () => window.removeEventListener("keydown", onKey);+ }, [selectedSegmentIds.size, handleClearSelection]);++ const handleBulkAssignName = useCallback(+ async (displayName: string, _email?: string | null, profileId?: number) => {+ if (!selectedSegmentIds.size) return;const nextSegments = displaySegments.map((segment) =>- runSegmentIds.has(segment.id)+ selectedSegmentIds.has(segment.id)? lockTranscriptSpeaker(segment, {- speaker: targetSpeakerId,- speakerName: targetState.speakerName,- speakerIsPlaceholder: targetState.speakerIsPlaceholder,+ speakerName: displayName,+ speakerIsPlaceholder: false,suggestedName: undefined,- suggestedProfileId: undefined,+ suggestedProfileId: profileId ?? undefined,}): segment);-await persistDisplaySegments(nextSegments);+ handleClearSelection();},- [displaySegments, getSpeakerAssignmentState, persistDisplaySegments]+ [displaySegments, selectedSegmentIds, persistDisplaySegments, handleClearSelection]);const handleTitleInput = useCallback(() => {@@ -817,13 +808,13 @@ export default function NoteEditor({isMeetingRecording ? meetingSystemPartialSpeakerName : undefined}speakerMappings={speakerMappings}- speakerProfiles={speakerProfiles}+ speakerProfiles={knownSpeakers}participants={parsedParticipants}onMapSpeaker={handleMapSpeaker}- onReassignBubble={!isMeetingRecording ? handleReassignBubble : undefined}- onReassignRun={!isMeetingRecording ? handleReassignRun : undefined}onConfirmSuggestion={handleConfirmSuggestion}onDismissSuggestion={handleDismissSuggestion}+ selectedSegmentIds={!isMeetingRecording ? selectedSegmentIds : undefined}+ onToggleSelect={!isMeetingRecording ? handleToggleSelect : undefined}/>{isDiarizing && (<div className="flex items-center justify-center gap-1.5 py-2">@@ -858,6 +849,18 @@ export default function NoteEditor({background: "linear-gradient(to bottom, transparent, var(--color-background))",}}/>+ {!isMeetingRecording && selectedSegmentIds.size > 0 && (+ <div className="absolute bottom-20 left-1/2 -translate-x-1/2 z-20 pointer-events-auto">+ <SelectionBar+ count={selectedSegmentIds.size}+ onClear={handleClearSelection}+ speakerProfiles={knownSpeakers}+ participants={parsedParticipants}+ onAssignName={handleBulkAssignName}+ t={t}+ />+ </div>+ )}<NoteBottomBarisRecording={isRecording || !!isMeetingRecording}isProcessing={isProcessing}diff --git a/src/locales/de/translation.json b/src/locales/de/translation.jsonindex f9066d354..8e784e26f 100644--- a/src/locales/de/translation.json+++ b/src/locales/de/translation.json@@ -1818,8 +1818,9 @@"meetingAttendees": "Meeting-Teilnehmer","assignName": "Name zuweisen","isThisPerson": "Ist das {{name}}?",- "moveBubble": "Diese Blase verschieben",- "moveRun": "Diesen Block verschieben",+ "selected": "{{n}} ausgewählt",+ "assignTo": "Zuweisen zu…",+ "deselectAll": "Alle abwählen","confirmed": "Bestätigt","nameAssigned": "Name zugewiesen","state": {@@ -2073,13 +2074,6 @@"proLimit": "Unbegrenzt","upgrade": "Upgrade"},- "beta": {- "title": "Meeting-Aufnahme ist in der Beta-Phase",- "description": "Wir arbeiten noch daran, wie wir diese Funktion am besten ins Produkt integrieren. Feedback ist sehr willkommen!",- "freeTier": "Kostenloser Plan: 5 Stunden / Monat",- "proTier": "Pro-Plan: 20 Stunden / Monat",- "feedback": "Mehr als 20 Stunden benötigt? Kontaktieren Sie [email protected]"- },"notABot": {"title": "OpenWhispr ist ein Meeting-Rekorder, kein Bot","description": "OpenWhispr erfasst Audio direkt von deinem System — es nimmt niemals als Teilnehmer an deinen Meetings teil. Verbinde einfach deinen Kalender und mach Notizen wie gewohnt."diff --git a/src/locales/en/translation.json b/src/locales/en/translation.jsonindex 982a1e69f..b590b06b2 100644--- a/src/locales/en/translation.json+++ b/src/locales/en/translation.json@@ -1927,8 +1927,9 @@"meetingAttendees": "Meeting attendees","assignName": "Assign name","isThisPerson": "Is this {{name}}?",- "moveBubble": "Move this bubble",- "moveRun": "Move this run",+ "selected": "{{n}} selected",+ "assignTo": "Assign to…",+ "deselectAll": "Deselect all","confirmed": "Confirmed","nameAssigned": "Name assigned","state": {@@ -2121,13 +2122,6 @@"proLimit": "Unlimited","upgrade": "Upgrade"},- "beta": {- "title": "Meeting recording is in beta",- "description": "We're still working on how best to build this into the product. Feedback is very welcome!",- "freeTier": "Free plan: 5 hours / month",- "proTier": "Pro plan: 20 hours / month",- "feedback": "Need more than 20 hours? Contact [email protected]"- },"notABot": {"title": "OpenWhispr is a meeting recorder, not a bot","description": "OpenWhispr captures audio directly from your system — it never joins your meetings as a participant. Just connect your calendar and take notes as normal."diff --git a/src/locales/es/translation.json b/src/locales/es/translation.jsonindex 5fd39deea..e38747a85 100644--- a/src/locales/es/translation.json+++ b/src/locales/es/translation.json@@ -1818,8 +1818,9 @@"meetingAttendees": "Asistentes de la reunión","assignName": "Asignar nombre","isThisPerson": "¿Es {{name}}?",- "moveBubble": "Mover esta burbuja",- "moveRun": "Mover este bloque",+ "selected": "{{n}} seleccionados",+ "assignTo": "Asignar a…",+ "deselectAll": "Deseleccionar todo","confirmed": "Confirmado","nameAssigned": "Nombre asignado","state": {@@ -2073,13 +2074,6 @@"proLimit": "Ilimitado","upgrade": "Mejorar"},- "beta": {- "title": "La grabación de reuniones está en beta",- "description": "Seguimos trabajando en cómo integrar mejor esta función en el producto. ¡Tus comentarios son bienvenidos!",- "freeTier": "Plan gratuito: 5 horas / mes",- "proTier": "Plan Pro: 20 horas / mes",- "feedback": "¿Necesitas más de 20 horas? Contacta a [email protected]"- },"notABot": {"title": "OpenWhispr es un grabador de reuniones, no un bot","description": "OpenWhispr captura el audio directamente de tu sistema — nunca se une a tus reuniones como participante. Solo conecta tu calendario y toma notas con normalidad."diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.jsonindex c7696b49b..01d785d48 100644--- a/src/locales/fr/translation.json+++ b/src/locales/fr/translation.json@@ -1879,8 +1879,9 @@"meetingAttendees": "Participants à la réunion","assignName": "Attribuer un nom","isThisPerson": "Est-ce {{name}} ?",- "moveBubble": "Déplacer cette bulle",- "moveRun": "Déplacer ce bloc",+ "selected": "{{n}} sélectionné(s)",+ "assignTo": "Assigner à…",+ "deselectAll": "Tout désélectionner","confirmed": "Confirmé","nameAssigned": "Nom attribué","state": {@@ -2073,13 +2074,6 @@"proLimit": "Illimité","upgrade": "Passer au supérieur"},- "beta": {- "title": "L'enregistrement de réunions est en bêta",- "description": "Nous travaillons encore sur la meilleure façon d'intégrer cette fonctionnalité. Vos retours sont les bienvenus !",- "freeTier": "Plan gratuit : 5 heures / mois",- "proTier": "Plan Pro : 20 heures / mois",- "feedback": "Besoin de plus de 20 heures ? Contactez [email protected]"- },"notABot": {"title": "OpenWhispr est un enregistreur de réunions, pas un bot","description": "OpenWhispr capture l'audio directement depuis votre système — il ne rejoint jamais vos réunions en tant que participant. Connectez simplement votre calendrier et prenez vos notes normalement."diff --git a/src/locales/it/translation.json b/src/locales/it/translation.jsonindex 391c1fe4c..f830b5c8f 100644--- a/src/locales/it/translation.json+++ b/src/locales/it/translation.json@@ -1818,8 +1818,9 @@"meetingAttendees": "Partecipanti alla riunione","assignName": "Assegna nome","isThisPerson": "È {{name}}?",- "moveBubble": "Sposta questa bolla",- "moveRun": "Sposta questo blocco",+ "selected": "{{n}} selezionati",+ "assignTo": "Assegna a…",+ "deselectAll": "Deseleziona tutto","confirmed": "Confermato","nameAssigned": "Nome assegnato","state": {@@ -2073,13 +2074,6 @@"proLimit": "Illimitato","upgrade": "Aggiorna"},- "beta": {- "title": "La registrazione delle riunioni è in beta",- "description": "Stiamo ancora lavorando su come integrare al meglio questa funzionalità. Il tuo feedback è molto apprezzato!",- "freeTier": "Piano gratuito: 5 ore / mese",- "proTier": "Piano Pro: 20 ore / mese",- "feedback": "Hai bisogno di più di 20 ore? Contatta [email protected]"- },"notABot": {"title": "OpenWhispr è un registratore di riunioni, non un bot","description": "OpenWhispr cattura l'audio direttamente dal tuo sistema — non entra mai nelle tue riunioni come partecipante. Basta collegare il calendario e prendere appunti normalmente."diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.jsonindex ef24c84fa..346998c36 100644--- a/src/locales/ja/translation.json+++ b/src/locales/ja/translation.json@@ -1746,8 +1746,9 @@"meetingAttendees": "会議の参加者","assignName": "名前を割り当て","isThisPerson": "{{name}}さんですか?",- "moveBubble": "この吹き出しを移動",- "moveRun": "このまとまりを移動",+ "selected": "{{n}}件選択中",+ "assignTo": "割り当て…",+ "deselectAll": "すべて選択解除","confirmed": "確認済み","nameAssigned": "名前を割り当てました","state": {@@ -2073,13 +2074,6 @@"proLimit": "無制限","upgrade": "アップグレード"},- "beta": {- "title": "会議録音はベータ版です",- "description": "この機能を製品にどう組み込むか、まだ検討中です。フィードバックをお待ちしています!",- "freeTier": "無料プラン:月5時間",- "proTier": "Proプラン:月20時間",- "feedback": "20時間以上必要ですか? [email protected] までご連絡ください"- },"notABot": {"title": "OpenWhispr はミーティング録音ツールであり、ボットではありません","description": "OpenWhispr はシステムから直接オーディオをキャプチャします — 参加者としてミーティングに参加することはありません。カレンダーを接続して、通常通りノートを取るだけです。"diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.jsonindex 098441b10..54aac3850 100644--- a/src/locales/pt/translation.json+++ b/src/locales/pt/translation.json@@ -1818,8 +1818,9 @@"meetingAttendees": "Participantes da reunião","assignName": "Atribuir nome","isThisPerson": "É {{name}}?",- "moveBubble": "Mover este balão",- "moveRun": "Mover este bloco",+ "selected": "{{n}} selecionado(s)",+ "assignTo": "Atribuir a…",+ "deselectAll": "Desmarcar tudo","confirmed": "Confirmado","nameAssigned": "Nome atribuído","state": {@@ -2073,13 +2074,6 @@"proLimit": "Ilimitado","upgrade": "Atualizar"},- "beta": {- "title": "A gravação de reuniões está em beta",- "description": "Ainda estamos trabalhando na melhor forma de integrar isso ao produto. Seu feedback é muito bem-vindo!",- "freeTier": "Plano gratuito: 5 horas / mês",- "proTier": "Plano Pro: 20 horas / mês",- "feedback": "Precisa de mais de 20 horas? Entre em contato: [email protected]"- },"notABot": {"title": "O OpenWhispr é um gravador de reuniões, não um bot","description": "O OpenWhispr captura áudio diretamente do seu sistema — ele nunca entra nas suas reuniões como participante. Basta conectar seu calendário e fazer anotações normalmente."diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.jsonindex 0003b5dd2..a52b3901b 100644--- a/src/locales/ru/translation.json+++ b/src/locales/ru/translation.json@@ -1818,8 +1818,9 @@"meetingAttendees": "Участники встречи","assignName": "Назначить имя","isThisPerson": "Это {{name}}?",- "moveBubble": "Переместить эту реплику",- "moveRun": "Переместить этот блок",+ "selected": "Выбрано: {{n}}",+ "assignTo": "Назначить…",+ "deselectAll": "Снять выделение","confirmed": "Подтверждено","nameAssigned": "Имя назначено","state": {@@ -2073,13 +2074,6 @@"proLimit": "Безлимитно","upgrade": "Улучшить"},- "beta": {- "title": "Запись встреч в бета-версии",- "description": "Мы всё ещё работаем над тем, как лучше интегрировать эту функцию. Будем рады вашим отзывам!",- "freeTier": "Бесплатный план: 5 часов / месяц",- "proTier": "Pro-план: 20 часов / месяц",- "feedback": "Нужно больше 20 часов? Напишите на [email protected]"- },"notABot": {"title": "OpenWhispr — это запись встреч, а не бот","description": "OpenWhispr захватывает аудио напрямую из вашей системы — он никогда не присоединяется к встречам как участник. Просто подключите календарь и делайте заметки как обычно."diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.jsonindex a3a626ff3..c1d996b8c 100644--- a/src/locales/zh-CN/translation.json+++ b/src/locales/zh-CN/translation.json@@ -1813,8 +1813,9 @@"meetingAttendees": "会议参与者","assignName": "分配姓名","isThisPerson": "这是{{name}}吗?",- "moveBubble": "移动此气泡",- "moveRun": "移动这一段",+ "selected": "已选 {{n}} 个",+ "assignTo": "分配给…",+ "deselectAll": "取消全选","confirmed": "已确认","nameAssigned": "姓名已分配","state": {@@ -2068,13 +2069,6 @@"proLimit": "无限","upgrade": "升级"},- "beta": {- "title": "会议录制功能正在测试中",- "description": "我们仍在探索将此功能更好地融入产品的方式,非常欢迎您的反馈!",- "freeTier": "免费计划:每月 5 小时",- "proTier": "Pro 计划:每月 20 小时",- "feedback": "需要超过 20 小时?请联系 [email protected]"- },"notABot": {"title": "OpenWhispr 是会议录制工具,不是机器人","description": "OpenWhispr 直接从您的系统捕获音频 — 它不会以参与者身份加入您的会议。只需连接日历,正常记录笔记即可。"diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.jsonindex 61c46e6b8..488cc3b1e 100644--- a/src/locales/zh-TW/translation.json+++ b/src/locales/zh-TW/translation.json@@ -1813,8 +1813,10 @@"meetingAttendees": "會議參與者","assignName": "指派姓名","isThisPerson": "這是{{name}}嗎?",- "moveBubble": "移動此氣泡",- "moveRun": "移動這一段",+ "reassignTo": "重新指派給",+ "selected": "已選 {{n}} 個",+ "assignTo": "指派給…",+ "deselectAll": "取消全選","confirmed": "已確認","nameAssigned": "姓名已指派","state": {@@ -2068,13 +2070,6 @@"proLimit": "無限","upgrade": "升級"},- "beta": {- "title": "會議錄製功能正在測試中",- "description": "我們仍在探索將此功能更好地融入產品的方式,非常歡迎您的回饋!",- "freeTier": "免費方案:每月 5 小時",- "proTier": "Pro 方案:每月 20 小時",- "feedback": "需要超過 20 小時?請聯繫 [email protected]"- },"notABot": {"title": "OpenWhispr 是會議錄製工具,不是機器人","description": "OpenWhispr 直接從您的系統擷取音訊 — 它不會以參與者身分加入您的會議。只需連接日曆,正常記錄筆記即可。"