Skip to content

fix(changes): 「Git / 本轮文件」切换恢复会话页的下划线 Tabs - #1236

Merged
hairyf merged 1 commit into
devfrom
fix/changes-lens-underline-tabs
Nov 21, 2026
Merged

hairyf merged 1 commit into
devfrom
fix/changes-lens-underline-tabs

Conversation

@hairyfbot

Copy link
Copy Markdown
Collaborator

This is by an automated agent, not a human.

变更

Before / After

基线 dev @ 1b36bab(v0.32.1 行为),DSH 0.2.2-rc.3(仓库基线宿主),真实 dsh web + pnpm pack 产物经 dsh plugin add 挂载;同一 fixture(src/a.ts 改动 + src/new.ts 新增)、同一 420×126 裁切、同一主题与视口。

Before(灰底胶囊分段控件):

before

After(会话页下划线 Tabs):

after

After 的计算样式:选中态 rgb(65,118,230)、未选中 rgb(129,133,140)、13px/500、间距 24px —— 与宿主会话页 Tabs(wSkVaW_tab 的 65,118,230 / 129,133,140、13px/500)逐项一致。

验证

  • pnpm typecheck、pnpm lint:通过。
  • vitest run tests/changes-tab.spec.tsx tests/theme.spec.ts tests/primitives-exports.spec.ts --maxWorkers=1:53 项通过。
  • 全量 vitest run:3542 项通过、10 项失败;这些失败在基线提交 1b36bab 上逐条复现(Windows 符号链接权限、依赖 pnpm pack 的 manifest 用例、selection-quote),与本改动无关。
  • 挂载冒烟 tests/e2e/mount.e2e.ts:8/8 通过(真实 dsh web + Chromium,挂载的是本 PR 打包产物)。仓库脚本 scripts/e2e-mount.sh 在本机无法整条跑通:宿主 web 模板把 command-compact 等预设插件放在会话内挂载,而 scratch profile 的 node_modules 里没有这些包,session.create 会以 command-compact ... never started 失败;补装 @deepseek-ai/dsh-command-compact / dsh-compaction-basic 后同一 lane 全部通过。

已知边界

  • 宿主没有公开的下划线 Tabs 组件(ui-primitives 只有 SegmentedControl / SegmentedTabs,都是胶囊),所以这条切换由插件自绘;宿主若改版式需要同步这里。
  • 截图放在 evidence-1235 分支(只有两张 PNG),PR 合并后可随时删除。

Closes #1235

#1101 为摆脱宿主私有哈希类名(#1098)改用公开的 SegmentedControl,视觉随之退回灰底胶囊;#939 已按审阅意见改成官方会话页的下划线 Tabs,这一版把它丢了。

现在这条切换由插件自己的 changes.module.css 绘制:13px/500、未选中三级文字、选中态品牌色 + 2px 下划线压在页头分隔线上、24px 间距,ARIA 关联与左右方向键 / Home / End 漫游焦点照旧;不引用任何宿主私有类名。

Refs: #1235
@hairyf
hairyf merged commit ddcd435 into dev Nov 21, 2026
3 checks passed
Menghuan1918 added a commit that referenced this pull request Nov 24, 2026
Upstream moved under the branch while it was being rebased: the changes
lens grew its own underline tabs (#1236) and kept ONE native branch
select (#944), the task graph squared its controls (#948), the host
admission call moved to rc.3's admit fallback, and the graph viewport
got a fixed 248px floor. Where the two designs collided this takes
upstream's newer chrome and re-applies the branch's kit only where it
defines our own surfaces.

- changes/GitGraphSection: keep the branch's kit buttons but restore the
  native branch select, and give it token colours plus the 32px / 44px
  touch sizes so it stops falling back to the OS chrome in a dark panel.
- sidebar/dock-fallback: upstream's 28px host-matched geometry plus the
  branch's 44px coarse-pointer target (no longer a 32px base).
- ui/workbench-section: the disclosure bar is exactly 28px INCLUDING its
  divider, so the sections keep the heights the changes graph measures.
- tests: theme.spec, dock-fallback, git-graph-ui and git-view-worktree
  follow upstream's newer shapes; the surface sweep stops demanding one
  identical tab for upstream's underline lens strip, and the graph e2e
  clicks the shared section disclosure instead of the old div > button.
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.

2 participants