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
fix(workspaces): apply adversarial-review findings across sharing, settings, and invitations
Gabriel Stein0cc17d451a0a
diff --git a/src/components/AcceptInvitationModal.tsx b/src/components/AcceptInvitationModal.tsxindex 90fc24075..00a3c5565 100644--- a/src/components/AcceptInvitationModal.tsx+++ b/src/components/AcceptInvitationModal.tsx@@ -17,6 +17,7 @@ import {} from "../utils/pendingInvitationToken";import { useWorkspaceStore } from "../stores/workspaceStore";import { useAuth } from "../hooks/useAuth";+import { signOut } from "../lib/auth";import { useToast } from "./ui/useToast";import SignInDialog from "./SignInDialog";import type { InvitationPreview } from "../types/electron";@@ -89,6 +90,13 @@ export default function AcceptInvitationModal({ token, onClose }: Props) {onClose();}+ // Stored token survives the sign-out reload, so the modal resurfaces for+ // the next account.+ async function handleSwitchAccount() {+ if (token) storePendingInvitationToken(token);+ await signOut();+ }+return (<><Dialog open={!!token} onOpenChange={(open) => !open && handleDecline()}>@@ -119,12 +127,22 @@ export default function AcceptInvitationModal({ token, onClose }: Props) {</>)}{error && <DialogDescription className="text-destructive">{error}</DialogDescription>}- {loading && <DialogDescription>{t("workspaces.accept.loading")}</DialogDescription>}+ {loading && (+ <DialogDescription className="flex items-center gap-1.5">+ <Loader2 className="w-3 h-3 animate-spin" />+ {t("workspaces.accept.loading")}+ </DialogDescription>+ )}</DialogHeader><DialogFooter><Button variant="ghost" onClick={handleDecline} disabled={accepting}>{t("common.cancel")}</Button>+ {wrongAccount && (+ <Button variant="outline" onClick={() => void handleSwitchAccount()}>+ {t("workspaces.accept.switchAccount")}+ </Button>+ )}<ButtononClick={handleAccept}disabled={loading || !preview || accepting || !!error || wrongAccount}diff --git a/src/components/ControlPanel.tsx b/src/components/ControlPanel.tsxindex 472729989..a9b638e76 100644--- a/src/components/ControlPanel.tsx+++ b/src/components/ControlPanel.tsx@@ -261,6 +261,9 @@ export default function ControlPanel({ initialSettingsSection }: ControlPanelProuseEffect(() => {const unsubscribe = window.electronAPI?.onWorkspaceInvitationToken?.((token) => {setInvitationToken(token);+ // Consume the main-process stash so a handled push isn't re-pulled on a+ // later remount.+ void window.electronAPI?.getPendingInvitationToken?.();});window.electronAPI?.getPendingInvitationToken?.().then((token) => {if (token) setInvitationToken(token);@@ -269,7 +272,9 @@ export default function ControlPanel({ initialSettingsSection }: ControlPanelPro}, []);useEffect(() => {- if (!authLoaded || !isSignedIn) return;+ // Also when signed out (the modal's "Sign in to accept" handles auth);+ // isSignedIn stays in the deps so a stored token resurfaces after sign-in.+ if (!authLoaded) return;const pending = consumePendingInvitationToken();if (pending) {setInvitationToken(pending);diff --git a/src/components/InviteTeammateDialog.tsx b/src/components/InviteTeammateDialog.tsxindex 82a5fd62b..a0191c21d 100644--- a/src/components/InviteTeammateDialog.tsx+++ b/src/components/InviteTeammateDialog.tsx@@ -45,9 +45,9 @@ export default function InviteTeammateDialog({const [submitting, setSubmitting] = useState(false);const [seatsUsed, setSeatsUsed] = useState<number | null>(null);const [seatLimitSeats, setSeatLimitSeats] = useState<number | null>(null);- const seats = useWorkspaceStore(- (s) => s.workspaces.find((w) => w.id === workspaceId)?.seats ?? null- );+ const workspace = useWorkspaceStore((s) => s.workspaces.find((w) => w.id === workspaceId));+ const seats = workspace?.seats ?? null;+ const isOwner = workspace?.role === "owner";useEffect(() => {if (!open) return;@@ -56,8 +56,15 @@ export default function InviteTeammateDialog({.then((preview) => {if (!cancelled) setSeatsUsed(preview.next_quantity - 1);})- .catch(() => {- if (!cancelled) setSeatsUsed(null);+ .catch(async () => {+ // No subscription yet — fall back to the member count so the seat+ // line always renders.+ try {+ const members = await WorkspacesService.listMembers(workspaceId);+ if (!cancelled) setSeatsUsed(members.length);+ } catch {+ if (!cancelled) setSeatsUsed(null);+ }});return () => {cancelled = true;@@ -169,9 +176,11 @@ export default function InviteTeammateDialog({{seatLimitSeats !== null && (<div className="rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 flex items-center justify-between gap-3"><p className="text-xs text-destructive">- {t("workspaces.invite.seatLimit", { seats: seatLimitSeats })}+ {isOwner+ ? t("workspaces.invite.seatLimit", { seats: seatLimitSeats })+ : t("workspaces.invite.askOwner", { seats: seatLimitSeats })}</p>- {onNavigateToBilling && (+ {isOwner && onNavigateToBilling && (<Buttontype="button"variant="outline"diff --git a/src/components/SignInDialog.tsx b/src/components/SignInDialog.tsxindex 5f260b7dd..5a1b011eb 100644--- a/src/components/SignInDialog.tsx+++ b/src/components/SignInDialog.tsx@@ -1,6 +1,6 @@import React, { useState } from "react";import { useTranslation } from "react-i18next";-import { Dialog, DialogContent, DialogTitle } from "./ui/dialog";+import { Dialog, DialogContent, DialogDescription, DialogTitle } from "./ui/dialog";import AuthenticationStep from "./AuthenticationStep";import EmailVerificationStep from "./EmailVerificationStep";@@ -22,6 +22,7 @@ export default function SignInDialog({ open, onOpenChange }: SignInDialogProps)<Dialog open={open} onOpenChange={handleOpenChange}><DialogContent className="max-w-md"><DialogTitle className="sr-only">{t("auth.welcomeTitle")}</DialogTitle>+ <DialogDescription className="sr-only">{t("auth.welcomeSubtitle")}</DialogDescription>{pendingVerificationEmail ? (<EmailVerificationStepemail={pendingVerificationEmail}diff --git a/src/components/notes/NoteEditor.tsx b/src/components/notes/NoteEditor.tsxindex 38eefe1e8..d35f06496 100644--- a/src/components/notes/NoteEditor.tsx+++ b/src/components/notes/NoteEditor.tsx@@ -157,6 +157,10 @@ export default function NoteEditor({// Persisted flag is the restart-safe truth; the live cache overlays it for// the current session (it reflects server state before the flag persists).const isShared = shareCache ? shareCache.share.visibility !== "private" : Boolean(note.is_shared);+ // Same gate as SyncService.canSyncSharedNotes: sharing needs a subscription.+ // An already-shared note stays manageable (unshare/revoke) after a lapse.+ const canShare =+ isSignedIn && (localStorage.getItem("isSubscribed") === "true" || Boolean(note.is_shared));const [diarizedSegments, setDiarizedSegments] = useState<TranscriptSegment[] | null>(null);const [speakerMappings, setSpeakerMappings] = useState<Record<string, string>>({});const [speakerProfiles, setSpeakerProfiles] = useState<@@ -788,7 +792,7 @@ export default function NoteEditor({)}</div>)}- {isSignedIn && (+ {canShare && (<buttontype="button"onClick={() => setShareDialogOpen(true)}@@ -982,7 +986,7 @@ export default function NoteEditor({onNewChat={embeddedChat.startNewChat}/>)}- {isSignedIn && (+ {canShare && (<ShareNoteDialog open={shareDialogOpen} onOpenChange={setShareDialogOpen} note={note} />)}</div>diff --git a/src/components/notes/ShareNoteDialog.tsx b/src/components/notes/ShareNoteDialog.tsxindex 38a5e643e..f9cb11140 100644--- a/src/components/notes/ShareNoteDialog.tsx+++ b/src/components/notes/ShareNoteDialog.tsx@@ -51,6 +51,8 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteDconst cached = useShareCacheEntry(cloudId);const [loading, setLoading] = useState(false);+ const [loadError, setLoadError] = useState(false);+ const [loadAttempt, setLoadAttempt] = useState(0);const [syncing, setSyncing] = useState(false);const [savingVisibility, setSavingVisibility] = useState(false);const [linkBusy, setLinkBusy] = useState(false);@@ -72,7 +74,8 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteDconst share = cached?.share ?? null;const invitations = useMemo(() => cached?.invitations ?? [], [cached?.invitations]);- const isPrivate = (share?.visibility ?? "private") === "private";+ // While server state loads, the persisted flag keeps the footer honest.+ const isPrivate = share ? share.visibility === "private" : !note.is_shared;// The store's note can miss a cloud_id assigned by a background sync// (markNoteSynced doesn't broadcast); read the DB before offering to sync.@@ -92,12 +95,12 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteD};}, [open, note.id, note.cloud_id]);- // Pure read of server state on open, plus reconciling the local is_shared- // flag when it disagrees with the server.+ // Loading also reconciles the local is_shared flag with server truth.useEffect(() => {if (!open || !cloudId) return;let cancelled = false;setLoading(true);+ setLoadError(false);NoteSharingService.getShareSettings(cloudId).then((res) => {if (cancelled) return;@@ -111,17 +114,13 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteDvoid persistNoteShareState(note.id,serverShared ? { is_shared: 1 } : { is_shared: 0, share_token: null }- );+ ).catch((err) => console.error("Share flag persist failed:", err));}}).catch((err) => {if (cancelled) return;console.error("Failed to load share settings:", err);- toast({- title: t("noteEditor.share.dialog.error.loadFailed"),- description: err instanceof Error ? err.message : t("common.unknownError"),- variant: "destructive",- });+ setLoadError(true);}).finally(() => {if (!cancelled) setLoading(false);@@ -129,7 +128,7 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteDreturn () => {cancelled = true;};- }, [open, cloudId, note.id, t, toast]);+ }, [open, cloudId, note.id, loadAttempt]);useEffect(() => {if (open) {@@ -176,7 +175,11 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteDinvitations: entry?.invitations ?? [],rawToken: null,}));- await persistNoteShareState(note.id, { is_shared: 0, share_token: null });+ // Local bookkeeping must not roll back a succeeded server call; the+ // dialog-open reconcile heals a failed flag write.+ void persistNoteShareState(note.id, { is_shared: 0, share_token: null }).catch((err) =>+ console.error("Share flag persist failed:", err)+ );return null;}const res = await NoteSharingService.updateShareSettings(@@ -189,10 +192,10 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteDinvitations: entry?.invitations ?? [],rawToken: res.raw_token ?? entry?.rawToken ?? null,}));- await persistNoteShareState(+ void persistNoteShareState(note.id,res.raw_token ? { is_shared: 1, share_token: res.raw_token } : { is_shared: 1 }- );+ ).catch((err) => console.error("Share flag persist failed:", err));return res;} catch (err) {console.error("Failed to update sharing:", err);@@ -241,7 +244,9 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteDinvitations: entry?.invitations ?? [],rawToken: res.raw_token,}));- await persistNoteShareState(note.id, { is_shared: 1, share_token: res.raw_token });+ void persistNoteShareState(note.id, { is_shared: 1, share_token: res.raw_token }).catch(+ (err) => console.error("Share flag persist failed:", err)+ );await copyLink(res.raw_token);} catch (err) {console.error("Share link recovery failed:", err);@@ -398,6 +403,20 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteD{t("noteEditor.share.dialog.syncAndShare")}</Button></>+ ) : loadError ? (+ <div className="flex items-center justify-between gap-2 py-1">+ <p className="text-xs text-foreground/50">+ {t("noteEditor.share.dialog.error.loadFailed")}+ </p>+ <Button+ variant="outline"+ size="sm"+ className="h-7 px-2.5 text-xs"+ onClick={() => setLoadAttempt((a) => a + 1)}+ >+ {t("noteEditor.share.dialog.error.retry")}+ </Button>+ </div>) : (<><DialogDescription className="sr-only">@@ -448,7 +467,7 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteD<div className="flex flex-col gap-1.5 mt-1"><MemberRowprimary={ownerName || ownerEmail}- secondary={ownerEmail}+ secondary={ownerName ? ownerEmail : null}trailing={<span className="text-[11px] text-foreground/40">{t("noteEditor.share.dialog.owner")}@@ -516,7 +535,7 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteDvariant={isPrivate ? "default" : "outline"}size="sm"className="h-8 px-3 text-xs gap-1.5"- disabled={loading || !share || savingVisibility || linkBusy || copied}+ disabled={loading || !share || savingVisibility || linkBusy}onClick={() => void handleLinkButton()}>{linkBusy ? (@@ -553,7 +572,7 @@ export default function ShareNoteDialog({ open, onOpenChange, note }: ShareNoteDinterface MemberRowProps {primary: string;- secondary: string;+ secondary: string | null;trailing: React.ReactNode;}@@ -562,7 +581,7 @@ function MemberRow({ primary, secondary, trailing }: MemberRowProps) {<div className="flex items-center gap-2 py-1.5 px-1"><div className="flex-1 min-w-0"><p className="text-xs text-foreground truncate">{primary}</p>- <p className="text-[11px] text-foreground/40 truncate">{secondary}</p>+ {secondary && <p className="text-[11px] text-foreground/40 truncate">{secondary}</p>}</div>{trailing}</div>diff --git a/src/components/notes/ShareVisibilityMenu.tsx b/src/components/notes/ShareVisibilityMenu.tsxindex d5192ecd1..1bd8df349 100644--- a/src/components/notes/ShareVisibilityMenu.tsx+++ b/src/components/notes/ShareVisibilityMenu.tsx@@ -46,8 +46,8 @@ export default function ShareVisibilityMenu({aria-label={t("noteEditor.share.dialog.visibility.label")}>{current.icon}- <span>{current.label}</span>- <ChevronDown size={12} className="text-foreground/40" />+ <span className="max-w-44 truncate">{current.label}</span>+ <ChevronDown size={12} className="text-foreground/40 shrink-0" /></button></DropdownMenuTrigger><DropdownMenuContent align="start" sideOffset={4} className="min-w-[260px]">diff --git a/src/components/settings/WorkspaceBillingTab.tsx b/src/components/settings/WorkspaceBillingTab.tsxindex 2388d586a..4ce1ef715 100644--- a/src/components/settings/WorkspaceBillingTab.tsx+++ b/src/components/settings/WorkspaceBillingTab.tsx@@ -43,16 +43,26 @@ export default function WorkspaceBillingTab({ workspace }: Props) {useEffect(() => () => focusCleanupRef.current?.(), []);- // The user finishes checkout / the portal in the browser; refresh when they return.+ // The user finishes checkout / the portal in the browser; refresh when they+ // return, then re-poll a few times to outlast Stripe webhook lag.function refreshOnReturn() {focusCleanupRef.current?.();- const onFocus = () => {- focusCleanupRef.current = null;+ const timers: ReturnType<typeof setTimeout>[] = [];+ const poll = () => {void refresh();void loadSeats();};+ const onFocus = () => {+ poll();+ for (const delayMs of [4000, 8000, 16000]) {+ timers.push(setTimeout(poll, delayMs));+ }+ };window.addEventListener("focus", onFocus, { once: true });- focusCleanupRef.current = () => window.removeEventListener("focus", onFocus);+ focusCleanupRef.current = () => {+ window.removeEventListener("focus", onFocus);+ timers.forEach(clearTimeout);+ };}async function openBilling(getUrl: () => Promise<string>) {@@ -139,6 +149,12 @@ export default function WorkspaceBillingTab({ workspace }: Props) {)}</div>+ {!isOwner && (+ <p className="text-xs text-muted-foreground">+ {t("settingsPage.workspace.billing.ownerOnly")}+ </p>+ )}+{isOwner && (<div className="flex gap-2">{workspace.stripe_subscription_id ? (diff --git a/src/components/settings/WorkspaceDeveloperTab.tsx b/src/components/settings/WorkspaceDeveloperTab.tsxindex 5ee9a6aef..5ec1cb743 100644--- a/src/components/settings/WorkspaceDeveloperTab.tsx+++ b/src/components/settings/WorkspaceDeveloperTab.tsx@@ -1,6 +1,6 @@import React, { useEffect, useRef, useState } from "react";import { useTranslation } from "react-i18next";-import { Plus, Copy, Trash2, Check, Key } from "lucide-react";+import { Plus, Copy, Trash2, Check, Key, Loader2 } from "lucide-react";import { Button } from "../ui/button";import { Input } from "../ui/input";import { Label } from "../ui/label";@@ -70,13 +70,16 @@ export default function WorkspaceDeveloperTab({ workspace }: Props) {const [name, setName] = useState("");const [selectedScopes, setSelectedScopes] = useState<Set<string>>(new Set());const [submitting, setSubmitting] = useState(false);+ const [loadError, setLoadError] = useState(false);const copyTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);async function refresh() {+ setLoadError(false);try {setKeys(await WorkspaceApiKeysService.list(workspace.id));} catch {setKeys([]);+ setLoadError(true);}}@@ -179,7 +182,17 @@ export default function WorkspaceDeveloperTab({ workspace }: Props) {</div><div className="rounded-lg border border-border/50 dark:border-border-subtle/70 divide-y divide-border/30 dark:divide-border-subtle/50 bg-card/50 dark:bg-surface-2/50">- {keys.length === 0 && (+ {loadError && (+ <div className="px-4 py-6 flex items-center justify-between gap-2">+ <p className="text-xs text-muted-foreground">+ {t("settingsPage.workspace.developer.loadError")}+ </p>+ <Button variant="outline" size="sm" onClick={() => void refresh()}>+ {t("settingsPage.workspace.loadError.retry")}+ </Button>+ </div>+ )}+ {!loadError && keys.length === 0 && (<div className="py-10 text-center"><Key className="w-5 h-5 text-muted-foreground/60 mx-auto mb-2" /><p className="text-xs text-muted-foreground">@@ -282,6 +295,7 @@ export default function WorkspaceDeveloperTab({ workspace }: Props) {type="submit"disabled={!name.trim() || selectedScopes.size === 0 || submitting}>+ {submitting && <Loader2 className="mr-1.5 h-3.5 w-3.5 animate-spin" />}{submitting ? t("common.saving") : t("settingsPage.workspace.developer.create")}</Button></DialogFooter>diff --git a/src/components/settings/WorkspaceMembersTab.tsx b/src/components/settings/WorkspaceMembersTab.tsxindex 09318d7c2..e76be1126 100644--- a/src/components/settings/WorkspaceMembersTab.tsx+++ b/src/components/settings/WorkspaceMembersTab.tsx@@ -37,19 +37,36 @@ export default function WorkspaceMembersTab({ workspace, onNavigateToBilling }:const [invitations, setInvitations] = useState<WorkspaceInvitation[]>([]);const [inviteOpen, setInviteOpen] = useState(false);const [resendingId, setResendingId] = useState<string | null>(null);+ const [membersLoading, setMembersLoading] = useState(false);+ const [membersError, setMembersError] = useState(false);+ const [invitationsError, setInvitationsError] = useState(false);const canManage = workspace.role === "owner" || workspace.role === "admin";+ async function loadMembers() {+ setMembersLoading(true);+ setMembersError(false);+ try {+ await refreshMembers(workspace.id);+ } catch {+ setMembersError(true);+ } finally {+ setMembersLoading(false);+ }+ }+async function refreshInvitations() {+ setInvitationsError(false);try {const list = await InvitationsService.list(workspace.id);setInvitations(list);} catch {setInvitations([]);+ setInvitationsError(true);}}useEffect(() => {- void refreshMembers(workspace.id);+ void loadMembers();if (canManage) void refreshInvitations();// eslint-disable-next-line react-hooks/exhaustive-deps}, [workspace.id]);@@ -171,80 +188,104 @@ export default function WorkspaceMembersTab({ workspace, onNavigateToBilling }:)}</div>- <div className="rounded-lg border border-border/50 dark:border-border-subtle/70 divide-y divide-border/30 dark:divide-border-subtle/50 bg-card/50 dark:bg-surface-2/50">- {members.map((member) => (- <div key={member.user_id} className="flex items-center gap-3 px-4 h-14">- {member.image ? (- <img- src={member.image}- alt=""- className="w-7 h-7 rounded-full object-cover shrink-0"- />- ) : (- <span className="w-7 h-7 rounded-full bg-primary/10 text-primary text-[10px] font-semibold flex items-center justify-center shrink-0">- {(member.name || member.email).slice(0, 2).toUpperCase()}+ {membersLoading && members.length === 0 ? (+ <div className="h-24 rounded-lg bg-foreground/5 dark:bg-white/5 animate-pulse" />+ ) : membersError && members.length === 0 ? (+ <div className="rounded-lg border border-border/50 dark:border-border-subtle/70 bg-card/50 dark:bg-surface-2/50 px-4 py-6 flex items-center justify-between gap-2">+ <p className="text-xs text-muted-foreground">+ {t("settingsPage.workspace.members.loadError")}+ </p>+ <Button variant="outline" size="sm" onClick={() => void loadMembers()}>+ {t("settingsPage.workspace.loadError.retry")}+ </Button>+ </div>+ ) : (+ <div className="rounded-lg border border-border/50 dark:border-border-subtle/70 divide-y divide-border/30 dark:divide-border-subtle/50 bg-card/50 dark:bg-surface-2/50">+ {members.map((member) => (+ <div key={member.user_id} className="flex items-center gap-3 px-4 h-14">+ {member.image ? (+ <img+ src={member.image}+ alt=""+ className="w-7 h-7 rounded-full object-cover shrink-0"+ />+ ) : (+ <span className="w-7 h-7 rounded-full bg-primary/10 text-primary text-[10px] font-semibold flex items-center justify-center shrink-0">+ {(member.name || member.email).slice(0, 2).toUpperCase()}+ </span>+ )}+ <div className="flex-1 min-w-0">+ <p className="text-xs font-medium text-foreground truncate">+ {member.name || member.email}+ </p>+ {member.name && (+ <p className="text-xs text-muted-foreground truncate">{member.email}</p>+ )}+ </div>+ <span+ className={cn(+ "text-[10px] font-medium px-2 py-0.5 rounded-md uppercase tracking-wide",+ member.role === "owner"+ ? "bg-primary/10 text-primary"+ : "bg-foreground/6 text-foreground/65"+ )}+ >+ {t(`settingsPage.workspace.role.${member.role}`)}</span>- )}- <div className="flex-1 min-w-0">- <p className="text-xs font-medium text-foreground truncate">- {member.name || member.email}- </p>- {member.name && (- <p className="text-xs text-muted-foreground truncate">{member.email}</p>+ {canManage && member.role !== "owner" && (+ <DropdownMenu>+ <DropdownMenuTrigger+ className="p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-foreground/5 outline-none focus-visible:ring-1 focus-visible:ring-primary/30"+ aria-label={t("common.actions")}+ >+ <MoreVertical className="w-3.5 h-3.5" />+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end" className="text-xs">+ {member.role !== "admin" && (+ <DropdownMenuItem onSelect={() => handleRoleChange(member.user_id, "admin")}>+ {t("settingsPage.workspace.members.promote")}+ </DropdownMenuItem>+ )}+ {member.role !== "member" && (+ <DropdownMenuItem onSelect={() => handleRoleChange(member.user_id, "member")}>+ {t("settingsPage.workspace.members.demote")}+ </DropdownMenuItem>+ )}+ {workspace.role === "owner" && (+ <DropdownMenuItem onSelect={() => confirmTransferOwnership(member)}>+ {t("settingsPage.workspace.members.transferOwnership")}+ </DropdownMenuItem>+ )}+ <DropdownMenuItem+ className="text-destructive"+ onSelect={() => confirmRemoveMember(member)}+ >+ <Trash2 className="mr-1.5 h-3.5 w-3.5" />+ {t("settingsPage.workspace.members.remove")}+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>)}</div>- <span- className={cn(- "text-[10px] font-medium px-2 py-0.5 rounded-md uppercase tracking-wide",- member.role === "owner"- ? "bg-primary/10 text-primary"- : "bg-foreground/6 text-foreground/65"- )}- >- {t(`settingsPage.workspace.role.${member.role}`)}- </span>- {canManage && member.role !== "owner" && (- <DropdownMenu>- <DropdownMenuTrigger- className="p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-foreground/5 outline-none focus-visible:ring-1 focus-visible:ring-primary/30"- aria-label={t("common.actions")}- >- <MoreVertical className="w-3.5 h-3.5" />- </DropdownMenuTrigger>- <DropdownMenuContent align="end" className="text-xs">- {member.role !== "admin" && (- <DropdownMenuItem onSelect={() => handleRoleChange(member.user_id, "admin")}>- {t("settingsPage.workspace.members.promote")}- </DropdownMenuItem>- )}- {member.role !== "member" && (- <DropdownMenuItem onSelect={() => handleRoleChange(member.user_id, "member")}>- {t("settingsPage.workspace.members.demote")}- </DropdownMenuItem>- )}- {workspace.role === "owner" && (- <DropdownMenuItem onSelect={() => confirmTransferOwnership(member)}>- {t("settingsPage.workspace.members.transferOwnership")}- </DropdownMenuItem>- )}- <DropdownMenuItem- className="text-destructive"- onSelect={() => confirmRemoveMember(member)}- >- <Trash2 className="mr-1.5 h-3.5 w-3.5" />- {t("settingsPage.workspace.members.remove")}- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>- )}- </div>- ))}- {members.length === 0 && (- <div className="py-8 text-center text-xs text-muted-foreground">- {t("settingsPage.workspace.members.empty")}- </div>- )}- </div>+ ))}+ {members.length === 0 && (+ <div className="py-8 text-center text-xs text-muted-foreground">+ {t("settingsPage.workspace.members.empty")}+ </div>+ )}+ </div>+ )}++ {canManage && invitationsError && (+ <div className="rounded-lg border border-border/50 dark:border-border-subtle/70 bg-card/50 dark:bg-surface-2/50 px-4 py-3 flex items-center justify-between gap-2">+ <p className="text-xs text-muted-foreground">+ {t("settingsPage.workspace.invites.loadError")}+ </p>+ <Button variant="outline" size="sm" onClick={() => void refreshInvitations()}>+ {t("settingsPage.workspace.loadError.retry")}+ </Button>+ </div>+ )}{canManage && invitations.length > 0 && (<div>diff --git a/src/components/settings/WorkspaceSection.tsx b/src/components/settings/WorkspaceSection.tsxindex 27dae9e6e..2bac1f14f 100644--- a/src/components/settings/WorkspaceSection.tsx+++ b/src/components/settings/WorkspaceSection.tsx@@ -52,8 +52,8 @@ export default function WorkspaceSection({ initialSubTab }: Props) {if (!isSignedIn) return null;- // Rendered in both the empty and populated branches; creating a workspace- // chains straight into inviting a teammate (with a Skip affordance).+ // Shared by the empty and populated branches so the create→invite chain+ // survives the branch switch when the first workspace lands in the store.const inviteWorkspace = inviteWorkspaceId? (workspaces.find((w) => w.id === inviteWorkspaceId) ?? null): null;@@ -143,40 +143,36 @@ export default function WorkspaceSection({ initialSubTab }: Props) {<div className="space-y-4"><div className="flex items-center justify-between"><div className="min-w-0">- {workspaces.length > 1 ? (- <DropdownMenu>- <DropdownMenuTrigger- className={cn(- "group flex items-center gap-1.5 outline-none rounded-md px-2 -mx-2 py-0.5",- "hover:bg-foreground/5 dark:hover:bg-white/5 focus-visible:ring-1 focus-visible:ring-primary/30"- )}- >- <h2 className="text-sm font-semibold text-foreground truncate">{workspace.name}</h2>- <ChevronDown className="h-3.5 w-3.5 text-muted-foreground" aria-hidden="true" />- </DropdownMenuTrigger>- <DropdownMenuContent align="start">- <DropdownMenuLabel className="text-[10px] uppercase tracking-wide text-muted-foreground/70 font-medium">- {t("workspaces.switcher.workspaces")}- </DropdownMenuLabel>- {workspaces.map((w) => (- <DropdownMenuItem- key={w.id}- onSelect={() => setActiveWorkspaceId(w.id)}- className="text-xs"- >- {w.name}- </DropdownMenuItem>- ))}- <DropdownMenuSeparator />- <DropdownMenuItem onSelect={() => setCreateOpen(true)} className="text-xs">- <UserPlus className="mr-1.5 h-3.5 w-3.5" />- {t("workspaces.switcher.create")}+ <DropdownMenu>+ <DropdownMenuTrigger+ className={cn(+ "group flex items-center gap-1.5 outline-none rounded-md px-2 -mx-2 py-0.5",+ "hover:bg-foreground/5 dark:hover:bg-white/5 focus-visible:ring-1 focus-visible:ring-primary/30"+ )}+ >+ <h2 className="text-sm font-semibold text-foreground truncate">{workspace.name}</h2>+ <ChevronDown className="h-3.5 w-3.5 text-muted-foreground" aria-hidden="true" />+ </DropdownMenuTrigger>+ <DropdownMenuContent align="start">+ <DropdownMenuLabel className="text-[10px] uppercase tracking-wide text-muted-foreground/70 font-medium">+ {t("workspaces.switcher.workspaces")}+ </DropdownMenuLabel>+ {workspaces.map((w) => (+ <DropdownMenuItem+ key={w.id}+ onSelect={() => setActiveWorkspaceId(w.id)}+ className="text-xs"+ >+ {w.name}</DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>- ) : (- <h2 className="text-sm font-semibold text-foreground truncate">{workspace.name}</h2>- )}+ ))}+ <DropdownMenuSeparator />+ <DropdownMenuItem onSelect={() => setCreateOpen(true)} className="text-xs">+ <UserPlus className="mr-1.5 h-3.5 w-3.5" />+ {t("workspaces.switcher.create")}+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu><p className="text-xs text-muted-foreground mt-0.5">{t(`settingsPage.workspace.role.${workspace.role}`)} · {workspace.slug}</p>diff --git a/src/locales/de/translation.json b/src/locales/de/translation.jsonindex ad87f46d8..cdf1c492e 100644--- a/src/locales/de/translation.json+++ b/src/locales/de/translation.json@@ -1174,7 +1174,7 @@},"general": {"nameLabel": "Workspace-Name",- "slugLabel": "Slug",+ "slugLabel": "Kurzname","slugHint": "Wird in URLs verwendet. Nur Kleinbuchstaben, Ziffern und Bindestriche.","slugInvalid": "Nur Kleinbuchstaben, Ziffern und Bindestriche.","saved": "Workspace aktualisiert",@@ -1200,6 +1200,7 @@"description": "{{count}} von {{seats}} Plätzen belegt.","invite": "Einladen","empty": "Noch keine Mitglieder.",+ "loadError": "Mitglieder konnten nicht geladen werden.","roleUpdated": "Rolle aktualisiert","promote": "Zum Administrator machen","demote": "Zum Mitglied machen",@@ -1219,6 +1220,7 @@"expiresIn_one": "Läuft in {{count}} Tag ab","expiresIn_other": "Läuft in {{count}} Tagen ab","expired": "Abgelaufen",+ "loadError": "Einladungen konnten nicht geladen werden.","resend": "Erneut senden","resending": "Sende erneut…","revoke": "Widerrufen",@@ -1234,6 +1236,7 @@"description": "Plan, Plätze und Zahlung.","plan": "Plan","seats": "Plätze",+ "ownerOnly": "Nur der Workspace-Inhaber kann das Abonnement verwalten.","nextInvoice": "Nächste Rechnung","manageStripe": "In Stripe verwalten","opening": "Öffne…",@@ -1256,6 +1259,7 @@"title": "API-Schlüssel","description": "Programmatischer Zugriff auf diesen Workspace.","empty": "Noch keine API-Schlüssel. Erstellen Sie einen für Integrationen.",+ "loadError": "API-Schlüssel konnten nicht geladen werden.","new": "Neuer Schlüssel","create": "Schlüssel erstellen","createTitle": "API-Schlüssel erstellen",@@ -2146,6 +2150,7 @@"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…",@@ -2168,6 +2173,7 @@"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",@@ -2870,7 +2876,7 @@"resendSent": "Einladung gesendet","resendThrottled": "Einladung wurde kürzlich gesendet. Versuche es in einer Minute erneut.","syncPrompt": "Beim Teilen wird eine Kopie dieser Notiz in deiner OpenWhispr-Cloud gespeichert.",- "syncAndShare": "Synchronisieren und teilen",+ "syncAndShare": "Notiz synchronisieren","visibility": {"label": "Sichtbarkeit","private": "Privat",@@ -2888,7 +2894,8 @@"revokeFailed": "Die Einladung konnte nicht entfernt werden. Versuche es erneut.","resendFailed": "Die Einladung konnte nicht erneut gesendet werden. Versuche es erneut.","syncFailed": "Die Notiz konnte nicht synchronisiert werden. Versuche es erneut.",- "loadFailed": "Freigabeeinstellungen konnten nicht geladen werden"+ "loadFailed": "Freigabeeinstellungen konnten nicht geladen werden",+ "retry": "Erneut versuchen"}}}diff --git a/src/locales/en/translation.json b/src/locales/en/translation.jsonindex 0664be29a..e2be42dd1 100644--- a/src/locales/en/translation.json+++ b/src/locales/en/translation.json@@ -1174,7 +1174,7 @@},"general": {"nameLabel": "Workspace name",- "slugLabel": "Slug",+ "slugLabel": "Short name","slugHint": "Used in URLs and invite links. Lowercase letters, digits, and dashes only.","slugInvalid": "Only lowercase letters, digits, and dashes.","saved": "Workspace updated",@@ -1200,6 +1200,7 @@"description": "{{count}} of {{seats}} seats used.","invite": "Invite","empty": "No members yet.",+ "loadError": "Couldn't load members.","roleUpdated": "Role updated","promote": "Make admin","demote": "Make member",@@ -1219,6 +1220,7 @@"expiresIn_one": "Expires in {{count}} day","expiresIn_other": "Expires in {{count}} days","expired": "Expired",+ "loadError": "Couldn't load invitations.","resend": "Resend","resending": "Resending…","revoke": "Revoke",@@ -1234,6 +1236,7 @@"description": "Plan, seats, and payment.","plan": "Plan","seats": "Seats",+ "ownerOnly": "Only the workspace owner can manage the subscription.","nextInvoice": "Next invoice","manageStripe": "Manage in Stripe","opening": "Opening…",@@ -1256,6 +1259,7 @@"title": "API keys","description": "Programmatic access scoped to this workspace.","empty": "No API keys yet. Create one to integrate with this workspace.",+ "loadError": "Couldn't load API keys.","new": "New key","create": "Create key","createTitle": "Create API key",@@ -2146,6 +2150,7 @@"roleLabel": "Role","seatUsage": "Using {{used}} of {{seats}} seats","seatLimit": "All {{seats}} seats are in use.",+ "askOwner": "All {{seats}} seats are in use. Ask the workspace owner to add seats.","manageSeats": "Manage seats","submit": "Send invite","submitting": "Sending…",@@ -2168,6 +2173,7 @@"accept": "Accept invitation","accepting": "Accepting…","signInToAccept": "Sign in to accept",+ "switchAccount": "Switch account","successTitle": "You're in","successDescription": "You're a member of {{name}}. Manage it in Settings → Workspace.","errorTitle": "Couldn't accept invitation",@@ -2870,7 +2876,7 @@"resendSent": "Invitation sent","resendThrottled": "Invitation sent recently. Try again in a minute.","syncPrompt": "Sharing keeps a copy of this note in your OpenWhispr cloud.",- "syncAndShare": "Sync and share",+ "syncAndShare": "Sync note","visibility": {"label": "Visibility","private": "Private",@@ -2888,7 +2894,8 @@"revokeFailed": "Couldn't remove the invitation. Try again.","resendFailed": "Couldn't resend the invitation. Try again.","syncFailed": "Couldn't sync this note. Try again.",- "loadFailed": "Couldn't load share settings"+ "loadFailed": "Couldn't load share settings",+ "retry": "Retry"}}}diff --git a/src/locales/es/translation.json b/src/locales/es/translation.jsonindex c3c0af80f..ff87d4f83 100644--- a/src/locales/es/translation.json+++ b/src/locales/es/translation.json@@ -1827,7 +1827,7 @@},"general": {"nameLabel": "Nombre del espacio de trabajo",- "slugLabel": "Slug",+ "slugLabel": "Nombre corto","slugHint": "Se usa en URLs y enlaces de invitación. Solo letras minúsculas, dígitos y guiones.","slugInvalid": "Solo letras minúsculas, dígitos y guiones.","saved": "Espacio de trabajo actualizado",@@ -1853,6 +1853,7 @@"description": "{{count}} de {{seats}} asientos utilizados.","invite": "Invitar","empty": "Aún no hay miembros.",+ "loadError": "No se pudieron cargar los miembros.","roleUpdated": "Rol actualizado","promote": "Hacer administrador","demote": "Hacer miembro",@@ -1872,6 +1873,7 @@"expiresIn_one": "Expira en {{count}} día","expiresIn_other": "Expira en {{count}} días","expired": "Expirada",+ "loadError": "No se pudieron cargar las invitaciones.","resend": "Reenviar","resending": "Reenviando…","revoke": "Revocar",@@ -1887,6 +1889,7 @@"description": "Plan, asientos y pago.","plan": "Plan","seats": "Asientos",+ "ownerOnly": "Solo el propietario del espacio de trabajo puede gestionar la suscripción.","nextInvoice": "Próxima factura","manageStripe": "Administrar en Stripe","opening": "Abriendo…",@@ -1909,6 +1912,7 @@"title": "Claves API","description": "Acceso programático limitado a este espacio de trabajo.","empty": "Aún no hay claves API. Crea una para integrarte con este espacio de trabajo.",+ "loadError": "No se pudieron cargar las claves de API.","new": "Nueva clave","create": "Crear clave","createTitle": "Crear clave API",@@ -2815,7 +2819,7 @@"resendSent": "Invitación enviada","resendThrottled": "Invitación enviada hace poco. Inténtalo de nuevo en un minuto.","syncPrompt": "Al compartir se guarda una copia de esta nota en tu nube de OpenWhispr.",- "syncAndShare": "Sincronizar y compartir",+ "syncAndShare": "Sincronizar nota","visibility": {"label": "Visibilidad","private": "Privada",@@ -2833,7 +2837,8 @@"revokeFailed": "No se pudo quitar la invitación. Inténtalo de nuevo.","resendFailed": "No se pudo reenviar la invitación. Inténtalo de nuevo.","syncFailed": "No se pudo sincronizar esta nota. Inténtalo de nuevo.",- "loadFailed": "No se pudo cargar la configuración de uso compartido"+ "loadFailed": "No se pudo cargar la configuración de uso compartido",+ "retry": "Reintentar"}}}@@ -2917,6 +2922,7 @@"roleLabel": "Rol","seatUsage": "Usando {{used}} de {{seats}} asientos","seatLimit": "Todos los {{seats}} asientos están en uso.",+ "askOwner": "Todos los {{seats}} asientos están en uso. Pide al propietario del espacio de trabajo que añada asientos.","manageSeats": "Administrar asientos","submit": "Enviar invitación","submitting": "Enviando…",@@ -2939,6 +2945,7 @@"accept": "Aceptar invitación","accepting": "Aceptando…","signInToAccept": "Inicia sesión para aceptar",+ "switchAccount": "Cambiar de cuenta","successTitle": "Te uniste","successDescription": "Eres miembro de {{name}}. Adminístralo en Configuración → Espacio de trabajo.","errorTitle": "No se pudo aceptar la invitación",diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.jsonindex 792e03dc3..df351091b 100644--- a/src/locales/fr/translation.json+++ b/src/locales/fr/translation.json@@ -1174,7 +1174,7 @@},"general": {"nameLabel": "Nom",- "slugLabel": "Slug",+ "slugLabel": "Nom court","slugHint": "Utilisé dans les URL. Minuscules, chiffres et tirets uniquement.","slugInvalid": "Minuscules, chiffres et tirets uniquement.","saved": "Espace mis à jour",@@ -1200,6 +1200,7 @@"description": "{{count}} sur {{seats}} sièges utilisés.","invite": "Inviter","empty": "Aucun membre pour l'instant.",+ "loadError": "Impossible de charger les membres.","roleUpdated": "Rôle mis à jour","promote": "Promouvoir administrateur","demote": "Rétrograder membre",@@ -1219,6 +1220,7 @@"expiresIn_one": "Expire dans {{count}} jour","expiresIn_other": "Expire dans {{count}} jours","expired": "Expirée",+ "loadError": "Impossible de charger les invitations.","resend": "Renvoyer","resending": "Renvoi…","revoke": "Révoquer",@@ -1234,6 +1236,7 @@"description": "Plan, sièges et paiement.","plan": "Plan","seats": "Sièges",+ "ownerOnly": "Seul le propriétaire de l'espace de travail peut gérer l'abonnement.","nextInvoice": "Prochaine facture","manageStripe": "Gérer dans Stripe","opening": "Ouverture…",@@ -1256,6 +1259,7 @@"title": "Clés API","description": "Accès programmatique limité à cet espace.","empty": "Aucune clé API. Créez-en une pour vous intégrer.",+ "loadError": "Impossible de charger les clés API.","new": "Nouvelle clé","create": "Créer la clé","createTitle": "Créer une clé API",@@ -2146,6 +2150,7 @@"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…",@@ -2168,6 +2173,7 @@"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",@@ -2870,7 +2876,7 @@"resendSent": "Invitation envoyée","resendThrottled": "Invitation envoyée récemment. Réessayez dans une minute.","syncPrompt": "Le partage conserve une copie de cette note dans votre cloud OpenWhispr.",- "syncAndShare": "Synchroniser et partager",+ "syncAndShare": "Synchroniser la note","visibility": {"label": "Visibilité","private": "Privée",@@ -2888,7 +2894,8 @@"revokeFailed": "Impossible de retirer l'invitation. Réessayez.","resendFailed": "Impossible de renvoyer l'invitation. Réessayez.","syncFailed": "Impossible de synchroniser cette note. Réessayez.",- "loadFailed": "Impossible de charger les paramètres de partage"+ "loadFailed": "Impossible de charger les paramètres de partage",+ "retry": "Réessayer"}}}diff --git a/src/locales/it/translation.json b/src/locales/it/translation.jsonindex 8a5d9864f..08468eff9 100644--- a/src/locales/it/translation.json+++ b/src/locales/it/translation.json@@ -1779,7 +1779,7 @@},"general": {"nameLabel": "Nome dell'area di lavoro",- "slugLabel": "Slug",+ "slugLabel": "Nome breve","slugHint": "Usato negli URL e nei link di invito. Solo lettere minuscole, cifre e trattini.","slugInvalid": "Solo lettere minuscole, cifre e trattini.","saved": "Area di lavoro aggiornata",@@ -1805,6 +1805,7 @@"description": "{{count}} di {{seats}} posti utilizzati.","invite": "Invita","empty": "Nessun membro per ora.",+ "loadError": "Impossibile caricare i membri.","roleUpdated": "Ruolo aggiornato","promote": "Rendi amministratore","demote": "Rendi membro",@@ -1824,6 +1825,7 @@"expiresIn_one": "Scade tra {{count}} giorno","expiresIn_other": "Scade tra {{count}} giorni","expired": "Scaduto",+ "loadError": "Impossibile caricare gli inviti.","resend": "Reinvia","resending": "Reinvio…","revoke": "Revoca",@@ -1839,6 +1841,7 @@"description": "Piano, posti e pagamento.","plan": "Piano","seats": "Posti",+ "ownerOnly": "Solo il proprietario dell'area di lavoro può gestire l'abbonamento.","nextInvoice": "Prossima fattura","manageStripe": "Gestisci in Stripe","opening": "Apertura…",@@ -1861,6 +1864,7 @@"title": "Chiavi API","description": "Accesso programmatico limitato a questa area di lavoro.","empty": "Nessuna chiave API. Creane una per integrarti con questa area di lavoro.",+ "loadError": "Impossibile caricare le chiavi API.","new": "Nuova chiave","create": "Crea chiave","createTitle": "Crea chiave API",@@ -2767,7 +2771,7 @@"resendSent": "Invito inviato","resendThrottled": "Invito inviato di recente. Riprova tra un minuto.","syncPrompt": "La condivisione mantiene una copia di questa nota nel tuo cloud OpenWhispr.",- "syncAndShare": "Sincronizza e condividi",+ "syncAndShare": "Sincronizza nota","visibility": {"label": "Visibilità","private": "Privata",@@ -2785,7 +2789,8 @@"revokeFailed": "Impossibile rimuovere l'invito. Riprova.","resendFailed": "Impossibile reinviare l'invito. Riprova.","syncFailed": "Impossibile sincronizzare questa nota. Riprova.",- "loadFailed": "Impossibile caricare le impostazioni di condivisione"+ "loadFailed": "Impossibile caricare le impostazioni di condivisione",+ "retry": "Riprova"}}}@@ -2917,6 +2922,7 @@"roleLabel": "Ruolo","seatUsage": "{{used}} di {{seats}} posti in uso","seatLimit": "Tutti i {{seats}} posti sono in uso.",+ "askOwner": "Tutti i {{seats}} posti sono in uso. Chiedi al proprietario dell'area di lavoro di aggiungere posti.","manageSeats": "Gestisci posti","submit": "Invia invito","submitting": "Invio…",@@ -2939,6 +2945,7 @@"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",diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.jsonindex 930a7696d..f721abeb7 100644--- a/src/locales/ja/translation.json+++ b/src/locales/ja/translation.json@@ -1779,7 +1779,7 @@},"general": {"nameLabel": "ワークスペース名",- "slugLabel": "スラッグ",+ "slugLabel": "短縮名","slugHint": "URL や招待リンクに使用されます。小文字の英字、数字、ハイフンのみ使用できます。","slugInvalid": "小文字の英字、数字、ハイフンのみ使用できます。","saved": "ワークスペースを更新しました",@@ -1805,6 +1805,7 @@"description": "{{seats}} シート中 {{count}} シートを使用中。","invite": "招待","empty": "まだメンバーがいません。",+ "loadError": "メンバーを読み込めませんでした。","roleUpdated": "役割を更新しました","promote": "管理者にする","demote": "メンバーにする",@@ -1824,6 +1825,7 @@"expiresIn_one": "有効期限まであと{{count}}日","expiresIn_other": "有効期限まであと{{count}}日","expired": "期限切れ",+ "loadError": "招待を読み込めませんでした。","resend": "再送信","resending": "再送信中…","revoke": "取り消す",@@ -1839,6 +1841,7 @@"description": "プラン、シート、支払い。","plan": "プラン","seats": "シート",+ "ownerOnly": "サブスクリプションを管理できるのはワークスペースのオーナーのみです。","nextInvoice": "次回の請求","manageStripe": "Stripe で管理","opening": "開いています…",@@ -1861,6 +1864,7 @@"title": "API キー","description": "このワークスペースに限定されたプログラムからのアクセス。","empty": "まだ API キーがありません。このワークスペースと連携するには作成してください。",+ "loadError": "APIキーを読み込めませんでした。","new": "新規キー","create": "キーを作成","createTitle": "API キーを作成",@@ -2767,7 +2771,7 @@"resendSent": "招待を送信しました","resendThrottled": "招待を送信したばかりです。1分ほど待ってからお試しください。","syncPrompt": "共有すると、このノートのコピーが OpenWhispr クラウドに保存されます。",- "syncAndShare": "同期して共有",+ "syncAndShare": "ノートを同期","visibility": {"label": "公開範囲","private": "非公開",@@ -2785,7 +2789,8 @@"revokeFailed": "招待を削除できませんでした。もう一度お試しください。","resendFailed": "招待を再送信できませんでした。もう一度お試しください。","syncFailed": "このノートを同期できませんでした。もう一度お試しください。",- "loadFailed": "共有設定を読み込めませんでした"+ "loadFailed": "共有設定を読み込めませんでした",+ "retry": "再試行"}}}@@ -2917,6 +2922,7 @@"roleLabel": "役割","seatUsage": "{{seats}} シート中 {{used}} シートを使用中","seatLimit": "{{seats}} シートすべてが使用中です。",+ "askOwner": "{{seats}} シートすべてが使用中です。シートの追加はワークスペースのオーナーにご依頼ください。","manageSeats": "シートを管理","submit": "招待を送信","submitting": "送信中…",@@ -2939,6 +2945,7 @@"accept": "招待を承諾","accepting": "承諾中…","signInToAccept": "サインインして承諾",+ "switchAccount": "アカウントを切り替える","successTitle": "参加しました","successDescription": "{{name}} のメンバーになりました。設定 → ワークスペースで管理できます。","errorTitle": "招待を承諾できませんでした",diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.jsonindex 861867a08..46a722913 100644--- a/src/locales/pt/translation.json+++ b/src/locales/pt/translation.json@@ -1758,7 +1758,7 @@},"general": {"nameLabel": "Nome do espaço de trabalho",- "slugLabel": "Slug",+ "slugLabel": "Nome curto","slugHint": "Usado em URLs e links de convite. Apenas letras minúsculas, dígitos e hifens.","slugInvalid": "Apenas letras minúsculas, dígitos e hifens.","saved": "Espaço de trabalho atualizado",@@ -1784,6 +1784,7 @@"description": "{{count}} de {{seats}} assentos usados.","invite": "Convidar","empty": "Ainda não há membros.",+ "loadError": "Não foi possível carregar os membros.","roleUpdated": "Função atualizada","promote": "Tornar administrador","demote": "Tornar membro",@@ -1803,6 +1804,7 @@"expiresIn_one": "Expira em {{count}} dia","expiresIn_other": "Expira em {{count}} dias","expired": "Expirado",+ "loadError": "Não foi possível carregar os convites.","resend": "Reenviar","resending": "Reenviando…","revoke": "Revogar",@@ -1818,6 +1820,7 @@"description": "Plano, assentos e pagamento.","plan": "Plano","seats": "Assentos",+ "ownerOnly": "Apenas o proprietário do espaço de trabalho pode gerenciar a assinatura.","nextInvoice": "Próxima fatura","manageStripe": "Gerenciar no Stripe","opening": "Abrindo…",@@ -1840,6 +1843,7 @@"title": "Chaves de API","description": "Acesso programático limitado a este espaço de trabalho.","empty": "Ainda não há chaves de API. Crie uma para integrar com este espaço de trabalho.",+ "loadError": "Não foi possível carregar as chaves de API.","new": "Nova chave","create": "Criar chave","createTitle": "Criar chave de API",@@ -2767,7 +2771,7 @@"resendSent": "Convite enviado","resendThrottled": "Convite enviado há pouco. Tente novamente em um minuto.","syncPrompt": "O compartilhamento mantém uma cópia desta nota na sua nuvem OpenWhispr.",- "syncAndShare": "Sincronizar e compartilhar",+ "syncAndShare": "Sincronizar nota","visibility": {"label": "Visibilidade","private": "Privada",@@ -2785,7 +2789,8 @@"revokeFailed": "Não foi possível remover o convite. Tente novamente.","resendFailed": "Não foi possível reenviar o convite. Tente novamente.","syncFailed": "Não foi possível sincronizar esta nota. Tente novamente.",- "loadFailed": "Não foi possível carregar as configurações de compartilhamento"+ "loadFailed": "Não foi possível carregar as configurações de compartilhamento",+ "retry": "Tentar novamente"}}}@@ -2917,6 +2922,7 @@"roleLabel": "Função","seatUsage": "Usando {{used}} de {{seats}} assentos","seatLimit": "Todos os {{seats}} assentos estão em uso.",+ "askOwner": "Todos os {{seats}} assentos estão em uso. Peça ao proprietário do espaço de trabalho para adicionar assentos.","manageSeats": "Gerenciar assentos","submit": "Enviar convite","submitting": "Enviando…",@@ -2939,6 +2945,7 @@"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",diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.jsonindex 264ddccf3..a4465d1e5 100644--- a/src/locales/ru/translation.json+++ b/src/locales/ru/translation.json@@ -1779,7 +1779,7 @@},"general": {"nameLabel": "Название рабочего пространства",- "slugLabel": "Slug",+ "slugLabel": "Короткое имя","slugHint": "Используется в URL и ссылках-приглашениях. Только строчные буквы, цифры и дефисы.","slugInvalid": "Только строчные буквы, цифры и дефисы.","saved": "Рабочее пространство обновлено",@@ -1805,6 +1805,7 @@"description": "Занято {{count}} из {{seats}} мест.","invite": "Пригласить","empty": "Пока нет участников.",+ "loadError": "Не удалось загрузить участников.","roleUpdated": "Роль обновлена","promote": "Сделать администратором","demote": "Сделать участником",@@ -1826,6 +1827,7 @@"expiresIn_many": "Истекает через {{count}} дней","expiresIn_other": "Истекает через {{count}} дня","expired": "Истекло",+ "loadError": "Не удалось загрузить приглашения.","resend": "Отправить снова","resending": "Отправка…","revoke": "Отозвать",@@ -1841,6 +1843,7 @@"description": "Тариф, места и оплата.","plan": "Тариф","seats": "Места",+ "ownerOnly": "Управлять подпиской может только владелец рабочего пространства.","nextInvoice": "Следующий счёт","manageStripe": "Управлять в Stripe","opening": "Открытие…",@@ -1863,6 +1866,7 @@"title": "API-ключи","description": "Программный доступ в рамках этого рабочего пространства.","empty": "Пока нет API-ключей. Создайте ключ для интеграции с этим рабочим пространством.",+ "loadError": "Не удалось загрузить API-ключи.","new": "Новый ключ","create": "Создать ключ","createTitle": "Создать API-ключ",@@ -2773,7 +2777,7 @@"resendSent": "Приглашение отправлено","resendThrottled": "Приглашение недавно отправлено. Попробуйте через минуту.","syncPrompt": "При публикации копия этой заметки сохраняется в вашем облаке OpenWhispr.",- "syncAndShare": "Синхронизировать и поделиться",+ "syncAndShare": "Синхронизировать заметку","visibility": {"label": "Видимость","private": "Приватная",@@ -2791,7 +2795,8 @@"revokeFailed": "Не удалось удалить приглашение. Попробуйте ещё раз.","resendFailed": "Не удалось отправить приглашение повторно. Попробуйте ещё раз.","syncFailed": "Не удалось синхронизировать заметку. Попробуйте ещё раз.",- "loadFailed": "Не удалось загрузить настройки доступа"+ "loadFailed": "Не удалось загрузить настройки доступа",+ "retry": "Повторить"}}}@@ -2923,6 +2928,7 @@"roleLabel": "Роль","seatUsage": "Занято {{used}} из {{seats}} мест","seatLimit": "Все {{seats}} мест заняты.",+ "askOwner": "Все {{seats}} мест заняты. Попросите владельца рабочего пространства добавить места.","manageSeats": "Управлять местами","submit": "Отправить приглашение","submitting": "Отправка…",@@ -2945,6 +2951,7 @@"accept": "Принять приглашение","accepting": "Принятие…","signInToAccept": "Войдите, чтобы принять",+ "switchAccount": "Сменить аккаунт","successTitle": "Вы в команде","successDescription": "Вы участник {{name}}. Управляйте им в разделе Настройки → Рабочее пространство.","errorTitle": "Не удалось принять приглашение",diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.jsonindex 1cd7115f3..e4d86c0af 100644--- a/src/locales/zh-CN/translation.json+++ b/src/locales/zh-CN/translation.json@@ -1774,7 +1774,7 @@},"general": {"nameLabel": "工作区名称",- "slugLabel": "Slug",+ "slugLabel": "简短名称","slugHint": "用于 URL 和邀请链接。仅限小写字母、数字和连字符。","slugInvalid": "仅限小写字母、数字和连字符。","saved": "工作区已更新",@@ -1800,6 +1800,7 @@"description": "已使用 {{count}}/{{seats}} 个席位。","invite": "邀请","empty": "暂无成员。",+ "loadError": "无法加载成员。","roleUpdated": "角色已更新","promote": "设为管理员","demote": "设为成员",@@ -1819,6 +1820,7 @@"expiresIn_one": "{{count}} 天后过期","expiresIn_other": "{{count}} 天后过期","expired": "已过期",+ "loadError": "无法加载邀请。","resend": "重新发送","resending": "重新发送中…","revoke": "撤销",@@ -1834,6 +1836,7 @@"description": "套餐、席位和付款。","plan": "套餐","seats": "席位",+ "ownerOnly": "只有工作区所有者可以管理订阅。","nextInvoice": "下一张账单","manageStripe": "在 Stripe 中管理","opening": "正在打开...",@@ -1856,6 +1859,7 @@"title": "API 密钥","description": "仅限此工作区的编程访问。","empty": "暂无 API 密钥。创建一个即可与此工作区集成。",+ "loadError": "无法加载 API 密钥。","new": "新建密钥","create": "创建密钥","createTitle": "创建 API 密钥",@@ -2762,7 +2766,7 @@"resendSent": "邀请已发送","resendThrottled": "邀请刚刚发送过,请一分钟后再试。","syncPrompt": "分享会在你的 OpenWhispr 云端保留此笔记的副本。",- "syncAndShare": "同步并分享",+ "syncAndShare": "同步笔记","visibility": {"label": "可见性","private": "私密",@@ -2780,7 +2784,8 @@"revokeFailed": "无法移除邀请。请重试。","resendFailed": "无法重新发送邀请。请重试。","syncFailed": "无法同步此笔记。请重试。",- "loadFailed": "无法加载分享设置"+ "loadFailed": "无法加载分享设置",+ "retry": "重试"}}}@@ -2912,6 +2917,7 @@"roleLabel": "角色","seatUsage": "已使用 {{used}}/{{seats}} 个席位","seatLimit": "全部 {{seats}} 个席位均已使用。",+ "askOwner": "全部 {{seats}} 个席位均已使用。请联系工作区所有者添加席位。","manageSeats": "管理席位","submit": "发送邀请","submitting": "发送中…",@@ -2934,6 +2940,7 @@"accept": "接受邀请","accepting": "接受中…","signInToAccept": "登录以接受",+ "switchAccount": "切换账号","successTitle": "你已加入","successDescription": "你已成为 {{name}} 的成员。可在设置 → 工作区中管理。","errorTitle": "无法接受邀请",diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.jsonindex d4a01205b..03daa65a1 100644--- a/src/locales/zh-TW/translation.json+++ b/src/locales/zh-TW/translation.json@@ -1774,7 +1774,7 @@},"general": {"nameLabel": "工作區名稱",- "slugLabel": "Slug",+ "slugLabel": "簡短名稱","slugHint": "用於網址與邀請連結。僅限小寫字母、數字與連字號。","slugInvalid": "僅限小寫字母、數字與連字號。","saved": "工作區已更新",@@ -1800,6 +1800,7 @@"description": "已使用 {{count}} / {{seats}} 個席次。","invite": "邀請","empty": "尚無成員。",+ "loadError": "無法載入成員。","roleUpdated": "角色已更新","promote": "設為管理員","demote": "設為成員",@@ -1819,6 +1820,7 @@"expiresIn_one": "{{count}} 天後到期","expiresIn_other": "{{count}} 天後到期","expired": "已到期",+ "loadError": "無法載入邀請。","resend": "重新傳送","resending": "重新傳送中…","revoke": "撤銷",@@ -1834,6 +1836,7 @@"description": "方案、席次與付款。","plan": "方案","seats": "席次",+ "ownerOnly": "只有工作區擁有者可以管理訂閱。","nextInvoice": "下期帳單","manageStripe": "在 Stripe 中管理","opening": "開啟中…",@@ -1856,6 +1859,7 @@"title": "API 金鑰","description": "範圍限於此工作區的程式化存取。","empty": "尚無 API 金鑰。建立一個以整合此工作區。",+ "loadError": "無法載入 API 金鑰。","new": "新增金鑰","create": "建立金鑰","createTitle": "建立 API 金鑰",@@ -2762,7 +2766,7 @@"resendSent": "邀請已傳送","resendThrottled": "邀請剛剛已傳送,請一分鐘後再試。","syncPrompt": "分享後,這則筆記會在你的 OpenWhispr 雲端保留一份副本。",- "syncAndShare": "同步並分享",+ "syncAndShare": "同步筆記","visibility": {"label": "可見性","private": "私人",@@ -2780,7 +2784,8 @@"revokeFailed": "無法移除邀請。請再試一次。","resendFailed": "無法重新傳送邀請。請再試一次。","syncFailed": "無法同步此筆記。請再試一次。",- "loadFailed": "無法載入分享設定"+ "loadFailed": "無法載入分享設定",+ "retry": "重試"}}}@@ -2912,6 +2917,7 @@"roleLabel": "角色","seatUsage": "已使用 {{used}} / {{seats}} 個席次","seatLimit": "{{seats}} 個席次已全數使用。",+ "askOwner": "{{seats}} 個席次已全數使用。請聯絡工作區擁有者新增席次。","manageSeats": "管理席次","submit": "傳送邀請","submitting": "傳送中…",@@ -2934,6 +2940,7 @@"accept": "接受邀請","accepting": "接受中…","signInToAccept": "登入以接受",+ "switchAccount": "切換帳號","successTitle": "你已加入","successDescription": "你已成為 {{name}} 的成員。可前往「設定 → 工作區」進行管理。","errorTitle": "無法接受邀請",diff --git a/src/services/SyncService.ts b/src/services/SyncService.tsindex 3f0fa7d3e..318db1292 100644--- a/src/services/SyncService.ts+++ b/src/services/SyncService.ts@@ -102,12 +102,12 @@ class SyncService {async syncAll(waitForLock = false): Promise<void> {if (!this.canSync()) {- // Backup is off, but shared-note deletes must still reach the cloud so- // revoked notes stop being served (edits flow through debouncedPush).+ // Backup is off, but deletes of cloud copies must still propagate so+ // revoked/deleted notes stop being served (edits flow via debouncedPush).if (this.canSyncSharedNotes() && !this.syncing) {this.syncing = true;try {- await this.pushNoteDeletes(true);+ await this.pushNoteDeletes();} catch (err) {console.error("Shared note sync failed:", err);} finally {@@ -579,10 +579,12 @@ class SyncService {}}- private async pushNoteDeletes(sharedOnly = false): Promise<void> {+ // A cloud copy only exists through prior consent (backup or sync-and-share),+ // so deletes always propagate — even for notes never shared and with the+ // backup toggle off.+ private async pushNoteDeletes(): Promise<void> {const deletes = (await window.electronAPI.getPendingNoteDeletes?.()) ?? [];for (const note of deletes) {- if (sharedOnly && !note.is_shared) continue;try {await NotesService.delete(note.cloud_id!);await window.electronAPI.hardDeleteNote?.(note.id);diff --git a/src/stores/noteStore.ts b/src/stores/noteStore.tsindex da2910380..fedb1e9ce 100644--- a/src/stores/noteStore.ts+++ b/src/stores/noteStore.ts@@ -68,6 +68,9 @@ function ensureIpcListeners() {if (window.electronAPI?.onNoteDeleted) {const dispose = window.electronAPI.onNoteDeleted(({ id }) => {removeNote(id);+ // Push the tombstone right away so a shared link stops serving now,+ // not at the next ambient pass ("manual" bypasses the throttle).+ syncService.requestSyncAll("manual");});if (typeof dispose === "function") {disposers.push(dispose);diff --git a/src/stores/workspaceStore.ts b/src/stores/workspaceStore.tsindex 2b3e15335..f3390a25b 100644--- a/src/stores/workspaceStore.ts+++ b/src/stores/workspaceStore.ts@@ -43,6 +43,9 @@ export const useWorkspaceStore = create<WorkspaceState>((set, get) => ({setActiveWorkspaceId: (id) => {writeActiveWorkspaceId(id);+ // Invalidate in-flight member fetches so the old workspace's roster can't+ // land under the new one.+ membersRequestSeq++;set({ activeWorkspaceId: id, members: [] });},@@ -95,6 +98,7 @@ export const useWorkspaceStore = create<WorkspaceState>((set, get) => ({{ error: (error as Error).message },"workspaces");+ throw error;}},}));