feat(ui): Git 面板列表头显示 remote

列表只有仓库路径和分支,看不出这个仓库推到哪、也没法一眼确认有没有配远端。

ensureRepo 多读一条 git remote -v(取第一条 fetch,origin 惯例在最前),
URL 里的 user:pass 先脱敏再给前端;列表头渲染成「路径 · 分支 · origin」,
悬停看完整地址,没配 remote 时灰色标「无 remote」。
This commit is contained in:
2026-11-13 18:00:56 +08:00
parent 71f3cdb694
commit a0195c710b
3 changed files with 16 additions and 2 deletions
+3
View File
@@ -1923,6 +1923,9 @@ body.pv-max .pv-code { max-width: none; padding-left: 16px; padding-right: 16px;
.vcs-repo { padding: 9px 16px; border-bottom: 1px solid var(--border); background: var(--drawer-bg);
font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--gray);
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 列表头里的 remote 名:悬停看 URL(已脱敏);没配 remote 时灰色注明 */
.vcs-repo .vcs-remote { color: var(--fg-0550ae); cursor: help; }
.vcs-repo .vcs-remote.none { color: var(--gray); }
.vcs-empty { padding: 44px 24px; text-align: center; font-size: 13px; color: var(--gray-light); }
.vcs-item { padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.vcs-item:hover { background: var(--surface); }
+4 -1
View File
@@ -54,7 +54,10 @@
const parts = [];
parts.push('<div class="vcs-list">');
if (st.repo) {
parts.push('<div class="vcs-repo">' + esc(st.repo.root) + (st.repo.branch ? ' · ' + esc(st.repo.branch) : '') + '</div>');
const rm = st.repo.remote;
parts.push('<div class="vcs-repo">' + esc(st.repo.root) + (st.repo.branch ? ' · ' + esc(st.repo.branch) : '') +
' · <span class="vcs-remote' + (rm ? '' : ' none') + '" title="' + esc(rm ? rm.url : '未配置 remote') + '">' +
esc(rm ? rm.name : '无 remote') + '</span></div>');
}
if (st.worktree && st.worktree.files) {
parts.push('<div class="vcs-item wt" data-act="worktree">' +