Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(chat): start file manager for project links

vastsac3fd0a553fb7
diff --git a/apps/desktop/src/hooks/use-preview-target.ts b/apps/desktop/src/hooks/use-preview-target.ts
index 639c93d98..486e2f479 100644
--- a/apps/desktop/src/hooks/use-preview-target.ts
+++ b/apps/desktop/src/hooks/use-preview-target.ts
@@ -1,5 +1,6 @@
-import { useCallback, useMemo } from "react";
+import { useCallback } from "react";
import { useTranslation } from "react-i18next";
+import { isActiveInProject } from "@pi-desktop/shared";
import { useAppStore } from "../stores/app-store";
import { api } from "../lib/api";
import { isHtmlFilePath, toWorkspaceRel, type ChatPreviewTarget } from "../lib/chat-links";
@@ -79,6 +80,66 @@ export type ResolvedChatFileRef = {
primary: boolean;
};
+/**
+ * Load the bundled file view on demand when a user explicitly opens a project
+ * file. Its enabled state can be off or its runtime can have failed even though
+ * the app still ships the plugin; project scope and the recorded ui.view grant
+ * remain authoritative.
+ */
+const fileManagerViewLoads = new Map<string, Promise<boolean>>();
+
+async function ensureFileManagerView(workspacePath: string | null): Promise<boolean> {
+ const key = workspacePath ?? "";
+ const pending = fileManagerViewLoads.get(key);
+ if (pending) return pending;
+
+ const load = (async () => {
+ try {
+ const views = await api.listPluginViews();
+ useAppStore.setState({ pluginViews: views });
+ if (hasPluginView(views, FILE_MANAGER_PLUGIN_TAB)) return true;
+
+ const { plugins } = await api.listPlugins();
+ const fileManager = plugins.find(
+ (plugin) => plugin.id === FILE_MANAGER_PLUGIN_TAB.pluginId,
+ );
+ if (
+ !fileManager?.bundled ||
+ !fileManager.permissions.includes("ui.view") ||
+ useAppStore.getState().workspace?.path !== workspacePath ||
+ !isActiveInProject(
+ { ...fileManager, enabled: true },
+ workspacePath,
+ )
+ ) {
+ return false;
+ }
+
+ if (!fileManager.enabled) {
+ await api.enablePlugin(fileManager.id);
+ } else {
+ // The host can finish booting before the bundled plugin runtime has
+ // restored its view. Reloading here joins that gap and retries a failed
+ // startup without changing the user's scope or permission grants.
+ const result = await api.reloadPlugin(fileManager.id);
+ if (result.review) return false;
+ }
+
+ const refreshedViews = await api.listPluginViews();
+ useAppStore.setState({ pluginViews: refreshedViews });
+ return hasPluginView(refreshedViews, FILE_MANAGER_PLUGIN_TAB);
+ } catch {
+ return false;
+ }
+ })();
+ fileManagerViewLoads.set(key, load);
+ try {
+ return await load;
+ } finally {
+ if (fileManagerViewLoads.get(key) === load) fileManagerViewLoads.delete(key);
+ }
+}
+
function useResolveChatFileRef() {
const { t } = useTranslation();
const workspacePath = useAppStore((s) => s.workspace?.path ?? null);
@@ -142,25 +203,23 @@ function useResolveChatFileRef() {
* Open a file reference the conversation mentioned.
*
* A workspace `.html` page in the primary folder stays with the side browser
- * (ADR 0163): it is a page to run, not a file to read. A plain project file
- * opens in the bundled file view when available; a positioned `path:line`
- * reference uses the host file tab, which can scroll to the requested line.
+ * (ADR 0163): it is a page to run, not a file to read. A direct click on a
+ * plain project file starts or retries the bundled file view; a positioned
+ * `path:line` reference uses the host file tab, which can scroll to the line.
* The plugin view accepts opaque path locations and has no line-navigation
* contract, so positioned references keep their path unchanged and use the
* host viewer's existing scroll support. Scratch and attachment files also use
* the host file tab.
*/
export function useOpenChatFileRef() {
+ const { t } = useTranslation();
const resolveRef = useResolveChatFileRef();
- const pluginViews = useAppStore((s) => s.pluginViews);
+ const workspacePath = useAppStore((s) => s.workspace?.path ?? null);
+ const sessionId = useAppStore((s) => s.activeSessionId);
const openFile = useAppStore((s) => s.openFileInWorkPanel);
const openUrl = useAppStore((s) => s.openUrlInWorkPanel);
const openTab = useAppStore((s) => s.openWorkPanelTab);
-
- const fileViewAvailable = useMemo(
- () => hasPluginView(pluginViews, FILE_MANAGER_PLUGIN_TAB),
- [pluginViews],
- );
+ const showToast = useAppStore((s) => s.showToast);
return useCallback(
(
@@ -174,6 +233,13 @@ export function useOpenChatFileRef() {
void (async () => {
const resolved = await resolveRef(path, baseDir);
if (!resolved) return;
+ const current = useAppStore.getState();
+ if (
+ current.workspace?.path !== workspacePath ||
+ current.activeSessionId !== sessionId
+ ) {
+ return;
+ }
const hasPosition = line !== undefined || column !== undefined;
if (
!hasPosition &&
@@ -185,18 +251,40 @@ export function useOpenChatFileRef() {
openUrl(resolved.relativePath);
return;
}
- if (
- resolved.inProject &&
- fileViewAvailable &&
- !hasPosition
- ) {
- openTab(fileManagerPluginTab(resolved.path));
- return;
+ if (resolved.inProject && !hasPosition) {
+ if (await ensureFileManagerView(workspacePath)) {
+ const latest = useAppStore.getState();
+ if (
+ latest.workspace?.path !== workspacePath ||
+ latest.activeSessionId !== sessionId
+ ) {
+ return;
+ }
+ openTab(fileManagerPluginTab(resolved.path));
+ return;
+ }
+ const latest = useAppStore.getState();
+ if (
+ latest.workspace?.path !== workspacePath ||
+ latest.activeSessionId !== sessionId
+ ) {
+ return;
+ }
+ showToast(t("chat.fileManagerUnavailable"), { variant: "error" });
}
openFile(resolved.path, mimeType, { line, column });
})();
},
- [fileViewAvailable, openFile, openTab, openUrl, resolveRef],
+ [
+ openFile,
+ openTab,
+ openUrl,
+ resolveRef,
+ sessionId,
+ showToast,
+ t,
+ workspacePath,
+ ],
);
}
diff --git a/apps/desktop/test/chat-links.test.mjs b/apps/desktop/test/chat-links.test.mjs
index 02d071c58..de23dea29 100644
--- a/apps/desktop/test/chat-links.test.mjs
+++ b/apps/desktop/test/chat-links.test.mjs
@@ -216,6 +216,10 @@ test("resolvePreviewTarget classifies urls and workspace files", () => {
kind: "file",
path: "docs/README.md",
});
+ assert.deepEqual(resolvePreviewTarget("核查报告.md", ROOT), {
+ kind: "file",
+ path: "核查报告.md",
+ });
assert.deepEqual(resolvePreviewTarget(`${ROOT}/src/a.ts`, ROOT), {
kind: "file",
path: `${ROOT}/src/a.ts`,
@@ -742,6 +746,12 @@ test("markdown linkification encodes a Windows file path without losing its sour
assert.equal(uncLink.children[0].value, unc);
});
+test("a relative Unicode Markdown anchor reaches the local file opener", () => {
+ const markup = renderSanitizedMarkdown("[核查报告.md](核查报告.md)");
+ assert.match(markup, /<a href="[^"]+">核查报告\.md<\/a>/);
+ assertMarkdownLinkClick(markup, "核查报告.md");
+});
+
test("splitChatText keeps unknown extensions literal", () => {
assert.deepEqual(splitChatText("安装包.dmg 在下载目录", ROOT), [
{ kind: "text", text: "安装包.dmg 在下载目录" },
diff --git a/apps/desktop/test/tool-row-file-refs.test.mjs b/apps/desktop/test/tool-row-file-refs.test.mjs
index 6a1b0c19d..728fe28ca 100644
--- a/apps/desktop/test/tool-row-file-refs.test.mjs
+++ b/apps/desktop/test/tool-row-file-refs.test.mjs
@@ -41,7 +41,7 @@ function loadModule(relative, imports) {
return module.exports;
}
-const calls = { tabs: [], files: [], urls: [], toasts: [], resolved: [] };
+const calls = { tabs: [], files: [], urls: [], toasts: [], resolved: [], enabled: [], reloaded: [] };
/** The store the hook reads: mutable state plus recorded actions. */
const state = {
@@ -53,17 +53,34 @@ const state = {
openWorkPanelTab: (tab) => calls.tabs.push(tab),
showToast: (...args) => calls.toasts.push(args),
};
+const useAppStore = Object.assign((selector) => selector(state), {
+ getState: () => state,
+ setState: (patch) => Object.assign(state, patch),
+});
+
+let pluginSummary = {
+ id: "pi.file-manager",
+ bundled: true,
+ enabled: true,
+ status: "ready",
+ permissions: ["ui.view"],
+ scope: { mode: "global", projects: [] },
+};
+let listedPluginViews = [];
/** What the next `fs.resolveRef` reply is; each case sets it. */
let nextMatch = null;
let nextReason = null;
let resolveFails = false;
+let pluginOperationFails = false;
const workPanelTabs = loadModule("../src/lib/work-panel-tabs.ts", {});
+const shared = await import("@pi-desktop/shared");
const { useOpenPreviewTarget } = loadModule("../src/hooks/use-preview-target.ts", {
react: React,
"react-i18next": { useTranslation: () => ({ t: (key, values) => `${key}:${values?.name ?? ""}` }) },
- "../stores/app-store": { useAppStore: (selector) => selector(state) },
+ "@pi-desktop/shared": shared,
+ "../stores/app-store": { useAppStore },
"../lib/api": {
api: {
fsResolveRef: async (ref) => {
@@ -71,6 +88,21 @@ const { useOpenPreviewTarget } = loadModule("../src/hooks/use-preview-target.ts"
if (resolveFails) throw new Error("host unavailable");
return { match: nextMatch, ...(nextReason ? { reason: nextReason } : {}) };
},
+ listPlugins: async () => ({ plugins: [pluginSummary] }),
+ listPluginViews: async () => listedPluginViews,
+ enablePlugin: async (id) => {
+ calls.enabled.push(id);
+ if (pluginOperationFails) throw new Error("plugin start failed");
+ pluginSummary = { ...pluginSummary, enabled: true, status: "ready" };
+ listedPluginViews = [{ pluginId: id, viewId: "manager" }];
+ },
+ reloadPlugin: async (id) => {
+ calls.reloaded.push(id);
+ if (pluginOperationFails) throw new Error("plugin reload failed");
+ pluginSummary = { ...pluginSummary, status: "ready" };
+ listedPluginViews = [{ pluginId: id, viewId: "manager" }];
+ return {};
+ },
},
},
"../lib/chat-links": loadModule("../src/lib/chat-links.ts", {
@@ -94,6 +126,18 @@ function reset({ pluginView = false } = {}) {
nextMatch = null;
nextReason = null;
resolveFails = false;
+ pluginOperationFails = false;
+ pluginSummary = {
+ id: "pi.file-manager",
+ bundled: true,
+ enabled: true,
+ status: "ready",
+ permissions: ["ui.view"],
+ scope: { mode: "global", projects: [] },
+ };
+ listedPluginViews = pluginView
+ ? [{ pluginId: "pi.file-manager", viewId: "manager" }]
+ : [];
}
/**
@@ -113,6 +157,19 @@ async function click(target) {
await flush();
}
+async function clickTwice(target) {
+ let open = null;
+ function Harness() {
+ open = useOpenPreviewTarget();
+ return null;
+ }
+ renderToStaticMarkup(React.createElement(Harness));
+ assert.equal(typeof open, "function", "the hook returned a click handler");
+ open(target);
+ open(target);
+ await flush();
+}
+
/** The match the main process would report for a project file. */
function projectMatch(overrides = {}) {
return {
@@ -153,13 +210,86 @@ test("a Windows tool path reaches resolution intact and opens its exact project
assert.deepEqual(calls.toasts, []);
});
-test("without the file view a project file keeps falling back to the host file tab", async () => {
+test("a project file still falls back when the bundled manager is absent", async () => {
reset();
+ pluginSummary = { ...pluginSummary, bundled: false };
nextMatch = projectMatch();
await click({ kind: "file", path: "src/dir/a.ts" });
assert.deepEqual(calls.tabs, []);
assert.equal(calls.files.length, 1);
assert.equal(calls.files[0][0], "src/dir/a.ts");
+ assert.equal(calls.toasts[0][0], "chat.fileManagerUnavailable:");
+});
+
+test("a project file click enables the bundled file manager before opening it", async () => {
+ reset();
+ pluginSummary = { ...pluginSummary, enabled: false, status: "disabled" };
+ nextMatch = projectMatch();
+ await click({ kind: "file", path: "src/dir/a.ts" });
+ assert.deepEqual(calls.enabled, ["pi.file-manager"]);
+ assert.deepEqual(calls.tabs, [
+ {
+ id: "plugin:pi.file-manager/manager",
+ kind: "plugin",
+ resource: "pi.file-manager/manager",
+ location: "src/dir/a.ts",
+ },
+ ]);
+ assert.deepEqual(calls.files, []);
+});
+
+test("a project file click retries a bundled view missing during startup", async () => {
+ reset();
+ nextMatch = projectMatch();
+ await click({ kind: "file", path: "src/dir/a.ts" });
+ assert.deepEqual(calls.reloaded, ["pi.file-manager"]);
+ assert.equal(calls.tabs[0].resource, "pi.file-manager/manager");
+ assert.deepEqual(calls.files, []);
+});
+
+test("simultaneous file clicks share one bundled view startup", async () => {
+ reset();
+ nextMatch = projectMatch();
+ await clickTwice({ kind: "file", path: "src/dir/a.ts" });
+ assert.deepEqual(calls.reloaded, ["pi.file-manager"]);
+ assert.equal(calls.tabs.length, 2);
+});
+
+test("a project-scoped file manager is not enabled outside its selected projects", async () => {
+ reset();
+ pluginSummary = {
+ ...pluginSummary,
+ enabled: false,
+ status: "disabled",
+ scope: { mode: "projects", projects: ["C:/another-project"] },
+ };
+ nextMatch = projectMatch();
+ await click({ kind: "file", path: "src/dir/a.ts" });
+ assert.deepEqual(calls.enabled, []);
+ assert.equal(calls.files[0][0], "src/dir/a.ts");
+ assert.equal(calls.toasts[0][0], "chat.fileManagerUnavailable:");
+});
+
+test("a missing ui.view grant is not restored by a file click", async () => {
+ reset();
+ pluginSummary = { ...pluginSummary, enabled: false, status: "disabled", permissions: [] };
+ nextMatch = projectMatch();
+ await click({ kind: "file", path: "src/dir/a.ts" });
+ assert.deepEqual(calls.enabled, []);
+ assert.deepEqual(calls.reloaded, []);
+ assert.equal(calls.files[0][0], "src/dir/a.ts");
+ assert.equal(calls.toasts[0][0], "chat.fileManagerUnavailable:");
+});
+
+test("a failed file-manager start reports the fallback and opens the host viewer", async () => {
+ reset();
+ pluginSummary = { ...pluginSummary, enabled: false, status: "disabled" };
+ pluginOperationFails = true;
+ nextMatch = projectMatch();
+ await click({ kind: "file", path: "src/dir/a.ts" });
+ assert.deepEqual(calls.enabled, ["pi.file-manager"]);
+ assert.equal(calls.toasts[0][0], "chat.fileManagerUnavailable:");
+ assert.equal(calls.files[0][0], "src/dir/a.ts");
});
test("a scratch or attachment file a tool surface names opens on the host file tab", async () => {
diff --git a/apps/desktop/test/transcript-file-chips.test.mjs b/apps/desktop/test/transcript-file-chips.test.mjs
index 8d510060c..c1d4552fe 100644
--- a/apps/desktop/test/transcript-file-chips.test.mjs
+++ b/apps/desktop/test/transcript-file-chips.test.mjs
@@ -7,9 +7,17 @@ import { readFile } from "node:fs/promises";
import test from "node:test";
const read = (path) => readFile(new URL(path, import.meta.url), "utf8");
-const markdown = await read("../src/components/Markdown.tsx");
-const [transcript, styles, hook, api, toolDetails, toolRow, filesTab] = await Promise.all([
+const [
+ transcript,
+ styles,
+ hook,
+ api,
+ toolDetails,
+ toolRow,
+ filesTab,
+ markdown,
+] = await Promise.all([
readTranscriptSource(),
read("../src/styles/chat-links.css"),
read("../src/hooks/use-preview-target.ts"),
@@ -17,6 +25,7 @@ const [transcript, styles, hook, api, toolDetails, toolRow, filesTab] = await Pr
read("../src/components/ToolDetails.tsx"),
readTranscriptModule("ToolRow.tsx"),
read("../src/components/workpanel/FilesTab.tsx"),
+ read("../src/components/Markdown.tsx"),
]);
test("sent user-message file refs render as composer-like chips", () => {
@@ -49,9 +58,20 @@ test("a file chip is routed by where the reference resolved, never optimisticall
// Plain project files prefer the bundled file view. A path:line reference
// uses the host file tab because the bundled view has no line-navigation API.
assert.match(hook, /FILE_MANAGER_PLUGIN_TAB/);
+ const resolvedRefIndex = hook.indexOf("const resolved = await resolveRef(path, baseDir)");
+ const livePluginViewIndex = hook.indexOf("ensureFileManagerView(workspacePath)", resolvedRefIndex);
+ assert.ok(
+ livePluginViewIndex > resolvedRefIndex,
+ "actively ensure the bundled file view after async path resolution",
+ );
+ assert.match(hook, /api\.listPluginViews\(\)/);
+ assert.match(hook, /api\.enablePlugin\(fileManager\.id\)/);
+ assert.match(hook, /api\.reloadPlugin\(fileManager\.id\)/);
+ assert.match(hook, /isActiveInProject\(/);
+ assert.doesNotMatch(hook, /const pluginViews = useAppStore\(\(s\) => s\.pluginViews\)/);
assert.match(hook, /const hasPosition = line !== undefined \|\| column !== undefined/);
assert.match(hook, /!hasPosition[\s\S]*?isHtmlFilePath/);
- assert.match(hook, /!hasPosition[\s\S]*?fileViewAvailable/);
+ assert.match(hook, /!hasPosition[\s\S]*?ensureFileManagerView/);
assert.match(hook, /fileManagerPluginTab\(resolved\.path\)/);
assert.match(filesTab, /data-line=\{i \+ 1\}/);
assert.match(filesTab, /viewerBodyRef\.current\?\.querySelector/);
@@ -69,8 +89,12 @@ test("a file chip is routed by where the reference resolved, never optimisticall
assert.match(api, /fsOpen: \(path: string, mimeType\?: string\) =>\s*invoke\(IPC\.invoke\.fsOpen, \{ path, mimeType \}\)/);
});
-test("Markdown file anchors route clicks through the existing file opener", () => {
- assert.match(markdown, /handleMarkdownFileLinkClick\(e, href, root, baseDir, openFileRef\)/);
+test("Markdown file anchors use the same project-file opener as inline references", () => {
+ const anchorStart = markdown.indexOf("function Anchor(");
+ const imageStart = markdown.indexOf("/**\n * Local image references", anchorStart);
+ assert.ok(anchorStart >= 0 && imageStart > anchorStart);
+ const anchor = markdown.slice(anchorStart, imageStart);
+ assert.match(anchor, /handleMarkdownFileLinkClick\(e, href, root, baseDir, openFileRef\)/);
});
test("a tool row and a tool result row open a file where the message body does", () => {
diff --git a/docs/adr/0262-chat-file-refs-open-in-the-file-view.md b/docs/adr/0262-chat-file-refs-open-in-the-file-view.md
index 840af419a..f94bae795 100644
--- a/docs/adr/0262-chat-file-refs-open-in-the-file-view.md
+++ b/docs/adr/0262-chat-file-refs-open-in-the-file-view.md
@@ -57,8 +57,13 @@ work-panel tab already carries was honoured by main for `pi.browser` only.
host `file:` tab, because it lives outside that view's project root — see
point 4. A workspace `.html` / `.htm` file still opens in the side browser
(ADR 0163), for an agent reply and a user chip alike: it is a page to run,
- not a file to read. When the file view is not loaded, a project file falls
- back to the host `file:` tab, so the click never regresses to nothing.
+ not a file to read. A direct user click on a project file actively ensures
+ the bundled file view is running: an off plugin is enabled, and an enabled
+ plugin with no contributed view is reloaded before the tab opens. This click
+ is explicit intent to use the bundled view. The host does not restore a
+ missing `ui.view` grant or widen project scope; if either boundary excludes
+ the current project, or the plugin still cannot start, the host `file:` tab
+ opens with a notice.
3. **A contributed view's `location` stops being browser-only.** It travels as
the view entry URL's `piViewOpen` query parameter on creation — the only
channel that cannot race a document that has not run yet — and as the
@@ -90,9 +95,13 @@ work-panel tab already carries was honoured by main for `pi.browser` only.
distinguishable.
- The transcript's file surface is the same editable view the launcher offers,
so "show me that file" and "let me change it" are one surface.
-- The host now depends on a plugin version for a chat affordance. The fallback
- in point 2 bounds that dependency: an absent, disabled or older view degrades
- to the surface the click used before.
+- The host now depends on a plugin version for a chat affordance. A direct
+ project-file click starts or retries the bundled view before falling back;
+ missing permissions, an out-of-scope project, or a failed load still degrades
+ to the host `file:` tab and reports that the File Manager could not start.
+- A direct project-file click can re-enable the bundled plugin, because the
+ click is an explicit request to use it. The plugin's recorded permission
+ grants and project scope remain unchanged.
- The file view is no longer confined to the project root whenever, and only
when, the host asks it for a path the host itself picked. A defect in that
path handling is not caught by the host gateway; that is the same trust
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index 48e734ee8..25cc6b579 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -9002,17 +9002,18 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.
7. Click a conversation reference to `src/example.ts:42`. Confirm the host
`file:` tab opens at line 42 even though the File Manager plugin is enabled.
8. Disable the File Manager plugin. Confirm the view disappears from the menu
- and the panel, and that a clicked conversation file path falls back to the
- host `file:<path>` tab under Open resources.
- 9. Re-enable it, then restart the app. Confirm the enabled state and the tree
- return, and that the registry did not gain a duplicate row.
+ and the panel. Click a project file path in the conversation; the host
+ should enable the bundled plugin and open that file in its view.
+ 9. Restart the app. Confirm the enabled state and the tree return, and that
+ the registry did not gain a duplicate row.
- **Expected**: A panel surface runs entirely on the public plugin contribution
channel, is user-disableable, cannot be uninstalled, and survives restart. Its
host-mediated actions obey the declared `fs.read` scope, and its own reads and
writes stay inside the jail of the one project folder it is browsing
- (ADR 0241, ADR 0263). Plain project-file links open in the bundled view; a
- positioned `path:line` reference opens the host file tab and scrolls the
- requested line even while the plugin view is available.
+ (ADR 0241, ADR 0263). Plain project-file links open in the bundled view,
+ bringing it up on demand after a direct click when its scope and permission
+ allow it; a positioned `path:line` reference opens the host file tab and
+ scrolls the requested line even while the plugin view is available.
- **Specs linked**: `07-plugins/03-plugin-api.md` §3,
`07-plugins/13-plugin-permissions-matrix.md` §2,
`04-ux/08-component-spec.md` §5, ADR 0104, ADR 0109, ADR 0111,
@@ -12892,12 +12893,14 @@ are withdrawn with ADR 0165.
- **Preconditions**: An Agent session in a workspace that contains
`apps/desktop/src/App.tsx`, `docs/adr/0163-transcript-file-reference-chips.md`,
- `docs/spec/00-baseline.md`, and a Unicode-named file such as `报告.pdf`.
+ `docs/spec/00-baseline.md`, `核查报告.md`, and a Unicode-named file such as
+ `报告.pdf`.
- **Steps**: 1) Open an existing session whose transcript already contains
assistant markdown. 2) Prompt a turn whose assistant reply mentions
`apps/desktop/src/App.tsx` as a bare path, as inline code, a Unicode path such
- as `报告.pdf`, and as a markdown link. 3) Click each. 4) Open the ADR markdown
- file in the work-panel files viewer and click a `../spec/00-baseline.md` link.
+ as `报告.pdf`, and as a markdown link; also include
+ `[核查报告.md](核查报告.md)`. 3) Click each. 4) Open the ADR markdown file
+ in the work-panel files viewer and click a `../spec/00-baseline.md` link.
5) Include an absolute path under the workspace, an outside absolute path,
and a `~/` path in chat; confirm only the under-root path becomes a target.
6) Send a user message `使用llama.cpp,给我迁移步骤,只读。`, then a user
@@ -12911,6 +12914,8 @@ are withdrawn with ADR 0165.
- Each chat path opens `apps/desktop/src/App.tsx` in the File Manager
work-panel view — the file view a chat click prefers — not a host `file:`
tab.
+ - Clicking `[核查报告.md](核查报告.md)` in the assistant reply opens that
+ project Markdown file in the File Manager work-panel view.
- Unicode filenames and multi-segment paths inside the workspace become
targets, while an outside absolute path and a `~/` path stay plain text.
- An absolute path under the workspace resolves to its workspace-relative
diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.ts
index 9b8aa2a76..b23f8a778 100644
--- a/packages/i18n/src/locales/de/index.ts
+++ b/packages/i18n/src/locales/de/index.ts
@@ -352,6 +352,7 @@ export const de = {
"fileRefMissing": "Keine Datei entspricht {{name}}",
"fileRefRestricted": "{{name}} liegt außerhalb der für die App zugänglichen Orte",
"fileRefLookupFailed": "Dieser Dateiverweis konnte nicht geprüft werden.",
+ "fileManagerUnavailable": "Der Dateimanager ist nicht verfügbar. Die Datei wurde im integrierten Viewer geöffnet.",
"revealFileInFolder": "Im Ordner anzeigen",
"fileRevealFailed": "Die Datei konnte nicht im Ordner angezeigt werden.",
"copyFullPath": "Vollständigen Pfad kopieren",
diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.ts
index dfcdf9314..83a039ba0 100644
--- a/packages/i18n/src/locales/en/index.ts
+++ b/packages/i18n/src/locales/en/index.ts
@@ -367,6 +367,7 @@ export const en = {
fileRefMissing: "No file matches {{name}}",
fileRefRestricted: "{{name}} is outside the locations this app can access",
fileRefLookupFailed: "Could not check this file reference.",
+ fileManagerUnavailable: "The File Manager is unavailable. The file was opened in the built-in viewer.",
revealFileInFolder: "Show in folder",
fileRevealFailed: "Could not show the file in its folder.",
copyFullPath: "Copy full path",
diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.ts
index 6114667db..2b33fcefa 100644
--- a/packages/i18n/src/locales/es/index.ts
+++ b/packages/i18n/src/locales/es/index.ts
@@ -352,6 +352,7 @@ export const es = {
"fileRefMissing": "Ningún archivo coincide con {{name}}",
"fileRefRestricted": "{{name}} está fuera de las ubicaciones a las que puede acceder la aplicación",
"fileRefLookupFailed": "No se pudo comprobar esta referencia de archivo.",
+ "fileManagerUnavailable": "El administrador de archivos no está disponible. El archivo se abrió en el visor integrado.",
"revealFileInFolder": "Mostrar en carpeta",
"fileRevealFailed": "No se pudo mostrar el archivo en su carpeta.",
"copyFullPath": "Copiar ruta completa",
diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.ts
index 7644ccfd3..b611ce20c 100644
--- a/packages/i18n/src/locales/fr/index.ts
+++ b/packages/i18n/src/locales/fr/index.ts
@@ -352,6 +352,7 @@ export const fr = {
"fileRefMissing": "Aucun fichier ne correspond à {{name}}",
"fileRefRestricted": "{{name}} se trouve hors des emplacements accessibles à l'application",
"fileRefLookupFailed": "Impossible de vérifier cette référence de fichier.",
+ "fileManagerUnavailable": "Le gestionnaire de fichiers est indisponible. Le fichier a été ouvert dans le lecteur intégré.",
"revealFileInFolder": "Afficher dans le dossier",
"fileRevealFailed": "Impossible d'afficher le fichier dans son dossier.",
"copyFullPath": "Copier le chemin complet",
diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.ts
index 378a0ed44..27ac89a52 100644
--- a/packages/i18n/src/locales/ko/index.ts
+++ b/packages/i18n/src/locales/ko/index.ts
@@ -364,6 +364,7 @@ export const ko = {
fileRefMissing: "{{name}}과(와) 일치하는 파일이 없습니다",
fileRefRestricted: "{{name}}은(는) 앱이 접근할 수 있는 위치 밖에 있습니다",
fileRefLookupFailed: "이 파일 참조를 확인할 수 없습니다.",
+ fileManagerUnavailable: "파일 관리자를 사용할 수 없어 내장 파일 보기에서 열었습니다.",
revealFileInFolder: "폴더에서 보기",
fileRevealFailed: "폴더에서 파일을 표시할 수 없습니다.",
copyFullPath: "전체 경로 복사",
diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.ts
index 111d9ce7a..532b65103 100644
--- a/packages/i18n/src/locales/pt-BR/index.ts
+++ b/packages/i18n/src/locales/pt-BR/index.ts
@@ -353,6 +353,7 @@ export const ptBR = {
fileRefMissing: "Nenhum arquivo corresponde a {{name}}",
fileRefRestricted: "{{name}} está fora dos locais que o aplicativo pode acessar",
fileRefLookupFailed: "Não foi possível verificar esta referência de arquivo.",
+ fileManagerUnavailable: "O gerenciador de arquivos está indisponível. O arquivo foi aberto no visualizador integrado.",
revealFileInFolder: "Mostrar na pasta",
fileRevealFailed: "Não foi possível mostrar o arquivo na pasta.",
copyFullPath: "Copiar caminho completo",
diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.ts
index 50345e407..771f6629b 100644
--- a/packages/i18n/src/locales/tr/index.ts
+++ b/packages/i18n/src/locales/tr/index.ts
@@ -364,6 +364,7 @@ export const tr = {
fileRefMissing: "{{name}} ile eşleşen dosya yok",
fileRefRestricted: "{{name}} uygulamanın erişebildiği konumların dışında",
fileRefLookupFailed: "Bu dosya başvurusu denetlenemedi.",
+ fileManagerUnavailable: "Dosya yöneticisi kullanılamıyor. Dosya yerleşik görüntüleyicide açıldı.",
revealFileInFolder: "Klasörde göster",
fileRevealFailed: "Dosya klasörde gösterilemedi.",
copyFullPath: "Tam yolu kopyala",
diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.ts
index 6687edca9..3d53f20ec 100644
--- a/packages/i18n/src/locales/zh-CN/index.ts
+++ b/packages/i18n/src/locales/zh-CN/index.ts
@@ -356,6 +356,7 @@ export const zhCN = {
fileRefMissing: "没有匹配 {{name}} 的文件",
fileRefRestricted: "{{name}} 不在应用允许访问的范围内",
fileRefLookupFailed: "无法检查此文件引用。",
+ fileManagerUnavailable: "文件管理器当前不可用,已在内置文件查看器中打开。",
revealFileInFolder: "在文件夹中显示",
fileRevealFailed: "无法在文件夹中打开该文件。",
copyFullPath: "复制完整地址",
diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.ts
index cab7ab144..0f6c91790 100644
--- a/packages/i18n/src/locales/zh-TW/index.ts
+++ b/packages/i18n/src/locales/zh-TW/index.ts
@@ -356,6 +356,7 @@ export const zhTW = {
fileRefMissing: "沒有匹配 {{name}} 的檔案",
fileRefRestricted: "{{name}} 不在應用程式允許存取的範圍內",
fileRefLookupFailed: "無法檢查此檔案參照。",
+ fileManagerUnavailable: "檔案管理器目前無法使用,已在內建檔案檢視器中開啟。",
revealFileInFolder: "在資料夾中顯示",
fileRevealFailed: "無法在資料夾中開啟該檔案。",
copyFullPath: "複製完整位址",