Skip to content

feat(chat): 在会话顶栏显示当前 Git 分支 - #727

Open
Blue-Berrys wants to merge 1 commit into
vastsa:mainfrom
Blue-Berrys:fix/issue-679-branch-badge
Open

Blue-Berrys wants to merge 1 commit into
vastsa:mainfrom
Blue-Berrys:fix/issue-679-branch-badge

Conversation

@Blue-Berrys

Copy link
Copy Markdown
Contributor

问题

项目会话的顶栏只显示任务标题。用户从多个分支打开项目,或在应用外切换分支后,无法在当前会话中确认正在操作哪个 checkout。

修改

  • 在项目会话顶栏的任务标题旁显示紧凑的 Git 分支标记,长分支名自动省略,完整名称保留在提示信息中。
  • 选择会话或窗口重新获得焦点时刷新项目元数据,让应用外的分支切换及时反映到界面。
  • 支持普通 .git 目录和 linked worktree 的 .git 指针文件;detached HEAD 显示为 detached,临时会话及非 Git 文件夹不显示标记。
  • 同步中英文组件规格与 E2E 测试计划。

验证

  • node --test apps/desktop/test/git-branch.test.mjs apps/desktop/test/app-store-sidebar.test.mjs apps/desktop/test/thinking-ui.test.mjs apps/desktop/test/sidebar-collapse-animation.test.mjs apps/desktop/test/plan-mode-source-contract.test.mjs(54 项通过)
  • pnpm --filter '@pi-desktop/desktop^...' build
  • pnpm --filter @pi-desktop/desktop typecheck
  • pnpm --filter @pi-desktop/desktop build
  • pnpm lint
  • pnpm docs:check
  • 原生 macOS Electron 验证:linked worktree 显示 fix/issue-679-branch-badge,长名称省略;切换至临时会话后标记消失。

Fixes #679

@Blue-Berrys
Blue-Berrys force-pushed the fix/issue-679-branch-badge branch from c952428 to 28242f5 Compare September 21, 2026 02:29
@Blue-Berrys

Copy link
Copy Markdown
Contributor Author
image

@Blue-Berrys
Blue-Berrys force-pushed the fix/issue-679-branch-badge branch from 28242f5 to 035f761 Compare September 21, 2026 03:45
Refresh branch metadata when the window regains focus and support both standard repositories and linked worktrees.\n\nFixes vastsa#679
@Blue-Berrys
Blue-Berrys force-pushed the fix/issue-679-branch-badge branch from 035f761 to af829f6 Compare September 21, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 项目会话页面没有展示当前分支信息

1 participant