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
Merge origin/main (1.7.6) into feat/workspaces-and-sharing-v1
Gabriel Steina50d4359a9d4
diff --cc main.jsindex b4f8070fb,44d6a4018..776a1e1a7--- a/main.js+++ b/main.js@@@ -524,18 -529,10 +529,22 @@@ app.on("open-url", (event, url) =>}});+ function isInvitationDeepLink(url) {+ return url.slice(`${OAUTH_PROTOCOL}://`.length).startsWith("invitations/");+ }++// Deep links can arrive before windowManager exists (cold start) or before the+// renderer has mounted its listener. The token is stashed here and the renderer+// pulls it via `get-pending-invitation-token` on mount; the push below is a+// best-effort fast path for an already-running app.+let pendingInvitationDeepLinkToken = null;++ipcMain.handle("get-pending-invitation-token", () => {+ const token = pendingInvitationDeepLinkToken;+ pendingInvitationDeepLinkToken = null;+ return token;+});+function handleInvitationDeepLink(deepLinkUrl) {try {const match = deepLinkUrl.match(/invitations\/([^/?#]+)/);diff --cc src/components/ControlPanel.tsxindex e64218168,7705b325d..3a9cb87de--- a/src/components/ControlPanel.tsx+++ b/src/components/ControlPanel.tsx@@@ -41,10 -50,11 +51,12 @@@ importinitializeNotes,} from "../stores/noteStore";import { fetchProviders as fetchStreamingProviders } from "../stores/streamingProvidersStore";+ import { executeTranslationChain, shouldRunTranslateStep } from "../helpers/translationChain";import HistoryView from "./HistoryView";import BackgroundActionToastListener from "./notes/BackgroundActionToastListener";+import SpaceSyncToastListener from "./notes/SpaceSyncToastListener";import { syncService } from "../services/SyncService.js";+ import logger from "../utils/logger";import AcceptInvitationModal from "./AcceptInvitationModal";import {consumePendingInvitationToken,@@@ -976,9 -1070,30 +1091,31 @@@ export default function ControlPanel({)}</div></main>+ {!isSidePanelLayout && (+ <div+ className={`absolute z-40 flex h-10 items-center ${+ platform === "darwin" ? "left-21 top-2" : "left-2 top-0"+ }`}+ style={{ WebkitAppRegion: "no-drag" } as React.CSSProperties}+ onMouseEnter={sidebarCollapsed ? showSidebarPeek : undefined}+ onMouseLeave={sidebarCollapsed ? leaveSidebarToggle : undefined}+ >+ <button+ onClick={toggleSidebar}+ aria-label={sidebarCollapsed ? t("sidebar.expand") : t("sidebar.collapse")}+ className="group flex items-center justify-center h-7 w-7 rounded-md outline-none hover:bg-foreground/5 dark:hover:bg-white/5 focus-visible:ring-1 focus-visible:ring-primary/30 transition-colors duration-150"+ >+ {sidebarCollapsed ? (+ <PanelLeftOpen size={15} className={toggleIconClass} />+ ) : (+ <PanelLeftClose size={15} className={toggleIconClass} />+ )}+ </button>+ </div>+ )}</div><BackgroundActionToastListener />+ <SpaceSyncToastListener /></div>);}diff --cc src/components/notes/PersonalNotesView.tsxindex 8a42fe930,c02e549bc..6a3189bb2--- a/src/components/notes/PersonalNotesView.tsx+++ b/src/components/notes/PersonalNotesView.tsx@@@ -62,7 -80,11 +62,8 @@@ import} from "../../stores/meetingRecordingStore";import { useNotesOnboarding } from "../../hooks/useNotesOnboarding";import NotesOnboarding from "./NotesOnboarding";+ import { isRegenerableNoteTitle } from "../../helpers/regenerableNoteTitle";-const FOLDER_INPUT_CLASS =- "w-full h-6 bg-foreground/5 dark:bg-white/5 rounded px-2 text-xs text-foreground outline-none border border-primary/30 focus:border-primary/50";-function makeContentHash(content: string): string {return String(content.length) + "-" + content.slice(0, 50);}diff --cc src/components/notes/UploadAudioView.tsxindex 09724d239,c5a6a8bfc..7ed642d96--- a/src/components/notes/UploadAudioView.tsx+++ b/src/components/notes/UploadAudioView.tsx@@@ -163,11 -311,27 +311,33 @@@ export default function UploadAudioView}, []);useEffect(() => {- window.electronAPI.getFolders?.().then((f) => {+ mountedRef.current = true;+ return () => {+ mountedRef.current = false;+ if (urlDownloadActiveRef.current) {+ window.electronAPI.cancelUrlDownload();+ }+ if (downloadedTempPathRef.current) {+ window.electronAPI.deleteTempFile(downloadedTempPathRef.current);+ }+ };+ }, []);++ useEffect(() => {- window.electronAPI.getFolders?.().then((f) => {++ // Uploads and URL downloads are a personal flow: scope the folder list++ // (and the by-name "Videos" destination lookup) to the private space so a++ // same-named team folder can never capture them.++ (async () => {++ const spaces = (await window.electronAPI.getSpaces?.()) ?? [];++ const privateSpace = spaces.find((s) => s.kind === "private");++ const f = (await window.electronAPI.getFolders?.(privateSpace?.id ?? null)) ?? [];setFolders(f);const personal = findDefaultFolder(f);- if (personal) setSelectedFolderId(String(personal.id));- });+ if (personal) {+ setSelectedFolderId(String(personal.id));+ setBatchFolderId(String(personal.id));+ }- });++ })();}, []);useEffect(() => {diff --cc src/helpers/database.jsindex 3ea694f96,e8eee5902..81107d412--- a/src/helpers/database.js+++ b/src/helpers/database.js@@@ -195,30 -202,41 +202,48 @@@ class DatabaseManager);seedFolder.run("Personal", 0);seedFolder.run("Meetings", 1);+ seedFolder.run("Videos", 2);}+ // Backfill folder_id only when the column is first added: on later+ // launches a NULL folder_id is a legitimate space-root note, not a+ // pre-folders row.+ let folderColumnAdded = true;try {this.db.exec("ALTER TABLE notes ADD COLUMN folder_id INTEGER REFERENCES folders(id)");} catch (err) {if (!err.message.includes("duplicate column")) throw err;+ folderColumnAdded = false;}- const personalFolder = this.db- .prepare("SELECT id FROM folders WHERE name = 'Personal' AND is_default = 1")- .get();- if (personalFolder) {- this.db- .prepare("UPDATE notes SET folder_id = ? WHERE folder_id IS NULL")- .run(personalFolder.id);+ if (folderColumnAdded) {+ const personalFolder = this.db+ .prepare("SELECT id FROM folders WHERE name = 'Personal' AND is_default = 1")+ .get();+ if (personalFolder) {+ this.db+ .prepare("UPDATE notes SET folder_id = ? WHERE folder_id IS NULL")+ .run(personalFolder.id);+ }}+ // One-time seed (user_version 1): a pre-existing user-created "Videos"+ // folder stays untouched (never promoted to default); URL downloads route+ // to it by name. Guarded so a later delete/rename doesn't resurrect it as+ // an undeletable default on the next launch.+ if (this.db.pragma("user_version", { simple: true }) < 1) {+ const videosFolder = this.db.prepare("SELECT id FROM folders WHERE name = 'Videos'").get();+ if (!videosFolder) {+ const maxOrder = this.db.prepare("SELECT MAX(sort_order) as m FROM folders").get();+ this.db+ .prepare(+ "INSERT OR IGNORE INTO folders (name, is_default, sort_order) VALUES ('Videos', 1, ?)"+ )+ .run((maxOrder?.m ?? 1) + 1);+ }+ this.db.pragma("user_version = 1");+ }+this.db.exec(`CREATE TABLE IF NOT EXISTS actions (id INTEGER PRIMARY KEY AUTOINCREMENT,@@@ -2612,21 -2121,11 +2639,18 @@@}}- searchNotes(query, limit = 50) {+ searchNotes(query, limit = 50, spaceId = null) {try {if (!this.db) throw new Error("Database not initialized");- const term = query- .trim()- .replace(/[^\w\s]/g, " ")- .trim();- if (!term) return [];- const params = [term + "*"];+ const ftsQuery = buildNoteSearchQuery(query);+ if (!ftsQuery) return [];++ const params = [ftsQuery];+ let spaceFilter = "";+ if (spaceId != null) {+ spaceFilter = "AND n.space_id = ?";+ params.push(spaceId);+ }+ params.push(limit);return this.db.prepare(`diff --cc src/helpers/ipcHandlers.jsindex 226fbf0fe,f87c42c0b..21c5906c2--- a/src/helpers/ipcHandlers.js+++ b/src/helpers/ipcHandlers.js@@@ -6916,9 -7137,16 +7289,17 @@@ class IPCHandlersconst apiUrl = getApiUrl();if (!apiUrl) throw new Error("OpenWhispr API URL not configured");+ if (typeof opts?.path !== "string" || !opts.path.startsWith("/")) {+ return { success: false, error: "Invalid API path" };+ }+ const targetUrl = new URL(opts.path, apiUrl);+ if (targetUrl.origin !== new URL(apiUrl).origin) {+ return { success: false, error: "Invalid API path" };+ }+const authHeader = await getAuthHeader(event);- if (!Object.keys(authHeader).length) throw new Error("Not authenticated");+ // Public endpoints (e.g. invitation previews) work without a session.+ if (!Object.keys(authHeader).length && !opts.public) throw new Error("Not authenticated");const method = (opts.method || "GET").toUpperCase();const sendWith = (header) => {diff --cc src/locales/de/translation.jsonindex 80c2045af,50d1ae7b6..5b9276f23--- a/src/locales/de/translation.json+++ b/src/locales/de/translation.json@@@ -403,7 -399,7 +398,8 @@@"recordingWithDuration": "Verworfene Aufnahme · {{duration}}","recover": "Wiederherstellen","recovered": "Wiederhergestellt"-- }++ },++ "retryTranslationMode": "Übersetzungsmodus"},"cloudMigration": {"title": "Willkommen bei OpenWhispr Cloud",@@@ -577,6 -579,6 +573,12 @@@"offline": "Du bist offline. Die Cloud-Transkription benötigt eine Internetverbindung.","dailyLimitReached": "Du hast dein heutiges Transkriptionslimit erreicht. Versuch es morgen erneut oder upgrade deinen Plan.","providerRateLimited": "Dein Transkriptionsanbieter hat die Anfrage begrenzt. Warte kurz und versuch es erneut."++ },++ "translationFallback": {++ "unreachableTitle": "Übersetzung nicht verfügbar",++ "unreachableDescription": "Dein Diktat wurde unübersetzt eingefügt. Überprüfe die Übersetzungseinstellungen.",++ "failedTitle": "Übersetzung fehlgeschlagen",++ "failedDescription": "Der Originaltext wurde eingefügt. Du kannst es im Verlauf erneut versuchen."}},"clipboard": {@@@ -1125,13 -1042,15 +1127,18 @@@"providerLabel": "Anbieter","run": "Test ausführen","customEndpoint": "Benutzerdefinierter Endpoint",- "apiKeyMissing": "{{provider}} API-Schlüssel nicht konfiguriert. Fügen Sie ihn in den KI-Modelle-Einstellungen hinzu."+ "apiKeyMissing": "{{provider}} API-Schlüssel nicht konfiguriert. Fügen Sie ihn in den KI-Modelle-Einstellungen hinzu.",++ "translateHint": "Der Text wird in {{language}} übersetzt",++ "translation": "Übersetzung",+ "translationDisabled": "Aktiviere die Diktatübersetzung, um diesen Prompt zu testen",+ "noTargetLanguage": "Wähle zuerst eine Zielsprache"},"view": {"customPrompt": "Benutzerdefinierter Prompt","defaultPrompt": "Standard-Prompt","modified": "Geändert"-- }++ },++ "defaultTestInputTranslate": "Das Wetter ist heute wunderschön, hast du Lust auf einen Spaziergang?"},"settingsModal": {"groups": {@@@ -1858,6 -1610,6 +1865,10 @@@"title": "Updates","versionPlaceholder": "—","whatsNew": "Neu in v{{version}}"++ },++ "translationHotkey": {++ "title": "Übersetzungs-Hotkey",++ "description": "Diktiere in beliebiger Sprache — der eingefügte Text kommt übersetzt heraus"}},"permissions": {@@@ -1930,8 -1682,9 +1941,9 @@@"tabs": {"dictationCleanup": "Diktat-Bereinigung","dictationAgent": "Voice Agent",- "dictationTranslation": "Übersetzung","noteFormatting": "Notizformatierung",-- "chatIntelligence": "Chat"++ "chatIntelligence": "Chat",++ "dictationTranslation": "Übersetzung"}},"noteFormatting": {@@@ -2168,111 -2002,17 +2180,113 @@@"liquidai_lfm2_2_6b_q4_k_m": "Ausgewogenes LFM2 für hochwertigere Bereinigung","liquidai_lfm2_5_350m_q8_0": "Ultraleichtes Modell für schnelle Diktatbereinigung","liquidai_lfm2_5_230m_q8_0": "Winziges Modell, sofortige Bereinigung auf bescheidener Hardware"+ }+ }+ },+ "sidebar": {+ "home": "Startseite",+ "notes": "Notizen",+ "upload": "Hochladen",+ "dictionary": "Wörterbuch",+ "referral": "Gratis-Monat erhalten",+ "settings": "Einstellungen",+ "support": "Support",+ "limitReached": "Wochenlimit erreicht",+ "limitReachedDescription": "Upgraden Sie auf Pro für unbegrenzte Transkriptionen.",+ "viewPlans": "Tarife ansehen",+ "upgradeTitle": "Auf Pro upgraden",+ "upgradeDescription": "Unbegrenzte Transkriptionen und mehr.",+ "learnMore": "Mehr erfahren",+ "integrations": "Integrationen",+ "defaultUser": "Benutzer",+ "notSignedIn": "Nicht angemeldet",- "chat": "Chat"++ "chat": "Chat",++ "collapse": "Seitenleiste einklappen",++ "expand": "Seitenleiste ausklappen"+ },+ "workspaces": {+ "switcher": {+ "workspaces": "Workspaces",+ "create": "Workspace erstellen…"+ },+ "create": {+ "title": "Workspace erstellen",+ "description": "Workspaces ermöglichen Zusammenarbeit, geteilte Notizen und gemeinsame Abrechnung.",+ "nameLabel": "Workspace-Name",+ "namePlaceholder": "Acme Corp",+ "submit": "Workspace erstellen",+ "submitting": "Erstelle…",+ "errorTitle": "Workspace konnte nicht erstellt werden"+ },+ "created": {+ "title": "Workspace erstellt",+ "description": "Sie sind nun Inhaber von {{name}}."+ },+ "invite": {+ "title": "Zu {{workspace}} einladen",+ "description": "Fügen Sie Teammitglieder per E-Mail hinzu. Sie erhalten einen Beitrittslink.",+ "emailLabel": "E-Mail",+ "emailPlaceholder": "[email protected]",+ "roleLabel": "Rolle",+ "seatUsage": "{{used}} von {{seats}} Plätzen belegt",+ "seatLimit": "Alle {{seats}} Plätze sind belegt.",+ "askOwner": "Alle {{seats}} Plätze sind belegt. Bitten Sie den Workspace-Inhaber, Plätze hinzuzufügen.",+ "manageSeats": "Plätze verwalten",+ "submit": "Einladung senden",+ "submitting": "Sende…",+ "sentTitle": "Einladung gesendet",+ "sentDescription": "Einladung an {{email}} gesendet.",+ "errorTitle": "Einladung konnte nicht gesendet werden",+ "role": {+ "admin": "Administrator",+ "member": "Mitglied"},- "diarization": {- "segmentation": "Sprachgrenzerkennung für die Sprecherzuordnung",- "embedding_en": "Stimmerkennung zur Sprecheridentifikation"+ "roleDescription": {+ "admin": "Verwaltet Mitglieder und Abrechnung",+ "member": "Nutzt den Workspace"}+ },+ "accept": {+ "title": "Workspace beitreten",+ "description": "{{inviter}} hat Sie eingeladen, {{workspace}} als {{role}} beizutreten.",+ "loading": "Lade Einladung…",+ "accept": "Einladung annehmen",+ "accepting": "Annehmen…",+ "signInToAccept": "Anmelden zum Annehmen",+ "switchAccount": "Konto wechseln",+ "successTitle": "Beigetreten",+ "successDescription": "Sie sind jetzt Mitglied von {{name}}. Verwalten Sie ihn unter Einstellungen → Workspace.",+ "errorTitle": "Einladung konnte nicht angenommen werden",+ "sentTo": "Einladung gesendet an {{email}}",+ "wrongAccount": "Diese Einladung wurde an {{email}} gesendet. Sie sind als {{current}} angemeldet."}},+ "chat": {+ "newChat": "Neuer Chat",+ "search": "Unterhaltungen suchen...",+ "archived": "Archiviert",+ "noConversations": "Starten Sie Ihre erste Unterhaltung",+ "selectChat": "Wählen Sie eine Unterhaltung oder starten Sie eine neue",+ "noResults": "Keine passenden Unterhaltungen",+ "today": "Heute",+ "yesterday": "Gestern",+ "previousWeek": "Letzte 7 Tage",+ "older": "Älter",+ "archive": "Archivieren",+ "unarchive": "Dearchivieren",+ "delete": "Löschen",+ "deleteConfirm": "Diese Unterhaltung wird dauerhaft gelöscht. Dies kann nicht rückgängig gemacht werden.",+ "editTitle": "Doppelklick zum Bearbeiten des Titels",+ "untitled": "Ohne Titel",+ "searchChats": "Chats suchen",+ "searchTitle": "Unterhaltungen suchen",+ "searchDescription": "In allen Unterhaltungen suchen",+ "newChatEmpty": "Fragen Sie zu Ihren Notizen, Transkripten oder anderem"+ },"referral": {"title": "Empfehlen und Belohnungen erhalten",- "subtitle": "Schenke einen Monat. Erhalte einen Monat.","modalTitle": "Freunde einladen",+ "subtitle": "Schenke einen Monat. Erhalte einen Monat.","tabs": {"refer": "Empfehlen","pastInvites": "Vergangene Einladungen"@@@ -2597,9 -2264,26 +2644,10 @@@},"errors": {"noModel": "Kein KI-Modell ausgewählt. Konfigurieren Sie eins in den Einstellungen.",- "noEndpoint": "Keine URL für den selbst gehosteten Server festgelegt. Konfigurieren Sie eine in den Einstellungen.",-- "actionFailed": "Aktion fehlgeschlagen"++ "actionFailed": "Aktion fehlgeschlagen",++ "noEndpoint": "Keine URL für den selbst gehosteten Server festgelegt. Konfigurieren Sie eine in den Einstellungen."}},- "empty": {- "title": "Noch keine Notizen hier",- "description": "Erstelle deine erste Notiz, um loszuschreiben",- "selectTitle": "Notiz auswählen",- "selectDescription": "Wähle eine Notiz aus der Seitenleiste",- "createNote": "Notiz erstellen",- "emptyFolder": "Keine Notizen in diesem Ordner"- },- "addToFolder": {- "title": "Notizen hinzufügen",- "searchPlaceholder": "Notizen zum Hinzufügen suchen...",- "addExisting": "Vorhandene hinzufügen",- "addCount": "{{count}} Notizen hinzufügen",- "noResults": "Keine passenden Notizen",- "noNotesAvailable": "Keine weiteren Notizen verfügbar"- },"onboarding": {"llm": {"title": "KI-Modell konfigurieren",@@@ -2772,11 -2521,19 +2820,19 @@@"title": "Tastenkombination nicht verfügbar","description": "Die ausgewählte Tastenkombination konnte nicht registriert werden. Bitte wähle eine andere in den Einstellungen."},+ "addedToDict": "{{words}} zu deinem Wörterbuch hinzugefügt",+ "undo": "Rückgängig",+ "accessibilityMissing": {+ "title": "Bedienungshilfen-Berechtigungen erforderlich",+ "description": "OpenWhispr benötigt Bedienungshilfen-Berechtigungen, um Ihren Hotkey zu erkennen und Text einzufügen. Bitte aktivieren Sie diese in der Systemsteuerung."++ },+ "gpuFallback": {+ "title": "GPU-Beschleunigung nicht verfügbar",+ "description": "Die Transkription verwendet stattdessen die CPU. Du kannst die GPU-Beschleunigung in den Einstellungen deaktivieren."+ },+ "cleanupFailed": {+ "title": "Bereinigung fehlgeschlagen",+ "description": "Dein Diktat wurde ohne KI-Bereinigung eingefügt."- },- "addedToDict": "{{words}} zu deinem Wörterbuch hinzugefügt",- "undo": "Rückgängig",- "accessibilityMissing": {- "title": "Bedienungshilfen-Berechtigungen erforderlich",- "description": "OpenWhispr benötigt Bedienungshilfen-Berechtigungen, um Ihren Hotkey zu erkennen und Text einzufügen. Bitte aktivieren Sie diese in der Systemsteuerung."}},"mic": {@@@ -3090,5 -2942,63 +3146,37 @@@"you": "Du","others": "Andere"}+ },- "workspaces": {- "switcher": {- "personal": "Persönlich",- "workspaces": "Workspaces",- "empty": "Noch keine Workspaces",- "create": "Workspace erstellen…"- },- "create": {- "title": "Workspace erstellen",- "description": "Workspaces ermöglichen Zusammenarbeit, geteilte Notizen und gemeinsame Abrechnung.",- "nameLabel": "Workspace-Name",- "namePlaceholder": "Acme Corp",- "submit": "Workspace erstellen",- "submitting": "Erstelle…",- "errorTitle": "Workspace konnte nicht erstellt werden"- },- "created": {- "title": "Workspace erstellt",- "description": "Sie sind nun Inhaber von {{name}}."- },- "invite": {- "title": "Zu {{workspace}} einladen",- "description": "Fügen Sie Teammitglieder per E-Mail hinzu. Sie erhalten einen Beitrittslink.",- "emailLabel": "E-Mail",- "roleLabel": "Rolle",- "teamsLabel": "Zu Teams hinzufügen",- "submit": "Einladung senden",- "submitting": "Sende…",- "sentTitle": "Einladung gesendet",- "sentDescription": "Einladung an {{email}} gesendet.",- "errorTitle": "Einladung konnte nicht gesendet werden",- "role": {- "admin": "Administrator",- "member": "Mitglied"- }++ "dictationTranslation": {++ "title": "Diktat-Übersetzung",++ "description": "Ein eigener Hotkey, der dein Diktat übersetzt in eine andere Sprache einfügt",++ "enabled": "Diktat-Übersetzung aktivieren",++ "enabledDescription": "Mit dem Übersetzungs-Hotkey gestartete Diktate werden bereinigt und dann übersetzt, bevor sie eingefügt werden",++ "sourceLanguage": "Gesprochene Sprache",++ "sourceLanguageDescription": "Die Sprache, in der du diktierst — Automatisch funktioniert auch bei gemischten Diktaten",++ "targetLanguage": "Übersetzen nach",++ "targetLanguageDescription": "Die Sprache des eingefügten Textes",++ "targetLanguageMissing": "Wähle eine Zielsprache, um den Übersetzungs-Hotkey zu aktivieren",++ "selectLanguage": "Sprache auswählen…",++ "prompt": {++ "title": "Übersetzungs-Prompt",++ "description": "Passe an, wie das Modell dein Diktat übersetzt"+ },- "accept": {- "title": "Workspace beitreten",- "description": "{{inviter}} hat Sie eingeladen, {{workspace}} als {{role}} beizutreten.",- "loading": "Lade Einladung…",- "accept": "Einladung annehmen",- "accepting": "Annehmen…",- "signInToAccept": "Anmelden zum Annehmen",- "successTitle": "Beigetreten",- "successDescription": "Willkommen bei {{name}}.",- "errorTitle": "Einladung konnte nicht angenommen werden"- }++ "hotkeyHint": "Lege den Hotkey unter Einstellungen → Allgemein → Übersetzungs-Hotkey fest",++ "targetsLabel": "Zielsprachen",++ "addTarget": "Sprache hinzufügen…",++ "activeTarget": "Aktive Zielsprache",++ "removeTarget": "{{language}} entfernen",++ "maxTargets": "Bis zu {{max}} Sprachen"+ },+ "meetingNotification": {+ "title": "Meeting erkannt",+ "body": {+ "detected": "Es klingt, als wärst du in einem Meeting. Notizen aufnehmen?",+ "starting": "Dein Meeting beginnt gleich. Notizen aufnehmen?",+ "underway": "Es klingt, als wäre dein Meeting schon im Gange. Notizen aufnehmen?"+ },+ "start": "Notizen aufnehmen",+ "join": "Beitreten & transkribieren"}}diff --cc src/locales/en/translation.jsonindex a2c542305,1d4a33e0c..0bd4b9190--- a/src/locales/en/translation.json+++ b/src/locales/en/translation.json@@@ -403,7 -399,7 +398,8 @@@"recordingWithDuration": "Discarded recording · {{duration}}","recover": "Recover","recovered": "Recovered"-- }++ },++ "retryTranslationMode": "Translation Mode"},"cloudMigration": {"title": "Welcome to OpenWhispr Cloud",@@@ -577,6 -579,6 +573,12 @@@"offline": "You're offline. Cloud transcription requires an internet connection.","dailyLimitReached": "You've reached today's transcription limit. Try again tomorrow or upgrade your plan.","providerRateLimited": "Your transcription provider rate-limited the request. Wait a moment and try again."++ },++ "translationFallback": {++ "unreachableTitle": "Translation unavailable",++ "unreachableDescription": "Your dictation was pasted untranslated. Check the translation settings.",++ "failedTitle": "Translation failed",++ "failedDescription": "The original text was pasted. You can retry it from History."}},"clipboard": {@@@ -1125,13 -1130,15 +1127,18 @@@"providerLabel": "Provider","run": "Run Test","customEndpoint": "Custom endpoint",- "apiKeyMissing": "{{provider}} API key not configured. Add it in AI Models settings."+ "apiKeyMissing": "{{provider}} API key not configured. Add it in AI Models settings.",++ "translateHint": "The text will be translated to {{language}}",++ "translation": "Translation",+ "translationDisabled": "Enable Dictation Translation to test this prompt",+ "noTargetLanguage": "Pick a target language first"},"view": {"customPrompt": "Custom prompt","defaultPrompt": "Default prompt","modified": "Modified"-- }++ },++ "defaultTestInputTranslate": "The weather is beautiful today, want to go for a walk?"},"settingsModal": {"groups": {@@@ -1858,6 -1783,6 +1865,10 @@@"title": "Updates","versionPlaceholder": "—","whatsNew": "What's new in v{{version}}"++ },++ "translationHotkey": {++ "title": "Translation Hotkey",++ "description": "Dictate in any language — the pasted text comes out translated"}},"permissions": {@@@ -1930,8 -1855,9 +1941,9 @@@"tabs": {"dictationCleanup": "Dictation Cleanup","dictationAgent": "Voice Agent",- "dictationTranslation": "Translation","noteFormatting": "Note Formatting",-- "chatIntelligence": "Chat"++ "chatIntelligence": "Chat",++ "dictationTranslation": "Translation"}},"noteFormatting": {@@@ -2188,7 -2114,11 +2200,9 @@@"integrations": "Integrations","defaultUser": "User","notSignedIn": "Not signed in",- "chat": "Chat"+ "chat": "Chat",- "inviteTeammate": "Invite teammate",- "createWorkspace": "Create workspace",+ "collapse": "Collapse sidebar",+ "expand": "Expand sidebar"},"workspaces": {"switcher": {@@@ -2597,7 -2481,8 +2644,8 @@@},"errors": {"noModel": "No AI model selected. Configure one in Settings.",- "noEndpoint": "No self-hosted server URL set. Configure one in Settings.",-- "actionFailed": "Action failed"++ "actionFailed": "Action failed",++ "noEndpoint": "No self-hosted server URL set. Configure one in Settings."}},"onboarding": {@@@ -2772,11 -2657,19 +2820,19 @@@"title": "Hotkey unavailable","description": "The selected hotkey could not be registered. Please choose a different one in settings."},+ "addedToDict": "Added {{words}} to your dictionary",+ "undo": "Undo",+ "accessibilityMissing": {+ "title": "Accessibility permissions required",+ "description": "OpenWhispr needs accessibility permissions to detect your hotkey and paste text. Please enable them in the Control Panel."++ },+ "gpuFallback": {+ "title": "GPU acceleration unavailable",+ "description": "Transcription is using the CPU instead. You can disable GPU acceleration in Settings."+ },+ "cleanupFailed": {+ "title": "Cleanup failed",+ "description": "Your dictation was pasted without AI cleanup."- },- "addedToDict": "Added {{words}} to your dictionary",- "undo": "Undo",- "accessibilityMissing": {- "title": "Accessibility permissions required",- "description": "OpenWhispr needs accessibility permissions to detect your hotkey and paste text. Please enable them in the Control Panel."}},"mic": {@@@ -3090,5 -2990,15 +3146,37 @@@"you": "You","others": "Others"}+ },++ "dictationTranslation": {++ "title": "Dictation Translation",++ "description": "A dedicated hotkey that pastes your dictation translated into another language",++ "enabled": "Enable Dictation Translation",++ "enabledDescription": "Dictations started with the translation hotkey are cleaned up and then translated before pasting",++ "sourceLanguage": "Spoken language",++ "sourceLanguageDescription": "The language you dictate in — Automatic also handles mixed-language dictation",++ "targetLanguage": "Translate to",++ "targetLanguageDescription": "The language of the pasted text",++ "targetLanguageMissing": "Pick a target language to activate the translation hotkey",++ "selectLanguage": "Select language…",++ "prompt": {++ "title": "Translation Prompt",++ "description": "Customize how the model translates your dictation"++ },++ "hotkeyHint": "Set the hotkey under Settings → General → Translation Hotkey",++ "targetsLabel": "Target languages",++ "addTarget": "Add language…",++ "activeTarget": "Active target language",++ "removeTarget": "Remove {{language}}",++ "maxTargets": "Up to {{max}} languages"++ },+ "meetingNotification": {+ "title": "Meeting detected",+ "body": {+ "detected": "It sounds like you're in a meeting. Want to take notes?",+ "starting": "Your meeting is starting. Want to take notes?",+ "underway": "It sounds like your meeting is underway. Want to take notes?"+ },+ "start": "Take notes",+ "join": "Join & transcribe"}}diff --cc src/locales/es/translation.jsonindex bf6f734f0,f21d69424..54e90f39a--- a/src/locales/es/translation.json+++ b/src/locales/es/translation.json@@@ -403,7 -399,7 +398,8 @@@"retryError": "Error al volver a transcribir","audioNotFound": "Archivo de audio no encontrado o expirado","noAiProcessing": "No se aplicó procesamiento de IA a esta transcripción",-- "rawTranscript": "Transcripción sin procesar"++ "rawTranscript": "Transcripción sin procesar",++ "retryTranslationMode": "Modo Traducción"},"cloudMigration": {"title": "Bienvenido a OpenWhispr Cloud",@@@ -577,6 -579,6 +573,12 @@@"offline": "Estás sin conexión. La transcripción en la nube requiere conexión a Internet.","dailyLimitReached": "Has alcanzado el límite de transcripción de hoy. Inténtalo mañana o mejora tu plan.","providerRateLimited": "Tu proveedor de transcripción limitó la solicitud. Espera un momento e inténtalo de nuevo."++ },++ "translationFallback": {++ "unreachableTitle": "Traducción no disponible",++ "unreachableDescription": "Tu dictado se pegó sin traducir. Revisa los ajustes de traducción.",++ "failedTitle": "La traducción falló",++ "failedDescription": "Se pegó el texto original. Puedes reintentarlo desde el Historial."}},"clipboard": {@@@ -1085,13 -1090,15 +1087,18 @@@"providerLabel": "Proveedor","run": "Ejecutar prueba","customEndpoint": "Endpoint personalizado",- "apiKeyMissing": "La clave API de {{provider}} no está configurada. Agrégala en la configuración de Modelos de IA."+ "apiKeyMissing": "La clave API de {{provider}} no está configurada. Agrégala en la configuración de Modelos de IA.",++ "translateHint": "El texto se traducirá al {{language}}",++ "translation": "Traducción",+ "translationDisabled": "Activa la traducción de dictado para probar este prompt",+ "noTargetLanguage": "Elige primero un idioma de destino"},"view": {"customPrompt": "Prompt personalizado","defaultPrompt": "Prompt predeterminado","modified": "Modificado"-- }++ },++ "defaultTestInputTranslate": "Hace un día precioso hoy, ¿te apetece dar un paseo?"},"settingsModal": {"groups": {@@@ -1647,6 -1658,6 +1654,10 @@@"title": "Actualizaciones","versionPlaceholder": "—","whatsNew": "Novedades en v{{version}}"++ },++ "translationHotkey": {++ "title": "Atajo de Traducción",++ "description": "Dicta en cualquier idioma: el texto pegado sale traducido"}},"permissions": {@@@ -1719,8 -1730,9 +1730,9 @@@"tabs": {"dictationCleanup": "Limpieza de dictado","dictationAgent": "Voice Agent",- "dictationTranslation": "Traducción","noteFormatting": "Formato de notas",-- "chatIntelligence": "Chat"++ "chatIntelligence": "Chat",++ "dictationTranslation": "Traducción"}},"noteFormatting": {@@@ -2423,7 -2312,8 +2468,8 @@@},"errors": {"noModel": "No hay modelo de IA seleccionado. Configura uno en Ajustes.",- "noEndpoint": "No hay URL del servidor autoalojado configurada. Configura una en Ajustes.",-- "actionFailed": "La acción falló"++ "actionFailed": "La acción falló",++ "noEndpoint": "No hay URL del servidor autoalojado configurada. Configura una en Ajustes."}},"empty": {@@@ -2586,7 -2476,11 +2632,9 @@@"integrations": "Integraciones","defaultUser": "Usuario","notSignedIn": "Sin sesión iniciada",- "chat": "Chat"+ "chat": "Chat",- "inviteTeammate": "Invitar compañero",- "createWorkspace": "Crear espacio de trabajo",+ "collapse": "Contraer barra lateral",+ "expand": "Expandir barra lateral"},"chat": {"newChat": "Nuevo chat",@@@ -2675,11 -2569,19 +2723,19 @@@"title": "Atajo no disponible","description": "No se pudo registrar el atajo seleccionado. Elige otro en la configuración."},+ "addedToDict": "{{words}} añadido a tu diccionario",+ "undo": "Deshacer",+ "accessibilityMissing": {+ "title": "Se requieren permisos de accesibilidad",+ "description": "OpenWhispr necesita permisos de accesibilidad para detectar tu atajo y pegar texto. Actívalos en el Panel de Control."++ },+ "gpuFallback": {+ "title": "Aceleración GPU no disponible",+ "description": "La transcripción está usando la CPU. Puedes desactivar la aceleración GPU en Configuración."+ },+ "cleanupFailed": {+ "title": "Limpieza fallida",+ "description": "Tu dictado se pegó sin limpieza con IA."- },- "addedToDict": "{{words}} añadido a tu diccionario",- "undo": "Deshacer",- "accessibilityMissing": {- "title": "Se requieren permisos de accesibilidad",- "description": "OpenWhispr necesita permisos de accesibilidad para detectar tu atajo y pegar texto. Actívalos en el Panel de Control."}},"mic": {@@@ -3083,12 -2986,19 +3139,44 @@@"accept": "Aceptar invitación","accepting": "Aceptando…","signInToAccept": "Inicia sesión para aceptar",+ "switchAccount": "Cambiar de cuenta","successTitle": "Te uniste",- "successDescription": "Bienvenido a {{name}}.",- "errorTitle": "No se pudo aceptar la invitación"+ "successDescription": "Eres miembro de {{name}}. Adminístralo en Configuración → Espacio de trabajo.",+ "errorTitle": "No se pudo aceptar la invitación",+ "sentTo": "Invitación enviada a {{email}}",+ "wrongAccount": "Esta invitación se envió a {{email}}. Has iniciado sesión como {{current}}."}+ },++ "dictationTranslation": {++ "title": "Traducción de Dictado",++ "description": "Un atajo dedicado que pega tu dictado traducido a otro idioma",++ "enabled": "Activar Traducción de Dictado",++ "enabledDescription": "Los dictados iniciados con el atajo de traducción se limpian y luego se traducen antes de pegarse",++ "sourceLanguage": "Idioma hablado",++ "sourceLanguageDescription": "El idioma en el que dictas: Automático también gestiona dictados mixtos",++ "targetLanguage": "Traducir a",++ "targetLanguageDescription": "El idioma del texto pegado",++ "targetLanguageMissing": "Elige un idioma de destino para activar el atajo de traducción",++ "selectLanguage": "Seleccionar idioma…",++ "prompt": {++ "title": "Prompt de Traducción",++ "description": "Personaliza cómo el modelo traduce tu dictado"++ },++ "hotkeyHint": "Configura el atajo en Ajustes → General → Atajo de Traducción",++ "targetsLabel": "Idiomas de destino",++ "addTarget": "Añadir idioma…",++ "activeTarget": "Idioma de destino activo",++ "removeTarget": "Quitar {{language}}",++ "maxTargets": "Hasta {{max}} idiomas"++ },+ "meetingNotification": {+ "title": "Reunión detectada",+ "body": {+ "detected": "Parece que estás en una reunión. ¿Quieres tomar notas?",+ "starting": "Tu reunión está por comenzar. ¿Quieres tomar notas?",+ "underway": "Parece que tu reunión ya está en curso. ¿Quieres tomar notas?"+ },+ "start": "Tomar notas",+ "join": "Unirse y transcribir"}}diff --cc src/locales/fr/translation.jsonindex 629981ffe,c3c7987d2..f6447d1f9--- a/src/locales/fr/translation.json+++ b/src/locales/fr/translation.json@@@ -403,7 -399,7 +398,8 @@@"recordingWithDuration": "Enregistrement abandonné · {{duration}}","recover": "Récupérer","recovered": "Récupérée"-- }++ },++ "retryTranslationMode": "Mode Traduction"},"cloudMigration": {"title": "Bienvenue sur OpenWhispr Cloud",@@@ -577,6 -579,6 +573,12 @@@"offline": "Vous êtes hors ligne. La transcription cloud nécessite une connexion Internet.","dailyLimitReached": "Vous avez atteint votre limite de transcription du jour. Réessayez demain ou améliorez votre forfait.","providerRateLimited": "Votre fournisseur de transcription a limité la requête. Patientez un instant et réessayez."++ },++ "translationFallback": {++ "unreachableTitle": "Traduction indisponible",++ "unreachableDescription": "Votre dictée a été collée sans traduction. Vérifiez les paramètres de traduction.",++ "failedTitle": "Échec de la traduction",++ "failedDescription": "Le texte original a été collé. Vous pouvez réessayer depuis l'Historique."}},"clipboard": {@@@ -1125,13 -1090,15 +1127,18 @@@"providerLabel": "Fournisseur","run": "Lancer le test","customEndpoint": "Endpoint personnalisé",- "apiKeyMissing": "Clé API {{provider}} non configurée. Ajoutez-la dans les paramètres Modèles IA."+ "apiKeyMissing": "Clé API {{provider}} non configurée. Ajoutez-la dans les paramètres Modèles IA.",++ "translateHint": "Le texte sera traduit en {{language}}",++ "translation": "Traduction",+ "translationDisabled": "Activez la traduction de dictée pour tester ce prompt",+ "noTargetLanguage": "Choisissez d’abord une langue cible"},"view": {"customPrompt": "Prompt personnalisé","defaultPrompt": "Prompt par défaut","modified": "Modifié"-- }++ },++ "defaultTestInputTranslate": "Il fait très beau aujourd'hui, ça te dit d'aller te promener ?"},"settingsModal": {"groups": {@@@ -1858,6 -1658,6 +1865,10 @@@"title": "Mises à jour","versionPlaceholder": "—","whatsNew": "Nouveautés de la v{{version}}"++ },++ "translationHotkey": {++ "title": "Raccourci de Traduction",++ "description": "Dictez dans n'importe quelle langue : le texte collé ressort traduit"}},"permissions": {@@@ -1930,8 -1730,9 +1941,9 @@@"tabs": {"dictationCleanup": "Nettoyage de la dictée","dictationAgent": "Voice Agent",- "dictationTranslation": "Traduction","noteFormatting": "Mise en forme des notes",-- "chatIntelligence": "Chat"++ "chatIntelligence": "Chat",++ "dictationTranslation": "Traduction"}},"noteFormatting": {@@@ -2188,65 -2074,12 +2200,67 @@@"integrations": "Intégrations","defaultUser": "Utilisateur","notSignedIn": "Non connecté",- "chat": "Chat"+ "chat": "Chat",- "inviteTeammate": "Inviter un coéquipier",- "createWorkspace": "Créer un espace de travail",+ "collapse": "Réduire la barre latérale",+ "expand": "Développer la barre latérale"},+ "workspaces": {+ "switcher": {+ "workspaces": "Espaces de travail",+ "create": "Créer un espace de travail…"+ },+ "create": {+ "title": "Créer un espace de travail",+ "description": "Les espaces de travail vous permettent de collaborer, partager des notes et gérer la facturation.",+ "nameLabel": "Nom de l'espace de travail",+ "namePlaceholder": "Acme Corp",+ "submit": "Créer l'espace",+ "submitting": "Création…",+ "errorTitle": "Impossible de créer l'espace"+ },+ "created": {+ "title": "Espace de travail créé",+ "description": "Vous êtes maintenant propriétaire de {{name}}."+ },+ "invite": {+ "title": "Inviter dans {{workspace}}",+ "description": "Ajoutez des coéquipiers par e-mail. Ils recevront un lien pour rejoindre.",+ "emailLabel": "E-mail",+ "emailPlaceholder": "[email protected]",+ "roleLabel": "Rôle",+ "seatUsage": "{{used}} sur {{seats}} sièges utilisés",+ "seatLimit": "Les {{seats}} sièges sont tous utilisés.",+ "askOwner": "Les {{seats}} sièges sont tous utilisés. Demandez au propriétaire de l'espace de travail d'ajouter des sièges.",+ "manageSeats": "Gérer les sièges",+ "submit": "Envoyer l'invitation",+ "submitting": "Envoi…",+ "sentTitle": "Invitation envoyée",+ "sentDescription": "Nous avons envoyé une invitation à {{email}}.",+ "errorTitle": "Impossible d'envoyer l'invitation",+ "role": {+ "admin": "Administrateur",+ "member": "Membre"+ },+ "roleDescription": {+ "admin": "Gère les membres et la facturation",+ "member": "Utilise l'espace de travail"+ }+ },+ "accept": {+ "title": "Rejoindre l'espace",+ "description": "{{inviter}} vous a invité à rejoindre {{workspace}} en tant que {{role}}.",+ "loading": "Chargement…",+ "accept": "Accepter l'invitation",+ "accepting": "Acceptation…",+ "signInToAccept": "Connectez-vous pour accepter",+ "switchAccount": "Changer de compte",+ "successTitle": "Vous êtes membre",+ "successDescription": "Vous êtes membre de {{name}}. Gérez-le dans Paramètres → Espace de travail.",+ "errorTitle": "Impossible d'accepter l'invitation",+ "sentTo": "Invitation envoyée à {{email}}",+ "wrongAccount": "Cette invitation a été envoyée à {{email}}. Vous êtes connecté en tant que {{current}}."+ }+ },"chat": {"newChat": "Nouveau chat","search": "Rechercher des conversations...",@@@ -2597,7 -2393,8 +2644,8 @@@},"errors": {"noModel": "Aucun modèle IA sélectionné. Configurez-en un dans les Paramètres.",- "noEndpoint": "Aucune URL de serveur auto-hébergé définie. Configurez-en une dans les Paramètres.",-- "actionFailed": "L'action a échoué"++ "actionFailed": "L'action a échoué",++ "noEndpoint": "Aucune URL de serveur auto-hébergé définie. Configurez-en une dans les Paramètres."}},"onboarding": {@@@ -2772,11 -2569,19 +2820,19 @@@"title": "Raccourci indisponible","description": "Le raccourci sélectionné n’a pas pu être enregistré. Veuillez en choisir un autre dans les paramètres."},+ "addedToDict": "{{words}} ajouté à votre dictionnaire",+ "undo": "Annuler",+ "accessibilityMissing": {+ "title": "Autorisations d'accessibilité requises",+ "description": "OpenWhispr a besoin des autorisations d'accessibilité pour détecter votre raccourci et coller du texte. Veuillez les activer dans le Panneau de configuration."++ },+ "gpuFallback": {+ "title": "Accélération GPU indisponible",+ "description": "La transcription utilise le CPU à la place. Vous pouvez désactiver l'accélération GPU dans les paramètres."+ },+ "cleanupFailed": {+ "title": "Échec du nettoyage",+ "description": "Votre dictée a été collée sans nettoyage par IA."- },- "addedToDict": "{{words}} ajouté à votre dictionnaire",- "undo": "Annuler",- "accessibilityMissing": {- "title": "Autorisations d'accessibilité requises",- "description": "OpenWhispr a besoin des autorisations d'accessibilité pour détecter votre raccourci et coller du texte. Veuillez les activer dans le Panneau de configuration."}},"mic": {@@@ -3090,5 -2942,63 +3146,37 @@@"you": "Vous","others": "Autres"}+ },- "workspaces": {- "switcher": {- "personal": "Personnel",- "workspaces": "Espaces de travail",- "empty": "Aucun espace de travail",- "create": "Créer un espace de travail…"- },- "create": {- "title": "Créer un espace de travail",- "description": "Les espaces de travail vous permettent de collaborer, partager des notes et gérer la facturation.",- "nameLabel": "Nom de l'espace de travail",- "namePlaceholder": "Acme Corp",- "submit": "Créer l'espace",- "submitting": "Création…",- "errorTitle": "Impossible de créer l'espace"- },- "created": {- "title": "Espace de travail créé",- "description": "Vous êtes maintenant propriétaire de {{name}}."- },- "invite": {- "title": "Inviter dans {{workspace}}",- "description": "Ajoutez des coéquipiers par e-mail. Ils recevront un lien pour rejoindre.",- "emailLabel": "E-mail",- "roleLabel": "Rôle",- "teamsLabel": "Ajouter aux équipes",- "submit": "Envoyer l'invitation",- "submitting": "Envoi…",- "sentTitle": "Invitation envoyée",- "sentDescription": "Nous avons envoyé une invitation à {{email}}.",- "errorTitle": "Impossible d'envoyer l'invitation",- "role": {- "admin": "Administrateur",- "member": "Membre"- }++ "dictationTranslation": {++ "title": "Traduction de Dictée",++ "description": "Un raccourci dédié qui colle votre dictée traduite dans une autre langue",++ "enabled": "Activer la Traduction de Dictée",++ "enabledDescription": "Les dictées lancées avec le raccourci de traduction sont nettoyées puis traduites avant d'être collées",++ "sourceLanguage": "Langue parlée",++ "sourceLanguageDescription": "La langue dans laquelle vous dictez : Automatique gère aussi les dictées mixtes",++ "targetLanguage": "Traduire vers",++ "targetLanguageDescription": "La langue du texte collé",++ "targetLanguageMissing": "Choisissez une langue cible pour activer le raccourci de traduction",++ "selectLanguage": "Sélectionner la langue…",++ "prompt": {++ "title": "Prompt de Traduction",++ "description": "Personnalisez la façon dont le modèle traduit votre dictée"+ },- "accept": {- "title": "Rejoindre l'espace",- "description": "{{inviter}} vous a invité à rejoindre {{workspace}} en tant que {{role}}.",- "loading": "Chargement…",- "accept": "Accepter l'invitation",- "accepting": "Acceptation…",- "signInToAccept": "Connectez-vous pour accepter",- "successTitle": "Vous êtes membre",- "successDescription": "Bienvenue dans {{name}}.",- "errorTitle": "Impossible d'accepter l'invitation"- }++ "hotkeyHint": "Définissez le raccourci dans Réglages → Général → Raccourci de Traduction",++ "targetsLabel": "Langues cibles",++ "addTarget": "Ajouter une langue…",++ "activeTarget": "Langue cible active",++ "removeTarget": "Supprimer {{language}}",++ "maxTargets": "Jusqu’à {{max}} langues"+ },+ "meetingNotification": {+ "title": "Réunion détectée",+ "body": {+ "detected": "On dirait que vous êtes en réunion. Vous voulez prendre des notes ?",+ "starting": "Votre réunion va commencer. Vous voulez prendre des notes ?",+ "underway": "On dirait que votre réunion est déjà en cours. Vous voulez prendre des notes ?"+ },+ "start": "Prendre des notes",+ "join": "Rejoindre et transcrire"}}diff --cc src/locales/it/translation.jsonindex ed3838e04,db3412593..f04e4c544--- a/src/locales/it/translation.json+++ b/src/locales/it/translation.json@@@ -403,7 -399,7 +398,8 @@@"recordingWithDuration": "Registrazione scartata · {{duration}}","recover": "Recupera","recovered": "Recuperata"-- }++ },++ "retryTranslationMode": "Modalità Traduzione"},"cloudMigration": {"title": "Benvenuto in OpenWhispr Cloud",@@@ -577,6 -579,6 +573,12 @@@"offline": "Sei offline. La trascrizione cloud richiede una connessione Internet.","dailyLimitReached": "Hai raggiunto il limite di trascrizioni di oggi. Riprova domani o aggiorna il tuo piano.","providerRateLimited": "Il tuo provider di trascrizione ha limitato la richiesta. Attendi un momento e riprova."++ },++ "translationFallback": {++ "unreachableTitle": "Traduzione non disponibile",++ "unreachableDescription": "La dettatura è stata incollata senza traduzione. Controlla le impostazioni di traduzione.",++ "failedTitle": "Traduzione non riuscita",++ "failedDescription": "È stato incollato il testo originale. Puoi riprovare dalla History."}},"clipboard": {@@@ -1037,13 -1042,15 +1039,18 @@@"providerLabel": "Provider","run": "Esegui test","customEndpoint": "Endpoint personalizzato",- "apiKeyMissing": "Chiave API di {{provider}} non configurata. Aggiungila nelle impostazioni Modelli IA."+ "apiKeyMissing": "Chiave API di {{provider}} non configurata. Aggiungila nelle impostazioni Modelli IA.",++ "translateHint": "Il testo verrà tradotto in {{language}}",++ "translation": "Traduzione",+ "translationDisabled": "Attiva la traduzione della dettatura per testare questo prompt",+ "noTargetLanguage": "Scegli prima una lingua di destinazione"},"view": {"customPrompt": "Prompt personalizzato","defaultPrompt": "Prompt predefinito","modified": "Modificato"-- }++ },++ "defaultTestInputTranslate": "Che bella giornata oggi, ti va di fare due passi?"},"settingsModal": {"groups": {@@@ -1599,6 -1610,6 +1606,10 @@@"title": "Aggiornamenti","versionPlaceholder": "—","whatsNew": "Novità nella v{{version}}"++ },++ "translationHotkey": {++ "title": "Hotkey Traduzione",++ "description": "Detta in qualsiasi lingua: il testo incollato esce tradotto"}},"permissions": {@@@ -1671,8 -1682,9 +1682,9 @@@"tabs": {"dictationCleanup": "Pulizia della dettatura","dictationAgent": "Voice Agent",- "dictationTranslation": "Traduzione","noteFormatting": "Formattazione note",-- "chatIntelligence": "Chat"++ "chatIntelligence": "Chat",++ "dictationTranslation": "Traduzione"}},"noteFormatting": {@@@ -2375,7 -2264,8 +2420,8 @@@},"errors": {"noModel": "Nessun modello IA selezionato. Configurane uno nelle Impostazioni.",- "noEndpoint": "Nessun URL del server self-hosted impostato. Configurane uno nelle Impostazioni.",-- "actionFailed": "Azione non riuscita"++ "actionFailed": "Azione non riuscita",++ "noEndpoint": "Nessun URL del server self-hosted impostato. Configurane uno nelle Impostazioni."}},"empty": {@@@ -2538,7 -2428,11 +2584,9 @@@"integrations": "Integrazioni","defaultUser": "Utente","notSignedIn": "Non hai effettuato l'accesso",- "chat": "Chat"+ "chat": "Chat",- "inviteTeammate": "Inviter un coéquipier",- "createWorkspace": "Créer un espace de travail",+ "collapse": "Comprimi barra laterale",+ "expand": "Espandi barra laterale"},"chat": {"newChat": "Nuova chat",@@@ -2627,11 -2521,19 +2675,19 @@@"title": "Scorciatoia non disponibile","description": "Non è stato possibile registrare la scorciatoia selezionata. Scegline un’altra nelle impostazioni."},+ "addedToDict": "{{words}} aggiunto al tuo dizionario",+ "undo": "Annulla",+ "accessibilityMissing": {+ "title": "Autorizzazioni di accessibilità richieste",+ "description": "OpenWhispr necessita delle autorizzazioni di accessibilità per rilevare il tasto di scelta rapida e incollare il testo. Abilitale nel Pannello di controllo."++ },+ "gpuFallback": {+ "title": "Accelerazione GPU non disponibile",+ "description": "La trascrizione sta usando la CPU. Puoi disattivare l'accelerazione GPU nelle Impostazioni."+ },+ "cleanupFailed": {+ "title": "Pulizia non riuscita",+ "description": "La dettatura è stata incollata senza pulizia IA."- },- "addedToDict": "{{words}} aggiunto al tuo dizionario",- "undo": "Annulla",- "accessibilityMissing": {- "title": "Autorizzazioni di accessibilità richieste",- "description": "OpenWhispr necessita delle autorizzazioni di accessibilità per rilevare il tasto di scelta rapida e incollare il testo. Abilitale nel Pannello di controllo."}},"mic": {@@@ -3077,18 -2980,25 +3133,50 @@@}},"accept": {- "title": "Rejoindre l'espace",- "description": "{{inviter}} vous a invité à rejoindre {{workspace}} en tant que {{role}}.",- "loading": "Chargement…",- "accept": "Accepter l'invitation",- "accepting": "Acceptation…",- "signInToAccept": "Connectez-vous pour accepter",- "successTitle": "Vous êtes membre",- "successDescription": "Bienvenue dans {{name}}.",- "errorTitle": "Impossible d'accepter l'invitation"+ "title": "Unisciti all'area di lavoro",+ "description": "{{inviter}} ti ha invitato a unirti a {{workspace}} come {{role}}.",+ "loading": "Caricamento dell'invito…",+ "accept": "Accetta invito",+ "accepting": "Accettazione…",+ "signInToAccept": "Accedi per accettare",+ "switchAccount": "Cambia account",+ "successTitle": "Sei dentro",+ "successDescription": "Sei membro di {{name}}. Gestiscila in Impostazioni → Area di lavoro.",+ "errorTitle": "Impossibile accettare l'invito",+ "sentTo": "Invito inviato a {{email}}",+ "wrongAccount": "Questo invito è stato inviato a {{email}}. Hai effettuato l'accesso come {{current}}."}+ },++ "dictationTranslation": {++ "title": "Traduzione Dettatura",++ "description": "Una hotkey dedicata che incolla la dettatura tradotta in un'altra lingua",++ "enabled": "Abilita Traduzione Dettatura",++ "enabledDescription": "Le dettature avviate con la hotkey di traduzione vengono ripulite e poi tradotte prima di essere incollate",++ "sourceLanguage": "Lingua parlata",++ "sourceLanguageDescription": "La lingua in cui detti: Automatico gestisce anche dettature miste",++ "targetLanguage": "Traduci in",++ "targetLanguageDescription": "La lingua del testo incollato",++ "targetLanguageMissing": "Scegli una lingua di destinazione per attivare la hotkey di traduzione",++ "selectLanguage": "Seleziona lingua…",++ "prompt": {++ "title": "Prompt di Traduzione",++ "description": "Personalizza come il modello traduce la tua dettatura"++ },++ "hotkeyHint": "Imposta la hotkey in Impostazioni → Generali → Hotkey Traduzione",++ "targetsLabel": "Lingue di destinazione",++ "addTarget": "Aggiungi lingua…",++ "activeTarget": "Lingua di destinazione attiva",++ "removeTarget": "Rimuovi {{language}}",++ "maxTargets": "Fino a {{max}} lingue"++ },+ "meetingNotification": {+ "title": "Riunione rilevata",+ "body": {+ "detected": "Sembra che tu sia in riunione. Vuoi prendere appunti?",+ "starting": "La tua riunione sta per iniziare. Vuoi prendere appunti?",+ "underway": "Sembra che la tua riunione sia già in corso. Vuoi prendere appunti?"+ },+ "start": "Prendi appunti",+ "join": "Partecipa e trascrivi"}}diff --cc src/locales/ja/translation.jsonindex 622843534,c7fa28ffa..cb616daee--- a/src/locales/ja/translation.json+++ b/src/locales/ja/translation.json@@@ -403,7 -399,7 +398,8 @@@"recordingWithDuration": "破棄した録音 · {{duration}}","recover": "復元","recovered": "復元しました"-- }++ },++ "retryTranslationMode": "翻訳モード"},"cloudMigration": {"title": "OpenWhispr Cloud へようこそ",@@@ -577,6 -579,6 +573,12 @@@"offline": "オフラインです。クラウド文字起こしにはインターネット接続が必要です。","dailyLimitReached": "本日の文字起こし上限に達しました。明日もう一度お試しいただくか、プランをアップグレードしてください。","providerRateLimited": "文字起こしプロバイダーがリクエストを制限しました。しばらく待ってからもう一度お試しください。"++ },++ "translationFallback": {++ "unreachableTitle": "翻訳を利用できません",++ "unreachableDescription": "口述内容は翻訳されずに貼り付けられました。翻訳設定を確認してください。",++ "failedTitle": "翻訳に失敗しました",++ "failedDescription": "元のテキストが貼り付けられました。履歴から再試行できます。"}},"clipboard": {@@@ -1037,13 -1042,15 +1039,18 @@@"providerLabel": "プロバイダー","run": "テスト実行","customEndpoint": "カスタムエンドポイント",- "apiKeyMissing": "{{provider}} の API キーが未設定です。AI モデル設定で追加してください。"+ "apiKeyMissing": "{{provider}} の API キーが未設定です。AI モデル設定で追加してください。",++ "translateHint": "テキストは{{language}}に翻訳されます",++ "translation": "翻訳",+ "translationDisabled": "このプロンプトをテストするには音声入力翻訳を有効にしてください",+ "noTargetLanguage": "先に翻訳先の言語を選択してください"},"view": {"customPrompt": "カスタムプロンプト","defaultPrompt": "デフォルトプロンプト","modified": "変更済み"-- }++ },++ "defaultTestInputTranslate": "今日はいい天気ですね、散歩に行きませんか?"},"settingsModal": {"groups": {@@@ -1599,6 -1610,6 +1606,10 @@@"title": "アップデート","versionPlaceholder": "—","whatsNew": "v{{version}} の新機能"++ },++ "translationHotkey": {++ "title": "翻訳ホットキー",++ "description": "どの言語で話しても、貼り付けられるテキストは翻訳済みになります"}},"permissions": {@@@ -1671,8 -1682,9 +1682,9 @@@"tabs": {"dictationCleanup": "ディクテーションのクリーンアップ","dictationAgent": "Voice Agent",- "dictationTranslation": "翻訳","noteFormatting": "ノートのフォーマット",-- "chatIntelligence": "チャット"++ "chatIntelligence": "チャット",++ "dictationTranslation": "翻訳"}},"noteFormatting": {@@@ -2228,7 -2085,8 +2240,8 @@@},"errors": {"noModel": "AIモデルが選択されていません。設定で構成してください。",- "noEndpoint": "セルフホストサーバーの URL が設定されていません。設定で構成してください。",-- "actionFailed": "アクションに失敗しました"++ "actionFailed": "アクションに失敗しました",++ "noEndpoint": "セルフホストサーバーの URL が設定されていません。設定で構成してください。"}},"empty": {@@@ -2538,7 -2428,11 +2584,9 @@@"integrations": "連携","defaultUser": "ユーザー","notSignedIn": "未サインイン",- "chat": "チャット"+ "chat": "チャット",- "inviteTeammate": "Invitar compañero",- "createWorkspace": "Crear espacio de trabajo",+ "collapse": "サイドバーを折りたたむ",+ "expand": "サイドバーを展開"},"chat": {"newChat": "新しいチャット",@@@ -2627,11 -2521,19 +2675,19 @@@"title": "ホットキーが使用できません","description": "選択したホットキーを登録できませんでした。設定から別のホットキーを選択してください。"},+ "addedToDict": "{{words}} を辞書に追加しました",+ "undo": "元に戻す",+ "accessibilityMissing": {+ "title": "アクセシビリティの許可が必要です",+ "description": "OpenWhispr がホットキーの検出とテキストの貼り付けを行うには、アクセシビリティの許可が必要です。コントロールパネルで有効にしてください。"++ },+ "gpuFallback": {+ "title": "GPU アクセラレーションを利用できません",+ "description": "文字起こしは代わりに CPU を使用しています。設定で GPU アクセラレーションを無効にできます。"+ },+ "cleanupFailed": {+ "title": "クリーンアップに失敗しました",+ "description": "ディクテーションは AI クリーンアップなしで貼り付けられました。"- },- "addedToDict": "{{words}} を辞書に追加しました",- "undo": "元に戻す",- "accessibilityMissing": {- "title": "アクセシビリティの許可が必要です",- "description": "OpenWhispr がホットキーの検出とテキストの貼り付けを行うには、アクセシビリティの許可が必要です。コントロールパネルで有効にしてください。"}},"mic": {@@@ -3077,18 -2980,25 +3133,50 @@@}},"accept": {- "title": "Unirse al espacio de trabajo",- "description": "{{inviter}} te invitó a unirte a {{workspace}} como {{role}}.",- "loading": "Cargando invitación…",- "accept": "Aceptar invitación",- "accepting": "Aceptando…",- "signInToAccept": "Inicia sesión para aceptar",- "successTitle": "Te uniste",- "successDescription": "Bienvenido a {{name}}.",- "errorTitle": "No se pudo aceptar la invitación"+ "title": "ワークスペースに参加",+ "description": "{{inviter}} さんから、{{workspace}} に{{role}}として参加するよう招待されています。",+ "loading": "招待を読み込み中…",+ "accept": "招待を承諾",+ "accepting": "承諾中…",+ "signInToAccept": "サインインして承諾",+ "switchAccount": "アカウントを切り替える",+ "successTitle": "参加しました",+ "successDescription": "{{name}} のメンバーになりました。設定 → ワークスペースで管理できます。",+ "errorTitle": "招待を承諾できませんでした",+ "sentTo": "{{email}} に送信された招待です",+ "wrongAccount": "この招待は {{email}} 宛てに送信されました。現在 {{current}} でサインインしています。"}+ },++ "dictationTranslation": {++ "title": "音声入力翻訳",++ "description": "専用ホットキーで、音声入力を別の言語に翻訳して貼り付けます",++ "enabled": "音声入力翻訳を有効にする",++ "enabledDescription": "翻訳ホットキーで開始した音声入力は、整形されてから翻訳されて貼り付けられます",++ "sourceLanguage": "話す言語",++ "sourceLanguageDescription": "音声入力する言語。自動検出は複数言語が混在する場合にも対応します",++ "targetLanguage": "翻訳先",++ "targetLanguageDescription": "貼り付けられるテキストの言語",++ "targetLanguageMissing": "翻訳ホットキーを有効にするには翻訳先の言語を選択してください",++ "selectLanguage": "言語を選択…",++ "prompt": {++ "title": "翻訳プロンプト",++ "description": "モデルによる音声入力の翻訳方法をカスタマイズします"++ },++ "hotkeyHint": "ホットキーは 設定 → 一般 → 翻訳ホットキー で設定できます",++ "targetsLabel": "翻訳先の言語",++ "addTarget": "言語を追加…",++ "activeTarget": "使用中の翻訳先言語",++ "removeTarget": "{{language}}を削除",++ "maxTargets": "最大{{max}}言語"++ },+ "meetingNotification": {+ "title": "会議を検出しました",+ "body": {+ "detected": "会議中のようです。メモを取りますか?",+ "starting": "まもなく会議が始まります。メモを取りますか?",+ "underway": "会議はすでに進行中のようです。メモを取りますか?"+ },+ "start": "メモを取る",+ "join": "参加して文字起こし"}}diff --cc src/locales/pt/translation.jsonindex 9d69e721e,8ab56278e..315cd5280--- a/src/locales/pt/translation.json+++ b/src/locales/pt/translation.json@@@ -382,7 -378,7 +377,8 @@@"recordingWithDuration": "Gravação descartada · {{duration}}","recover": "Recuperar","recovered": "Recuperada"-- }++ },++ "retryTranslationMode": "Modo de Tradução"},"cloudMigration": {"title": "Boas-vindas ao OpenWhispr Cloud",@@@ -556,6 -558,6 +552,12 @@@"offline": "Você está offline. A transcrição na nuvem exige conexão com a internet.","dailyLimitReached": "Você atingiu o limite de transcrições de hoje. Tente novamente amanhã ou faça upgrade do seu plano.","providerRateLimited": "Seu provedor de transcrição limitou a solicitação. Aguarde um momento e tente novamente."++ },++ "translationFallback": {++ "unreachableTitle": "Tradução indisponível",++ "unreachableDescription": "Seu ditado foi colado sem tradução. Verifique as configurações de tradução.",++ "failedTitle": "Falha na tradução",++ "failedDescription": "O texto original foi colado. Você pode tentar novamente pelo Histórico."}},"clipboard": {@@@ -1016,13 -1021,15 +1018,18 @@@"providerLabel": "Provedor","run": "Executar teste","customEndpoint": "Endpoint personalizado",- "apiKeyMissing": "Chave API do {{provider}} não configurada. Adicione nas configurações de Modelos de IA."+ "apiKeyMissing": "Chave API do {{provider}} não configurada. Adicione nas configurações de Modelos de IA.",++ "translateHint": "O texto será traduzido para {{language}}",++ "translation": "Tradução",+ "translationDisabled": "Ative a tradução de ditado para testar este prompt",+ "noTargetLanguage": "Escolha primeiro um idioma de destino"},"view": {"customPrompt": "Prompt personalizado","defaultPrompt": "Prompt padrão","modified": "Modificado"-- }++ },++ "defaultTestInputTranslate": "O tempo está lindo hoje, quer dar um passeio?"},"settingsModal": {"groups": {@@@ -1578,6 -1589,6 +1585,10 @@@"title": "Atualizações","versionPlaceholder": "—","whatsNew": "Novidades na v{{version}}"++ },++ "translationHotkey": {++ "title": "Atalho de Tradução",++ "description": "Dite em qualquer idioma: o texto colado sai traduzido"}},"permissions": {@@@ -1650,8 -1661,9 +1661,9 @@@"tabs": {"dictationCleanup": "Limpeza do ditado","dictationAgent": "Voice Agent",- "dictationTranslation": "Tradução","noteFormatting": "Formatação de notas",-- "chatIntelligence": "Chat"++ "chatIntelligence": "Chat",++ "dictationTranslation": "Tradução"}},"noteFormatting": {@@@ -2375,7 -2264,8 +2420,8 @@@},"errors": {"noModel": "Nenhum modelo de IA selecionado. Configure um nas Configurações.",- "noEndpoint": "Nenhum URL de servidor auto-hospedado definido. Configure um nas Configurações.",-- "actionFailed": "A ação falhou"++ "actionFailed": "A ação falhou",++ "noEndpoint": "Nenhum URL de servidor auto-hospedado definido. Configure um nas Configurações."}},"empty": {@@@ -2538,7 -2428,11 +2584,9 @@@"integrations": "Integrações","defaultUser": "Usuário","notSignedIn": "Não conectado",- "chat": "Chat"+ "chat": "Chat",- "inviteTeammate": "Invitar compañero",- "createWorkspace": "Crear espacio de trabajo",+ "collapse": "Recolher barra lateral",+ "expand": "Expandir barra lateral"},"chat": {"newChat": "Novo chat",@@@ -2627,11 -2521,19 +2675,19 @@@"title": "Atalho indisponível","description": "Não foi possível registrar o atalho selecionado. Escolha outro nas configurações."},+ "addedToDict": "{{words}} adicionado ao seu dicionário",+ "undo": "Desfazer",+ "accessibilityMissing": {+ "title": "Permissões de acessibilidade necessárias",+ "description": "O OpenWhispr precisa de permissões de acessibilidade para detectar seu atalho e colar texto. Ative-as no Painel de Controle."++ },+ "gpuFallback": {+ "title": "Aceleração GPU indisponível",+ "description": "A transcrição está usando a CPU. Você pode desativar a aceleração GPU nas Configurações."+ },+ "cleanupFailed": {+ "title": "Falha na limpeza",+ "description": "Seu ditado foi colado sem limpeza por IA."- },- "addedToDict": "{{words}} adicionado ao seu dicionário",- "undo": "Desfazer",- "accessibilityMissing": {- "title": "Permissões de acessibilidade necessárias",- "description": "O OpenWhispr precisa de permissões de acessibilidade para detectar seu atalho e colar texto. Ative-as no Painel de Controle."}},"mic": {@@@ -3077,18 -2980,25 +3133,50 @@@}},"accept": {- "title": "Unirse al espacio de trabajo",- "description": "{{inviter}} te invitó a unirte a {{workspace}} como {{role}}.",- "loading": "Cargando invitación…",- "accept": "Aceptar invitación",- "accepting": "Aceptando…",- "signInToAccept": "Inicia sesión para aceptar",- "successTitle": "Te uniste",- "successDescription": "Bienvenido a {{name}}.",- "errorTitle": "No se pudo aceptar la invitación"+ "title": "Entrar no espaço de trabalho",+ "description": "{{inviter}} convidou você para entrar em {{workspace}} como {{role}}.",+ "loading": "Carregando convite…",+ "accept": "Aceitar convite",+ "accepting": "Aceitando…",+ "signInToAccept": "Faça login para aceitar",+ "switchAccount": "Trocar de conta",+ "successTitle": "Você entrou",+ "successDescription": "Você é membro de {{name}}. Gerencie em Configurações → Espaço de trabalho.",+ "errorTitle": "Não foi possível aceitar o convite",+ "sentTo": "Convite enviado para {{email}}",+ "wrongAccount": "Este convite foi enviado para {{email}}. Você está conectado como {{current}}."}+ },++ "dictationTranslation": {++ "title": "Tradução de Ditado",++ "description": "Um atalho dedicado que cola seu ditado traduzido para outro idioma",++ "enabled": "Ativar Tradução de Ditado",++ "enabledDescription": "Ditados iniciados com o atalho de tradução são limpos e depois traduzidos antes de serem colados",++ "sourceLanguage": "Idioma falado",++ "sourceLanguageDescription": "O idioma em que você dita: Automático também lida com ditados mistos",++ "targetLanguage": "Traduzir para",++ "targetLanguageDescription": "O idioma do texto colado",++ "targetLanguageMissing": "Escolha um idioma de destino para ativar o atalho de tradução",++ "selectLanguage": "Selecionar idioma…",++ "prompt": {++ "title": "Prompt de Tradução",++ "description": "Personalize como o modelo traduz seu ditado"++ },++ "hotkeyHint": "Defina o atalho em Configurações → Geral → Atalho de Tradução",++ "targetsLabel": "Idiomas de destino",++ "addTarget": "Adicionar idioma…",++ "activeTarget": "Idioma de destino ativo",++ "removeTarget": "Remover {{language}}",++ "maxTargets": "Até {{max}} idiomas"++ },+ "meetingNotification": {+ "title": "Reunião detectada",+ "body": {+ "detected": "Parece que você está em uma reunião. Quer fazer anotações?",+ "starting": "Sua reunião está começando. Quer fazer anotações?",+ "underway": "Parece que sua reunião já está em andamento. Quer fazer anotações?"+ },+ "start": "Fazer anotações",+ "join": "Entrar e transcrever"}}diff --cc src/locales/ru/translation.jsonindex 5bd52bade,4fd40a959..73140839d--- a/src/locales/ru/translation.json+++ b/src/locales/ru/translation.json@@@ -403,7 -399,7 +398,8 @@@"recordingWithDuration": "Отменённая запись · {{duration}}","recover": "Восстановить","recovered": "Восстановлено"-- }++ },++ "retryTranslationMode": "Режим перевода"},"cloudMigration": {"title": "Добро пожаловать в OpenWhispr Cloud",@@@ -577,6 -579,6 +573,12 @@@"offline": "Вы офлайн. Облачная транскрипция требует подключения к интернету.","dailyLimitReached": "Достигнут дневной лимит транскрипций. Попробуйте завтра или обновите тариф.","providerRateLimited": "Ваш провайдер транскрипции ограничил запрос. Подождите немного и попробуйте снова."++ },++ "translationFallback": {++ "unreachableTitle": "Перевод недоступен",++ "unreachableDescription": "Ваша диктовка вставлена без перевода. Проверьте настройки перевода.",++ "failedTitle": "Не удалось выполнить перевод",++ "failedDescription": "Вставлен исходный текст. Вы можете повторить попытку в Истории."}},"clipboard": {@@@ -1037,13 -1042,15 +1039,18 @@@"providerLabel": "Провайдер","run": "Запустить тест","customEndpoint": "Пользовательская конечная точка",- "apiKeyMissing": "API-ключ {{provider}} не настроен. Добавьте его в настройках ИИ-моделей."+ "apiKeyMissing": "API-ключ {{provider}} не настроен. Добавьте его в настройках ИИ-моделей.",++ "translateHint": "Текст будет переведён на {{language}}",++ "translation": "Перевод",+ "translationDisabled": "Включите перевод диктовки, чтобы протестировать этот промпт",+ "noTargetLanguage": "Сначала выберите язык перевода"},"view": {"customPrompt": "Пользовательский промпт","defaultPrompt": "Промпт по умолчанию","modified": "Изменён"-- }++ },++ "defaultTestInputTranslate": "Сегодня прекрасная погода, хочешь прогуляться?"},"settingsModal": {"groups": {@@@ -1599,6 -1610,6 +1606,10 @@@"title": "Обновления","versionPlaceholder": "—","whatsNew": "Что нового в v{{version}}"++ },++ "translationHotkey": {++ "title": "Горячая клавиша перевода",++ "description": "Диктуйте на любом языке — вставленный текст будет переведён"}},"permissions": {@@@ -1671,8 -1682,9 +1682,9 @@@"tabs": {"dictationCleanup": "Очистка диктовки","dictationAgent": "Voice Agent",- "dictationTranslation": "Перевод","noteFormatting": "Форматирование заметок",-- "chatIntelligence": "Чат"++ "chatIntelligence": "Чат",++ "dictationTranslation": "Перевод"}},"noteFormatting": {@@@ -2381,7 -2264,8 +2426,8 @@@},"errors": {"noModel": "Модель ИИ не выбрана. Настройте её в разделе Настройки.",- "noEndpoint": "URL собственного сервера не задан. Настройте его в разделе Настройки.",-- "actionFailed": "Действие не выполнено"++ "actionFailed": "Действие не выполнено",++ "noEndpoint": "URL собственного сервера не задан. Настройте его в разделе Настройки."}},"empty": {@@@ -2548,7 -2432,11 +2594,9 @@@"integrations": "Интеграции","defaultUser": "Пользователь","notSignedIn": "Не авторизован",- "chat": "Чат"+ "chat": "Чат",- "inviteTeammate": "Teammitglied einladen",- "createWorkspace": "Workspace erstellen",+ "collapse": "Свернуть боковую панель",+ "expand": "Развернуть боковую панель"},"chat": {"newChat": "Новый чат",@@@ -2637,11 -2525,19 +2685,19 @@@"title": "Горячая клавиша недоступна","description": "Не удалось зарегистрировать выбранную комбинацию. Выберите другую в настройках."},+ "addedToDict": "{{words}} добавлено в ваш словарь",+ "undo": "Отменить",+ "accessibilityMissing": {+ "title": "Требуются разрешения универсального доступа",+ "description": "OpenWhispr нужны разрешения универсального доступа для распознавания горячей клавиши и вставки текста. Включите их в Панели управления."++ },+ "gpuFallback": {+ "title": "Ускорение GPU недоступно",+ "description": "Транскрипция выполняется на CPU. Вы можете отключить ускорение GPU в настройках."+ },+ "cleanupFailed": {+ "title": "Не удалось выполнить очистку",+ "description": "Диктовка вставлена без ИИ-очистки."- },- "addedToDict": "{{words}} добавлено в ваш словарь",- "undo": "Отменить",- "accessibilityMissing": {- "title": "Требуются разрешения универсального доступа",- "description": "OpenWhispr нужны разрешения универсального доступа для распознавания горячей клавиши и вставки текста. Включите их в Панели управления."}},"mic": {@@@ -3087,18 -2984,25 +3143,50 @@@}},"accept": {- "title": "Workspace beitreten",- "description": "{{inviter}} hat Sie eingeladen, {{workspace}} als {{role}} beizutreten.",- "loading": "Lade Einladung…",- "accept": "Einladung annehmen",- "accepting": "Annehmen…",- "signInToAccept": "Anmelden zum Annehmen",- "successTitle": "Beigetreten",- "successDescription": "Willkommen bei {{name}}.",- "errorTitle": "Einladung konnte nicht angenommen werden"+ "title": "Присоединиться к рабочему пространству",+ "description": "{{inviter}} приглашает вас в {{workspace}} с ролью «{{role}}».",+ "loading": "Загрузка приглашения…",+ "accept": "Принять приглашение",+ "accepting": "Принятие…",+ "signInToAccept": "Войдите, чтобы принять",+ "switchAccount": "Сменить аккаунт",+ "successTitle": "Вы в команде",+ "successDescription": "Вы участник {{name}}. Управляйте им в разделе Настройки → Рабочее пространство.",+ "errorTitle": "Не удалось принять приглашение",+ "sentTo": "Приглашение отправлено на {{email}}",+ "wrongAccount": "Это приглашение было отправлено на {{email}}. Вы вошли как {{current}}."}+ },++ "dictationTranslation": {++ "title": "Перевод диктовки",++ "description": "Отдельная горячая клавиша, вставляющая вашу диктовку в переводе на другой язык",++ "enabled": "Включить перевод диктовки",++ "enabledDescription": "Диктовки, начатые горячей клавишей перевода, очищаются и затем переводятся перед вставкой",++ "sourceLanguage": "Язык речи",++ "sourceLanguageDescription": "Язык, на котором вы диктуете — «Автоматически» подходит и для смешанной речи",++ "targetLanguage": "Перевести на",++ "targetLanguageDescription": "Язык вставляемого текста",++ "targetLanguageMissing": "Выберите целевой язык, чтобы активировать горячую клавишу перевода",++ "selectLanguage": "Выберите язык…",++ "prompt": {++ "title": "Промпт перевода",++ "description": "Настройте, как модель переводит вашу диктовку"++ },++ "hotkeyHint": "Задайте горячую клавишу в Настройки → Общие → Горячая клавиша перевода",++ "targetsLabel": "Языки перевода",++ "addTarget": "Добавить язык…",++ "activeTarget": "Активный язык перевода",++ "removeTarget": "Удалить {{language}}",++ "maxTargets": "До {{max}} языков"++ },+ "meetingNotification": {+ "title": "Обнаружена встреча",+ "body": {+ "detected": "Похоже, вы на встрече. Хотите вести заметки?",+ "starting": "Ваша встреча скоро начнётся. Хотите вести заметки?",+ "underway": "Похоже, ваша встреча уже идёт. Хотите вести заметки?"+ },+ "start": "Вести заметки",+ "join": "Присоединиться и вести заметки"}}diff --cc src/locales/zh-CN/translation.jsonindex c1307b683,42aaf4f16..3b364c851--- a/src/locales/zh-CN/translation.json+++ b/src/locales/zh-CN/translation.json@@@ -403,7 -399,7 +398,8 @@@"recordingWithDuration": "已放弃的录音 · {{duration}}","recover": "恢复","recovered": "已恢复"-- }++ },++ "retryTranslationMode": "翻译模式"},"cloudMigration": {"title": "欢迎使用 OpenWhispr 云端",@@@ -577,6 -579,6 +573,12 @@@"offline": "你目前离线。云端转录需要互联网连接。","dailyLimitReached": "已达今日转录上限。请明天再试或升级你的套餐。","providerRateLimited": "你的转录服务商限制了请求频率。请稍候再试。"++ },++ "translationFallback": {++ "unreachableTitle": "翻译不可用",++ "unreachableDescription": "你的口述内容已按原文粘贴,未经翻译。请检查翻译设置。",++ "failedTitle": "翻译失败",++ "failedDescription": "已粘贴原始文本。你可以在历史记录中重试。"}},"clipboard": {@@@ -1037,13 -1042,15 +1039,18 @@@"providerLabel": "服务商","run": "运行测试","customEndpoint": "自定义端点",- "apiKeyMissing": "未配置 {{provider}} API 密钥,请在 AI 模型设置中添加。"+ "apiKeyMissing": "未配置 {{provider}} API 密钥,请在 AI 模型设置中添加。",++ "translateHint": "文本将翻译为{{language}}",++ "translation": "翻译",+ "translationDisabled": "启用听写翻译以测试此提示词",+ "noTargetLanguage": "请先选择目标语言"},"view": {"customPrompt": "自定义提示词","defaultPrompt": "默认提示词","modified": "已修改"-- }++ },++ "defaultTestInputTranslate": "今天天气真好,要不要出去走走?"},"settingsModal": {"groups": {@@@ -1599,6 -1605,6 +1601,10 @@@"title": "更新","versionPlaceholder": "—","whatsNew": "v{{version}} 更新内容"++ },++ "translationHotkey": {++ "title": "翻译快捷键",++ "description": "用任何语言听写——粘贴的文本会自动翻译"}},"permissions": {@@@ -1671,8 -1677,9 +1677,9 @@@"tabs": {"dictationCleanup": "听写清理","dictationAgent": "Voice Agent",- "dictationTranslation": "翻译","noteFormatting": "笔记格式化",-- "chatIntelligence": "聊天"++ "chatIntelligence": "聊天",++ "dictationTranslation": "翻译"}},"noteFormatting": {@@@ -2375,7 -2259,8 +2415,8 @@@},"errors": {"noModel": "未选择 AI 模型。请在设置中配置。",- "noEndpoint": "未设置自托管服务器 URL。请在设置中配置。",-- "actionFailed": "操作失败"++ "actionFailed": "操作失败",++ "noEndpoint": "未设置自托管服务器 URL。请在设置中配置。"}},"empty": {@@@ -2538,7 -2423,11 +2579,9 @@@"integrations": "集成","defaultUser": "用户","notSignedIn": "未登录",- "chat": "聊天"+ "chat": "聊天",- "inviteTeammate": "Invitar compañero",- "createWorkspace": "Crear espacio de trabajo",+ "collapse": "折叠侧边栏",+ "expand": "展开侧边栏"},"chat": {"newChat": "新对话",@@@ -2627,11 -2516,19 +2670,19 @@@"title": "快捷键不可用","description": "无法注册所选快捷键。请在设置中选择其他快捷键。"},+ "addedToDict": "已将 {{words}} 添加到你的词典",+ "undo": "撤消",+ "accessibilityMissing": {+ "title": "需要辅助功能权限",+ "description": "OpenWhispr 需要辅助功能权限来检测快捷键和粘贴文本。请在控制面板中启用。"++ },+ "gpuFallback": {+ "title": "GPU 加速不可用",+ "description": "转录正在使用 CPU。你可以在设置中关闭 GPU 加速。"+ },+ "cleanupFailed": {+ "title": "清理失败",+ "description": "你的听写已直接粘贴,未经 AI 清理。"- },- "addedToDict": "已将 {{words}} 添加到你的词典",- "undo": "撤消",- "accessibilityMissing": {- "title": "需要辅助功能权限",- "description": "OpenWhispr 需要辅助功能权限来检测快捷键和粘贴文本。请在控制面板中启用。"}},"mic": {@@@ -3077,18 -2975,25 +3128,50 @@@}},"accept": {- "title": "Unirse al espacio de trabajo",- "description": "{{inviter}} te invitó a unirte a {{workspace}} como {{role}}.",- "loading": "Cargando invitación…",- "accept": "Aceptar invitación",- "accepting": "Aceptando…",- "signInToAccept": "Inicia sesión para aceptar",- "successTitle": "Te uniste",- "successDescription": "Bienvenido a {{name}}.",- "errorTitle": "No se pudo aceptar la invitación"+ "title": "加入工作区",+ "description": "{{inviter}} 邀请你以{{role}}身份加入 {{workspace}}。",+ "loading": "正在加载邀请…",+ "accept": "接受邀请",+ "accepting": "接受中…",+ "signInToAccept": "登录以接受",+ "switchAccount": "切换账号",+ "successTitle": "你已加入",+ "successDescription": "你已成为 {{name}} 的成员。可在设置 → 工作区中管理。",+ "errorTitle": "无法接受邀请",+ "sentTo": "邀请已发送至 {{email}}",+ "wrongAccount": "此邀请发送给了 {{email}},而你当前登录的是 {{current}}。"}+ },++ "dictationTranslation": {++ "title": "听写翻译",++ "description": "专用快捷键,将你的听写翻译成另一种语言后粘贴",++ "enabled": "启用听写翻译",++ "enabledDescription": "通过翻译快捷键开始的听写会先整理再翻译,然后粘贴",++ "sourceLanguage": "口语语言",++ "sourceLanguageDescription": "你听写时使用的语言——自动检测也能处理混合语言听写",++ "targetLanguage": "翻译为",++ "targetLanguageDescription": "粘贴文本的语言",++ "targetLanguageMissing": "请选择目标语言以启用翻译快捷键",++ "selectLanguage": "选择语言…",++ "prompt": {++ "title": "翻译提示词",++ "description": "自定义模型翻译听写内容的方式"++ },++ "hotkeyHint": "在 设置 → 通用 → 翻译快捷键 中设置快捷键",++ "targetsLabel": "目标语言",++ "addTarget": "添加语言…",++ "activeTarget": "当前目标语言",++ "removeTarget": "移除{{language}}",++ "maxTargets": "最多 {{max}} 种语言"++ },+ "meetingNotification": {+ "title": "检测到会议",+ "body": {+ "detected": "你似乎正在开会。要开始记录吗?",+ "starting": "你的会议即将开始。要开始记录吗?",+ "underway": "你的会议似乎已在进行中。要开始记录吗?"+ },+ "start": "开始记录",+ "join": "加入并转录"}}diff --cc src/locales/zh-TW/translation.jsonindex 9fa2f256f,eb1f84c18..dcf1c2975--- a/src/locales/zh-TW/translation.json+++ b/src/locales/zh-TW/translation.json@@@ -403,7 -399,7 +398,8 @@@"recordingWithDuration": "已捨棄的錄音 · {{duration}}","recover": "復原","recovered": "已復原"-- }++ },++ "retryTranslationMode": "翻譯模式"},"cloudMigration": {"title": "歡迎使用 OpenWhispr Cloud",@@@ -577,6 -579,6 +573,12 @@@"offline": "你目前離線。雲端轉錄需要網際網路連線。","dailyLimitReached": "已達今日的轉錄上限。請明天再試或升級你的方案。","providerRateLimited": "你的轉錄服務商限制了請求頻率。請稍候再試。"++ },++ "translationFallback": {++ "unreachableTitle": "翻譯無法使用",++ "unreachableDescription": "你的口述內容已按原文貼上,未經翻譯。請檢查翻譯設定。",++ "failedTitle": "翻譯失敗",++ "failedDescription": "已貼上原始文字。你可以在歷史記錄中重試。"}},"clipboard": {@@@ -1037,13 -1042,15 +1039,18 @@@"providerLabel": "供應商","run": "執行測試","customEndpoint": "自訂端點",- "apiKeyMissing": "未設定 {{provider}} API 金鑰。請在 AI 模型設定中新增。"+ "apiKeyMissing": "未設定 {{provider}} API 金鑰。請在 AI 模型設定中新增。",++ "translateHint": "文字將翻譯為{{language}}",++ "translation": "翻譯",+ "translationDisabled": "啟用聽寫翻譯以測試此提示詞",+ "noTargetLanguage": "請先選擇目標語言"},"view": {"customPrompt": "自訂提示詞","defaultPrompt": "預設提示詞","modified": "已修改"-- }++ },++ "defaultTestInputTranslate": "今天天氣真好,要不要出去走走?"},"settingsModal": {"groups": {@@@ -1599,6 -1605,6 +1601,10 @@@"title": "更新","versionPlaceholder": "—","whatsNew": "v{{version}} 的新功能"++ },++ "translationHotkey": {++ "title": "翻譯快捷鍵",++ "description": "用任何語言聽寫——貼上的文字會自動翻譯"}},"permissions": {@@@ -1671,8 -1677,9 +1677,9 @@@"tabs": {"dictationCleanup": "聽寫清理","dictationAgent": "Voice Agent",- "dictationTranslation": "翻譯","noteFormatting": "筆記格式化",-- "chatIntelligence": "聊天"++ "chatIntelligence": "聊天",++ "dictationTranslation": "翻譯"}},"noteFormatting": {@@@ -2375,7 -2259,8 +2415,8 @@@},"errors": {"noModel": "未選擇 AI 模型。請在設定中進行配置。",- "noEndpoint": "未設定自架伺服器 URL。請在設定中進行配置。",-- "actionFailed": "操作失敗"++ "actionFailed": "操作失敗",++ "noEndpoint": "未設定自架伺服器 URL。請在設定中進行配置。"}},"empty": {@@@ -2538,7 -2423,11 +2579,9 @@@"integrations": "整合","defaultUser": "使用者","notSignedIn": "尚未登入",- "chat": "聊天"+ "chat": "聊天",- "inviteTeammate": "Invitar compañero",- "createWorkspace": "Crear espacio de trabajo",+ "collapse": "收合側邊欄",+ "expand": "展開側邊欄"},"chat": {"newChat": "新對話",@@@ -2627,11 -2516,19 +2670,19 @@@"title": "快捷鍵無法使用","description": "無法註冊所選快捷鍵。請在設定中選擇其他快捷鍵。"},+ "addedToDict": "已將 {{words}} 加入到你的詞典",+ "undo": "復原",+ "accessibilityMissing": {+ "title": "需要輔助使用權限",+ "description": "OpenWhispr 需要輔助使用權限來偵測快捷鍵和貼上文字。請在控制面板中啟用。"++ },+ "gpuFallback": {+ "title": "GPU 加速無法使用",+ "description": "轉錄正在使用 CPU。你可以在設定中關閉 GPU 加速。"+ },+ "cleanupFailed": {+ "title": "清理失敗",+ "description": "你的聽寫已直接貼上,未經 AI 清理。"- },- "addedToDict": "已將 {{words}} 加入到你的詞典",- "undo": "復原",- "accessibilityMissing": {- "title": "需要輔助使用權限",- "description": "OpenWhispr 需要輔助使用權限來偵測快捷鍵和貼上文字。請在控制面板中啟用。"}},"mic": {@@@ -3077,18 -2975,25 +3128,50 @@@}},"accept": {- "title": "Unirse al espacio de trabajo",- "description": "{{inviter}} te invitó a unirte a {{workspace}} como {{role}}.",- "loading": "Cargando invitación…",- "accept": "Aceptar invitación",- "accepting": "Aceptando…",- "signInToAccept": "Inicia sesión para aceptar",- "successTitle": "Te uniste",- "successDescription": "Bienvenido a {{name}}.",- "errorTitle": "No se pudo aceptar la invitación"+ "title": "加入工作區",+ "description": "{{inviter}} 邀請你以 {{role}} 的身分加入 {{workspace}}。",+ "loading": "正在載入邀請…",+ "accept": "接受邀請",+ "accepting": "接受中…",+ "signInToAccept": "登入以接受",+ "switchAccount": "切換帳號",+ "successTitle": "你已加入",+ "successDescription": "你已成為 {{name}} 的成員。可前往「設定 → 工作區」進行管理。",+ "errorTitle": "無法接受邀請",+ "sentTo": "邀請已傳送至 {{email}}",+ "wrongAccount": "此邀請是傳送給 {{email}} 的。你目前以 {{current}} 的身分登入。"}+ },++ "dictationTranslation": {++ "title": "聽寫翻譯",++ "description": "專用快捷鍵,將你的聽寫翻譯成另一種語言後貼上",++ "enabled": "啟用聽寫翻譯",++ "enabledDescription": "透過翻譯快捷鍵開始的聽寫會先整理再翻譯,然後貼上",++ "sourceLanguage": "口說語言",++ "sourceLanguageDescription": "你聽寫時使用的語言——自動偵測也能處理混合語言聽寫",++ "targetLanguage": "翻譯為",++ "targetLanguageDescription": "貼上文字的語言",++ "targetLanguageMissing": "請選擇目標語言以啟用翻譯快捷鍵",++ "selectLanguage": "選擇語言…",++ "prompt": {++ "title": "翻譯提示詞",++ "description": "自訂模型翻譯聽寫內容的方式"++ },++ "hotkeyHint": "在 設定 → 一般 → 翻譯快捷鍵 中設定快捷鍵",++ "targetsLabel": "目標語言",++ "addTarget": "新增語言…",++ "activeTarget": "目前目標語言",++ "removeTarget": "移除{{language}}",++ "maxTargets": "最多 {{max}} 種語言"++ },+ "meetingNotification": {+ "title": "偵測到會議",+ "body": {+ "detected": "你似乎正在開會。要開始記錄嗎?",+ "starting": "你的會議即將開始。要開始記錄嗎?",+ "underway": "你的會議似乎已在進行中。要開始記錄嗎?"+ },+ "start": "開始記錄",+ "join": "加入並轉錄"}}diff --cc src/services/SyncService.tsindex b28b73566,8c4a9f85d..29a8ef90d--- a/src/services/SyncService.ts+++ b/src/services/SyncService.ts@@@ -903,154 -434,62 +903,163 @@@ class SyncService}}- private async pullFolders(): Promise<void> {+ private async pullFolders(teamOnly = false, snapshot = false): Promise<boolean> {try {- const since = localStorage.getItem("lastSyncedAt.folders") ?? undefined;+ const cursorKey = teamOnly ? "lastSyncedAt.folders.team" : "lastSyncedAt.folders";+ const since = snapshot ? undefined : (localStorage.getItem(cursorKey) ?? undefined);const syncStartedAt = new Date().toISOString();- const { folders: cloudFolders } = await FoldersService.list(since);+ const teamCapable = this.canSyncTeamSpaces() && this.hasTeamSpacesCapability();+ const scope = teamCapable ? "all" : undefined;+ const { folders: cloudFolders } = await FoldersService.list(since, scope);+ const ctx = await this.buildSpaceContext();+ // Parked or failed rows must retry: they hold the cursor back (and fail+ // a backfill) so one bad row never drops the rest of the delta.+ let dirtyRows = 0;for (const cloudFolder of cloudFolders) {- const local = await window.electronAPI.getFolderByClientId?.(- cloudFolder.client_folder_id ?? ""- );+ try {+ const local = await window.electronAPI.getFolderByClientId?.(+ cloudFolder.client_folder_id ?? ""+ );- if (cloudFolder.deleted_at) {- if (local) await window.electronAPI.hardDeleteFolder?.(local.id);- continue;- }+ // Redacted stub: the folder moved out of one of our teams. Clean+ // local copies (folder and child notes) are no longer ours to keep;+ // dirty ones move to the private space with forked identities so+ // unpushed work survives (plan §7.2).+ if (cloudFolder.access_removed) {+ if (!local) continue;+ if (ctx.privateSpace) {+ const preserveFolder = local.sync_status === "pending" && !local.deleted_at;+ const result = await window.electronAPI.relocateRevokedFolder?.(+ local.id,+ ctx.privateSpace.id,+ preserveFolder+ );+ if (result?.success) {+ const teamName = ctx.byCloudTeamId.get(cloudFolder.previous_team_id ?? "")?.name;+ if (result.folder) {+ this.dispatchNoteRelocated(result.folder.name, teamName);+ } else {+ for (const note of result.relocatedNotes ?? []) {+ this.dispatchNoteRelocated(note.title, teamName);+ }+ }+ } else {+ dirtyRows++;+ console.warn(`Could not relocate revoked folder ${local.id}:`, result?.error);+ }+ } else {+ await window.electronAPI.hardDeleteFolder?.(local.id);+ }+ continue;+ }++ if (teamOnly && !cloudFolder.team_id) {+ // A personal row whose local copy still sits in a team space+ // announces a team→personal transition — apply it, or a later+ // edit's push would re-team the privatized folder.+ if (+ local &&+ !local.deleted_at &&+ ctx.byId.get(local.space_id)?.kind === "team" &&+ ctx.privateSpace+ ) {+ if (cloudFolder.deleted_at) {+ await window.electronAPI.hardDeleteFolder?.(local.id);+ } else if (+ normalizeTimestamp(cloudFolder.updated_at) > normalizeTimestamp(local.updated_at)+ ) {+ await window.electronAPI.upsertFolderFromCloud?.(+ cloudFolder as unknown as Record<string, unknown>,+ ctx.privateSpace.id+ );+ }+ }+ continue;+ }- // A folder created elsewhere arrives with an unknown client_folder_id;- // inserting it would violate the local unique folder name. Converge by- // adopting the cloud identity onto the same-named local folder — e.g. a- // pre-existing user-created "Videos" in the cloud meeting the locally- // seeded default, in either combination. Only unlinked folders are- // adoptable (never re-point one already bound to another cloud folder),- // and the case-insensitive fallback stays reserved for fixed-name- // defaults so distinct user folders like "work"/"Work" never merge.- if (!local) {- const allFolders = (await window.electronAPI.getFolderIdMap?.()) ?? [];- const adoptable = allFolders.filter((f) => !f.cloud_id || f.cloud_id === cloudFolder.id);- const nameMatch =- adoptable.find((f) => f.name === cloudFolder.name) ??- adoptable.find(- (f) =>- (f.is_default || cloudFolder.is_default) &&- f.name.toLowerCase() === cloudFolder.name.toLowerCase()+ if (cloudFolder.deleted_at) {+ if (local) await window.electronAPI.hardDeleteFolder?.(local.id);+ continue;+ }++ const space = await this.resolveSpaceForCloudRow(cloudFolder.team_id, ctx);+ if (!space) {+ dirtyRows++;+ console.warn(`Parking folder ${cloudFolder.id}: unknown team ${cloudFolder.team_id}`);+ continue;+ }+- // A default folder created on another platform arrives with an- // unknown client_folder_id; inserting it would violate the per-space- // unique folder name. Match it by name within the private space and- // adopt its identity (team folders never adopt by name).- if (!local && cloudFolder.is_default && !cloudFolder.team_id) {++ // A folder created elsewhere arrives with an unknown++ // client_folder_id; inserting it would violate the per-space unique++ // folder name. Converge by adopting the cloud identity onto the++ // same-named local folder in the same space. Only unlinked folders++ // are adoptable (never re-point one already bound to another cloud++ // folder), and the case-insensitive fallback stays reserved for++ // fixed-name defaults so distinct user folders like "work"/"Work"++ // never merge. Team rows skip this — upsertFolderFromCloud's++ // collision convergence owns those.++ if (!local && !cloudFolder.team_id) {+ const allFolders = (await window.electronAPI.getFolderIdMap?.()) ?? [];- const nameMatch = allFolders.find(- (f) =>- f.is_default &&- f.space_id === space.id &&- f.name.toLowerCase() === cloudFolder.name.toLowerCase()++ const adoptable = allFolders.filter(++ (f) => f.space_id === space.id && (!f.cloud_id || f.cloud_id === cloudFolder.id));- if (nameMatch) {- await window.electronAPI.adoptFolderIdentity?.(- nameMatch.id,- cloudFolder.client_folder_id ?? nameMatch.client_folder_id,- cloudFolder.id,- cloudFolder.updated_at++ const nameMatch =++ adoptable.find((f) => f.name === cloudFolder.name) ??++ adoptable.find(++ (f) =>++ (f.is_default || cloudFolder.is_default) &&++ f.name.toLowerCase() === cloudFolder.name.toLowerCase()++ );+ if (nameMatch) {+ await window.electronAPI.adoptFolderIdentity?.(+ nameMatch.id,+ cloudFolder.client_folder_id ?? nameMatch.client_folder_id,+ cloudFolder.id,+ cloudFolder.updated_at+ );+ continue;+ }+ }++ if (local?.deleted_at) continue;+ // Pending rows are never overwritten by pull: an unpushed change+ // (e.g. a team→private move awaiting its scope PATCH) must win over+ // a teammate's rename, or the move silently snaps back (D2).+ if (+ !local ||+ (local.sync_status !== "pending" &&+ normalizeTimestamp(cloudFolder.updated_at) > normalizeTimestamp(local.updated_at))+ ) {+ await window.electronAPI.upsertFolderFromCloud?.(+ cloudFolder as unknown as Record<string, unknown>,+ space.id);- continue;}+ } catch (err) {+ dirtyRows++;+ console.error(`Folder pull failed for cloud folder ${cloudFolder.id}:`, err);}+ }- if (local?.deleted_at) continue;- if (!local || cloudFolder.updated_at > local.updated_at) {- await window.electronAPI.upsertFolderFromCloud?.(- cloudFolder as unknown as Record<string, unknown>- );+ // A backfill snapshot never sees tombstones or stubs, and a dirty pass+ // must re-see its parked/failed rows, so neither advances the cursors.+ if (!snapshot && dirtyRows === 0) {+ // A degraded (own-rows-only) pull never saw team rows; advancing+ // would permanently skip teammate edits once the capability probe+ // recovers.+ const hasTeamSpaces = [...ctx.byId.values()].some((s) => s.kind === "team");+ if (teamCapable || !hasTeamSpaces) {+ localStorage.setItem(cursorKey, syncStartedAt);+ // Full pulls cover team rows too; keep the team cursor current so a+ // later backup-off pass doesn't re-pull from the distant past.+ if (!teamOnly) localStorage.setItem("lastSyncedAt.folders.team", syncStartedAt);}}-- localStorage.setItem("lastSyncedAt.folders", syncStartedAt);+ return dirtyRows === 0;} catch (err) {console.error("Folder pull failed:", err);+ return false;}}diff --cc test/helpers/spacesDatabase.test.jsindex 70c9693a6,000000000..da6a47596mode 100644,000000..100644--- a/test/helpers/spacesDatabase.test.js+++ b/test/helpers/spacesDatabase.test.js@@@ -1,820 -1,0 +1,826 @@@+const test = require("node:test");+const assert = require("node:assert/strict");+const fs = require("node:fs");+const os = require("node:os");+const path = require("node:path");+const Module = require("node:module");++let userDataDir = fs.mkdtempSync(path.join(os.tmpdir(), "openwhispr-spaces-db-"));+const originalLoad = Module._load;++Module._load = function patchedLoad(request, parent, isMain) {+ if (request === "electron") {+ return {+ app: {+ getPath: () => userDataDir,+ getAppPath: () => process.cwd(),+ isReady: () => false,+ },+ };+ }+ return originalLoad.call(this, request, parent, isMain);+};++process.env.NODE_ENV = "test";++const DatabaseManager = require("../../src/helpers/database.js");++function isNativeBindingUnavailable(error) {+ const message = String(error?.message || error);+ return (+ message.includes("NODE_MODULE_VERSION") ||+ message.includes("Could not locate the bindings file")+ );+}++function createDb(t) {+ userDataDir = fs.mkdtempSync(path.join(os.tmpdir(), "openwhispr-spaces-db-"));+ try {+ const BetterSqlite = require("better-sqlite3");+ const probe = new BetterSqlite(path.join(userDataDir, "probe.db"));+ probe.close();+ fs.rmSync(path.join(userDataDir, "probe.db"), { force: true });+ } catch (error) {+ if (isNativeBindingUnavailable(error)) {+ t.skip("better-sqlite3 native binding is not available for this Node runtime");+ return null;+ }+ throw error;+ }++ try {+ return new DatabaseManager();+ } catch (error) {+ if (isNativeBindingUnavailable(error)) {+ t.skip("better-sqlite3 native binding is not available for this Node runtime");+ return null;+ }+ throw error;+ }+}++test("spaces migration is idempotent across launches", (t) => {+ const db = createDb(t);+ if (!db) return;++ const foldersSql = db.db+ .prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'folders'")+ .get().sql;+ assert.ok(+ !foldersSql.includes("UNIQUE"),+ "folders rebuild should drop the UNIQUE(name) constraint"+ );+ db.db.close();++ const db2 = new DatabaseManager();+ const rerunSql = db2.db+ .prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'folders'")+ .get().sql;+ assert.equal(rerunSql, foldersSql, "second launch must not rebuild folders again");++ const noteColumns = db2.db.pragma("table_info('notes')").map((col) => col.name);+ assert.ok(noteColumns.includes("space_id"));+ const folderColumns = db2.db.pragma("table_info('folders')").map((col) => col.name);+ assert.ok(folderColumns.includes("space_id"));++ const indexes = db2.db+ .prepare("SELECT name FROM sqlite_master WHERE type = 'index' AND tbl_name = 'folders'")+ .all()+ .map((row) => row.name);+ assert.ok(indexes.includes("idx_folders_client_folder_id"));+ assert.ok(indexes.includes("idx_folders_space_name"));++ const privates = db2.db+ .prepare("SELECT COUNT(*) as count FROM spaces WHERE kind = 'private'")+ .get();+ assert.equal(privates.count, 1);+});++test("pre-migration rows are backfilled into the private space", (t) => {+ const db = createDb(t);+ if (!db) return;+ const privateId = db.getPrivateSpaceId();+ assert.ok(privateId);++ for (const folder of db.getFolders()) {+ assert.equal(folder.space_id, privateId);+ }+ for (const note of db.getNotes()) {+ assert.equal(note.space_id, privateId);+ }++ // Simulate rows written before the spaces migration existed.+ db.db+ .prepare("INSERT INTO folders (name, client_folder_id) VALUES ('Legacy', 'legacy-folder')")+ .run();+ db.db+ .prepare(+ "INSERT INTO notes (title, content, client_note_id) VALUES ('Legacy', '', 'legacy-note')"+ )+ .run();+ db.db.close();++ const db2 = new DatabaseManager();+ const legacyFolder = db2.db+ .prepare("SELECT * FROM folders WHERE client_folder_id = 'legacy-folder'")+ .get();+ assert.equal(legacyFolder.space_id, privateId);+ const legacyNote = db2.db+ .prepare("SELECT * FROM notes WHERE client_note_id = 'legacy-note'")+ .get();+ assert.equal(legacyNote.space_id, privateId);+});++test("folder names are unique per space, not globally", (t) => {+ const db = createDb(t);+ if (!db) return;+ const team = db.createSpace({ name: "Design" });+ assert.ok(team.success);+ assert.equal(team.space.kind, "team");++ const inPrivate = db.createFolder("Projects");+ assert.ok(inPrivate.success);+ assert.equal(inPrivate.folder.space_id, db.getPrivateSpaceId());++ const inTeam = db.createFolder("Projects", team.space.id);+ assert.ok(inTeam.success, "same name in another space must be allowed");+ assert.equal(inTeam.folder.space_id, team.space.id);++ assert.equal(db.createFolder("Projects").success, false);+ assert.equal(db.createFolder("Projects", team.space.id).success, false);+});++test("updateNote forces space_id to follow folder_id (D2)", (t) => {+ const db = createDb(t);+ if (!db) return;+ const privateId = db.getPrivateSpaceId();+ const team = db.createSpace({ name: "Eng" }).space;+ const teamFolder = db.createFolder("Docs", team.id).folder;++ const { note } = db.saveNote("Move me", "content");+ assert.equal(note.space_id, privateId);++ const moved = db.updateNote(note.id, { folder_id: teamFolder.id, space_id: privateId });+ assert.equal(moved.note.folder_id, teamFolder.id);+ assert.equal(moved.note.space_id, team.id, "folder's space must win over an explicit space_id");++ const detached = db.updateNote(note.id, { folder_id: null, space_id: privateId });+ assert.equal(detached.note.folder_id, null);+ assert.equal(detached.note.space_id, privateId);++ const retitled = db.updateNote(note.id, { title: "kept" });+ assert.equal(+ retitled.note.space_id,+ privateId,+ "space must not change without folder/space updates"+ );+});++test("purgeSpace leaves zero residue for the space and spares the private space", (t) => {+ const db = createDb(t);+ if (!db) return;+ const privateId = db.getPrivateSpaceId();+ const team = db.createSpace({ name: "Secret" }).space;+ const teamFolder = db.createFolder("Vault", team.id).folder;++ const teamNote = db.saveNote(+ "Team plan",+ "classified zebracorn intel",+ "personal",+ null,+ null,+ teamFolder.id+ ).note;+ assert.equal(teamNote.space_id, team.id);+ db.markNoteSynced(teamNote.id, "cloud-team-note");+ const draft = db.saveNote(+ "Draft",+ "unsent yeti prose",+ "personal",+ null,+ null,+ teamFolder.id+ ).note;+ const privateNote = db.saveNote("Mine", "private groundhog data").note;++ const seedMapping = db.db.prepare(+ "INSERT INTO speaker_mappings (note_id, speaker_id, display_name) VALUES (?, ?, ?)"+ );+ const seedEmbedding = db.db.prepare(+ "INSERT INTO note_speaker_embeddings (note_id, speaker_id, embedding) VALUES (?, ?, ?)"+ );+ for (const note of [teamNote, privateNote]) {+ seedMapping.run(note.id, "spk_0", "Alice");+ seedEmbedding.run(note.id, "spk_0", Buffer.from(new Float32Array([0.1, 0.2]).buffer));+ }++ const result = db.purgeSpace(team.id);+ assert.ok(result.success);+ assert.deepEqual(result.noteIds, [teamNote.id]);+ assert.deepEqual(result.folderNames, ["Vault"]);+ assert.equal(result.spaceId, team.id);++ // Never-synced notes exist nowhere else — relocated, not destroyed.+ assert.equal(result.relocatedCount, 1);+ assert.deepEqual(result.relocatedTitles, ["Draft"]);+ assert.deepEqual(+ result.relocatedNotes.map((n) => n.id),+ [draft.id]+ );+ const relocated = db.getNote(draft.id);+ assert.equal(relocated.space_id, privateId);+ assert.equal(relocated.folder_id, null);+ assert.equal(relocated.sync_status, "pending");++ const count = (sql, ...args) => db.db.prepare(sql).get(...args).count;+ assert.equal(count("SELECT COUNT(*) as count FROM notes WHERE space_id = ?", team.id), 0);+ assert.equal(count("SELECT COUNT(*) as count FROM folders WHERE space_id = ?", team.id), 0);+ assert.equal(count("SELECT COUNT(*) as count FROM spaces WHERE id = ?", team.id), 0);+ assert.equal(+ count("SELECT COUNT(*) as count FROM speaker_mappings WHERE note_id = ?", teamNote.id),+ 0+ );+ assert.equal(+ count("SELECT COUNT(*) as count FROM note_speaker_embeddings WHERE note_id = ?", teamNote.id),+ 0+ );+ assert.equal(+ count("SELECT COUNT(*) as count FROM notes_fts WHERE notes_fts MATCH 'zebracorn'"),+ 0+ );+ assert.equal(count("SELECT COUNT(*) as count FROM notes_fts WHERE notes_fts MATCH 'yeti'"), 1);++ assert.equal(count("SELECT COUNT(*) as count FROM notes WHERE space_id = ?", privateId), 2);+ assert.equal(+ count("SELECT COUNT(*) as count FROM speaker_mappings WHERE note_id = ?", privateNote.id),+ 1+ );+ assert.equal(+ count("SELECT COUNT(*) as count FROM notes_fts WHERE notes_fts MATCH 'groundhog'"),+ 1+ );++ const refused = db.purgeSpace(privateId);+ assert.equal(refused.success, false);+ assert.equal(count("SELECT COUNT(*) as count FROM spaces WHERE id = ?", privateId), 1);+});++test("saveNote resolves default folders within the target space", (t) => {+ const db = createDb(t);+ if (!db) return;+ const privateId = db.getPrivateSpaceId();+ const team = db.createSpace({ name: "Ops" }).space;+ db.db+ .prepare(+ "INSERT INTO folders (name, is_default, sort_order, space_id, client_folder_id) VALUES ('Meetings', 1, 0, ?, 'team-meetings')"+ )+ .run(team.id);++ const privateMeetingsFolder = db.getMeetingsFolder();+ const teamMeetingsFolder = db.getMeetingsFolder(team.id);+ assert.ok(privateMeetingsFolder);+ assert.ok(teamMeetingsFolder);+ assert.notEqual(teamMeetingsFolder.id, privateMeetingsFolder.id);++ const privateMeeting = db.saveNote("Standup", "notes", "meeting").note;+ assert.equal(privateMeeting.folder_id, privateMeetingsFolder.id);+ assert.equal(privateMeeting.space_id, privateId);++ const teamMeeting = db.saveNote("Sync", "notes", "meeting", null, null, null, team.id).note;+ assert.equal(teamMeeting.folder_id, teamMeetingsFolder.id);+ assert.equal(teamMeeting.space_id, team.id);++ // No matching default folder in the team space → note keeps the space, no folder.+ const teamDoc = db.saveNote("Doc", "body", "personal", null, null, null, team.id).note;+ assert.equal(teamDoc.folder_id, null);+ assert.equal(teamDoc.space_id, team.id);+});++test("moveFolderToSpace moves the folder and its live notes in one transaction", (t) => {+ const db = createDb(t);+ if (!db) return;+ const privateId = db.getPrivateSpaceId();+ const team = db.createSpace({ name: "Growth" }).space;+ const folder = db.createFolder("Campaigns").folder;+ const filed = db.saveNote("Plan", "body", "personal", null, null, folder.id).note;+ const loose = db.saveNote("Loose", "body").note;++ const moved = db.moveFolderToSpace(folder.id, team.id);+ assert.ok(moved.success);+ assert.equal(moved.folder.space_id, team.id);+ assert.equal(moved.folder.sync_status, "pending");+ assert.deepEqual(+ moved.notes.map((n) => n.id),+ [filed.id]+ );++ const movedNote = db.getNote(filed.id);+ assert.equal(movedNote.space_id, team.id);+ assert.equal(movedNote.folder_id, folder.id, "notes keep their folder link");+ assert.equal(movedNote.sync_status, "pending");+ assert.equal(db.getNote(loose.id).space_id, privateId, "notes outside the folder stay put");++ const duplicate = db.createFolder("Campaigns").folder;+ assert.equal(+ db.moveFolderToSpace(duplicate.id, team.id).success,+ false,+ "a same-named folder in the target space blocks the move"+ );++ const meetings = db.getMeetingsFolder();+ assert.equal(db.moveFolderToSpace(meetings.id, team.id).success, false);+});++test("getNotes with spaceId and no folderId lists only the space's root notes", (t) => {+ const db = createDb(t);+ if (!db) return;+ const team = db.createSpace({ name: "Ops" }).space;+ const folder = db.createFolder("Docs", team.id).folder;+ const rootNote = db.saveNote("Root", "body", "personal", null, null, null, team.id).note;+ db.saveNote("Filed", "body", "personal", null, null, folder.id);++ const rootNotes = db.getNotes(null, 50, null, team.id);+ assert.deepEqual(+ rootNotes.map((n) => n.id),+ [rootNote.id]+ );++ const folderNotes = db.getNotes(null, 50, folder.id);+ assert.equal(folderNotes.length, 1);+ assert.equal(folderNotes[0].title, "Filed");+});++test("pending queues split by space kind", (t) => {+ const db = createDb(t);+ if (!db) return;+ const team = db.createSpace({ name: "Sales" }).space;+ const privateFolder = db.createFolder("Ideas").folder;+ const teamFolder = db.createFolder("Pipeline", team.id).folder;+ const privateNote = db.saveNote("Mine", "body").note;+ const teamNote = db.saveNote("Ours", "body", "personal", null, null, null, team.id).note;++ assert.deepEqual(+ db.getPendingNotes("team").map((n) => n.id),+ [teamNote.id]+ );+ assert.ok(db.getPendingNotes("private").some((n) => n.id === privateNote.id));+ assert.ok(!db.getPendingNotes("private").some((n) => n.id === teamNote.id));+ assert.equal(+ db.getPendingNotes().length,+ db.getPendingNotes("private").length + db.getPendingNotes("team").length+ );++ assert.deepEqual(+ db.getPendingFolders("team").map((f) => f.id),+ [teamFolder.id]+ );+ assert.ok(db.getPendingFolders("private").some((f) => f.id === privateFolder.id));+ assert.equal(+ db.getPendingFolders().length,+ db.getPendingFolders("private").length + db.getPendingFolders("team").length+ );+});++test("space-root notes keep folder_id NULL across relaunches", (t) => {+ const db = createDb(t);+ if (!db) return;+ const privateId = db.getPrivateSpaceId();+ const team = db.createSpace({ name: "Team" }).space;+ const teamRoot = db.saveNote("Team root", "body", "personal", null, null, null, team.id).note;+ assert.equal(teamRoot.folder_id, null);+ const privateRoot = db.saveNote("Mine", "body").note;+ db.updateNote(privateRoot.id, { folder_id: null, space_id: privateId });+ db.db+ .prepare("UPDATE notes SET sync_status = 'synced' WHERE id IN (?, ?)")+ .run(teamRoot.id, privateRoot.id);+ const snapshot = db.db+ .prepare(+ "SELECT id, folder_id, space_id, sync_status, updated_at FROM notes WHERE id IN (?, ?) ORDER BY id"+ )+ .all(teamRoot.id, privateRoot.id);+ db.db.close();++ const db2 = new DatabaseManager();+ const relaunched = db2.db+ .prepare(+ "SELECT id, folder_id, space_id, sync_status, updated_at FROM notes WHERE id IN (?, ?) ORDER BY id"+ )+ .all(teamRoot.id, privateRoot.id);+ assert.deepEqual(+ relaunched,+ snapshot,+ "relaunch must not backfill space-root notes into a folder"+ );+ for (const note of relaunched) {+ assert.equal(note.folder_id, null);+ }+});++test("hard deletes clean speaker rows", (t) => {+ const db = createDb(t);+ if (!db) return;+ const seedSpeakerRows = (noteId) => {+ db.db+ .prepare(+ "INSERT INTO speaker_mappings (note_id, speaker_id, display_name) VALUES (?, 'spk_0', 'Alice')"+ )+ .run(noteId);+ db.db+ .prepare(+ "INSERT INTO note_speaker_embeddings (note_id, speaker_id, embedding) VALUES (?, 'spk_0', ?)"+ )+ .run(noteId, Buffer.from(new Float32Array([0.1, 0.2]).buffer));+ };+ const residue = (noteId) =>+ db.db+ .prepare(+ "SELECT (SELECT COUNT(*) FROM speaker_mappings WHERE note_id = ?) + (SELECT COUNT(*) FROM note_speaker_embeddings WHERE note_id = ?) as count"+ )+ .get(noteId, noteId).count;++ const solo = db.saveNote("Solo", "body").note;+ seedSpeakerRows(solo.id);+ assert.ok(db.hardDeleteNote(solo.id).success);+ assert.equal(residue(solo.id), 0);++ const hardFolder = db.createFolder("Hard").folder;+ const hardNote = db.saveNote("Filed", "body", "personal", null, null, hardFolder.id).note;+ seedSpeakerRows(hardNote.id);+ assert.ok(db.hardDeleteFolder(hardFolder.id).success);+ assert.equal(residue(hardNote.id), 0);++ const softFolder = db.createFolder("Soft").folder;+ const softNote = db.saveNote("Filed too", "body", "personal", null, null, softFolder.id).note;+ seedSpeakerRows(softNote.id);+ assert.ok(db.deleteFolder(softFolder.id).success);+ assert.equal(residue(softNote.id), 0);+});++test("upsertFolderFromCloud converges on a same-space name collision", (t) => {+ const db = createDb(t);+ if (!db) return;+ const team = db.createSpace({ name: "Shared" }).space;+ const local = db.createFolder("Projects", team.id).folder;++ const cloud = {+ client_folder_id: "cf-remote",+ id: "cloud-folder-1",+ name: "Projects",+ sort_order: 7,+ created_at: "2026-07-01T00:00:00.000Z",+ updated_at: "2026-07-02T00:00:00.000Z",+ };+ const converged = db.upsertFolderFromCloud(cloud, team.id);+ assert.equal(converged.id, local.id, "must adopt the existing live folder, not insert");+ assert.equal(converged.client_folder_id, "cf-remote");+ assert.equal(converged.cloud_id, "cloud-folder-1");+ assert.equal(converged.sort_order, 7);+ assert.equal(converged.name, "Projects");+ assert.equal(converged.sync_status, "synced");+ assert.equal(db.getFolders(team.id).filter((f) => f.name === "Projects").length, 1);++ // DO UPDATE branch: the cloud folder is renamed to a name held by another+ // live local folder in the same space — the holder adopts the identity and+ // the stale tracker is forked instead of wedging the pull.+ const other = db.createFolder("Roadmap", team.id).folder;+ const renamed = db.upsertFolderFromCloud(+ { ...cloud, name: "Roadmap", updated_at: "2026-07-03T00:00:00.000Z" },+ team.id+ );+ assert.equal(renamed.id, other.id);+ assert.equal(renamed.client_folder_id, "cf-remote");+ assert.equal(renamed.cloud_id, "cloud-folder-1");+ const forked = db.db.prepare("SELECT * FROM folders WHERE id = ?").get(local.id);+ assert.notEqual(forked.client_folder_id, "cf-remote");+ assert.equal(forked.cloud_id, null);+ assert.equal(forked.sync_status, "pending");+});++test("pending vector purges persist across relaunches until cleared", (t) => {+ const db = createDb(t);+ if (!db) return;+ db.addPendingVectorPurge(42);+ db.addPendingVectorPurge(42);+ db.addPendingVectorPurge(7);+ assert.deepEqual(+ db+ .getPendingVectorPurges()+ .map((row) => row.space_id)+ .sort((a, b) => a - b),+ [7, 42]+ );+ db.db.close();++ const db2 = new DatabaseManager();+ assert.equal(db2.getPendingVectorPurges().length, 2, "queue must survive a relaunch");+ db2.clearPendingVectorPurge(42);+ assert.deepEqual(+ db2.getPendingVectorPurges().map((row) => row.space_id),+ [7]+ );+});++test("setSpaceSyncStatus flips a space's sync_status", (t) => {+ const db = createDb(t);+ if (!db) return;+ const team = db.createSpace({ name: "Docs" }).space;++ assert.ok(db.setSpaceSyncStatus(team.id, "synced").success);+ assert.equal(db.getSpaces().find((s) => s.id === team.id).sync_status, "synced");++ assert.ok(db.setSpaceSyncStatus(team.id, "pending").success);+ assert.equal(db.getSpaces().find((s) => s.id === team.id).sync_status, "pending");++ assert.equal(db.setSpaceSyncStatus(99999, "synced").success, false);+});++test("team→private moves set left_team so retractions stay in the team queue", (t) => {+ const db = createDb(t);+ if (!db) return;+ const privateId = db.getPrivateSpaceId();+ const team = db.createSpace({ name: "Sales" }).space;++ const note = db.saveNote("Comp review", "body", "personal", null, null, null, team.id).note;+ db.markNoteSynced(note.id, "cloud-note-1");+ db.updateNote(note.id, { space_id: privateId, folder_id: null });++ const moved = db.getNote(note.id);+ assert.equal(moved.space_id, privateId);+ assert.equal(moved.left_team, 1);+ assert.equal(moved.sync_status, "pending");+ assert.ok(+ db.getPendingNotes("team").some((n) => n.id === note.id),+ "the retraction must push even in the backup-off team-only pass"+ );++ db.markNoteSynced(note.id, "cloud-note-1");+ assert.equal(db.getNote(note.id).left_team, 0, "settling clears the flag");++ // Identity forks null the cloud_id — nothing to retract, no flag.+ const forked = db.saveNote("Stub", "body", "personal", null, null, null, team.id).note;+ db.markNoteSynced(forked.id, "cloud-note-2");+ db.updateNote(forked.id, {+ space_id: privateId,+ folder_id: null,+ client_note_id: "forked-client-id",+ cloud_id: null,+ });+ assert.equal(db.getNote(forked.id).left_team, 0);++ // Never-synced rows have no server copy to retract.+ const local = db.saveNote("Local", "body", "personal", null, null, null, team.id).note;+ db.updateNote(local.id, { space_id: privateId, folder_id: null });+ assert.equal(db.getNote(local.id).left_team, 0);+ assert.ok(!db.getPendingNotes("team").some((n) => n.id === local.id));+});++test("moveFolderToSpace team→private flags the folder and its cloud-backed notes", (t) => {+ const db = createDb(t);+ if (!db) return;+ const privateId = db.getPrivateSpaceId();+ const team = db.createSpace({ name: "Growth" }).space;+ const folder = db.createFolder("Campaigns", team.id).folder;+ db.markFolderSynced(folder.id, "cloud-folder-1");+ const cloudNote = db.saveNote("Plan", "body", "personal", null, null, folder.id).note;+ db.markNoteSynced(cloudNote.id, "cloud-note-1");+ const localNote = db.saveNote("Draft", "body", "personal", null, null, folder.id).note;++ assert.ok(db.moveFolderToSpace(folder.id, privateId).success);+ const movedFolder = db.db.prepare("SELECT * FROM folders WHERE id = ?").get(folder.id);+ assert.equal(movedFolder.left_team, 1);+ assert.equal(db.getNote(cloudNote.id).left_team, 1);+ assert.equal(db.getNote(localNote.id).left_team, 0);+ assert.ok(db.getPendingFolders("team").some((f) => f.id === folder.id));+ assert.ok(db.getPendingNotes("team").some((n) => n.id === cloudNote.id));+ assert.ok(!db.getPendingNotes("team").some((n) => n.id === localNote.id));++ // Moving back into a team clears the flags: the team queue covers the rows+ // by their space kind again.+ assert.ok(db.moveFolderToSpace(folder.id, team.id).success);+ assert.equal(+ db.db.prepare("SELECT left_team FROM folders WHERE id = ?").get(folder.id).left_team,+ 0+ );+ assert.equal(db.getNote(cloudNote.id).left_team, 0);+});++test("markNoteSyncedIfUnchanged settles only rows untouched since the push snapshot", (t) => {+ const db = createDb(t);+ if (!db) return;+ const note = db.saveNote("Doc", "v1").note;+ const snapshot = db.getNote(note.id);++ const settled = db.markNoteSyncedIfUnchanged(note.id, "cloud-1", snapshot.updated_at);+ assert.equal(settled.changes, 1);+ assert.equal(db.getNote(note.id).sync_status, "synced");+ assert.equal(db.getNote(note.id).cloud_id, "cloud-1");++ // Simulate an edit landing while the PATCH was in flight.+ db.db+ .prepare(+ "UPDATE notes SET content = 'v2', sync_status = 'pending', updated_at = datetime('now', '+1 hour') WHERE id = ?"+ )+ .run(note.id);+ const stale = db.markNoteSyncedIfUnchanged(note.id, "cloud-1", snapshot.updated_at);+ assert.equal(stale.changes, 0);+ assert.equal(db.getNote(note.id).sync_status, "pending", "the mid-flight edit must still push");+});++test("markFolderSyncedIfUnchanged settles only rows untouched since the push snapshot", (t) => {+ const db = createDb(t);+ if (!db) return;+ const folder = db.createFolder("Design").folder;+ const readFolder = () => db.db.prepare("SELECT * FROM folders WHERE id = ?").get(folder.id);+ const snapshot = readFolder();++ const settled = db.markFolderSyncedIfUnchanged(folder.id, "cloud-folder-1", snapshot.updated_at);+ assert.equal(settled.changes, 1);+ assert.equal(readFolder().sync_status, "synced");+ assert.equal(readFolder().cloud_id, "cloud-folder-1");++ // Simulate a rename landing while the PATCH was in flight.+ db.db+ .prepare(+ "UPDATE folders SET name = 'Design v2', sync_status = 'pending', updated_at = datetime('now', '+1 hour') WHERE id = ?"+ )+ .run(folder.id);+ const stale = db.markFolderSyncedIfUnchanged(folder.id, "cloud-folder-1", snapshot.updated_at);+ assert.equal(stale.changes, 0);+ assert.equal(readFolder().sync_status, "pending", "the mid-flight rename must still push");+});++test("relocateRevokedFolder preserves dirty children and hard-deletes server-owned ones", (t) => {+ const db = createDb(t);+ if (!db) return;+ const privateId = db.getPrivateSpaceId();+ const team = db.createSpace({ name: "Ops" }).space;+ const folder = db.createFolder("Q3 calls", team.id).folder;+ db.markFolderSynced(folder.id, "cloud-folder-1");++ const clean = db.saveNote("Recap", "server copy", "personal", null, null, folder.id).note;+ db.markNoteSynced(clean.id, "cloud-note-1");+ const dirty = db.saveNote("Edits", "unpushed work", "personal", null, null, folder.id).note;+ db.markNoteSynced(dirty.id, "cloud-note-2");+ db.updateNote(dirty.id, { content: "unpushed work v2" });+ const draft = db.saveNote("Draft", "never synced", "personal", null, null, folder.id).note;+ db.db+ .prepare(+ "INSERT INTO speaker_mappings (note_id, speaker_id, display_name) VALUES (?, 'spk_0', 'Alice')"+ )+ .run(clean.id);++ // Clean folder: the row is deleted, only dirty/never-synced children survive.+ const result = db.relocateRevokedFolder(folder.id, privateId, false);+ assert.ok(result.success);+ assert.equal(result.folder, null);+ assert.equal(result.folderName, "Q3 calls");+ assert.deepEqual(result.deletedNoteIds, [clean.id]);+ assert.deepEqual(+ result.relocatedNotes.map((n) => n.id).sort((a, b) => a - b),+ [dirty.id, draft.id]+ );+ assert.equal(db.getNote(clean.id), null);+ assert.equal(+ db.db.prepare("SELECT COUNT(*) as count FROM speaker_mappings WHERE note_id = ?").get(clean.id)+ .count,+ 0+ );+ assert.equal(db.db.prepare("SELECT * FROM folders WHERE id = ?").get(folder.id), undefined);+ for (const survivor of [db.getNote(dirty.id), db.getNote(draft.id)]) {+ assert.equal(survivor.space_id, privateId);+ assert.equal(survivor.folder_id, null);+ assert.equal(survivor.cloud_id, null);+ assert.equal(survivor.sync_status, "pending");+ }+ assert.notEqual(db.getNote(dirty.id).client_note_id, dirty.client_note_id, "identity forked");++ // Dirty folder: preserved in Personal with a forked identity, children keep+ // their folder link, and a name collision falls back to a suffixed rename.+ db.createFolder("Projects");+ const team2 = db.createSpace({ name: "Design" }).space;+ const dirtyFolder = db.createFolder("Projects", team2.id).folder;+ db.markFolderSynced(dirtyFolder.id, "cloud-folder-2");+ db.renameFolder(dirtyFolder.id, "Projects");+ const child = db.saveNote("Spec", "body", "personal", null, null, dirtyFolder.id).note;++ const preserved = db.relocateRevokedFolder(dirtyFolder.id, privateId, true);+ assert.ok(preserved.success);+ assert.equal(preserved.folder.name, "Projects (2)");+ assert.equal(preserved.folder.space_id, privateId);+ assert.equal(preserved.folder.cloud_id, null);+ assert.equal(preserved.folder.sync_status, "pending");+ assert.notEqual(preserved.folder.client_folder_id, dirtyFolder.client_folder_id);+ const movedChild = db.getNote(child.id);+ assert.equal(movedChild.space_id, privateId);+ assert.equal(movedChild.folder_id, dirtyFolder.id, "children keep the preserved folder link");+ assert.equal(movedChild.cloud_id, null);+});++test("getFolderNoteCounts attributes space-root notes per space", (t) => {+ const db = createDb(t);+ if (!db) return;+ const privateId = db.getPrivateSpaceId();+ const team = db.createSpace({ name: "Ops" }).space;+ const folder = db.createFolder("Docs", team.id).folder;+ db.saveNote("Filed", "body", "personal", null, null, folder.id);+ db.saveNote("Root A", "body", "personal", null, null, null, team.id);+ db.saveNote("Root B", "body", "personal", null, null, null, team.id);+ const tombstoned = db.saveNote("Gone", "body", "personal", null, null, null, team.id).note;+ db.deleteNote(tombstoned.id);++ const counts = db.getFolderNoteCounts();+ const folderRow = counts.find((c) => c.folder_id === folder.id);+ assert.equal(folderRow.space_id, team.id);+ assert.equal(folderRow.count, 1);++ const teamRootRow = counts.find((c) => c.folder_id === null && c.space_id === team.id);+ assert.equal(teamRootRow.count, 2, "space-root notes count per space, excluding tombstones");+ assert.ok(+ !counts.some((c) => c.folder_id === null && c.space_id === privateId),+ "no root row for spaces without root notes"+ );+});++test("folders rebuild succeeds on a legacy DB with notes referencing folders", (t) => {+ userDataDir = fs.mkdtempSync(path.join(os.tmpdir(), "openwhispr-spaces-db-"));+ let legacy;+ try {+ const BetterSqlite = require("better-sqlite3");+ legacy = new BetterSqlite(path.join(userDataDir, "transcriptions.db"));+ } catch (error) {+ if (isNativeBindingUnavailable(error)) {+ t.skip("better-sqlite3 native binding is not available for this Node runtime");+ return;+ }+ throw error;+ }++ // Pre-migration shape: folders still carries the table-level UNIQUE(name)+ // and notes rows reference them. better-sqlite3 enables foreign_keys by+ // default, so the rebuild's DROP TABLE used to throw on exactly this DB.+ legacy.exec(`+ CREATE TABLE folders (+ id INTEGER PRIMARY KEY AUTOINCREMENT,+ name TEXT NOT NULL UNIQUE,+ is_default INTEGER NOT NULL DEFAULT 0,+ sort_order INTEGER NOT NULL DEFAULT 0,+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,+ updated_at DATETIME DEFAULT CURRENT_TIMESTAMP+ );+ CREATE TABLE notes (+ id INTEGER PRIMARY KEY AUTOINCREMENT,+ title TEXT NOT NULL DEFAULT 'Untitled Note',+ content TEXT NOT NULL DEFAULT '',+ note_type TEXT NOT NULL DEFAULT 'personal',+ source_file TEXT,+ audio_duration_seconds REAL,+ folder_id INTEGER REFERENCES folders(id),+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,+ updated_at DATETIME DEFAULT CURRENT_TIMESTAMP+ );+ INSERT INTO folders (name, is_default, sort_order) VALUES ('Personal', 1, 0), ('Projects', 0, 1);+ INSERT INTO notes (title, content, folder_id) VALUES+ ('Legacy note one', 'body', 1),+ ('Legacy note two', 'body', 2),+ ('Legacy note three', 'body', 2);+ `);+ legacy.close();++ const db = new DatabaseManager();++ const foldersSql = db.db+ .prepare("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'folders'")+ .get().sql;+ assert.ok(!foldersSql.includes("UNIQUE"), "rebuild dropped the UNIQUE(name) constraint");+ assert.equal(+ db.db.pragma("foreign_keys", { simple: true }),+ 1,+ "foreign key enforcement is restored after the rebuild"+ );++ const privateId = db.getPrivateSpaceId();+ const notes = db.db.prepare("SELECT title, folder_id, space_id FROM notes ORDER BY id").all();+ assert.equal(notes.length, 3, "all legacy notes survive the rebuild");+ assert.deepEqual(+ notes.map((n) => n.folder_id),+ [1, 2, 2],+ "notes keep their folder references"+ );+ assert.ok(+ notes.every((n) => n.space_id === privateId),+ "legacy notes are backfilled into the private space"+ );+ const folders = db.db.prepare("SELECT id, name, space_id FROM folders ORDER BY id").all();- assert.equal(folders.length, 2, "both legacy folders survive");++ // init may seed additional defaults (e.g. "Videos"); the legacy folders++ // must survive with their ids intact.++ assert.deepEqual(++ folders.filter((f) => ["Personal", "Projects"].includes(f.name)).map((f) => f.id),++ [1, 2],++ "both legacy folders survive with their ids"++ );+ assert.ok(+ folders.every((f) => f.space_id === privateId),- "legacy folders are backfilled into the private space"++ "all folders are backfilled into the private space"+ );+ db.db.close();+});