问题类别 · Category: UI / 界面体验 · UI / UX
Agent 框架 · Framework: ZCode Agent(自研)
严重程度 · Severity: 影响体验 · Major(功能可用但体验受损)
复现频率 · Reproducibility: 必现 · Always
问题描述 · Description
把工作区连接到 Docker devcontainer 的文件系统根目录(/)时,所有工作区标题都退化为孤立的 /,无法分辨是哪个环境:
- Header 工作区标题显示
/(远程场景显示 / @ docker:容器名)
- 桌面窗口标题显示
ZCode / /
- 空态工作区切换菜单中,根目录工作区同样只显示
/
我在公开源码(v3.14.3)中定位到了根因:packages/ui/src/App.tsx 用 getPathLeaf(workspaceAbsPath) 派生项目名,而 getPathLeaf("/")(packages/ui/src/lib/path.ts)对根目录没有路径叶子可取,?? path 兜底直接把原始路径 "/" 透传给了所有标题面。devcontainer 场景下工作区恰好常常就是容器根目录。
When a workspace connects to a container root, every workspace title degrades to a bare / (header, desktop window title ZCode / /, workspace switcher). Root cause in the public source: getPathLeaf("/") has no leaf to return, and its ?? path fallback passes the raw "/" through to every title surface.
复现步骤 · Steps to reproduce
- 打开 ZCode 桌面端 / Open the ZCode desktop app
- 新建 Docker 远程连接,工作区路径填
/(devcontainer 默认 workdir 常为根目录)/ Create a Docker remote connection with workspace path /
- 连接成功后查看 Header 工作区标题与窗口标题 / Connect and observe the header title and window title
期望表现 · Expected behavior
根目录工作区应显示可读的名称——远程场景下最自然的身份是主机标识(如 docker:my-devcontainer),本地根目录显示本地化文案(如「根目录」/ "Root directory")。
Root workspaces should show a readable name — for remote, the host identity (e.g. docker:my-devcontainer); for local, a localized label.
实际表现 · Actual behavior
标题显示为孤立的 /(窗口标题为 ZCode / /),远程场景显示 / @ docker:容器名。
A bare / is displayed (window title ZCode / /); remote shows / @ docker:<container>.
版本与环境 · Version & environment
- ZCode v3.14.3(当前公开源码版本 / current public source)
- Linux 桌面端,连接 Docker devcontainer / Linux desktop app connected to a Docker devcontainer
附:修复方案 · Proposed fix
我已基于公开源码准备了一个小补丁并愿意提交 PR(如果仓库接受):新增统一的 getWorkspaceDisplayName 出口——根目录 + 远端回落到主机标识(复用 formatRemoteWorkspaceHeaderHostLabel),根目录 + 本地回落到 i18n 文案(workspace.rootDirectory:根目录 / Root directory),其余路径行为不变。已接入 Header、窗口标题、空态工作区菜单三个标题面,附单元测试,pnpm typecheck / pnpm lint / pnpm architecture:check --changed 全部通过。如需要可提供补丁文件或 fork 分支。
问题类别 · Category: UI / 界面体验 · UI / UX
Agent 框架 · Framework: ZCode Agent(自研)
严重程度 · Severity: 影响体验 · Major(功能可用但体验受损)
复现频率 · Reproducibility: 必现 · Always
问题描述 · Description
把工作区连接到 Docker devcontainer 的文件系统根目录(
/)时,所有工作区标题都退化为孤立的/,无法分辨是哪个环境:/(远程场景显示/ @ docker:容器名)ZCode / //我在公开源码(v3.14.3)中定位到了根因:
packages/ui/src/App.tsx用getPathLeaf(workspaceAbsPath)派生项目名,而getPathLeaf("/")(packages/ui/src/lib/path.ts)对根目录没有路径叶子可取,?? path兜底直接把原始路径"/"透传给了所有标题面。devcontainer 场景下工作区恰好常常就是容器根目录。When a workspace connects to a container root, every workspace title degrades to a bare
/(header, desktop window titleZCode / /, workspace switcher). Root cause in the public source:getPathLeaf("/")has no leaf to return, and its?? pathfallback passes the raw"/"through to every title surface.复现步骤 · Steps to reproduce
/(devcontainer 默认 workdir 常为根目录)/ Create a Docker remote connection with workspace path/期望表现 · Expected behavior
根目录工作区应显示可读的名称——远程场景下最自然的身份是主机标识(如
docker:my-devcontainer),本地根目录显示本地化文案(如「根目录」/ "Root directory")。Root workspaces should show a readable name — for remote, the host identity (e.g.
docker:my-devcontainer); for local, a localized label.实际表现 · Actual behavior
标题显示为孤立的
/(窗口标题为ZCode / /),远程场景显示/ @ docker:容器名。A bare
/is displayed (window titleZCode / /); remote shows/ @ docker:<container>.版本与环境 · Version & environment
附:修复方案 · Proposed fix
我已基于公开源码准备了一个小补丁并愿意提交 PR(如果仓库接受):新增统一的
getWorkspaceDisplayName出口——根目录 + 远端回落到主机标识(复用formatRemoteWorkspaceHeaderHostLabel),根目录 + 本地回落到 i18n 文案(workspace.rootDirectory:根目录 / Root directory),其余路径行为不变。已接入 Header、窗口标题、空态工作区菜单三个标题面,附单元测试,pnpm typecheck/pnpm lint/pnpm architecture:check --changed全部通过。如需要可提供补丁文件或 fork 分支。