Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fix(preview): say why a linked file outside the chat can't open, and how to find it

laijsg149f6c3ef7537
diff --git a/src/components/ChatMarkdown.tsx b/src/components/ChatMarkdown.tsx
index 48ceb39d45..cbe59f908e 100644
--- a/src/components/ChatMarkdown.tsx
+++ b/src/components/ChatMarkdown.tsx
@@ -361,7 +361,7 @@ export function MermaidDiagram({ code }: MermaidDiagramProps) {
// source: the original a delivered copy came from, offered on right-click (Show in Finder) like in the gallery.
function LocalFileLink({ filePath, shownPath, shownName, name, source, children, message }: { filePath: string; shownPath: string; shownName: string; name?: string; source?: string; children?: ReactNode; message?: MessageAttachmentContext }) {
const save = useLocalFileSave(filePath, name, message);
- const preview = useHtmlPreview(filePath, shownName, message);
+ const preview = useHtmlPreview(filePath, shownName, message, shownPath);
const revealMenu = useRevealOriginalMenu();
if (!message) {
return <span title={t("chat.file.legacy")} className="break-words text-ink-secondary">{children}</span>;
diff --git a/src/components/FilePreviewContent.outside.dom.test.ts b/src/components/FilePreviewContent.outside.dom.test.ts
new file mode 100644
index 0000000000..8cf51a8c31
--- /dev/null
+++ b/src/components/FilePreviewContent.outside.dom.test.ts
@@ -0,0 +1,72 @@
+// @vitest-environment happy-dom
+import { act, createElement } from "react";
+import { createRoot, type Root } from "react-dom/client";
+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
+import { setLocale } from "@/lib/i18n";
+import { FilePreviewContent } from "./HtmlFilePreview";
+
+const message = { threadId: "t", messageId: "m" };
+const linked = "/Users/maus/.openmausbot/workspaces/finance-head/Q3%20report";
+const onDisk = "/Users/maus/.openmausbot/workspaces/finance-head/Q3 report";
+let host: HTMLDivElement, root: Root;
+
+beforeEach(() => {
+ vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
+ host = document.createElement("div"); document.body.append(host); root = createRoot(host);
+});
+afterEach(async () => {
+ await act(async () => root.unmount());
+ host.remove();
+ vi.unstubAllGlobals();
+ Reflect.deleteProperty(window, "ogb");
+ setLocale("en");
+});
+
+const outside = () => new Response(JSON.stringify({ error: "the linked file is outside this conversation's workspace", code: "outside_workspace" }), { status: 403, headers: { "content-type": "application/json" } });
+const files = [
+ { kind: "markdown", extension: ".md" },
+ { kind: "html", extension: ".html" },
+ { kind: "table", extension: ".csv" },
+] as const;
+
+async function show(kind: (typeof files)[number]["kind"], extension: string, answer: () => Response) {
+ const fetch = vi.fn(async () => answer());
+ vi.stubGlobal("fetch", fetch);
+ await act(async () => root.render(createElement(FilePreviewContent, { kind, path: `${linked}${extension}`, shownPath: `${onDisk}${extension}`, name: `Q3 report${extension}`, message })));
+ await vi.waitFor(() => expect(host.querySelector("[role=alert]")).not.toBeNull(), { timeout: 5_000 });
+ return fetch;
+}
+const buttons = () => [...host.querySelectorAll("button")].map((button) => button.textContent?.trim() || button.getAttribute("aria-label"));
+
+describe("a previewed file outside the chat's folders", () => {
+ for (const { kind, extension } of files) {
+ it(`${kind}: says why it can't open and offers no Save or Retry that would fail the same way`, async () => {
+ const fetch = await show(kind, extension, outside);
+ expect(host.querySelector("[role=alert]")!.textContent).toBe("This file is outside this chat's working folder, so it can't be opened here");
+ expect(buttons()).toEqual([]);
+ expect(host.querySelector("code")?.textContent).toBe(`${onDisk}${extension}`);
+ expect(fetch).toHaveBeenCalledTimes(1);
+ });
+
+ it(`${kind}: shows the file in its folder on the desktop`, async () => {
+ const revealInFolder = vi.fn(async () => "shown");
+ Object.assign(window, { ogb: { revealInFolder } });
+ await show(kind, extension, outside);
+ expect(buttons()).toEqual(["Show in folder"]);
+ await act(async () => host.querySelector("button")!.click());
+ expect(revealInFolder).toHaveBeenCalledWith(`${onDisk}${extension}`);
+ });
+ }
+
+ it("keeps Retry for a refusal that may pass next time", async () => {
+ await show("markdown", ".md", () => new Response(JSON.stringify({ error: "the linked file changed while it was being opened" }), { status: 409, headers: { "content-type": "application/json" } }));
+ expect(host.querySelector("[role=alert]")!.textContent).toContain("the linked file changed while it was being opened");
+ expect(buttons()).toContain("Retry");
+ });
+
+ it("speaks the person's language", async () => {
+ setLocale("de");
+ await show("markdown", ".md", outside);
+ expect(host.querySelector("[role=alert]")!.textContent).toBe("Diese Datei liegt außerhalb des Arbeitsordners dieses Chats und kann hier nicht geöffnet werden");
+ });
+});
diff --git a/src/components/FilePreviewPanel.tsx b/src/components/FilePreviewPanel.tsx
index 361593b768..d89b8b45be 100644
--- a/src/components/FilePreviewPanel.tsx
+++ b/src/components/FilePreviewPanel.tsx
@@ -70,7 +70,7 @@ function FilePane({ preview }: { preview: FilePreview }) {
</header>
{/* An HTML file's frame swallows the pointer, so the resize drag would stop the moment it crossed the page. */}
<div className={cn("ms-1.5 flex min-h-0 flex-1 flex-col overflow-auto px-3 pb-3", dragging && "pointer-events-none")}>
- <FilePreviewContent kind={preview.kind} path={preview.path} name={preview.name} message={preview.message} original={preview.original} fill />
+ <FilePreviewContent kind={preview.kind} path={preview.path} shownPath={preview.shownPath} name={preview.name} message={preview.message} original={preview.original} fill />
</div>
</aside>
);
diff --git a/src/components/HtmlFilePreview.dom.test.ts b/src/components/HtmlFilePreview.dom.test.ts
index aef7ac5f64..80c890dc30 100644
--- a/src/components/HtmlFilePreview.dom.test.ts
+++ b/src/components/HtmlFilePreview.dom.test.ts
@@ -23,8 +23,8 @@ const alertText = () => document.body.querySelector("[role=alert]")?.textContent
describe("HTML file preview errors", () => {
it("shows the server's own reason instead of blaming the connection or the encoding", async () => {
- await open(async () => new Response(JSON.stringify({ error: "the linked file is outside this conversation's workspace", code: "outside_workspace" }), { status: 403, headers: { "content-type": "application/json" } }));
- expect(alertText()).toContain("the linked file is outside this conversation's workspace");
+ await open(async () => new Response(JSON.stringify({ error: "the linked file changed while it was being opened" }), { status: 409, headers: { "content-type": "application/json" } }));
+ expect(alertText()).toContain("the linked file changed while it was being opened");
expect(alertText()).not.toContain("Check your connection");
expect(alertText()).not.toContain("UTF-8");
});
diff --git a/src/components/HtmlFilePreview.tsx b/src/components/HtmlFilePreview.tsx
index ab168ec131..3b1676a161 100644
--- a/src/components/HtmlFilePreview.tsx
+++ b/src/components/HtmlFilePreview.tsx
@@ -1,6 +1,7 @@
import { Component, lazy, Suspense, useEffect, useRef, useState, type ReactNode } from "react";
import { Check, Code2, Download, ExternalLink, Eye, LoaderCircle, RotateCcw } from "lucide-react";
import { requestMessageFile, useLocalFileSave, type MessageAttachmentContext } from "./AttachmentPreview";
+import { OutsideWorkspacePreview, refusedAsOutsideWorkspace } from "./OutsideWorkspacePreview";
import { TableDialog } from "./RichTable";
import { readTableResponse, TableFileContent } from "./TableFilePreview";
import { cn } from "@/lib/cn";
@@ -53,7 +54,7 @@ export function htmlBrowserBridge(): ((source: string, name: string) => Promise<
/** The preview for an HTML or Markdown file in a message, opened by the eye button or by the file's name: beside the chat
* when the window has room for it, else in a dialog. */
-export function useHtmlPreview(path: string, name: string, message?: MessageAttachmentContext) {
+export function useHtmlPreview(path: string, name: string, message?: MessageAttachmentContext, shownPath = path) {
const [open, setOpen] = useState(false);
const opener = useRef<HTMLElement | null>(null);
const beside = useFileBesideChat();
@@ -65,27 +66,27 @@ export function useHtmlPreview(path: string, name: string, message?: MessageAtta
label: t(kind === "markdown" ? "markdown.preview" : "html.preview", { name }),
show: (event: { currentTarget: HTMLElement }) => {
opener.current = event.currentTarget;
- if (kind && message && beside({ kind, path, name, message, opener: event.currentTarget })) return;
+ if (kind && message && beside({ kind, path, shownPath, name, message, opener: event.currentTarget })) return;
setOpen(true);
},
dialog: kind && open && message
? <TableDialog title={name} returnFocus={opener.current} onClose={() => setOpen(false)}>
- <FilePreviewContent kind={kind} path={path} name={name} message={message} />
+ <FilePreviewContent kind={kind} path={path} shownPath={shownPath} name={name} message={message} />
</TableDialog>
: null,
};
}
/** A file's preview, in the dialog or in the pane beside the chat, which it fills. */
-export function FilePreviewContent({ kind, path, name, message, original, fill = false }: Pick<FilePreview, "kind" | "path" | "name" | "message" | "original"> & { fill?: boolean }) {
+export function FilePreviewContent({ kind, path, shownPath = path, name, message, original, fill = false }: Pick<FilePreview, "kind" | "path" | "shownPath" | "name" | "message" | "original"> & { fill?: boolean }) {
const key = `${message.threadId}:${message.messageId}:${path}`;
if (kind === "changes") return original ? <MarkdownPreviewBoundary><Suspense fallback={<div role="status" className="flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary"><LoaderCircle size={16} className="animate-spin" />{t("changes.loading")}</div>}><WhatChangedContent key={`${key}:${original.path}`} edited={{ path, name, message }} original={{ path: original.path, name: original.name, message: { threadId: message.threadId, messageId: original.messageId } }} fill={fill} /></Suspense></MarkdownPreviewBoundary> : null;
- if (kind === "html") return <HtmlFileContent key={key} path={path} name={name} message={message} fill={fill} />;
+ if (kind === "html") return <HtmlFileContent key={key} path={path} shownPath={shownPath} name={name} message={message} fill={fill} />;
if (kind === "table") {
const delimiter = tableDelimiter(name) ?? tableDelimiter(path);
- return delimiter && <TableFileContent key={key} path={path} name={name} message={message} delimiter={delimiter} />;
+ return delimiter && <TableFileContent key={key} path={path} shownPath={shownPath} name={name} message={message} delimiter={delimiter} />;
}
- return <MarkdownPreviewBoundary><Suspense fallback={<div role="status" className="flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary"><LoaderCircle size={16} className="animate-spin" />{t("markdown.loading")}</div>}><MarkdownFileContent key={key} path={path} name={name} message={message} fill={fill} /></Suspense></MarkdownPreviewBoundary>;
+ return <MarkdownPreviewBoundary><Suspense fallback={<div role="status" className="flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary"><LoaderCircle size={16} className="animate-spin" />{t("markdown.loading")}</div>}><MarkdownFileContent key={key} path={path} shownPath={shownPath} name={name} message={message} fill={fill} /></Suspense></MarkdownPreviewBoundary>;
}
export function HtmlFileButton({ path, name, message }: { path: string; name: string; message: MessageAttachmentContext }) {
@@ -130,10 +131,10 @@ export function OpenInBrowserButton({ source, name, onError }: { source: string;
}}><ExternalLink size={14} /></button>;
}
-function HtmlFileContent({ path, name, message, fill }: { path: string; name: string; message: MessageAttachmentContext; fill: boolean }) {
+function HtmlFileContent({ path, shownPath, name, message, fill }: { path: string; shownPath: string; name: string; message: MessageAttachmentContext; fill: boolean }) {
const [attempt, setAttempt] = useState(0);
const [source, setSource] = useState<string | null>(null);
- const [error, setError] = useState<"size" | "load" | { reason: string } | null>(null);
+ const [error, setError] = useState<"size" | "load" | "outside" | { reason: string } | null>(null);
const [showSource, setShowSource] = useState(false);
const [openFailed, setOpenFailed] = useState("");
const save = useLocalFileSave(path, name, message);
@@ -151,12 +152,14 @@ function HtmlFileContent({ path, name, message, fill }: { path: string; name: st
} catch (reason) {
if (controller.signal.aborted) return;
// A refusal from the server says why; only a request that got no answer (TypeError) is the connection.
- if (!answered && reason instanceof Error && !(reason instanceof TypeError)) setError({ reason: reason.message });
+ if (refusedAsOutsideWorkspace(reason)) setError("outside");
+ else if (!answered && reason instanceof Error && !(reason instanceof TypeError)) setError({ reason: reason.message });
else setError(reason instanceof Error && reason.message === "size" ? "size" : "load");
}
})();
return () => controller.abort();
}, [path, message.threadId, message.messageId, attempt]);
+ if (error === "outside") return <OutsideWorkspacePreview filePath={shownPath} />;
if (error) return <div className="p-8 text-center text-sm"><p role="alert" className="mb-3 text-ink-secondary">{typeof error === "object" ? t("html.refused", { reason: error.reason }) : t(error === "size" ? "html.tooLarge" : "html.loadFailed")}</p><button type="button" className="rounded-lg border border-hairline px-3 py-2 hover:bg-raised" onClick={() => setAttempt(attempt + 1)}>{t("chat.retry")}</button></div>;
if (source === null) return <div role="status" className="flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary"><LoaderCircle size={16} className="animate-spin" />{t("html.loading")}</div>;
return <div className={cn("flex flex-col gap-2", fill && "min-h-0 flex-1")}>
diff --git a/src/components/MarkdownFilePreview.tsx b/src/components/MarkdownFilePreview.tsx
index 9bc551fb6b..cd23aea9c3 100644
--- a/src/components/MarkdownFilePreview.tsx
+++ b/src/components/MarkdownFilePreview.tsx
@@ -1,6 +1,7 @@
import { useEffect, useState } from "react";
import { Code2, Download, Eye, LoaderCircle, RotateCcw } from "lucide-react";
import { requestMessageFile, useLocalFileSave, type MessageAttachmentContext } from "./AttachmentPreview";
+import { OutsideWorkspacePreview, refusedAsOutsideWorkspace } from "./OutsideWorkspacePreview";
import { ChatMarkdown } from "./ChatMarkdown";
import { previewHeight } from "./HtmlFilePreview";
import { readTableResponse } from "./TableFilePreview";
@@ -11,10 +12,10 @@ export const MARKDOWN_PREVIEW_MAX_BYTES = 2 * 1024 * 1024;
/** A Markdown file in a message, drawn the way the chat draws a reply. Security: no message context is passed on, so
* paths written in the file stay plain text instead of becoming links that fetch other files. */
-export default function MarkdownFileContent({ path, name, message, fill = false }: { path: string; name: string; message: MessageAttachmentContext; fill?: boolean }) {
+export default function MarkdownFileContent({ path, shownPath = path, name, message, fill = false }: { path: string; shownPath?: string; name: string; message: MessageAttachmentContext; fill?: boolean }) {
const [attempt, setAttempt] = useState(0);
const [source, setSource] = useState<string | null>(null);
- const [error, setError] = useState<"size" | "load" | "encoding" | { reason: string } | null>(null);
+ const [error, setError] = useState<"size" | "load" | "encoding" | "outside" | { reason: string } | null>(null);
const [showSource, setShowSource] = useState(false);
const save = useLocalFileSave(path, name, message);
useEffect(() => {
@@ -32,7 +33,8 @@ export default function MarkdownFileContent({ path, name, message, fill = false
} catch (reason) {
if (controller.signal.aborted) return;
// A refusal from the server says why; only a request that got no answer (TypeError) is the connection.
- if (!answered && reason instanceof Error && !(reason instanceof TypeError)) setError({ reason: reason.message });
+ if (refusedAsOutsideWorkspace(reason)) setError("outside");
+ else if (!answered && reason instanceof Error && !(reason instanceof TypeError)) setError({ reason: reason.message });
else setError(reason instanceof Error && (reason.message === "size" || reason.message === "encoding") ? reason.message : "load");
}
})();
@@ -40,6 +42,7 @@ export default function MarkdownFileContent({ path, name, message, fill = false
}, [path, message.threadId, message.messageId, attempt]);
// Save and Retry stay on screen while loading too, so a stalled request never leaves only a spinner; they wrap so a long name can't push Retry off a narrow dialog.
const recovery = <><div className="mt-3 flex flex-wrap justify-center gap-2"><button type="button" className="inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-lg border border-hairline px-3 py-2 hover:bg-raised" disabled={save.state === "saving"} onClick={() => void save.save()}><Download size={14} className="shrink-0" /><span className="min-w-0 break-all">{t("attach.saveAria", { name })}</span></button><button type="button" className="rounded-lg border border-hairline px-3 py-2 hover:bg-raised" onClick={() => setAttempt(attempt + 1)}>{t("chat.retry")}</button></div>{save.state === "failed" && <p role="alert" className="mt-2 text-[12px] text-danger">{save.reason}</p>}</>;
+ if (error === "outside") return <OutsideWorkspacePreview filePath={shownPath} />;
if (error) return <div className="p-8 text-center text-sm"><p role="alert" className="text-ink-secondary">{typeof error === "object" ? t("markdown.refused", { reason: error.reason }) : t(error === "size" ? "markdown.tooLarge" : error === "encoding" ? "markdown.notText" : "markdown.loadFailed")}</p>{recovery}</div>;
if (source === null) return <div className="p-12 text-center text-sm text-ink-secondary"><span role="status" className="inline-flex items-center gap-2"><LoaderCircle size={16} className="animate-spin" />{t("markdown.loading")}</span>{recovery}</div>;
return <div className={cn("flex flex-col gap-2", fill && "min-h-0 flex-1")}>
diff --git a/src/components/OutsideWorkspacePreview.tsx b/src/components/OutsideWorkspacePreview.tsx
new file mode 100644
index 0000000000..35b5cc4475
--- /dev/null
+++ b/src/components/OutsideWorkspacePreview.tsx
@@ -0,0 +1,14 @@
+import { OutsideWorkspaceFile } from "./AttachmentPreview";
+import { t } from "@/lib/i18n";
+
+export const refusedAsOutsideWorkspace = (error: unknown): boolean => (error as { code?: unknown } | null)?.code === "outside_workspace";
+
+/** A file preview the server refused as outside the chat's folders: saving or retrying would be refused the same way. */
+export function OutsideWorkspacePreview({ filePath }: { filePath: string }) {
+ return (
+ <div className="p-8 text-center text-sm">
+ <p role="alert" className="mb-3 text-ink-secondary">{t("attach.previewOutsideWorkspace")}</p>
+ <div className="flex flex-wrap items-center justify-center gap-x-1.5 text-[12px]"><OutsideWorkspaceFile filePath={filePath} /></div>
+ </div>
+ );
+}
diff --git a/src/components/TableFilePreview.tsx b/src/components/TableFilePreview.tsx
index 35f66421f5..677d97b79a 100644
--- a/src/components/TableFilePreview.tsx
+++ b/src/components/TableFilePreview.tsx
@@ -1,6 +1,7 @@
import { useEffect, useMemo, useRef, useState } from "react";
import { LoaderCircle, Table2 } from "lucide-react";
import { requestMessageFile, type MessageAttachmentContext } from "./AttachmentPreview";
+import { OutsideWorkspacePreview, refusedAsOutsideWorkspace } from "./OutsideWorkspacePreview";
import { RichTable, TableDialog } from "./RichTable";
import { useFileBesideChat } from "@/lib/file-preview";
import { TABLE_FILE_MAX_BYTES, tableDelimiter, type TextTable } from "@/lib/table-data";
@@ -51,8 +52,8 @@ export function TableFileButton({ path, name, message }: { path: string; name: s
</>;
}
-export function TableFileContent({ path, name, message, delimiter }: {
- path: string; name: string; message: MessageAttachmentContext; delimiter: "," | "\t";
+export function TableFileContent({ path, shownPath = path, name, message, delimiter }: {
+ path: string; shownPath?: string; name: string; message: MessageAttachmentContext; delimiter: "," | "\t";
}) {
const [attempt, setAttempt] = useState(0);
const [table, setTable] = useState<TextTable | null>(null);
@@ -79,11 +80,12 @@ export function TableFileContent({ path, name, message, delimiter }: {
};
worker.onerror = () => fail("format");
worker.postMessage({ text, delimiter });
- } catch (reason) { fail(reason instanceof Error && reason.message === "size" ? "size" : "load"); }
+ } catch (reason) { fail(refusedAsOutsideWorkspace(reason) ? "outside" : reason instanceof Error && reason.message === "size" ? "size" : "load"); }
})();
return () => { controller.abort(); worker?.terminate(); };
}, [path, message.threadId, message.messageId, delimiter, attempt]);
const data = useMemo(() => table && ({ columns: table.headers.map((text) => ({ text })), rows: table.rows.map((row) => row.map((text) => ({ text }))) }), [table]);
+ if (error === "outside") return <OutsideWorkspacePreview filePath={shownPath} />;
if (error) return <div className="p-8 text-center text-sm"><p role="alert" className="mb-3 text-ink-secondary">{t(error === "size" ? "table.tooLarge" : error === "columns" || error === "format" ? "table.invalid" : "table.loadFailed")}</p><button type="button" className="rounded-lg border border-hairline px-3 py-2 hover:bg-raised" onClick={() => setAttempt(attempt + 1)}>{t("chat.retry")}</button></div>;
if (!data) return <div role="status" className="flex items-center justify-center gap-2 p-12 text-sm text-ink-secondary"><LoaderCircle size={16} className="animate-spin" />{t("table.loading")}</div>;
return <RichTable {...data} name={name} expanded />;
diff --git a/src/lib/file-preview.ts b/src/lib/file-preview.ts
index b1f28aacac..49ad44ac5e 100644
--- a/src/lib/file-preview.ts
+++ b/src/lib/file-preview.ts
@@ -10,6 +10,7 @@ import { SIDEBAR_AND_PANEL_FIT } from "./use-media-query";
export interface FilePreview {
kind: "html" | "markdown" | "table" | "changes";
path: string;
+ shownPath?: string;
name: string;
message: { threadId: string; messageId: string };
/** For "changes": the person's file this one is an edit of, in the message that attached it. */
diff --git a/src/locales/de.json b/src/locales/de.json
index 6e0c7a9c0c..c2b826ef79 100644
--- a/src/locales/de.json
+++ b/src/locales/de.json
@@ -1233,6 +1233,7 @@
"attach.retryAria": "{name} erneut laden",
"attach.imageUnavailable": "Bild nicht verfügbar",
"attach.imageOutsideWorkspace": "Dieses Bild liegt außerhalb des Arbeitsordners dieses Chats und kann hier nicht angezeigt werden",
+ "attach.previewOutsideWorkspace": "Diese Datei liegt außerhalb des Arbeitsordners dieses Chats und kann hier nicht geöffnet werden",
"attach.previewImageAria": "Angehängtes Bild {name} ansehen",
"attach.externalHidden": "Externes Bild aus Datenschutzgründen ausgeblendet",
"attach.savedTo": "Gespeichert unter {path}",
diff --git a/src/locales/en.json b/src/locales/en.json
index f037385924..d5209201f3 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -3211,6 +3211,7 @@
"attach.retryAria": "Retry loading {name}",
"attach.imageUnavailable": "Image unavailable",
"attach.imageOutsideWorkspace": "This picture is outside this chat's working folder, so it can't be shown here",
+ "attach.previewOutsideWorkspace": "This file is outside this chat's working folder, so it can't be opened here",
"attach.previewImageAria": "Preview attached image {name}",
"attach.externalHidden": "External image hidden for privacy",
"attach.savedTo": "Saved to {path}",
diff --git a/src/locales/es.json b/src/locales/es.json
index 539be1ebe1..5d5fb37f6e 100644
--- a/src/locales/es.json
+++ b/src/locales/es.json
@@ -2207,6 +2207,7 @@
"attach.retryAria": "Reintentar la carga de {name}",
"attach.imageUnavailable": "Imagen no disponible",
"attach.imageOutsideWorkspace": "Esta imagen está fuera de la carpeta de trabajo de este chat, así que no se puede mostrar aquí",
+ "attach.previewOutsideWorkspace": "Este archivo está fuera de la carpeta de trabajo de este chat, así que no se puede abrir aquí",
"attach.previewImageAria": "Vista previa de la imagen adjunta {name}",
"attach.externalHidden": "Imagen externa oculta por privacidad",
"attach.savedTo": "Guardado en {path}",
diff --git a/src/locales/fr.json b/src/locales/fr.json
index e9caa3fb04..453de0700a 100644
--- a/src/locales/fr.json
+++ b/src/locales/fr.json
@@ -1032,6 +1032,7 @@
"attach.retryAria": "Réessayer de charger {name}",
"attach.imageUnavailable": "Image indisponible",
"attach.imageOutsideWorkspace": "Cette image se trouve hors du dossier de travail de cette discussion et ne peut pas être affichée ici",
+ "attach.previewOutsideWorkspace": "Ce fichier se trouve hors du dossier de travail de cette discussion et ne peut pas être ouvert ici",
"attach.previewImageAria": "Aperçu de l'image jointe {name}",
"attach.externalHidden": "Image externe masquée pour préserver la confidentialité",
"attach.savedTo": "Enregistré dans {path}",
diff --git a/src/locales/hi.json b/src/locales/hi.json
index 181e7d8447..604b8f243d 100644
--- a/src/locales/hi.json
+++ b/src/locales/hi.json
@@ -1030,6 +1030,7 @@
"attach.retryAria": "{name} फिर से लोड करें",
"attach.imageUnavailable": "छवि उपलब्ध नहीं है",
"attach.imageOutsideWorkspace": "यह तस्वीर इस चैट के कार्य फ़ोल्डर से बाहर है, इसलिए इसे यहाँ नहीं दिखाया जा सकता",
+ "attach.previewOutsideWorkspace": "यह फ़ाइल इस चैट के कार्य फ़ोल्डर से बाहर है, इसलिए इसे यहाँ नहीं खोला जा सकता",
"attach.previewImageAria": "संलग्न छवि {name} की झलक",
"attach.externalHidden": "निजता के लिए बाहरी छवि छिपाई गई",
"attach.savedTo": "{path} पर सहेजा गया",
diff --git a/src/locales/it.json b/src/locales/it.json
index 9e4d805d1a..95eae7b308 100644
--- a/src/locales/it.json
+++ b/src/locales/it.json
@@ -2293,6 +2293,7 @@
"attach.retryAria": "Riprova a caricare {name}",
"attach.imageUnavailable": "Immagine non disponibile",
"attach.imageOutsideWorkspace": "Questa immagine è fuori dalla cartella di lavoro di questa chat, quindi qui non si può mostrare",
+ "attach.previewOutsideWorkspace": "Questo file è fuori dalla cartella di lavoro di questa chat, quindi qui non si può aprire",
"attach.previewImageAria": "Anteprima dell'immagine allegata {name}",
"attach.externalHidden": "Immagine esterna nascosta per la privacy",
"attach.savedTo": "Salvato in {path}",
diff --git a/src/locales/ja.json b/src/locales/ja.json
index 5423b74352..c5f50b2fda 100644
--- a/src/locales/ja.json
+++ b/src/locales/ja.json
@@ -2654,6 +2654,7 @@
"attach.retryAria": "{name} を再読み込み",
"attach.imageUnavailable": "画像を表示できません",
"attach.imageOutsideWorkspace": "この画像はこのチャットの作業フォルダー外にあるため、ここでは表示できません",
+ "attach.previewOutsideWorkspace": "このファイルはこのチャットの作業フォルダー外にあるため、ここでは開けません",
"attach.previewImageAria": "添付画像 {name} をプレビュー",
"attach.externalHidden": "プライバシー保護のため外部画像を非表示にしています",
"attach.savedTo": "{path} に保存しました",
diff --git a/src/locales/ko.json b/src/locales/ko.json
index 4ade9ad824..047d953507 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -2524,6 +2524,7 @@
"attach.retryAria": "{name} 다시 불러오기",
"attach.imageUnavailable": "이미지를 볼 수 없음",
"attach.imageOutsideWorkspace": "이 사진은 이 채팅의 작업 폴더 밖에 있어서 여기에 표시할 수 없어요",
+ "attach.previewOutsideWorkspace": "이 파일은 이 채팅의 작업 폴더 밖에 있어서 여기서 열 수 없어요",
"attach.previewImageAria": "첨부 이미지 {name} 미리보기",
"attach.externalHidden": "개인정보 보호를 위해 외부 이미지를 숨겼어요",
"attach.savedTo": "{path}에 저장됨",
diff --git a/src/locales/pl.json b/src/locales/pl.json
index fee27a57dd..ae6943e9fe 100644
--- a/src/locales/pl.json
+++ b/src/locales/pl.json
@@ -2342,6 +2342,7 @@
"attach.retryAria": "Spróbuj ponownie wczytać {name}",
"attach.imageUnavailable": "Obraz niedostępny",
"attach.imageOutsideWorkspace": "Ten obraz znajduje się poza folderem roboczym tego czatu, więc nie można go tu wyświetlić",
+ "attach.previewOutsideWorkspace": "Ten plik znajduje się poza folderem roboczym tego czatu, więc nie można go tu otworzyć",
"attach.previewImageAria": "Podgląd załączonego obrazu {name}",
"attach.externalHidden": "Zewnętrzny obraz ukryty ze względu na prywatność",
"attach.savedTo": "Zapisano w: {path}",
diff --git a/src/locales/pt-br.json b/src/locales/pt-br.json
index 0347ebce2f..639aadc808 100644
--- a/src/locales/pt-br.json
+++ b/src/locales/pt-br.json
@@ -3024,6 +3024,7 @@
"attach.retryAria": "Tentar carregar {name} novamente",
"attach.imageUnavailable": "Imagem indisponível",
"attach.imageOutsideWorkspace": "Esta imagem está fora da pasta de trabalho desta conversa, então não pode ser exibida aqui",
+ "attach.previewOutsideWorkspace": "Este arquivo está fora da pasta de trabalho desta conversa, então não pode ser aberto aqui",
"attach.previewImageAria": "Ver prévia da imagem anexada {name}",
"attach.externalHidden": "Imagem externa oculta para proteger sua privacidade",
"attach.savedTo": "Salvo em {path}",
diff --git a/src/locales/ru.json b/src/locales/ru.json
index 911a264637..f5c41c88e5 100644
--- a/src/locales/ru.json
+++ b/src/locales/ru.json
@@ -2375,6 +2375,7 @@
"attach.retryAria": "Повторить загрузку {name}",
"attach.imageUnavailable": "Изображение недоступно",
"attach.imageOutsideWorkspace": "Эта картинка находится вне рабочей папки этого чата, поэтому её нельзя показать здесь",
+ "attach.previewOutsideWorkspace": "Этот файл находится вне рабочей папки этого чата, поэтому его нельзя открыть здесь",
"attach.previewImageAria": "Просмотр прикреплённого изображения {name}",
"attach.externalHidden": "Внешнее изображение скрыто из соображений приватности",
"attach.savedTo": "Сохранено в {path}",
diff --git a/src/locales/tr.json b/src/locales/tr.json
index 42230c9272..c4f9a32793 100644
--- a/src/locales/tr.json
+++ b/src/locales/tr.json
@@ -1911,6 +1911,7 @@
"attach.retryAria": "{name} yüklemesini yeniden dene",
"attach.imageUnavailable": "Görsel kullanılamıyor",
"attach.imageOutsideWorkspace": "Bu görsel, bu sohbetin çalışma klasörünün dışında olduğu için burada gösterilemiyor",
+ "attach.previewOutsideWorkspace": "Bu dosya, bu sohbetin çalışma klasörünün dışında olduğu için burada açılamıyor",
"attach.previewImageAria": "Eklenen {name} resmini önizle",
"attach.externalHidden": "Harici resim gizlilik nedeniyle gizlendi",
"attach.savedTo": "{path} konumuna kaydedildi",
diff --git a/src/locales/uk.json b/src/locales/uk.json
index 3849ad539d..c9e7e3702a 100644
--- a/src/locales/uk.json
+++ b/src/locales/uk.json
@@ -1199,6 +1199,7 @@
"attach.retryAria": "Повторити завантаження {name}",
"attach.imageUnavailable": "Зображення недоступне",
"attach.imageOutsideWorkspace": "Це зображення поза робочою папкою цього чату, тому його не можна показати тут",
+ "attach.previewOutsideWorkspace": "Цей файл поза робочою папкою цього чату, тому його не можна відкрити тут",
"attach.previewImageAria": "Переглянути прикріплене зображення {name}",
"attach.externalHidden": "Зовнішнє зображення приховано заради приватності",
"attach.savedTo": "Збережено до {path}",
diff --git a/src/locales/vi.json b/src/locales/vi.json
index 161b6c03bd..265eb84cc1 100644
--- a/src/locales/vi.json
+++ b/src/locales/vi.json
@@ -1911,6 +1911,7 @@
"attach.retryAria": "Thử tải lại {name}",
"attach.imageUnavailable": "Hình ảnh không khả dụng",
"attach.imageOutsideWorkspace": "Hình ảnh này nằm ngoài thư mục làm việc của cuộc trò chuyện này, vì vậy không thể hiển thị ở đây",
+ "attach.previewOutsideWorkspace": "Tệp này nằm ngoài thư mục làm việc của cuộc trò chuyện này, vì vậy không thể mở ở đây",
"attach.previewImageAria": "Xem trước hình ảnh đính kèm {name}",
"attach.externalHidden": "Hình ảnh bên ngoài bị ẩn vì lý do quyền riêng tư",
"attach.savedTo": "Đã lưu vào {path}",
diff --git a/src/locales/zh-tw.json b/src/locales/zh-tw.json
index 8b68508886..607cab910c 100644
--- a/src/locales/zh-tw.json
+++ b/src/locales/zh-tw.json
@@ -2837,6 +2837,7 @@
"attach.retryAria": "重試載入 {name}",
"attach.imageUnavailable": "無法顯示圖片",
"attach.imageOutsideWorkspace": "這張圖片不在此聊天的工作資料夾中,因此無法在這裡顯示",
+ "attach.previewOutsideWorkspace": "這個檔案不在此聊天的工作資料夾中,因此無法在這裡開啟",
"attach.previewImageAria": "預覽附加的圖片 {name}",
"attach.externalHidden": "為保護隱私,已隱藏外部圖片",
"attach.savedTo": "已儲存至 {path}",
diff --git a/src/locales/zh.json b/src/locales/zh.json
index 0b2fcadaf9..3956259acd 100644
--- a/src/locales/zh.json
+++ b/src/locales/zh.json
@@ -2888,6 +2888,7 @@
"attach.retryAria": "重新加载 {name}",
"attach.imageUnavailable": "图片不可用",
"attach.imageOutsideWorkspace": "这张图片不在此聊天的工作文件夹中,因此无法在这里显示",
+ "attach.previewOutsideWorkspace": "该文件不在此聊天的工作文件夹中,因此无法在这里打开",
"attach.previewImageAria": "预览附件图片 {name}",
"attach.externalHidden": "出于隐私考虑,已隐藏外部图片",
"attach.savedTo": "已保存到 {path}",