Skip to content

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

feat(work-panel): retain a File Manager entry across project sessions

v_wyxgwang9cd193fc0d6c
diff --git a/apps/desktop/src/lib/project-file-manager-tab.ts b/apps/desktop/src/lib/project-file-manager-tab.ts
new file mode 100644
index 000000000..e3075a6e9
--- /dev/null
+++ b/apps/desktop/src/lib/project-file-manager-tab.ts
@@ -0,0 +1,36 @@
+import type { SessionSummary } from "@pi-desktop/shared";
+import type { AppState } from "../stores/app-state";
+import { isRemoteSession } from "./remote-session-safety.ts";
+import { normalizeProjectPath } from "./sidebar-session-groups.ts";
+import { FILE_MANAGER_PLUGIN_TAB, hasPluginView, pluginWorkPanelTab, type WorkPanelContext, type WorkPanelTab } from "./work-panel-tabs.ts";
+
+const entry = pluginWorkPanelTab(FILE_MANAGER_PLUGIN_TAB.pluginId, FILE_MANAGER_PLUGIN_TAB.viewId);
+type Defaults = Pick<AppState, "fileManagerProjects" | "fileManagerTabReceipts">;
+
+function projectKey(session?: SessionSummary) {
+ return isRemoteSession(session) ? null : normalizeProjectPath(session?.projectPath);
+}
+
+/** Opening a view opts its project in; closing tabs never changes that decision. */
+export function recordFileManagerOpen(state: AppState, sessionId: string, tab: WorkPanelTab): Partial<Defaults> {
+ if (tab.id !== entry.id) return {};
+ const key = projectKey(state.sessions.find((session) => session.id === sessionId));
+ if (!key || state.fileManagerTabReceipts[sessionId] === key) return {};
+ return {
+ fileManagerProjects: state.fileManagerProjects.has(key) ? state.fileManagerProjects : new Set([...state.fileManagerProjects, key]),
+ fileManagerTabReceipts: { ...state.fileManagerTabReceipts, [sessionId]: key },
+ };
+}
+
+/** A session receives a plain entry once, never the originating file location. */
+export function receiveFileManagerEntry(state: AppState, session: SessionSummary | undefined, context: WorkPanelContext) {
+ const key = projectKey(session);
+ if (!session || !key || !state.fileManagerProjects.has(key) || state.fileManagerTabReceipts[session.id] === key ||
+ !hasPluginView(state.pluginViews, FILE_MANAGER_PLUGIN_TAB)) return null;
+ return {
+ context: context.tabs.some((tab) => tab.id === entry.id) ? context : {
+ ...context, tabs: [...context.tabs, entry], activeTabId: context.activeTabId ?? entry.id,
+ },
+ receipts: { ...state.fileManagerTabReceipts, [session.id]: key },
+ };
+}
diff --git a/apps/desktop/src/stores/app-state.ts b/apps/desktop/src/stores/app-state.ts
index fb96f0741..c58d528ee 100644
--- a/apps/desktop/src/stores/app-state.ts
+++ b/apps/desktop/src/stores/app-state.ts
@@ -410,6 +410,9 @@ export type AppState = {
activeWorkPanelTabId: string | null;
/** Runtime-only work panel state owned by each conversation. */
workPanelContexts: Record<string, WorkPanelContext>;
+ /** Runtime-only opt-in, and the last project whose entry each session received. */
+ fileManagerProjects: ReadonlySet<string>;
+ fileManagerTabReceipts: Record<string, string>;
/** The user's preferred panel width; persisted, never below the regular minimum. */
workPanelWidth: number;
/**
diff --git a/apps/desktop/src/stores/runtime/session-coordination.ts b/apps/desktop/src/stores/runtime/session-coordination.ts
index 1b08a94c6..0970c9a0c 100644
--- a/apps/desktop/src/stores/runtime/session-coordination.ts
+++ b/apps/desktop/src/stores/runtime/session-coordination.ts
@@ -192,7 +192,7 @@ export function createSessionCoordination({
};
if (!commit.activated) return shared;
return {
- ...switchWorkPanelSession(current, summary.id),
+ ...switchWorkPanelSession(current, summary.id, summary),
...shared,
...retainSessionPane(current, summary.id, messages),
activeSessionId: summary.id,
@@ -256,7 +256,7 @@ export function createSessionCoordination({
};
if (!commit.activated) return shared;
return {
- ...switchWorkPanelSession(current, summary.id),
+ ...switchWorkPanelSession(current, summary.id, summary),
...shared,
...retainSessionPane(current, summary.id, messages),
activeSessionId: summary.id,
diff --git a/apps/desktop/src/stores/slices/catalog-slice.ts b/apps/desktop/src/stores/slices/catalog-slice.ts
index 9a6291d3b..6cff37340 100644
--- a/apps/desktop/src/stores/slices/catalog-slice.ts
+++ b/apps/desktop/src/stores/slices/catalog-slice.ts
@@ -1,3 +1,5 @@
+import { currentWorkPanelContext } from "./work-panel-slice";
+import { receiveFileManagerEntry } from "../../lib/project-file-manager-tab";
import { rememberModelInList, saveRecentModels } from "../../lib/recent-models";
import type {
AppNotification,
@@ -208,7 +210,18 @@ export function createCatalogSlice({
try {
const pluginViews = await api.listPluginViews();
if (pluginViewRefresh !== request || get().activeProjectPath !== projectPath) return;
- set({ pluginViews });
+ const state = get();
+ const id = state.activeSessionId;
+ const context = id ? (state.workPanelContexts[id] ?? currentWorkPanelContext(state)) : null;
+ const received = context && (!state.selectingSessionId || state.selectingSessionId === id)
+ ? receiveFileManagerEntry({ ...state, pluginViews }, state.sessions.find((s) => s.id === id), context)
+ : null;
+ set({ pluginViews, ...(received && id ? {
+ fileManagerTabReceipts: received.receipts,
+ workPanelContexts: { ...state.workPanelContexts, [id]: received.context },
+ workPanelTabs: received.context.tabs,
+ activeWorkPanelTabId: received.context.activeTabId,
+ } : {}) });
} catch {
if (pluginViewRefresh === request && get().activeProjectPath === projectPath) {
set({ pluginViews: [] });
diff --git a/apps/desktop/src/stores/slices/initial-state.ts b/apps/desktop/src/stores/slices/initial-state.ts
index 256f09f9a..b68606f39 100644
--- a/apps/desktop/src/stores/slices/initial-state.ts
+++ b/apps/desktop/src/stores/slices/initial-state.ts
@@ -49,6 +49,8 @@ export function createInitialState(): AppStateData {
workPanelTabs: [],
activeWorkPanelTabId: null,
workPanelContexts: {},
+ fileManagerProjects: new Set(),
+ fileManagerTabReceipts: {},
workPanelWidth: initialWorkPanelWidth,
workPanelYieldedWidth: null,
workPanelFileRequest: null,
diff --git a/apps/desktop/src/stores/slices/project-slice.ts b/apps/desktop/src/stores/slices/project-slice.ts
index 7e168e7a3..78015f80f 100644
--- a/apps/desktop/src/stores/slices/project-slice.ts
+++ b/apps/desktop/src/stores/slices/project-slice.ts
@@ -170,7 +170,6 @@ function clearLocalSessionState(
const sessionOutcomes = { ...state.sessionOutcomes };
delete sessionOutcomes[id];
const queuedPrompts = withoutRecordKey(state.queuedPrompts, id);
- const workPanelContexts = withoutRecordKey(state.workPanelContexts, id);
const pendingPermissions = clearSessionPermissions(
state.pendingPermissions,
id,
@@ -196,7 +195,8 @@ function clearLocalSessionState(
agentStatuses,
sessionOutcomes,
queuedPrompts,
- workPanelContexts,
+ workPanelContexts: withoutRecordKey(state.workPanelContexts, id),
+ fileManagerTabReceipts: withoutRecordKey(state.fileManagerTabReceipts, id),
activeSessionId:
state.activeSessionId === id ? undefined : state.activeSessionId,
selectingSessionId:
diff --git a/apps/desktop/src/stores/slices/work-panel-slice.ts b/apps/desktop/src/stores/slices/work-panel-slice.ts
index 3da354efb..3c94f5bb7 100644
--- a/apps/desktop/src/stores/slices/work-panel-slice.ts
+++ b/apps/desktop/src/stores/slices/work-panel-slice.ts
@@ -1,3 +1,5 @@
+import type { SessionSummary } from "@pi-desktop/shared";
+import { receiveFileManagerEntry, recordFileManagerOpen } from "../../lib/project-file-manager-tab";
import { api } from "../../lib/api";
import { isRemoteSession } from "../../lib/remote-session-safety";
import {
@@ -70,8 +72,10 @@ export function currentWorkPanelContext(state: AppState): WorkPanelContext {
export function switchWorkPanelSession(
state: AppState,
nextSessionId?: string,
+ createdSession?: SessionSummary,
): Pick<
AppState,
+ | "fileManagerTabReceipts"
| "workPanelContexts"
| "workPanelOpen"
| "workPanelTabs"
@@ -84,12 +88,16 @@ export function switchWorkPanelSession(
currentWorkPanelContext(state),
nextSessionId,
);
+ const session = createdSession ?? state.sessions.find((item) => item.id === nextSessionId);
+ const received = receiveFileManagerEntry(state, session, switched.visible);
+ const visible = received?.context ?? switched.visible;
return {
- workPanelContexts: switched.contexts,
- workPanelOpen: switched.visible.open,
- workPanelTabs: switched.visible.tabs,
- activeWorkPanelTabId: switched.visible.activeTabId,
- workPanelFileRequest: switched.visible.fileRequest,
+ fileManagerTabReceipts: received?.receipts ?? state.fileManagerTabReceipts,
+ workPanelContexts: received && nextSessionId ? { ...switched.contexts, [nextSessionId]: visible } : switched.contexts,
+ workPanelOpen: visible.open,
+ workPanelTabs: visible.tabs,
+ activeWorkPanelTabId: visible.activeTabId,
+ workPanelFileRequest: visible.fileRequest,
};
}
@@ -189,6 +197,7 @@ export function createWorkPanelSlice({
fileRequest,
};
return {
+ ...recordFileManagerOpen(state, sessionId, tab),
workPanelContexts: {
...state.workPanelContexts,
[sessionId]: nextContext,
@@ -236,6 +245,7 @@ export function createWorkPanelSlice({
fileRequest,
};
return {
+ ...recordFileManagerOpen(state, sessionId, tab),
workPanelOpen: true,
workPanelTabs: next.tabs,
activeWorkPanelTabId: next.activeTabId,
diff --git a/apps/desktop/test/browser-tab-restore.test.mjs b/apps/desktop/test/browser-tab-restore.test.mjs
index 79363e2d1..7b0559cfd 100644
--- a/apps/desktop/test/browser-tab-restore.test.mjs
+++ b/apps/desktop/test/browser-tab-restore.test.mjs
@@ -3,6 +3,7 @@ import { readFileSync } from "node:fs";
import test from "node:test";
import ts from "typescript";
import * as workPanelResize from "../src/lib/work-panel-resize.ts";
+import * as fileManagerDefaults from "../src/lib/project-file-manager-tab.ts";
import * as workPanelTabs from "../src/lib/work-panel-tabs.ts";
const { outputText } = ts.transpileModule(readFileSync(new URL("../src/stores/slices/work-panel-slice.ts", import.meta.url), "utf8"), {
@@ -19,6 +20,7 @@ const imports = {
},
"../../lib/remote-session-safety": { isRemoteSession: () => false },
"../../lib/work-panel-tabs": workPanelTabs,
+ "../../lib/project-file-manager-tab": fileManagerDefaults,
"../../lib/work-panel-resize": workPanelResize,
};
const module = { exports: {} };
diff --git a/apps/desktop/test/project-file-manager-tab.test.mjs b/apps/desktop/test/project-file-manager-tab.test.mjs
new file mode 100644
index 000000000..dffc9ef56
--- /dev/null
+++ b/apps/desktop/test/project-file-manager-tab.test.mjs
@@ -0,0 +1,74 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { register } from "node:module";
+import * as tabs from "../src/lib/work-panel-tabs.ts";
+
+register(new URL("./helpers/ts-import-hooks.mjs", import.meta.url));
+const { createWorkPanelSlice, switchWorkPanelSession } = await import("../src/stores/slices/work-panel-slice.ts");
+const { createCatalogSlice } = await import("../src/stores/slices/catalog-slice.ts");
+const { api } = await import("../src/lib/api.ts");
+const view = tabs.FILE_MANAGER_PLUGIN_TAB;
+const manager = tabs.pluginWorkPanelTab(view.pluginId, view.viewId);
+const session = (id, projectPath, source) => ({ id, projectPath, source });
+function setup() {
+ let state = { activeSessionId: "B", workPanelOpen: false, activeWorkPanelTabId: null,
+ workPanelTabs: [], workPanelContexts: {}, workPanelFileRequest: null, pluginViews: [view],
+ fileManagerProjects: new Set(), fileManagerTabReceipts: {},
+ sessions: [session("A", "/project"), session("B", "/project/"), session("D", "/other"), session("T"), session("R", "/project", "remote")],
+ };
+ const get = () => state;
+ const set = (value) => { state = { ...state, ...(typeof value === "function" ? value(state) : value) }; };
+ Object.assign(state, createWorkPanelSlice({ get, set, isSessionSelectionPending: () => false }));
+ const select = (id, created) => set({ ...switchWorkPanelSession(state, id, created), activeSessionId: id,
+ ...(created ? { sessions: [...state.sessions, created] } : {}) });
+ return { get, set, select };
+}
+
+test("a project gets a plain File Manager entry once per session, not a shared dock or file location", () => {
+ const { get, select } = setup();
+ get().openWorkPanelTab(tabs.toolWorkPanelTab("review"));
+ get().collapseWorkPanel();
+ select("A");
+ get().openNewWorkPanelTab();
+ get().replaceWorkPanelTab(get().activeWorkPanelTabId, tabs.fileManagerPluginTab("private-in-A.txt"));
+ select("B");
+ assert.deepEqual(get().workPanelTabs, [tabs.toolWorkPanelTab("review"), manager]);
+ assert.equal(get().workPanelOpen, false);
+ assert.equal(get().activeWorkPanelTabId, "review");
+ get().openWorkPanel();
+ get().activateWorkPanelTab(manager.id);
+ select("A");
+ get().closeAllWorkPanelTabs();
+ select("B");
+ assert.equal(get().activeWorkPanelTabId, manager.id);
+ assert.equal(get().workPanelOpen, true);
+ get().closeOtherWorkPanelTabs("review");
+ select("A");
+ assert.deepEqual(get().workPanelTabs, []);
+ select("C", session("C", "/project"));
+ assert.deepEqual(get().workPanelTabs, [manager]);
+ assert.equal(get().workPanelOpen, false);
+ for (const id of ["D", "T", "R", "A"]) {
+ select(id);
+ assert.deepEqual(get().workPanelTabs, []);
+ }
+ get().openWorkPanelTab(manager);
+ get().openWorkPanelTab(manager);
+ assert.deepEqual(get().workPanelTabs, [manager]);
+ select("B");
+ assert.deepEqual(get().workPanelTabs, [tabs.toolWorkPanelTab("review")]);
+});
+
+test("a direct file reveal enables the default, but a late catalog seeds only when the view is available", async (t) => {
+ const { get, set, select } = setup();
+ get().openWorkPanelTab(tabs.fileManagerPluginTab("README.md"));
+ set({ pluginViews: [] });
+ select("A");
+ assert.deepEqual(get().workPanelTabs, []);
+ t.mock.method(api, "listPluginViews", async () => [view]);
+ await createCatalogSlice({ get, set }).refreshPluginViews();
+ assert.deepEqual(get().workPanelTabs, [manager]);
+ get().closeWorkPanelTab(manager.id);
+ select("B"); select("A");
+ assert.deepEqual(get().workPanelTabs, []);
+});
diff --git a/apps/desktop/test/work-panel-width-preference.test.mjs b/apps/desktop/test/work-panel-width-preference.test.mjs
index f285312e7..ccf2b0633 100644
--- a/apps/desktop/test/work-panel-width-preference.test.mjs
+++ b/apps/desktop/test/work-panel-width-preference.test.mjs
@@ -3,6 +3,7 @@ import { readFileSync } from "node:fs";
import test from "node:test";
import ts from "typescript";
import * as workPanelResize from "../src/lib/work-panel-resize.ts";
+import * as fileManagerDefaults from "../src/lib/project-file-manager-tab.ts";
import * as workPanelTabs from "../src/lib/work-panel-tabs.ts";
const STORAGE_KEY = "pi.desktop.workPanel";
@@ -22,6 +23,7 @@ function loadSlice() {
"../../lib/api": { api: {} },
"../../lib/remote-session-safety": { isRemoteSession: () => false },
"../../lib/work-panel-tabs": workPanelTabs,
+ "../../lib/project-file-manager-tab": fileManagerDefaults,
"../../lib/work-panel-resize": workPanelResize,
};
const module = { exports: {} };
diff --git a/docs/spec/04-ux/09-interaction-patterns.md b/docs/spec/04-ux/09-interaction-patterns.md
index 88fa255a4..1160ce260 100644
--- a/docs/spec/04-ux/09-interaction-patterns.md
+++ b/docs/spec/04-ux/09-interaction-patterns.md
@@ -553,6 +553,13 @@ may be retained while exactly one workspace supplies the visible shell context.
### 1.8 Work panel entry and resources (D128, D142, D154, D173, D179, D207, D221)
+- Opening the bundled File Manager opts the project into a default tab for this
+ renderer lifetime. Each existing or new local project session receives one plain
+ entry, without opening its dock, replacing a selection, or copying a file location.
+ Closing that entry (including bulk close) opts out only that session until it
+ reopens the view itself. Closing the last tab does not reset the project default.
+ Temporary sessions, remote sessions, and other projects do not inherit the tab.
+
- The shell starts without a visible work panel. The viewport-fixed toggle and
`Cmd/Ctrl + J` both toggle the active session's panel: they reveal the
retained context without creating a resource tab, and collapse the visible
diff --git a/docs/spec/06-delivery/e2e/ui-shell.md b/docs/spec/06-delivery/e2e/ui-shell.md
index 70ad886f4..7772f0a00 100644
--- a/docs/spec/06-delivery/e2e/ui-shell.md
+++ b/docs/spec/06-delivery/e2e/ui-shell.md
@@ -3,6 +3,16 @@
> Part of the [E2E test plan](../04-e2e-test-plan.md). Visual shell scenarios (US-UI), sidebar, settings, task dock, and work panel.
> Scenario template, gates, and traceability live in the plan.
+## E2E-PROJECT-FILE-MANAGER-TAB — A shared entry without a shared dock (#2607)
+
+- Leave Review selected and the dock collapsed in B. Open File Manager from the
+ launcher in same-project A. Return to B: the dock stays collapsed; expanding it
+ shows both tabs with Review still selected. No second launcher pick is needed.
+- Close the entry locally and switch twice: it stays closed there, not elsewhere.
+ Close the final entry in A. A fresh same-project C still gets the tab with a
+ collapsed dock; a session in another project does not.
+- Automated path: `node scripts/e2e-project-file-manager-tab.mjs`.
+
## E2E-SIDEBAR-upgrade-layout-recovery
- In an isolated profile, retain two synthetic Projects and organize metadata.
diff --git a/packages/shared/src/changelog-de.ts b/packages/shared/src/changelog-de.ts
index 58dd4b131..a45fa478b 100644
--- a/packages/shared/src/changelog-de.ts
+++ b/packages/shared/src/changelog-de.ts
@@ -5,6 +5,7 @@ export const deEntries: ChangelogEntry[] = [
version: "0.24.0",
date: "2026-11-24",
highlights: [
+ "Nach dem ersten Öffnen ist der Dateimanager als Tab in anderen Sitzungen desselben Projekts verfügbar. Das Schließen des Tabs und das Öffnen der Seitenleiste betreffen nur die aktuelle Sitzung.",
"Zeilenumbrüche im Eingabefeld erzeugen keine zusätzlichen Leerzeilen oder unsichtbaren Zeichen mehr. Rückgängig stellt eine gelöschte leere Schlusszeile wieder her.",
"Im /-Menü ausgewählte Skills erscheinen als einzelne Chips im Eingabefeld.",
"Bearbeite integrierte Rollen und Skills in den Moduseinstellungen, organisiere private Agent-Rollen und begrenze delegierte Aufgaben auf benötigte Werkzeuge und Dateien.",
diff --git a/packages/shared/src/changelog-en.ts b/packages/shared/src/changelog-en.ts
index d4ef4989d..68435d317 100644
--- a/packages/shared/src/changelog-en.ts
+++ b/packages/shared/src/changelog-en.ts
@@ -5,6 +5,7 @@ export const enEntries: ChangelogEntry[] = [
version: "0.24.0",
date: "2026-11-24",
highlights: [
+ "Open File Manager once to add its tab to other sessions in the same project. Closing it or opening the dock only affects the current session.",
"Composer line breaks no longer add phantom lines or characters, and undo restores a deleted empty last line.",
"Skills selected from the / menu appear as individual chips in the composer.",
"Edit bundled role and skill definitions in Modes, organize private agent roles, and scope delegated work to the tools and files each role needs.",
diff --git a/packages/shared/src/changelog-es.ts b/packages/shared/src/changelog-es.ts
index 7c95d6af0..d69d0e910 100644
--- a/packages/shared/src/changelog-es.ts
+++ b/packages/shared/src/changelog-es.ts
@@ -5,6 +5,7 @@ export const esEntries: ChangelogEntry[] = [
version: "0.24.0",
date: "2026-11-24",
highlights: [
+ "Abre el gestor de archivos una vez para añadir su pestaña a las demás sesiones del proyecto. Cerrar la pestaña o abrir el panel lateral solo afecta a la sesión actual.",
"Los saltos de línea ya no añaden líneas ni caracteres invisibles de más. Deshacer restaura la última línea vacía eliminada.",
"Las habilidades seleccionadas en el menú / aparecen como etiquetas individuales en el editor.",
"Edita los roles y las habilidades incluidos en los ajustes de Modos, organiza roles privados de agente y limita las tareas delegadas a las herramientas y archivos necesarios.",
diff --git a/packages/shared/src/changelog-fr.ts b/packages/shared/src/changelog-fr.ts
index 473e535c3..c1fd4d84b 100644
--- a/packages/shared/src/changelog-fr.ts
+++ b/packages/shared/src/changelog-fr.ts
@@ -5,6 +5,7 @@ export const frEntries: ChangelogEntry[] = [
version: "0.24.0",
date: "2026-11-24",
highlights: [
+ "Ouvrez le gestionnaire de fichiers une fois pour ajouter son onglet aux autres sessions du projet. Fermer cet onglet ou ouvrir le panneau latéral ne concerne que la session en cours.",
"Les sauts de ligne ne créent plus de lignes vides ni de caractères invisibles en trop. Annuler restaure une dernière ligne vide supprimée.",
"Les compétences choisies dans le menu / apparaissent sous forme de pastilles dans le champ de saisie.",
"Modifiez les rôles et compétences intégrés dans les réglages des Modes, organisez les rôles d'agent privés et limitez les tâches déléguées aux outils et fichiers nécessaires.",
diff --git a/packages/shared/src/changelog-ko.ts b/packages/shared/src/changelog-ko.ts
index b16ac3393..7f8b690d4 100644
--- a/packages/shared/src/changelog-ko.ts
+++ b/packages/shared/src/changelog-ko.ts
@@ -5,6 +5,7 @@ export const koEntries: ChangelogEntry[] = [
version: "0.24.0",
date: "2026-11-24",
highlights: [
+ "파일 관리자를 한 번 열면 같은 프로젝트의 다른 세션에도 탭이 추가됩니다. 탭을 닫거나 사이드바를 여는 동작은 현재 세션에만 적용됩니다.",
"입력창에서 줄을 바꿀 때 불필요한 빈 줄이나 보이지 않는 문자가 생기지 않으며, 실행 취소로 삭제한 마지막 빈 줄을 복원할 수 있습니다.",
"/ 메뉴에서 선택한 스킬이 입력창에 개별 태그로 표시됩니다.",
"모드 설정에서 기본 역할과 스킬을 편집하고, 비공개 에이전트 역할을 정리하며, 역할에 필요한 도구와 파일로 위임 작업 범위를 제한할 수 있습니다.",
diff --git a/packages/shared/src/changelog-pt-BR.ts b/packages/shared/src/changelog-pt-BR.ts
index a65194128..cec22896f 100644
--- a/packages/shared/src/changelog-pt-BR.ts
+++ b/packages/shared/src/changelog-pt-BR.ts
@@ -5,6 +5,7 @@ export const ptBREntries: ChangelogEntry[] = [
version: "0.24.0",
date: "2026-11-24",
highlights: [
+ "Abra o gerenciador de arquivos uma vez para adicionar sua aba às outras sessões do projeto. Fechar a aba ou abrir o painel lateral afeta apenas a sessão atual.",
"As quebras de linha não acrescentam mais linhas vazias nem caracteres invisíveis extras. Desfazer restaura a última linha vazia excluída.",
"As habilidades selecionadas no menu / aparecem como etiquetas individuais no campo de mensagem.",
"Edite funções e habilidades incluídas nas configurações de Modos, organize funções privadas de agentes e limite tarefas delegadas às ferramentas e arquivos necessários.",
diff --git a/packages/shared/src/changelog-tr.ts b/packages/shared/src/changelog-tr.ts
index a3631143b..23cbe023d 100644
--- a/packages/shared/src/changelog-tr.ts
+++ b/packages/shared/src/changelog-tr.ts
@@ -5,6 +5,7 @@ export const trEntries: ChangelogEntry[] = [
version: "0.24.0",
date: "2026-11-24",
highlights: [
+ "Dosya Yöneticisi bir kez açıldığında aynı projedeki diğer oturumlara da sekmesi eklenir. Sekmeyi kapatmak veya yan paneli açmak yalnızca geçerli oturumu etkiler.",
"İleti alanında satır sonları artık fazladan boş satır veya görünmez karakter eklemiyor. Geri al, silinen son boş satırı geri getiriyor.",
"/ menüsünden seçilen beceriler ileti alanında ayrı etiketler olarak görünür.",
"Modlar ayarlarında yerleşik rolleri ve becerileri düzenleyin, özel ajan rollerini düzenleyin ve devredilen işleri rolün ihtiyaç duyduğu araç ve dosyalarla sınırlayın.",
diff --git a/packages/shared/src/changelog-zh-CN.ts b/packages/shared/src/changelog-zh-CN.ts
index 4bc404c8a..72b445b73 100644
--- a/packages/shared/src/changelog-zh-CN.ts
+++ b/packages/shared/src/changelog-zh-CN.ts
@@ -5,6 +5,7 @@ export const zhCNEntries: ChangelogEntry[] = [
version: "0.24.0",
date: "2026-11-24",
highlights: [
+ "在项目中打开一次文件管理器,同项目会话即可看到它的标签;关闭标签或展开侧栏只影响当前会话。",
"输入框换行不再多出空行或隐藏字符,退格删掉的末尾空行也能撤销恢复。",
"从 / 菜单选择的技能会在输入框中显示为独立标签。",
"可在「模式」设置中编辑内置角色与技能,整理私有 Agent 角色,并按角色所需工具和文件范围委派任务。",
diff --git a/packages/shared/src/changelog-zh-TW.ts b/packages/shared/src/changelog-zh-TW.ts
index 4ccb4f56f..e80fc4207 100644
--- a/packages/shared/src/changelog-zh-TW.ts
+++ b/packages/shared/src/changelog-zh-TW.ts
@@ -5,6 +5,7 @@ export const zhTWEntries: ChangelogEntry[] = [
version: "0.24.0",
date: "2026-11-24",
highlights: [
+ "在專案中開啟一次檔案管理員,同專案的工作階段即可看到其分頁;關閉分頁或展開側欄只影響目前的工作階段。",
"輸入框換行不再多出空白行或隱藏字元,復原也能找回刪除的最後一個空白行。",
"從 / 選單選取的技能會在輸入框中顯示為獨立標籤。",
"可在「模式」設定中編輯內建角色與技能、整理私有 Agent 角色,並依角色所需工具和檔案範圍委派工作。",
diff --git a/scripts/e2e-project-file-manager-tab.mjs b/scripts/e2e-project-file-manager-tab.mjs
new file mode 100644
index 000000000..54006f70d
--- /dev/null
+++ b/scripts/e2e-project-file-manager-tab.mjs
@@ -0,0 +1,132 @@
+#!/usr/bin/env node
+/**
+ * #2607 — the bundled file manager is one live view shared by a project, so
+ * every session of that project must carry a real file-manager tab without the
+ * user opening one, while a session that closed it locally keeps it closed.
+ *
+ * Runs the real production WorkPanel, app store, launcher rows and tab strip in
+ * Electron and walks the user path: A opens the file manager from its launcher
+ * row, B (which had Review selected and the panel collapsed) comes back with
+ * both tabs, closing it locally in B is final, and a fresh session C already
+ * has it — while a session in another project never does.
+ *
+ * Only `window.piDesktop` is inert here; guest-page behaviour and
+ * WebContentsView composition stay with scripts/e2e-file-manager-lines.mjs.
+ *
+ * Prerequisite: `apps/desktop/node_modules` + `packages/agent-runtime/node_modules`
+ * (electron, esbuild) shared with the primary checkout. No install, no build
+ * step, and a throwaway profile — it never touches a real user profile.
+ */
+import assert from "node:assert/strict";
+import { spawn } from "node:child_process";
+import { createRequire } from "node:module";
+import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
+import { tmpdir } from "node:os";
+import { dirname, join } from "node:path";
+import { fileURLToPath } from "node:url";
+import { resolveElectronBinary } from "./e2e/boot.mjs";
+
+const root = join(dirname(fileURLToPath(import.meta.url)), "..");
+const require = createRequire(join(root, "packages/agent-runtime/package.json"));
+const { build } = require("esbuild");
+const { electronBinary } = resolveElectronBinary(root);
+const temp = await mkdtemp(join(tmpdir(), "pi-file-manager-tab-"));
+const MARKER = "FILE_MANAGER_TAB_E2E ";
+
+try {
+ // The panel's own stylesheet decides tab and launcher geometry; the shared
+ // token/base sheets keep its variables resolvable.
+ const styles = await Promise.all(
+ ["tokens", "base", "chat-shell", "ui-kit", "work-panel"].map((name) =>
+ readFile(join(root, `apps/desktop/src/styles/${name}.css`), "utf8"),
+ ),
+ );
+ await writeFile(join(temp, "style.css"), styles.join("\n"));
+
+ await build({
+ entryPoints: [join(root, "scripts/e2e/project-file-manager-tab.tsx")],
+ outfile: join(temp, "renderer.js"),
+ bundle: true,
+ platform: "browser",
+ format: "iife",
+ jsx: "automatic",
+ define: { "process.env.NODE_ENV": '"production"', "import.meta.env": '{"MODE":"test","DEV":false}' },
+ loader: { ".css": "empty" },
+ alias: {
+ "@pi-desktop/plugin-sdk": join(root, "packages/plugin-sdk/src/index.ts"),
+ "@pi-desktop/shared": join(root, "packages/shared/src/index.ts"),
+ "@pi-desktop/i18n": join(root, "packages/i18n/src/index.ts"),
+ react: join(root, "apps/desktop/node_modules/react"),
+ "react-dom": join(root, "apps/desktop/node_modules/react-dom"),
+ i18next: join(root, "apps/desktop/node_modules/i18next"),
+ "react-i18next": join(root, "apps/desktop/node_modules/react-i18next"),
+ },
+ nodePaths: [join(root, "apps/desktop/node_modules")],
+ });
+
+ await writeFile(
+ join(temp, "index.html"),
+ '<!doctype html><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="default-src \'self\'; style-src \'self\' \'unsafe-inline\'"><title>File manager tab regression</title><link rel="stylesheet" href="style.css"><body><script src="renderer.js"></script>',
+ );
+
+ await writeFile(
+ join(temp, "main.cjs"),
+ `
+const { app, BrowserWindow } = require("electron");
+const path = require("node:path");
+app.setPath("userData", path.join(__dirname, "profile"));
+app.whenReady().then(async () => {
+ const win = new BrowserWindow({ show: false, width: 1400, height: 820,
+ webPreferences: { sandbox: true, contextIsolation: true, nodeIntegration: false, backgroundThrottling: false } });
+ win.webContents.on("console-message", (event) => console.error(event.message));
+ try {
+ await win.loadFile(path.join(__dirname, "index.html"));
+ const result = await win.webContents.executeJavaScript("window.fileManagerProjectTabProbe()");
+ console.log(${JSON.stringify(MARKER)} + JSON.stringify(result));
+ app.exit(result?.ok === true ? 0 : 1);
+ } catch (error) {
+ console.error(${JSON.stringify(MARKER)} + JSON.stringify({ ok: false, error: String(error?.stack || error) }));
+ app.exit(1);
+ }
+});
+`,
+ );
+
+ const env = { ...process.env };
+ delete env.ELECTRON_RUN_AS_NODE;
+ const child = spawn(electronBinary, [join(temp, "main.cjs")], {
+ env,
+ stdio: ["ignore", "pipe", "pipe"],
+ });
+ let output = "";
+ for (const stream of [child.stdout, child.stderr]) {
+ stream.on("data", (data) => {
+ output += data;
+ });
+ }
+ const timeout = setTimeout(() => child.kill("SIGKILL"), 90_000);
+ let code;
+ try {
+ code = await new Promise((resolve, reject) => {
+ child.once("error", reject);
+ child.once("close", resolve);
+ });
+ } finally {
+ clearTimeout(timeout);
+ }
+
+ const line = output.split(/\r?\n/).find((entry) => entry.startsWith(MARKER));
+ assert(line, `probe returned no result (exit=${code}): ${output.slice(-4000)}`);
+ const result = JSON.parse(line.slice(MARKER.length));
+ assert.equal(
+ result.ok,
+ true,
+ `file manager tab assertions failed: ${result.error ?? "unknown failure"}\n${output.slice(-2000)}`,
+ );
+ assert.equal(code, 0, output.slice(-6000));
+ console.log(line);
+ for (const check of result.checks ?? []) console.log(" PASS " + check);
+ console.log("file manager project tab: PASS");
+} finally {
+ await rm(temp, { recursive: true, force: true });
+}
diff --git a/scripts/e2e/project-file-manager-tab.tsx b/scripts/e2e/project-file-manager-tab.tsx
new file mode 100644
index 000000000..d21dd8352
--- /dev/null
+++ b/scripts/e2e/project-file-manager-tab.tsx
@@ -0,0 +1,154 @@
+import { createRoot } from "react-dom/client";
+import { flushSync } from "react-dom";
+import { createInstance } from "i18next";
+import { I18nextProvider } from "react-i18next";
+import { catalogs } from "@pi-desktop/i18n";
+import { IPC } from "@pi-desktop/shared";
+import { WorkPanel } from "../../apps/desktop/src/components/workpanel/WorkPanel";
+import { useAppStore } from "../../apps/desktop/src/stores/app-store";
+import { pluginWorkPanelTab, toolWorkPanelTab } from "../../apps/desktop/src/lib/work-panel-tabs";
+import { switchWorkPanelSession } from "../../apps/desktop/src/stores/slices/work-panel-slice";
+
+/*
+ #2607 — the bundled file manager is one live view shared by a project, so every
+ session of that project must carry a real file-manager tab without the user
+ opening one, while a session that closed it locally keeps it closed.
+ Real WorkPanel, real store, real launcher rows, production session projection.
+ Only the native bridge is inert: no guest-page or scroll-state claims here.
+*/
+
+const VIEW_REF = "pi.file-manager/manager";
+const FM = pluginWorkPanelTab("pi.file-manager", "manager");
+const REVIEW = toolWorkPanelTab("review");
+const VIEW_META = { pluginId: "pi.file-manager", viewId: "manager", ref: VIEW_REF, title: "Files", pluginName: "PI-Desktop", order: 0 };
+
+declare global {
+ var fileManagerProjectTabProbe: () => Promise<{ ok: true; checks: string[] }>;
+}
+
+window.piDesktop = {
+ channels: IPC,
+ platform: "darwin",
+ invoke: async () => ({ ok: true, data: undefined }),
+ on: () => () => undefined,
+};
+
+const host = document.createElement("div");
+host.style.cssText = "position:absolute;left:0;top:0;width:1400px;height:820px;display:flex";
+document.body.append(host);
+const root = createRoot(host);
+const i18n = createInstance();
+const ready = i18n.init({ lng: "en", resources: { en: { translation: catalogs.en } }, interpolation: { escapeValue: false } });
+
+function check(condition: unknown, message: string): asserts condition {
+ if (!condition) throw new Error(message);
+}
+const store = () => useAppStore.getState();
+const strip = () => [...host.querySelectorAll<HTMLElement>("[data-work-panel-tab-id]")].map((node) => node.dataset.workPanelTabId);
+const hasFileManagerTab = (sessionId: string) => store().workPanelContexts[sessionId]?.tabs.some((tab) => tab.id === FM.id) === true;
+
+async function rendered(): Promise<void> {
+ await new Promise<void>((resolve) => requestAnimationFrame(() => requestAnimationFrame(() => resolve())));
+}
+function closeTab(tabId: string): void {
+ const button = host.querySelector<HTMLElement>(`[data-work-panel-tab-id="${tabId}"] .work-panel-tab-close`);
+ check(button, `no close control for tab ${tabId}`);
+ flushSync(() => button.click());
+}
+/** Production projection swap: what selecting a session does to the work panel. */
+function switchTo(sessionId: string): void {
+ flushSync(() => useAppStore.setState((state) => ({ ...switchWorkPanelSession(state, sessionId), activeSessionId: sessionId })));
+}
+function openPanel(): void {
+ flushSync(() => store().openWorkPanel());
+}
+
+export async function runFileManagerProjectTabProbe() {
+ await ready;
+ const checks: string[] = [];
+ flushSync(() => {
+ useAppStore.setState({
+ activeSessionId: "session-a",
+ sessions: ["a", "b", "c", "d"].map((id) => ({
+ id: `session-${id}`, title: id, projectPath: id === "d" ? "/other" : "/project",
+ mode: "agent", permissionMode: "inherit", thinkingLevel: "off",
+ createdAt: "2026-01-01", updatedAt: "2026-01-01", messageCount: 0,
+ })),
+ workPanelWidth: 520,
+ workPanelOpen: false,
+ workPanelTabs: [],
+ activeWorkPanelTabId: null,
+ workPanelFileRequest: null,
+ // B was used before: review selected, panel collapsed, no file manager.
+ workPanelContexts: { "session-b": { open: false, tabs: [REVIEW], activeTabId: REVIEW.id, fileRequest: null } },
+ pluginViews: [VIEW_META],
+ });
+ root.render(
+ <I18nextProvider i18n={i18n}>
+ <WorkPanel containerWidth={1400} sidebarCollapsed />
+ </I18nextProvider>,
+ );
+ });
+ await rendered();
+
+ // A opens the bundled file manager from its launcher row (never the `+` tab).
+ openPanel();
+ await rendered();
+ const launcherRow = host.querySelector<HTMLElement>(`[data-work-panel-launcher-item="${VIEW_REF}"]`);
+ check(launcherRow, "the launcher row for the bundled file manager is missing");
+ flushSync(() => launcherRow.click());
+ await rendered();
+ check(strip().includes(FM.id), "session A did not open the file manager");
+
+ // B keeps its retained review selection and already carries the shared tab.
+ switchTo("session-b");
+ await rendered();
+ check(store().workPanelContexts["session-b"]?.activeTabId === REVIEW.id, "session B lost its selected review tab");
+ check(hasFileManagerTab("session-b"), "session B has no file-manager tab");
+ check(store().workPanelOpen === false, "switching reopened session B's collapsed panel");
+ openPanel();
+ await rendered();
+ check(store().activeWorkPanelTabId === REVIEW.id, "session B did not restore its review tab");
+ check(strip().includes(FM.id) && strip().includes(REVIEW.id), "session B's strip lacks the file-manager tab");
+ checks.push("a same-project session keeps its selected tab and already carries the file-manager tab");
+
+ // Closing it locally is final for that session only.
+ closeTab(FM.id);
+ await rendered();
+ check(!hasFileManagerTab("session-b"), "the closed file-manager tab stayed in session B");
+ switchTo("session-a");
+ await rendered();
+ check(strip().includes(FM.id), "closing it in session B also closed session A's tab");
+ switchTo("session-b");
+ await rendered();
+ check(!hasFileManagerTab("session-b") && !store().workPanelTabs.some((tab) => tab.id === FM.id),
+ "the closed file-manager tab was reinserted in session B");
+ checks.push("a local tab close removes it from that session and it is never reinserted");
+
+ // After the last close, a fresh session of the project already has the tab.
+ switchTo("session-a");
+ await rendered();
+ closeTab(FM.id);
+ await rendered();
+ check(!hasFileManagerTab("session-a"), "the last file-manager tab did not close");
+ switchTo("session-c");
+ await rendered();
+ check(hasFileManagerTab("session-c"), "a fresh session in the project has no file-manager tab");
+ check(store().workPanelOpen === false, "a fresh session opened the collapsed panel");
+ openPanel();
+ await rendered();
+ check(strip().includes(FM.id), "opening the fresh session's panel hides the file-manager tab");
+ check(store().activeWorkPanelTabId === FM.id, "the file-manager tab is not the active tab");
+ checks.push("a fresh session of the project already has the file-manager tab, collapsed");
+
+ // Another project is isolated.
+ switchTo("session-d");
+ await rendered();
+ check(!hasFileManagerTab("session-d") && store().workPanelTabs.length === 0,
+ "another project's session inherited the file-manager tab");
+ checks.push("a session from another project has no file-manager tab");
+
+ return { ok: true as const, checks };
+}
+
+globalThis.fileManagerProjectTabProbe = runFileManagerProjectTabProbe;