🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
🐛 fix(page): show no-access state for another member's private page (#21184)
Rdmclin229bbca006119
diff --git a/apps/server/src/routers/lambda/document.ts b/apps/server/src/routers/lambda/document.tsindex b18c42f0a8c..59dee1a3cdf 100644--- a/apps/server/src/routers/lambda/document.ts+++ b/apps/server/src/routers/lambda/document.ts@@ -19,7 +19,7 @@ import { router } from '@/libs/trpc/lambda';import { serverDatabase } from '@/libs/trpc/lambda/middleware';import { DocumentService } from '@/server/services/document';import { resolveDocumentEditorData } from '@/server/services/document/editorData';-import { canViewDocumentContent } from '@/server/services/documentAccess';+import { canViewDocumentContent, getDocumentForViewer } from '@/server/services/documentAccess';import { FileService } from '@/server/services/file';import {assertCanPerformResourceAction,@@ -373,7 +373,7 @@ export const documentRouter = router({// KB-scoped documents inherit the KB's public visibility, so direct// reads must honor the restricted-KB (member No-access) policy too.await assertContentsNotInRestrictedKnowledgeBase(ctx, [input.id]);- const doc = await ctx.documentService.getDocumentById(input.id);+ const doc = await getDocumentForViewer(ctx, input.id);// `source` is a storage key for file-backed documents; sign it so PDF viewers// and downloads receive a usable URL. Absolute URLs (web sources) pass through.if (diff --git a/apps/server/src/services/documentAccess/index.test.ts b/apps/server/src/services/documentAccess/index.test.tsnew file mode 100644index 00000000000..2c179bac4cc--- /dev/null+++ b/apps/server/src/services/documentAccess/index.test.ts@@ -0,0 +1,98 @@+// @vitest-environment node+import { TRPCError } from '@trpc/server';+import { beforeEach, describe, expect, it, vi } from 'vitest';++import type { LobeChatDatabase } from '@/database/type';+import { canPerformResourceAction, getResourceMeta } from '@/server/services/resourcePermission';++import { getDocumentForViewer } from './index';++vi.mock('@/server/services/resourcePermission', () => ({+ canPerformResourceAction: vi.fn(),+ getResourceMeta: vi.fn(),+}));++vi.mock('@/server/services/knowledgeBaseAccess', () => ({+ assertContentsNotInRestrictedKnowledgeBase: vi.fn(),+}));++const getDocumentById = vi.fn();+const createContext = (workspaceId: string | null = 'ws-1') => ({+ documentService: { getDocumentById },+ serverDB: {} as LobeChatDatabase,+ userId: 'viewer',+ workspaceId,+ workspacePermissionCodes: ['document:read:all'],+});++describe('getDocumentForViewer', () => {+ beforeEach(() => {+ vi.clearAllMocks();+ getDocumentById.mockResolvedValue(undefined);+ });++ it('returns a readable document without checking access again', async () => {+ const doc = { id: 'doc-1' };+ getDocumentById.mockResolvedValue(doc);++ await expect(getDocumentForViewer(createContext(), 'doc-1')).resolves.toBe(doc);+ expect(getResourceMeta).not.toHaveBeenCalled();+ });++ it('rejects with FORBIDDEN when the page is another member’s private page', async () => {+ vi.mocked(getResourceMeta).mockResolvedValue({+ userId: 'creator',+ visibility: 'private',+ workspaceId: 'ws-1',+ });+ vi.mocked(canPerformResourceAction).mockResolvedValue(false);++ const error = await getDocumentForViewer(createContext(), 'doc-1').catch((e) => e);++ expect(error).toBeInstanceOf(TRPCError);+ expect(error.code).toBe('FORBIDDEN');+ expect(canPerformResourceAction).toHaveBeenCalledWith(+ expect.objectContaining({+ action: 'view',+ grantedPermissions: ['document:read:all'],+ resourceId: 'doc-1',+ userId: 'viewer',+ workspaceId: 'ws-1',+ }),+ );+ });++ it('stays not found when the document does not exist', async () => {+ vi.mocked(getResourceMeta).mockResolvedValue(undefined);++ await expect(getDocumentForViewer(createContext(), 'doc-1')).resolves.toBeUndefined();+ expect(canPerformResourceAction).not.toHaveBeenCalled();+ });++ it('stays not found for a document in another workspace', async () => {+ vi.mocked(getResourceMeta).mockResolvedValue({+ userId: 'creator',+ visibility: 'public',+ workspaceId: 'ws-2',+ });++ await expect(getDocumentForViewer(createContext(), 'doc-1')).resolves.toBeUndefined();+ expect(canPerformResourceAction).not.toHaveBeenCalled();+ });++ it('stays not found when the viewer could see it but the scoped read hid it', async () => {+ vi.mocked(getResourceMeta).mockResolvedValue({+ userId: 'creator',+ visibility: 'public',+ workspaceId: 'ws-1',+ });+ vi.mocked(canPerformResourceAction).mockResolvedValue(true);++ await expect(getDocumentForViewer(createContext(), 'doc-1')).resolves.toBeUndefined();+ });++ it('never probes other rows in personal mode', async () => {+ await expect(getDocumentForViewer(createContext(null), 'doc-1')).resolves.toBeUndefined();+ expect(getResourceMeta).not.toHaveBeenCalled();+ });+});diff --git a/apps/server/src/services/documentAccess/index.ts b/apps/server/src/services/documentAccess/index.tsindex ca65eaf058e..759db66578f 100644--- a/apps/server/src/services/documentAccess/index.ts+++ b/apps/server/src/services/documentAccess/index.ts@@ -1,7 +1,9 @@import { TRPCError } from '@trpc/server';+import type { DocumentItem } from '@/database/schemas';+import type { LobeChatDatabase } from '@/database/type';import { assertContentsNotInRestrictedKnowledgeBase } from '@/server/services/knowledgeBaseAccess';-import { canPerformResourceAction } from '@/server/services/resourcePermission';+import { canPerformResourceAction, getResourceMeta } from '@/server/services/resourcePermission';type DocumentContentAccessParams = Pick<Parameters<typeof canPerformResourceAction>[0],@@ -31,3 +33,45 @@ export const canViewDocumentContent = async (throw error;}};++interface DocumentViewerContext {+ documentService: { getDocumentById: (id: string) => Promise<DocumentItem | undefined> };+ serverDB: LobeChatDatabase;+ userId: string;+ workspaceId?: string | null;+ workspacePermissionCodes?: string[];+}++/**+ * Read a document for a viewer, telling "no access" apart from "not found".+ *+ * The scoped read hides another member's private page exactly like a missing+ * row. Inside the caller's workspace that would render a 404 for a page that+ * exists, so throw FORBIDDEN instead — the same split+ * `assertCanPerformResourceAction` makes. Rows outside the workspace stay hidden.+ */+export const getDocumentForViewer = async (+ ctx: DocumentViewerContext,+ id: string,+): Promise<DocumentItem | undefined> => {+ const doc = await ctx.documentService.getDocumentById(id);+ if (doc || !ctx.workspaceId) return doc;++ const meta = await getResourceMeta(ctx.serverDB, 'document', id);+ if (!meta || meta.workspaceId !== ctx.workspaceId) return doc;++ const canView = await canViewDocumentContent({+ db: ctx.serverDB,+ grantedPermissions: ctx.workspacePermissionCodes,+ meta,+ resourceId: id,+ userId: ctx.userId,+ workspaceId: ctx.workspaceId,+ });+ if (canView) return doc;++ throw new TRPCError({+ code: 'FORBIDDEN',+ message: 'You do not have permission to view this document',+ });+};diff --git a/locales/ar/file.json b/locales/ar/file.jsonindex 9914df580a8..caec20b6a56 100644--- a/locales/ar/file.json+++ b/locales/ar/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "استيراد صفحة","pageEditor.menu.move": "نقل","pageEditor.menu.pin": "تثبيت الصفحة",+ "pageEditor.noAccess.description": "هذه الصفحة خاصة، أو أنها في مكتبة لا يمكنك الوصول إليها. اطلب من منشئها أو مدير المكتبة الوصول.",+ "pageEditor.noAccess.title": "ليس لديك حق الوصول إلى هذه الصفحة","pageEditor.saveFailed": "فشل حفظ الصفحة، يرجى المحاولة مرة أخرى لاحقًا","pageEditor.saving": "جارٍ الحفظ...","pageEditor.titlePlaceholder": "بدون عنوان",diff --git a/locales/ar/setting.json b/locales/ar/setting.jsonindex a5dd773ddc6..aa537c11bdd 100644--- a/locales/ar/setting.json+++ b/locales/ar/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "تعذر التحقق مما إذا كان هذا الرمز متاحًا هنا. حاول إعادة تحميله مرة أخرى.","heterogeneousStatus.cloud.tokenNotShared": "لم تتم مشاركة رمز Claude Code الشخصي الخاص بك مع مساحة العمل هذه، لذلك لا يمكن تشغيل السحابة هنا استخدامه. احفظ رمزًا لمشاركته مع مساحة العمل هذه.","heterogeneousStatus.cloud.tokenPlaceholder": "الصق رمز OAuth الخاص بك هنا",+ "heterogeneousStatus.cloud.tokenRemove": "إزالة",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "سيؤدي هذا إلى حذف رمز OAuth الخاص بـ Claude Code من بيانات الاعتماد. لن تتمكن عمليات التشغيل السحابية لوكلاء Claude Code من استخدامه حتى تحفظ رمزًا جديدًا.",+ "heterogeneousStatus.cloud.tokenRemoveError": "فشل في إزالة رمز Claude Code. يرجى المحاولة مرة أخرى.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "إزالة رمز Claude Code؟","heterogeneousStatus.cloud.tokenRetry": "إعادة المحاولة","heterogeneousStatus.cloud.tokenSave": "حفظ","heterogeneousStatus.cloud.tokenSaveError": "فشل في حفظ رمز Claude Code. يرجى المحاولة مرة أخرى.",diff --git a/locales/bg-BG/file.json b/locales/bg-BG/file.jsonindex a5752626cfc..ff008a5ff76 100644--- a/locales/bg-BG/file.json+++ b/locales/bg-BG/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Импортирай страница","pageEditor.menu.move": "Премести","pageEditor.menu.pin": "Закачи страница",+ "pageEditor.noAccess.description": "Тази страница е частна или е в библиотека, до която нямате достъп. Помолете нейния създател или мениджър на библиотеката за достъп.",+ "pageEditor.noAccess.title": "Нямате достъп до тази страница","pageEditor.saveFailed": "Неуспешно запазване на страницата, моля опитайте отново по-късно","pageEditor.saving": "Запазване...","pageEditor.titlePlaceholder": "Без заглавие",diff --git a/locales/bg-BG/setting.json b/locales/bg-BG/setting.jsonindex bdc6cf24437..bc447812dff 100644--- a/locales/bg-BG/setting.json+++ b/locales/bg-BG/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "Не можа да се провери дали този токен е наличен тук. Опитайте да го заредите отново.","heterogeneousStatus.cloud.tokenNotShared": "Вашият личен Claude Code токен не е споделен с това работно пространство, така че облачните изпълнения тук не могат да го използват. Запазете токен, за да го споделите с това работно пространство.","heterogeneousStatus.cloud.tokenPlaceholder": "Поставете вашия OAuth токен тук",+ "heterogeneousStatus.cloud.tokenRemove": "Премахване",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "Това изтрива вашия OAuth токен за Claude Code от Удостоверения. Облачните изпълнения на агенти Claude Code няма да могат да го използват, докато не запазите нов токен.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Неуспешно премахване на токена за Claude Code. Моля, опитайте отново.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Премахване на токена за Claude Code?","heterogeneousStatus.cloud.tokenRetry": "Опитайте отново","heterogeneousStatus.cloud.tokenSave": "Запазване","heterogeneousStatus.cloud.tokenSaveError": "Неуспешно запазване на Claude Code токена. Моля, опитайте отново.",diff --git a/locales/de-DE/file.json b/locales/de-DE/file.jsonindex 0dedfd3720d..06da5268a8d 100644--- a/locales/de-DE/file.json+++ b/locales/de-DE/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Seite importieren","pageEditor.menu.move": "Verschieben","pageEditor.menu.pin": "Seite anheften",+ "pageEditor.noAccess.description": "Diese Seite ist privat oder befindet sich in einer Bibliothek, auf die Sie keinen Zugriff haben. Bitten Sie den Ersteller oder einen Bibliotheksmanager um Zugriff.",+ "pageEditor.noAccess.title": "Sie haben keinen Zugriff auf diese Seite","pageEditor.saveFailed": "Das Speichern der Seite ist fehlgeschlagen. Bitte versuchen Sie es später erneut.","pageEditor.saving": "Speichern...","pageEditor.titlePlaceholder": "Unbenannt",diff --git a/locales/de-DE/setting.json b/locales/de-DE/setting.jsonindex 125c777fb19..1f9d702d545 100644--- a/locales/de-DE/setting.json+++ b/locales/de-DE/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "Konnte nicht überprüfen, ob dieses Token hier verfügbar ist. Versuchen Sie, es erneut zu laden.","heterogeneousStatus.cloud.tokenNotShared": "Ihr persönliches Claude Code-Token ist nicht mit diesem Arbeitsbereich geteilt, daher können Cloud-Ausführungen hier es nicht verwenden. Speichern Sie ein Token, um es mit diesem Arbeitsbereich zu teilen.","heterogeneousStatus.cloud.tokenPlaceholder": "Fügen Sie hier Ihr OAuth-Token ein",+ "heterogeneousStatus.cloud.tokenRemove": "Entfernen",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "Dadurch wird Ihr Claude Code OAuth-Token aus den Anmeldeinformationen gelöscht. Cloud-Ausführungen von Claude Code-Agenten können es nicht verwenden, bis Sie ein neues Token speichern.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Das Claude Code-Token konnte nicht entfernt werden. Bitte versuchen Sie es erneut.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Claude Code-Token entfernen?","heterogeneousStatus.cloud.tokenRetry": "Erneut versuchen","heterogeneousStatus.cloud.tokenSave": "Speichern","heterogeneousStatus.cloud.tokenSaveError": "Das Claude Code-Token konnte nicht gespeichert werden. Bitte versuchen Sie es erneut.",diff --git a/locales/en-US/file.json b/locales/en-US/file.jsonindex ab1e807d2f3..d4475524609 100644--- a/locales/en-US/file.json+++ b/locales/en-US/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Import Page","pageEditor.menu.move": "Move to…","pageEditor.menu.pin": "Pin Page",+ "pageEditor.noAccess.description": "This page is private, or it’s in a library you can’t access. Ask its creator or a library manager for access.",+ "pageEditor.noAccess.title": "You don’t have access to this page","pageEditor.saveFailed": "Failed to save the page, please try again later","pageEditor.saving": "Saving...","pageEditor.titlePlaceholder": "Untitled",diff --git a/locales/es-ES/file.json b/locales/es-ES/file.jsonindex d44276a62a3..6c728e867d8 100644--- a/locales/es-ES/file.json+++ b/locales/es-ES/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Importar página","pageEditor.menu.move": "Mover","pageEditor.menu.pin": "Fijar página",+ "pageEditor.noAccess.description": "Esta página es privada o está en una biblioteca a la que no puedes acceder. Pide acceso a su creador o a un administrador de la biblioteca.",+ "pageEditor.noAccess.title": "No tienes acceso a esta página","pageEditor.saveFailed": "No se pudo guardar la página, por favor inténtelo de nuevo más tarde","pageEditor.saving": "Guardando...","pageEditor.titlePlaceholder": "Sin título",diff --git a/locales/es-ES/setting.json b/locales/es-ES/setting.jsonindex 72f92917f50..ff0aca1546d 100644--- a/locales/es-ES/setting.json+++ b/locales/es-ES/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "No se pudo verificar si este token está disponible aquí. Intenta cargarlo nuevamente.","heterogeneousStatus.cloud.tokenNotShared": "Tu token personal de Claude Code no está compartido con este espacio de trabajo, por lo que las ejecuciones en la nube aquí no pueden usarlo. Guarda un token para compartirlo con este espacio de trabajo.","heterogeneousStatus.cloud.tokenPlaceholder": "Pega tu token OAuth aquí",+ "heterogeneousStatus.cloud.tokenRemove": "Eliminar",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "Esto elimina tu token OAuth de Claude Code de Credenciales. Las ejecuciones en la nube de los agentes de Claude Code no podrán usarlo hasta que guardes un nuevo token.",+ "heterogeneousStatus.cloud.tokenRemoveError": "No se pudo eliminar el token de Claude Code. Por favor, inténtalo de nuevo.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "¿Eliminar el token de Claude Code?","heterogeneousStatus.cloud.tokenRetry": "Reintentar","heterogeneousStatus.cloud.tokenSave": "Guardar","heterogeneousStatus.cloud.tokenSaveError": "No se pudo guardar el token de Claude Code. Por favor, inténtalo nuevamente.",diff --git a/locales/fa-IR/file.json b/locales/fa-IR/file.jsonindex fc25ba241ca..188b708805a 100644--- a/locales/fa-IR/file.json+++ b/locales/fa-IR/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "وارد کردن صفحه","pageEditor.menu.move": "انتقال","pageEditor.menu.pin": "سنجاق کردن صفحه",+ "pageEditor.noAccess.description": "این صفحه خصوصی است یا در کتابخانهای است که شما به آن دسترسی ندارید. از سازنده آن یا مدیر کتابخانه درخواست دسترسی کنید.",+ "pageEditor.noAccess.title": "شما به این صفحه دسترسی ندارید","pageEditor.saveFailed": "ذخیره صفحه انجام نشد، لطفاً بعداً دوباره تلاش کنید","pageEditor.saving": "در حال ذخیره...","pageEditor.titlePlaceholder": "بدون عنوان",diff --git a/locales/fa-IR/setting.json b/locales/fa-IR/setting.jsonindex d81784faff0..10303505fd1 100644--- a/locales/fa-IR/setting.json+++ b/locales/fa-IR/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "نتوانستیم بررسی کنیم که آیا این توکن در اینجا موجود است یا خیر. دوباره تلاش کنید تا آن را بارگذاری کنید.","heterogeneousStatus.cloud.tokenNotShared": "توکن شخصی Claude Code شما به این فضای کاری به اشتراک گذاشته نشده است، بنابراین اجراهای ابری در اینجا نمیتوانند از آن استفاده کنند. یک توکن ذخیره کنید تا آن را به این فضای کاری به اشتراک بگذارید.","heterogeneousStatus.cloud.tokenPlaceholder": "توکن OAuth خود را اینجا بچسبانید",+ "heterogeneousStatus.cloud.tokenRemove": "حذف",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "این کار توکن OAuth کد Claude شما را از اعتبارنامهها حذف میکند. اجرای ابری عوامل کد Claude تا زمانی که توکن جدیدی ذخیره نکنید، قادر به استفاده از آن نخواهند بود.",+ "heterogeneousStatus.cloud.tokenRemoveError": "حذف توکن کد Claude ناموفق بود. لطفاً دوباره تلاش کنید.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "توکن کد Claude حذف شود؟","heterogeneousStatus.cloud.tokenRetry": "دوباره تلاش کنید","heterogeneousStatus.cloud.tokenSave": "ذخیره","heterogeneousStatus.cloud.tokenSaveError": "ذخیره توکن Claude Code ناموفق بود. لطفاً دوباره تلاش کنید.",diff --git a/locales/fr-FR/file.json b/locales/fr-FR/file.jsonindex 9329afbc469..2c8443f96f0 100644--- a/locales/fr-FR/file.json+++ b/locales/fr-FR/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Importer une page","pageEditor.menu.move": "Déplacer","pageEditor.menu.pin": "Épingler la page",+ "pageEditor.noAccess.description": "Cette page est privée ou se trouve dans une bibliothèque à laquelle vous n'avez pas accès. Demandez à son créateur ou à un gestionnaire de bibliothèque l'accès.",+ "pageEditor.noAccess.title": "Vous n'avez pas accès à cette page","pageEditor.saveFailed": "Échec de l'enregistrement de la page, veuillez réessayer plus tard","pageEditor.saving": "Enregistrement...","pageEditor.titlePlaceholder": "Sans titre",diff --git a/locales/fr-FR/setting.json b/locales/fr-FR/setting.jsonindex ab87a43cb42..caa3a11f340 100644--- a/locales/fr-FR/setting.json+++ b/locales/fr-FR/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "Impossible de vérifier si ce jeton est disponible ici. Réessayez de le charger.","heterogeneousStatus.cloud.tokenNotShared": "Votre jeton personnel Claude Code n'est pas partagé avec cet espace de travail, donc les exécutions cloud ici ne peuvent pas l'utiliser. Enregistrez un jeton pour le partager avec cet espace de travail.","heterogeneousStatus.cloud.tokenPlaceholder": "Collez votre jeton OAuth ici",+ "heterogeneousStatus.cloud.tokenRemove": "Supprimer",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "Cela supprime votre jeton OAuth Claude Code des Identifiants. Les exécutions cloud des agents Claude Code ne pourront pas l'utiliser tant que vous n'aurez pas enregistré un nouveau jeton.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Échec de la suppression du jeton Claude Code. Veuillez réessayer.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Supprimer le jeton Claude Code ?","heterogeneousStatus.cloud.tokenRetry": "Réessayer","heterogeneousStatus.cloud.tokenSave": "Sauvegarder","heterogeneousStatus.cloud.tokenSaveError": "Échec de l'enregistrement du jeton Claude Code. Veuillez réessayer.",diff --git a/locales/it-IT/file.json b/locales/it-IT/file.jsonindex 9a72e4221b9..0afde2a445b 100644--- a/locales/it-IT/file.json+++ b/locales/it-IT/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Importa pagina","pageEditor.menu.move": "Sposta","pageEditor.menu.pin": "Fissa pagina",+ "pageEditor.noAccess.description": "Questa pagina è privata o si trova in una libreria a cui non puoi accedere. Chiedi al suo creatore o a un gestore della libreria l'accesso.",+ "pageEditor.noAccess.title": "Non hai accesso a questa pagina","pageEditor.saveFailed": "Impossibile salvare la pagina, riprova più tardi","pageEditor.saving": "Salvataggio in corso...","pageEditor.titlePlaceholder": "Senza titolo",diff --git a/locales/it-IT/setting.json b/locales/it-IT/setting.jsonindex 082c336c633..76f248afa91 100644--- a/locales/it-IT/setting.json+++ b/locales/it-IT/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "Impossibile verificare se questo token è disponibile qui. Riprova a caricarlo di nuovo.","heterogeneousStatus.cloud.tokenNotShared": "Il tuo token personale di Claude Code non è condiviso con questo spazio di lavoro, quindi le esecuzioni cloud qui non possono utilizzarlo. Salva un token per condividerlo con questo spazio di lavoro.","heterogeneousStatus.cloud.tokenPlaceholder": "Incolla qui il tuo token OAuth",+ "heterogeneousStatus.cloud.tokenRemove": "Rimuovi",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "Questo elimina il tuo token OAuth di Claude Code dalle Credenziali. Le esecuzioni cloud degli agenti Claude Code non potranno utilizzarlo finché non salvi un nuovo token.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Impossibile rimuovere il token di Claude Code. Per favore riprova.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Rimuovere il token di Claude Code?","heterogeneousStatus.cloud.tokenRetry": "Riprova","heterogeneousStatus.cloud.tokenSave": "Salva","heterogeneousStatus.cloud.tokenSaveError": "Impossibile salvare il token di Claude Code. Per favore riprova.",diff --git a/locales/ja-JP/file.json b/locales/ja-JP/file.jsonindex eee00a8fa15..25dbc36863d 100644--- a/locales/ja-JP/file.json+++ b/locales/ja-JP/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "ドキュメントをインポート","pageEditor.menu.move": "移動","pageEditor.menu.pin": "ドキュメントをピン留め",+ "pageEditor.noAccess.description": "このページは非公開であるか、アクセスできないライブラリにあります。作成者またはライブラリ管理者にアクセスを依頼してください。",+ "pageEditor.noAccess.title": "このページへのアクセス権がありません","pageEditor.saveFailed": "ページの保存に失敗しました。後でもう一度お試しください。","pageEditor.saving": "保存中...","pageEditor.titlePlaceholder": "無題",diff --git a/locales/ja-JP/setting.json b/locales/ja-JP/setting.jsonindex ba58e47407a..1adc9524473 100644--- a/locales/ja-JP/setting.json+++ b/locales/ja-JP/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "このトークンがここで利用可能かどうかを確認できませんでした。再読み込みを試してください。","heterogeneousStatus.cloud.tokenNotShared": "個人用Claude Codeトークンはこのワークスペースに共有されていないため、ここでのクラウド実行では使用できません。トークンを保存してこのワークスペースに共有してください。","heterogeneousStatus.cloud.tokenPlaceholder": "ここにOAuthトークンを貼り付けてください",+ "heterogeneousStatus.cloud.tokenRemove": "削除",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "これにより、Claude Code OAuth トークンが資格情報から削除されます。Claude Code エージェントのクラウド実行は、新しいトークンを保存するまで使用できません。",+ "heterogeneousStatus.cloud.tokenRemoveError": "Claude Code トークンの削除に失敗しました。もう一度お試しください。",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Claude Code トークンを削除しますか?","heterogeneousStatus.cloud.tokenRetry": "再試行","heterogeneousStatus.cloud.tokenSave": "保存","heterogeneousStatus.cloud.tokenSaveError": "Claude Codeトークンの保存に失敗しました。もう一度お試しください。",diff --git a/locales/ko-KR/file.json b/locales/ko-KR/file.jsonindex 0d1fa6689bb..3c3931ab756 100644--- a/locales/ko-KR/file.json+++ b/locales/ko-KR/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "문서 가져오기","pageEditor.menu.move": "이동","pageEditor.menu.pin": "문서 상단 고정",+ "pageEditor.noAccess.description": "이 페이지는 비공개이거나 접근할 수 없는 라이브러리에 있습니다. 접근 권한을 얻으려면 생성자나 라이브러리 관리자에게 요청하세요.",+ "pageEditor.noAccess.title": "이 페이지에 접근할 수 없습니다","pageEditor.saveFailed": "페이지를 저장하지 못했습니다. 나중에 다시 시도해 주세요.","pageEditor.saving": "저장 중...","pageEditor.titlePlaceholder": "제목 없음",diff --git a/locales/ko-KR/setting.json b/locales/ko-KR/setting.jsonindex 660771ec974..5ac59479158 100644--- a/locales/ko-KR/setting.json+++ b/locales/ko-KR/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "이 토큰이 여기에서 사용 가능한지 확인할 수 없습니다. 다시 로드해 보세요.","heterogeneousStatus.cloud.tokenNotShared": "개인 Claude Code 토큰이 이 작업 공간에 공유되지 않았으므로 여기에서 클라우드 실행을 사용할 수 없습니다. 토큰을 저장하여 이 작업 공간에 공유하세요.","heterogeneousStatus.cloud.tokenPlaceholder": "여기에 OAuth 토큰을 붙여넣으세요",+ "heterogeneousStatus.cloud.tokenRemove": "제거",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "이 작업은 Claude Code OAuth 토큰을 자격 증명에서 삭제합니다. Claude Code 에이전트의 클라우드 실행은 새 토큰을 저장할 때까지 이를 사용할 수 없습니다.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Claude Code 토큰을 제거하지 못했습니다. 다시 시도해 주세요.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Claude Code 토큰을 제거하시겠습니까?","heterogeneousStatus.cloud.tokenRetry": "다시 시도","heterogeneousStatus.cloud.tokenSave": "저장","heterogeneousStatus.cloud.tokenSaveError": "Claude Code 토큰을 저장하지 못했습니다. 다시 시도해 주세요.",diff --git a/locales/nl-NL/file.json b/locales/nl-NL/file.jsonindex a134d6c327c..030c8964b18 100644--- a/locales/nl-NL/file.json+++ b/locales/nl-NL/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Pagina importeren","pageEditor.menu.move": "Verplaatsen","pageEditor.menu.pin": "Pagina vastzetten",+ "pageEditor.noAccess.description": "Deze pagina is privé, of bevindt zich in een bibliotheek waar je geen toegang toe hebt. Vraag de maker of een bibliotheekbeheerder om toegang.",+ "pageEditor.noAccess.title": "Je hebt geen toegang tot deze pagina","pageEditor.saveFailed": "Het opslaan van de pagina is mislukt, probeer het later opnieuw","pageEditor.saving": "Bezig met opslaan...","pageEditor.titlePlaceholder": "Naamloos",diff --git a/locales/nl-NL/setting.json b/locales/nl-NL/setting.jsonindex 1a35760391e..9cc59c731da 100644--- a/locales/nl-NL/setting.json+++ b/locales/nl-NL/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "Kon niet controleren of deze token hier beschikbaar is. Probeer opnieuw te laden.","heterogeneousStatus.cloud.tokenNotShared": "Je persoonlijke Claude Code-token is niet gedeeld met deze werkruimte, dus cloud-runs hier kunnen het niet gebruiken. Sla een token op om het te delen met deze werkruimte.","heterogeneousStatus.cloud.tokenPlaceholder": "Plak hier je OAuth-token",+ "heterogeneousStatus.cloud.tokenRemove": "Verwijderen",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "Hiermee verwijdert u uw Claude Code OAuth-token uit Referenties. Cloud-uitvoeringen van Claude Code-agents kunnen het niet gebruiken totdat u een nieuw token opslaat.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Het verwijderen van het Claude Code-token is mislukt. Probeer het opnieuw.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Claude Code-token verwijderen?","heterogeneousStatus.cloud.tokenRetry": "Opnieuw proberen","heterogeneousStatus.cloud.tokenSave": "Opslaan","heterogeneousStatus.cloud.tokenSaveError": "Het opslaan van het Claude Code-token is mislukt. Probeer het opnieuw.",diff --git a/locales/pl-PL/file.json b/locales/pl-PL/file.jsonindex d14867cbf81..e4a51c9376b 100644--- a/locales/pl-PL/file.json+++ b/locales/pl-PL/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Importuj stronę","pageEditor.menu.move": "Przenieś","pageEditor.menu.pin": "Przypnij stronę",+ "pageEditor.noAccess.description": "Ta strona jest prywatna lub znajduje się w bibliotece, do której nie masz dostępu. Poproś jej twórcę lub menedżera biblioteki o dostęp.",+ "pageEditor.noAccess.title": "Nie masz dostępu do tej strony","pageEditor.saveFailed": "Nie udało się zapisać strony, spróbuj ponownie później","pageEditor.saving": "Zapisywanie...","pageEditor.titlePlaceholder": "Bez tytułu",diff --git a/locales/pl-PL/setting.json b/locales/pl-PL/setting.jsonindex c424965d3c1..cccf41a5f9a 100644--- a/locales/pl-PL/setting.json+++ b/locales/pl-PL/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "Nie można sprawdzić, czy ten token jest dostępny tutaj. Spróbuj załadować go ponownie.","heterogeneousStatus.cloud.tokenNotShared": "Twój osobisty token Claude Code nie jest udostępniony w tym obszarze roboczym, więc uruchomienia w chmurze tutaj nie mogą go używać. Zapisz token, aby udostępnić go w tym obszarze roboczym.","heterogeneousStatus.cloud.tokenPlaceholder": "Wklej tutaj swój token OAuth",+ "heterogeneousStatus.cloud.tokenRemove": "Usuń",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "To usunie Twój token OAuth Claude Code z poświadczeń. Uruchomienia w chmurze agentów Claude Code nie będą mogły go używać, dopóki nie zapiszesz nowego tokena.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Nie udało się usunąć tokena Claude Code. Spróbuj ponownie.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Usunąć token Claude Code?","heterogeneousStatus.cloud.tokenRetry": "Ponów próbę","heterogeneousStatus.cloud.tokenSave": "Zapisz","heterogeneousStatus.cloud.tokenSaveError": "Nie udało się zapisać tokenu Claude Code. Spróbuj ponownie.",diff --git a/locales/pt-BR/file.json b/locales/pt-BR/file.jsonindex 9a848db73b8..6fba4484665 100644--- a/locales/pt-BR/file.json+++ b/locales/pt-BR/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Importar Página","pageEditor.menu.move": "Mover","pageEditor.menu.pin": "Fixar Página",+ "pageEditor.noAccess.description": "Esta página é privada ou está em uma biblioteca à qual você não tem acesso. Peça ao seu criador ou a um gerente da biblioteca para obter acesso.",+ "pageEditor.noAccess.title": "Você não tem acesso a esta página","pageEditor.saveFailed": "Falha ao salvar a página, tente novamente mais tarde","pageEditor.saving": "Salvando...","pageEditor.titlePlaceholder": "Sem título",diff --git a/locales/pt-BR/setting.json b/locales/pt-BR/setting.jsonindex 043da306dbe..e4106a38e0e 100644--- a/locales/pt-BR/setting.json+++ b/locales/pt-BR/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "Não foi possível verificar se este token está disponível aqui. Tente carregá-lo novamente.","heterogeneousStatus.cloud.tokenNotShared": "Seu token pessoal do Claude Code não está compartilhado com este espaço de trabalho, então execuções na nuvem aqui não podem usá-lo. Salve um token para compartilhá-lo com este espaço de trabalho.","heterogeneousStatus.cloud.tokenPlaceholder": "Cole seu token OAuth aqui",+ "heterogeneousStatus.cloud.tokenRemove": "Remover",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "Isso exclui seu token OAuth do Claude Code das Credenciais. Execuções na nuvem de agentes Claude Code não poderão usá-lo até que você salve um novo token.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Falha ao remover o token do Claude Code. Por favor, tente novamente.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Remover token do Claude Code?","heterogeneousStatus.cloud.tokenRetry": "Tentar novamente","heterogeneousStatus.cloud.tokenSave": "Salvar","heterogeneousStatus.cloud.tokenSaveError": "Falha ao salvar o token do Claude Code. Por favor, tente novamente.",diff --git a/locales/ru-RU/file.json b/locales/ru-RU/file.jsonindex 6032499e563..dbb75260b99 100644--- a/locales/ru-RU/file.json+++ b/locales/ru-RU/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Импорт страницы","pageEditor.menu.move": "Переместить","pageEditor.menu.pin": "Закрепить страницу",+ "pageEditor.noAccess.description": "Эта страница является приватной или находится в библиотеке, к которой у вас нет доступа. Обратитесь к её создателю или менеджеру библиотеки для получения доступа.",+ "pageEditor.noAccess.title": "У вас нет доступа к этой странице","pageEditor.saveFailed": "Не удалось сохранить страницу, попробуйте позже","pageEditor.saving": "Сохранение...","pageEditor.titlePlaceholder": "Без названия",diff --git a/locales/ru-RU/setting.json b/locales/ru-RU/setting.jsonindex 93eea995d97..40ad838695e 100644--- a/locales/ru-RU/setting.json+++ b/locales/ru-RU/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "Не удалось проверить, доступен ли этот токен здесь. Попробуйте загрузить его снова.","heterogeneousStatus.cloud.tokenNotShared": "Ваш личный токен Claude Code не привязан к этому рабочему пространству, поэтому облачные запуски здесь не могут его использовать. Сохраните токен, чтобы привязать его к этому рабочему пространству.","heterogeneousStatus.cloud.tokenPlaceholder": "Вставьте ваш OAuth токен здесь",+ "heterogeneousStatus.cloud.tokenRemove": "Удалить",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "Это удаляет ваш OAuth-токен Claude Code из Учетных данных. Облачные запуски агентов Claude Code не смогут его использовать, пока вы не сохраните новый токен.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Не удалось удалить токен Claude Code. Пожалуйста, попробуйте еще раз.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Удалить токен Claude Code?","heterogeneousStatus.cloud.tokenRetry": "Повторить попытку","heterogeneousStatus.cloud.tokenSave": "Сохранить","heterogeneousStatus.cloud.tokenSaveError": "Не удалось сохранить токен Claude Code. Пожалуйста, попробуйте снова.",diff --git a/locales/tr-TR/file.json b/locales/tr-TR/file.jsonindex 9af3c86f080..8d9742463b0 100644--- a/locales/tr-TR/file.json+++ b/locales/tr-TR/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Sayfa İçe Aktar","pageEditor.menu.move": "Taşı","pageEditor.menu.pin": "Sayfayı Sabitle",+ "pageEditor.noAccess.description": "Bu sayfa özeldir veya erişemediğiniz bir kütüphanede bulunmaktadır. Erişim için sayfanın yaratıcısından veya bir kütüphane yöneticisinden izin isteyin.",+ "pageEditor.noAccess.title": "Bu sayfaya erişiminiz yok","pageEditor.saveFailed": "Sayfa kaydedilemedi, lütfen daha sonra tekrar deneyin","pageEditor.saving": "Kaydediliyor...","pageEditor.titlePlaceholder": "Başlıksız",diff --git a/locales/tr-TR/setting.json b/locales/tr-TR/setting.jsonindex 8bc34d10eb6..241e278fea0 100644--- a/locales/tr-TR/setting.json+++ b/locales/tr-TR/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "Bu tokenin burada mevcut olup olmadığını kontrol edemedik. Yeniden yüklemeyi deneyin.","heterogeneousStatus.cloud.tokenNotShared": "Kişisel Claude Code tokeniniz bu çalışma alanına paylaşılmamış, bu nedenle buradaki bulut çalışmaları bunu kullanamaz. Bir token kaydedip bu çalışma alanına paylaşabilirsiniz.","heterogeneousStatus.cloud.tokenPlaceholder": "OAuth jetonunuzu buraya yapıştırın",+ "heterogeneousStatus.cloud.tokenRemove": "Kaldır",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "Bu işlem, Claude Code OAuth jetonunuzu Kimlik Bilgilerinden siler. Claude Code ajanlarının bulut çalışmaları, yeni bir jeton kaydedene kadar bunu kullanamayacak.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Claude Code jetonunu kaldırma başarısız oldu. Lütfen tekrar deneyin.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Claude Code jetonunu kaldır?","heterogeneousStatus.cloud.tokenRetry": "Tekrar Dene","heterogeneousStatus.cloud.tokenSave": "Kaydet","heterogeneousStatus.cloud.tokenSaveError": "Claude Code tokeni kaydedilemedi. Lütfen tekrar deneyin.",diff --git a/locales/vi-VN/file.json b/locales/vi-VN/file.jsonindex 157d1df1879..c0b32e7d6ce 100644--- a/locales/vi-VN/file.json+++ b/locales/vi-VN/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "Nhập Trang","pageEditor.menu.move": "Di chuyển","pageEditor.menu.pin": "Ghim Trang",+ "pageEditor.noAccess.description": "Trang này là riêng tư hoặc nằm trong một thư viện mà bạn không thể truy cập. Hãy yêu cầu người tạo hoặc quản lý thư viện cấp quyền truy cập.",+ "pageEditor.noAccess.title": "Bạn không có quyền truy cập vào trang này","pageEditor.saveFailed": "Không thể lưu trang, vui lòng thử lại sau","pageEditor.saving": "Đang lưu...","pageEditor.titlePlaceholder": "Chưa có tiêu đề",diff --git a/locales/vi-VN/setting.json b/locales/vi-VN/setting.jsonindex 2428d5233f4..eb0ef9d9d00 100644--- a/locales/vi-VN/setting.json+++ b/locales/vi-VN/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "Không thể kiểm tra xem token này có sẵn ở đây hay không. Thử tải lại nó.","heterogeneousStatus.cloud.tokenNotShared": "Token Claude Code cá nhân của bạn chưa được chia sẻ với không gian làm việc này, vì vậy các lần chạy trên đám mây ở đây không thể sử dụng nó. Lưu một token để chia sẻ nó với không gian làm việc này.","heterogeneousStatus.cloud.tokenPlaceholder": "Dán mã OAuth của bạn vào đây",+ "heterogeneousStatus.cloud.tokenRemove": "Xóa",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "Điều này sẽ xóa mã thông báo OAuth Claude Code của bạn khỏi Thông tin xác thực. Các lần chạy trên đám mây của các agent Claude Code sẽ không thể sử dụng nó cho đến khi bạn lưu một mã thông báo mới.",+ "heterogeneousStatus.cloud.tokenRemoveError": "Không thể xóa mã thông báo Claude Code. Vui lòng thử lại.",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "Xóa mã thông báo Claude Code?","heterogeneousStatus.cloud.tokenRetry": "Thử lại","heterogeneousStatus.cloud.tokenSave": "Lưu","heterogeneousStatus.cloud.tokenSaveError": "Không thể lưu token Claude Code. Vui lòng thử lại.",diff --git a/locales/zh-CN/file.json b/locales/zh-CN/file.jsonindex fd438c468f0..2da6dde7cd0 100644--- a/locales/zh-CN/file.json+++ b/locales/zh-CN/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "导入文稿","pageEditor.menu.move": "移动到…","pageEditor.menu.pin": "置顶文稿",+ "pageEditor.noAccess.description": "该页面是私有的,或位于你无权访问的资源库中。如需查看,请联系创建者或资源库管理员。",+ "pageEditor.noAccess.title": "你没有查看此页面的权限","pageEditor.saveFailed": "页面保存失败,请稍后重试","pageEditor.saving": "正在保存…","pageEditor.titlePlaceholder": "无标题",diff --git a/locales/zh-TW/file.json b/locales/zh-TW/file.jsonindex 35480ced5c0..5e8399656ae 100644--- a/locales/zh-TW/file.json+++ b/locales/zh-TW/file.json@@ -302,6 +302,8 @@"pageEditor.menu.importDocument": "匯入文稿","pageEditor.menu.move": "移動","pageEditor.menu.pin": "置頂文稿",+ "pageEditor.noAccess.description": "此頁面為私人頁面,或位於您無法存取的資料庫中。請向其創建者或資料庫管理員請求存取權限。",+ "pageEditor.noAccess.title": "您無權訪問此頁面","pageEditor.saveFailed": "無法儲存頁面,請稍後再試","pageEditor.saving": "儲存中...","pageEditor.titlePlaceholder": "無標題",diff --git a/locales/zh-TW/setting.json b/locales/zh-TW/setting.jsonindex a5acfce2fc3..ac2f2cbba2a 100644--- a/locales/zh-TW/setting.json+++ b/locales/zh-TW/setting.json@@ -826,6 +826,10 @@"heterogeneousStatus.cloud.tokenLookupError": "無法檢查此權杖是否可用於此處。請重試以重新加載。","heterogeneousStatus.cloud.tokenNotShared": "您的個人 Claude Code 權杖未分享至此工作區,因此此處的雲端運行無法使用它。請保存權杖以分享至此工作區。","heterogeneousStatus.cloud.tokenPlaceholder": "在此處粘貼您的 OAuth Token",+ "heterogeneousStatus.cloud.tokenRemove": "移除",+ "heterogeneousStatus.cloud.tokenRemoveConfirm": "這將從憑證中刪除您的 Claude Code OAuth 權杖。在您保存新的權杖之前,Claude Code 代理的雲端運行將無法使用它。",+ "heterogeneousStatus.cloud.tokenRemoveError": "無法移除 Claude Code 權杖。請再試一次。",+ "heterogeneousStatus.cloud.tokenRemoveTitle": "移除 Claude Code 權杖?","heterogeneousStatus.cloud.tokenRetry": "重試","heterogeneousStatus.cloud.tokenSave": "保存","heterogeneousStatus.cloud.tokenSaveError": "無法保存 Claude Code 權杖。請再試一次。",diff --git a/packages/locales/src/default/file.ts b/packages/locales/src/default/file.tsindex 70635270495..1df15b02edd 100644--- a/packages/locales/src/default/file.ts+++ b/packages/locales/src/default/file.ts@@ -336,6 +336,9 @@ export default {'pageEditor.menu.importDocument': 'Import Page','pageEditor.menu.move': 'Move to…','pageEditor.menu.pin': 'Pin Page',+ 'pageEditor.noAccess.description':+ 'This page is private, or it’s in a library you can’t access. Ask its creator or a library manager for access.',+ 'pageEditor.noAccess.title': 'You don’t have access to this page','pageEditor.saveFailed': 'Failed to save the page, please try again later','pageEditor.saving': 'Saving...','pageEditor.titlePlaceholder': 'Untitled',diff --git a/src/features/EditorCanvas/DocumentIdMode.test.tsx b/src/features/EditorCanvas/DocumentIdMode.test.tsxindex 70b2bd59ee9..001aca8b1f0 100644--- a/src/features/EditorCanvas/DocumentIdMode.test.tsx+++ b/src/features/EditorCanvas/DocumentIdMode.test.tsx@@ -4,6 +4,7 @@import { act, render, screen, waitFor } from '@testing-library/react';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import AsyncError from '@/components/AsyncError';import { useDocumentStore } from '@/store/document';import { editorSelectors } from '@/store/document/slices/editor';@@ -241,6 +242,27 @@ describe('DocumentIdMode', () => {expect(screen.queryByTestId('internal-editor')).not.toBeInTheDocument();});+ it('should explain missing access instead of a load failure on FORBIDDEN', () => {+ const editor = {+ getLexicalEditor: vi.fn(() => ({})),+ } as any;+ useFetchDocument.mockReturnValueOnce({+ ...createFetchDocumentResult(),+ error: Object.assign(new Error('forbidden'), { data: { code: 'FORBIDDEN' } }),+ });+ vi.mocked(editorSelectors.isDocumentLoading).mockReturnValueOnce(() => true);++ render(<DocumentIdMode documentId="doc-1" editor={editor} />);++ expect(screen.queryByTestId('not-found')).not.toBeInTheDocument();+ expect(vi.mocked(AsyncError).mock.lastCall?.[0]).toEqual(+ expect.objectContaining({+ description: 'pageEditor.noAccess.description',+ title: 'pageEditor.noAccess.title',+ }),+ );+ });+it('should render not found when the document fetch resolves to null', () => {const editor = {getLexicalEditor: vi.fn(() => ({})),diff --git a/src/features/EditorCanvas/DocumentIdMode.tsx b/src/features/EditorCanvas/DocumentIdMode.tsxindex 219d3092aa2..208943759b1 100644--- a/src/features/EditorCanvas/DocumentIdMode.tsx+++ b/src/features/EditorCanvas/DocumentIdMode.tsx@@ -12,6 +12,7 @@ import { ArticleSkeleton } from '@/components/Skeleton';import { useSaveDocumentHotkey } from '@/hooks/useHotkeys';import { useDocumentStore } from '@/store/document';import { editorSelectors } from '@/store/document/slices/editor';+import { isTrpcErrorCode } from '@/utils/trpcError';import { type EditorCanvasProps } from './EditorCanvas';import InternalEditor from './InternalEditor';@@ -218,11 +219,17 @@ const DocumentIdMode = memo<DocumentIdModeProps>(]);if (error && isLoading && !isFetchingDocument) {+ // The page exists but is private to another member (or not shared with+ // this one): say so instead of a generic load failure or a 404.+ const isForbidden = isTrpcErrorCode(error, 'FORBIDDEN');+return (<>{unsavedGuardNode}<AsyncError+ description={isForbidden ? t('pageEditor.noAccess.description') : undefined}error={error}+ title={isForbidden ? t('pageEditor.noAccess.title') : undefined}variant={'page'}onRetry={() => {void mutate();diff --git a/src/features/PageEditor/DocumentComments/context.tsx b/src/features/PageEditor/DocumentComments/context.tsxindex e06e98ca721..3e5893cccde 100644--- a/src/features/PageEditor/DocumentComments/context.tsx+++ b/src/features/PageEditor/DocumentComments/context.tsx@@ -5,6 +5,7 @@ import { createContext, type ReactNode, type RefObject, use, useEffect } from 'rimport { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';import { usePermission } from '@/hooks/usePermission';+import { isDocumentCommentsUnavailable } from '../isDocumentUnavailableError';import { usePageEditorStore } from '../store';import { DocumentCommentAnchorsProvider } from './anchor/context';import DocumentCommentHighlightStyle from './anchor/HighlightStyle';@@ -86,8 +87,12 @@ const DocumentCommentsStateProvider = ({// eslint-disable-next-line react-hooks/exhaustive-deps}, [pickVersion, pickTick, selectedRootId]);+ // Access to the page was revoked (it went private) or it is gone: every+ // comment surface — list, panel, marker, header toggle — reads this context,+ // so publish none rather than cached threads or a stacked load failure. SWR+ // keeps the last pages next to the error, so check the error, not the data.return (- <DocumentCommentsContext value={state}>+ <DocumentCommentsContext value={isDocumentCommentsUnavailable(state) ? null : state}><DocumentCommentAnchorsProvider value={state.anchors}><DocumentCommentHighlightStyle />{children}diff --git a/src/features/PageEditor/DocumentLikes/index.tsx b/src/features/PageEditor/DocumentLikes/index.tsxindex 207b05b7cb7..8b1d21578cf 100644--- a/src/features/PageEditor/DocumentLikes/index.tsx+++ b/src/features/PageEditor/DocumentLikes/index.tsx@@ -23,6 +23,8 @@ import { documentLikeService } from '@/services/documentLike';import { useUserStore } from '@/store/user';import { userProfileSelectors } from '@/store/user/selectors';+import { resolveDocumentSectionState } from '../isDocumentUnavailableError';+const BUTTON_SIZE = 56;const ICON_SIZE = 22;@@ -200,9 +202,12 @@ const DocumentLikes = memo<{ documentId: string }>(({ documentId }) => {if (!workspaceId) return null;- // A failed initial load must not masquerade as a zero-like page: surface a- // retryable error instead of the idle state with a dead button.- if (!data && error)+ // A page that went private or is gone drops even the cached count and likers;+ // a failed initial load must not masquerade as a zero-like page, so it+ // surfaces a retryable error instead of the idle state with a dead button.+ const sectionState = resolveDocumentSectionState(data, error);+ if (sectionState === 'hidden') return null;+ if (sectionState === 'error')return (<Flexbox data-document-likes align={'center'} className={styles.section} gap={16}><AsyncError error={error} variant={'inline'} onRetry={() => void mutate()} />diff --git a/src/features/PageEditor/isDocumentUnavailableError.test.ts b/src/features/PageEditor/isDocumentUnavailableError.test.tsnew file mode 100644index 00000000000..6670a119bd4--- /dev/null+++ b/src/features/PageEditor/isDocumentUnavailableError.test.ts@@ -0,0 +1,64 @@+import { describe, expect, it } from 'vitest';++import {+ isDocumentCommentsUnavailable,+ isDocumentUnavailableError,+ resolveDocumentSectionState,+} from './isDocumentUnavailableError';++const trpcError = (code: string) => Object.assign(new Error(code), { data: { code } });++describe('isDocumentUnavailableError', () => {+ it('matches a page this member may not open or that no longer exists', () => {+ expect(isDocumentUnavailableError(trpcError('FORBIDDEN'))).toBe(true);+ expect(isDocumentUnavailableError(trpcError('NOT_FOUND'))).toBe(true);+ });++ it('leaves transient failures to their own retryable error state', () => {+ expect(isDocumentUnavailableError(trpcError('INTERNAL_SERVER_ERROR'))).toBe(false);+ expect(isDocumentUnavailableError(new Error('network'))).toBe(false);+ expect(isDocumentUnavailableError(undefined)).toBe(false);+ });+});++describe('resolveDocumentSectionState', () => {+ const cached = { total: 3 };++ it('hides cached data once the page went private or is gone', () => {+ // SWR keeps the last data next to the revalidation error.+ expect(resolveDocumentSectionState(cached, trpcError('FORBIDDEN'))).toBe('hidden');+ expect(resolveDocumentSectionState(cached, trpcError('NOT_FOUND'))).toBe('hidden');+ expect(resolveDocumentSectionState(undefined, trpcError('FORBIDDEN'))).toBe('hidden');+ });++ it('shows a retryable error only for a transient initial failure', () => {+ expect(resolveDocumentSectionState(undefined, trpcError('INTERNAL_SERVER_ERROR'))).toBe(+ 'error',+ );+ expect(resolveDocumentSectionState(cached, trpcError('INTERNAL_SERVER_ERROR'))).toBe('ready');+ expect(resolveDocumentSectionState(cached, undefined)).toBe('ready');+ });+});++describe('isDocumentCommentsUnavailable', () => {+ it('drops comments when either thread list sees the page closed or gone', () => {+ expect(+ isDocumentCommentsUnavailable({ documentThreads: { error: trpcError('FORBIDDEN') } }),+ ).toBe(true);+ expect(+ isDocumentCommentsUnavailable({+ anchoredError: trpcError('NOT_FOUND'),+ documentThreads: {},+ }),+ ).toBe(true);+ });++ it('keeps comments on a transient failure', () => {+ expect(+ isDocumentCommentsUnavailable({+ anchoredError: new Error('network'),+ documentThreads: { error: trpcError('INTERNAL_SERVER_ERROR') },+ }),+ ).toBe(false);+ });+});diff --git a/src/features/PageEditor/isDocumentUnavailableError.ts b/src/features/PageEditor/isDocumentUnavailableError.tsnew file mode 100644index 00000000000..b9a9f10025e--- /dev/null+++ b/src/features/PageEditor/isDocumentUnavailableError.ts@@ -0,0 +1,36 @@+import { isTrpcErrorCode } from '@/utils/trpcError';++/**+ * Whether a page section failed because the document itself is closed to this+ * member (another member's private page) or gone. The body already explains that+ * state, so sections below it (likes, comments) render nothing instead of+ * stacking their own failures under it.+ */+export const isDocumentUnavailableError = (error: unknown): boolean =>+ isTrpcErrorCode(error, 'FORBIDDEN') || isTrpcErrorCode(error, 'NOT_FOUND');++/**+ * What a page section shows for its load result. SWR keeps the last data next+ * to a revalidation error, so an unavailable page is judged on the error alone:+ * cached likes or threads of a page that went private must disappear too.+ */+export const resolveDocumentSectionState = (+ data: unknown,+ error: unknown,+): 'error' | 'hidden' | 'ready' => {+ if (isDocumentUnavailableError(error)) return 'hidden';+ if (data === undefined && error) return 'error';+ return 'ready';+};++/**+ * Whether the page's comments must disappear entirely. Either thread list can+ * be the one that sees the terminal error first; cached pages next to it do not+ * keep the comments available.+ */+export const isDocumentCommentsUnavailable = (state: {+ anchoredError?: unknown;+ documentThreads: { error?: unknown };+}): boolean =>+ isDocumentUnavailableError(state.documentThreads.error) ||+ isDocumentUnavailableError(state.anchoredError);diff --git a/src/store/document/slices/document/action.test.ts b/src/store/document/slices/document/action.test.tsindex d9b701c92a8..59500507739 100644--- a/src/store/document/slices/document/action.test.ts+++ b/src/store/document/slices/document/action.test.ts@@ -453,6 +453,42 @@ describe('document detail replica', () => {await waitFor(async () => expect(await storedRow('doc-1', scope)).toBeUndefined());});+ it('evicts a cached document the viewer lost access to (FORBIDDEN)', async () => {+ // Cached while the page was readable; its creator has since made it private.+ const stale = documentRow({ content: '# Now private' });+ await documentDetailResource.storage!.set(+ { queryKey: 'doc-1', scope },+ { data: { document: stale }, updatedAt: 1 },+ );+ vi.mocked(documentService.getDocumentById).mockRejectedValue(+ Object.assign(new Error('forbidden'), { data: { code: 'FORBIDDEN' } }) as any,+ );++ const { result } = renderDocument('doc-1', createEditor());++ await waitFor(() => expect(result.current.error).toBeDefined());+ await waitFor(() =>+ expect(useDocumentStore.getState().documentDetailMap['doc-1']).toBeUndefined(),+ );+ expect(useDocumentStore.getState().documents['doc-1']).toBeUndefined();+ await waitFor(async () => expect(await storedRow('doc-1', scope)).toBeUndefined());+ });++ it('keeps the cached document when the read fails transiently', async () => {+ const cached = documentRow({ content: '# Cached' });+ await documentDetailResource.storage!.set(+ { queryKey: 'doc-1', scope },+ { data: { document: cached }, updatedAt: 1 },+ );+ vi.mocked(documentService.getDocumentById).mockRejectedValue(new Error('offline') as any);++ const { result } = renderDocument('doc-1', createEditor());++ await waitFor(() => expect(result.current.error).toBeDefined());+ expect(useDocumentStore.getState().documentDetailMap['doc-1']).toEqual({ document: cached });+ expect((await storedRow('doc-1', scope))?.data).toEqual({ document: cached });+ });+it('a reload cannot resurrect a document the server has dropped', async () => {const stale = documentRow({ content: '# Revoked' });await documentDetailResource.storage!.set(diff --git a/src/store/file/slices/document/action.test.ts b/src/store/file/slices/document/action.test.tsindex b09c35eeeb9..38a164605ba 100644--- a/src/store/file/slices/document/action.test.ts+++ b/src/store/file/slices/document/action.test.ts@@ -253,6 +253,45 @@ describe('file document replica', () => {});});+ it('drops the cached row when access to the document was revoked (FORBIDDEN)', async () => {+ const cached = lobeDocument({ content: '# Now private', title: 'Cached' });+ await fileDocumentResource.storage!.set(+ { queryKey: 'doc-1', scope },+ { data: { document: cached }, updatedAt: 1 },+ );+ vi.mocked(documentService.getDocumentById).mockRejectedValue(+ Object.assign(new Error('forbidden'), { data: { code: 'FORBIDDEN' } }) as any,+ );++ const { result } = renderDetail('doc-1');++ await waitFor(() => expect(result.current.error).toBeDefined());+ await waitFor(() =>+ expect(useFileStore.getState().documentMap['doc-1']).toEqual({ document: null }),+ );+ await waitFor(async () => {+ expect(await storedRow('doc-1', scope)).toBeUndefined();+ });+ });++ it('loads the document on retry once access is granted again', async () => {+ vi.mocked(documentService.getDocumentById).mockRejectedValue(+ Object.assign(new Error('forbidden'), { data: { code: 'FORBIDDEN' } }) as any,+ );+ const { result } = renderDetail('doc-1');+ await waitFor(() => expect(result.current.error).toBeDefined());++ vi.mocked(documentService.getDocumentById).mockResolvedValue(+ serverRow({ content: '# Shared', title: 'Shared' }) as any,+ );+ await act(async () => {+ await result.current.mutate();+ });++ await waitFor(() => expect(result.current.data?.content).toBe('# Shared'));+ expect(result.current.error).toBeUndefined();+ });+it('drops the previous identity’s rows before the next one paints', async () => {vi.mocked(documentService.getDocumentById).mockResolvedValue(serverRow() as any);diff --git a/src/store/file/slices/document/action.ts b/src/store/file/slices/document/action.tsindex b46f5ebf928..a62804f74ff 100644--- a/src/store/file/slices/document/action.ts+++ b/src/store/file/slices/document/action.ts@@ -14,6 +14,7 @@ import { type LobeDocument } from '@/types/document';import { DocumentSourceType } from '@/types/document';import { type ResourceItem } from '@/types/resource';import { setNamespace } from '@/utils/storeDebug';+import { isTrpcErrorCode } from '@/utils/trpcError';import { type FileStore, useFileStore } from '../../store';import { getResourceQueryKey } from '../resource/utils';@@ -563,6 +564,15 @@ export class DocumentActionImpl {const entry = useFileStore((s) => (documentId ? s.documentMap[documentId] : undefined));const sync = this.#documents.useSync(documentId, {+ // A page made private to another member (FORBIDDEN) or deleted (NOT_FOUND)+ // must not keep painting from the projection: settle it like a "not found"+ // answer (evicting the persisted row) rather than `remove`, which would also+ // unregister this mounted query and drop a retry once access is restored.+ // Transient failures keep the cached row.+ onError: (error, { key, scope }) => {+ if (key && (isTrpcErrorCode(error, 'FORBIDDEN') || isTrpcErrorCode(error, 'NOT_FOUND')))+ this.#documents.replace(key, { document: null }, scope);+ },// Keep an open page in step with other writers.revalidateOnFocus: true,});