diff --git a/CHANGELOG.md b/CHANGELOG.md
index ed2163f..7f78caf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,9 +34,16 @@
- `parseFolderEntry` 允许缺 `folders` 字段(不再连带丢掉 members),`remoteSubpath` 与
`joinSubpath` 对绝对/盘符/UNC 输入的判定统一;`joinSubpath` 额外拒绝 `C:foo`。
+### 侧栏文件夹行
+- 工作区自己的目录不再渲染成一条文件夹行。以前只要工作区挂了额外文件夹,它就会多出
+ 一条以目录末段命名的行;云端工作区的路径是镜像目录,于是侧栏出现 `wmvl31c7ilkuc`
+ 这样的内部 id,并且工作区自身的会话被藏进这条行里,看起来像「一个项目套在它自己里面」。
+- 现在只有真正额外挂进来的文件夹才有行,工作区自己的会话直接列在标题下方;没有额外
+ 文件夹时节点形状与引入文件夹功能之前完全一致。
+
### 测试与工程
- 新增 `tests/folders-cas.test.ts`、`tests/folders-persist.test.ts`、`tests/remote-paths.test.ts`
- 覆盖上述回归点;`tsc -p tsconfig.json` / `tsconfig.client.json` 与 288 个 vitest 用例全部通过。
+ 覆盖上述回归点;`tsc -p tsconfig.json` / `tsconfig.client.json` 与 290 个 vitest 用例全部通过。
- `tsdown.config.ts` 关闭客户端 sourcemap,`lib/client.js.map`(内嵌完整源码)已从构建产物移除;
`.gitignore` 补 `*.map` / `*.tsbuildinfo` / `dist/` / `coverage/` / `tools/_tmp/`,并取消对
`docs/` 的忽略,把 `remote-ssh-integration-plan.md` 纳入版本控制。
diff --git a/lib/client.js b/lib/client.js
index e044e20..4078e73 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -1557,18 +1557,17 @@ window.__ModuleLoader__.load({
if (bucket === void 0) byFolder.set(owner, [node]);
else bucket.push(node);
}
- const folderNode = (path, isBase) => {
- const owned = isBase ? base : byFolder.get(path) ?? [];
+ const folderNode = (path) => {
return {
path,
label: labels.get(path) ?? folderLabel(path),
isRoot: samePath(path, root),
expanded: collapsedFolders === void 0 || !collapsedFolders.has(folderKey(workspaceId, path)),
- isBase,
- sessions: owned
+ isBase: false,
+ sessions: byFolder.get(path) ?? []
};
};
- const folders = [folderNode(workspacePath, true), ...extras.map((path) => folderNode(path, false))];
+ const folders = extras.map((path) => folderNode(path));
const rootIndex = folders.findIndex((folder) => folder.isRoot);
if (rootIndex > 0) {
const [rootFolder] = folders.splice(rootIndex, 1);
@@ -8068,11 +8067,20 @@ window.__ModuleLoader__.load({
onArchive: onSessionArchive
}, session.id))
});
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RowGroup, {
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(RowGroup, {
expanded: workspace.expanded,
className: "wgTreeChildren",
animate: animate && folders.length + workspace.sessions.length <= ANIMATION_ROW_CAP,
- children: folders.map((folder) => {
+ children: [workspace.sessions.map((session) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionRow, {
+ node: session,
+ currentId: current,
+ now,
+ t,
+ onOpen,
+ onRename: onSessionRename,
+ onFork,
+ onArchive: onSessionArchive
+ }, session.id)), folders.map((folder) => {
const key = folderKey(workspace.workspaceId, folder.path);
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
role: "group",
@@ -8112,7 +8120,7 @@ window.__ModuleLoader__.load({
}, session.id))
})]
}, key);
- })
+ })]
});
}
/** One category section: header row + expanded workspace folders. */
@@ -8307,9 +8315,18 @@ window.__ModuleLoader__.load({
onArchive: () => {}
}, session.id))
});
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
role: "group",
- children: folders.map((folder) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
+ children: [workspace.sessions.map((session) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SessionRow, {
+ node: session,
+ currentId: current,
+ now,
+ t,
+ onOpen: open,
+ onRename: () => {},
+ onFork: () => {},
+ onArchive: () => {}
+ }, session.id)), folders.map((folder) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
role: "group",
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(FolderRow, {
node: folder,
@@ -8332,7 +8349,7 @@ window.__ModuleLoader__.load({
onArchive: () => {}
}, session.id))
})]
- }, folderKey(workspace.workspaceId, folder.path)))
+ }, folderKey(workspace.workspaceId, folder.path)))]
});
}
/**
diff --git a/lib/types/client/tree.d.ts b/lib/types/client/tree.d.ts
index 91073a9..8811c00 100644
--- a/lib/types/client/tree.d.ts
+++ b/lib/types/client/tree.d.ts
@@ -75,8 +75,10 @@ export interface WorkspaceGroupNode {
sessions: readonly SessionNode[];
/**
* Folder rows, present only when the workspace carries at least one extra
- * folder: root first, then stored order, base included. Absent means "this
- * workspace has exactly one directory", the plain pre-folders node shape.
+ * folder: root first, then stored order. The base directory is never a row —
+ * it is the workspace row itself, and its sessions live in {@link sessions}.
+ * Absent means "this workspace has exactly one directory", the plain
+ * pre-folders node shape.
*/
folders?: readonly FolderNode[];
}
diff --git a/src/client/GroupsBrowser.tsx b/src/client/GroupsBrowser.tsx
index 290f007..b2bc7b5 100644
--- a/src/client/GroupsBrowser.tsx
+++ b/src/client/GroupsBrowser.tsx
@@ -2366,6 +2366,19 @@ function WorkspaceSubtree({ workspace, current, now, t, animate, onOpen, onSessi
className="wgTreeChildren"
animate={animate && folders.length + workspace.sessions.length <= ANIMATION_ROW_CAP}
>
+ {workspace.sessions.map((session) => (
+