Repository navigation
feat(webui): the title bar says which checkout you are looking at - #130
Merged
Merged
Conversation
Branch, short sha, and when it landed — a left pair with the title: the title answers "what am I reading", this answers "which build". headSha uses git's own abbreviation rather than a fixed seven, so a large repository lengthens it instead of truncating away the digits you would paste into git show. headCommittedAt is the committer time, not the author time: rebase, amend and cherry-pick push the committer time to now while the author time stays at the first write, so an author timestamp would show a just-rebased branch as months old. No polling. One call is one real index refresh, and a checkout's identity changes on commit or branch switch rather than on a timer; the relative-time half rides the ticker the title bar already had. Nothing renders for a non-git directory, an unborn HEAD, or a failed request — an empty pill is a control that looks useful and says nothing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景(用户反馈 F-4)
后端
/api/git/status的返回体扩两个字段,无新端点:headShagit log -1 --format=%hgit show,截掉就不对了headCommittedAt%cIheadCommittedAt的选择理由值得单说:rebase / amend / cherry-pick 会把提交者时间推到当下,而作者时间停在最初那次写入。用作者时间会把刚 rebase 的分支显示成几个月前——而这个仓库的分支几乎全是 squash/rebase 出来的。走既有
execFile边界与既有assertWorkspacePath门(不引入第二个越权判断点),与git status并发发起,墙钟仍是一次往返。边界:
ok:true+ 两字段null## No commits yet on main原会被正则读成分支名"No"标题栏
位置:标题行的最右端(
ml-auto),在运行状态指示之后。形态
分支 + 短编号 + 相对时间;点击短编号复制(真按钮 +aria-label+ 1.2 秒「已复制」反馈)。字号、色板、hover 全部沿用同区域既有控件,没有自造视觉。三种情况元素完全不在 DOM 里
非 git 目录 · unborn HEAD · 请求失败/未返回。
不轮询
一次调用是一次真实
git status索引刷新。版本身份在提交或切分支时变,而非按时间表变。相对时间那半零成本——挂在标题栏本来就有的useTicker(1000)上。Git 面板已定「工作区变化 + 显式刷新」的先例。端到端截图
.tickets/webui-parity/下:shot-07-final-wide.pngshot-08-final-copied.pngshot-09-final-900px.pngshot-03-badge-absent-nonrepo.png隔离实例显式设了
MINIMAX_DATA_DIR、独立端口 18093、自建 dist。变异验证 5/5 全红
其中变异 2 第一次是绿的——原断言用共用夹具(只有一次提交、作者时间恰好等于提交者时间),
%aI与%cI无法区分,看着在验「提交者时间」其实只验了 ISO 格式。补了GIT_AUTHOR_DATE=2020-01-02/GIT_COMMITTER_DATE=2026-10-01的分离夹具(带前置断言确保两日期确实不同)后重跑即红。门禁
pnpm webui:typecheck/typecheckpnpm test:webapppnpm test:webui×3pnpm check:sourcecheck-docs-alignment.mjs顺带修掉的两个既有布局缺陷(实跑量出来的)
pr-20预留位按三个按钮算,但实际渲染四个 —— 标识被压住 68pxmin-w-0—— 420px 下标识被榨成零宽盒子这两处本就必须改才不压控件,但它们是既有行的属性,review 时值得单独看一眼。
意外验证:时钟偏差护栏
首次种子提交时间在 14 小时之后,标识只渲染分支 + 短编号、时间段整个不出现——不打印「-14 小时前」。
文档
docs/webui.md+docs/webui.zh-CN.md同批改(用户可见行为,双语同权);packages/webui/docs/API.md+API.zh-CN.md的GET /api/git/status小节同步两个新字段。🤖 Generated with DeepSeek Harness