Skip to content

feat: 皮肤兼容(令牌驱动)+ CSS 修复(#106 #105 #90 #60,附带 #52 #57 #92) - #110

Merged
Menghuan1918 merged 1 commit into
mainfrom
fix/skin-compat
Aug 16, 2026
Merged

feat: 皮肤兼容(令牌驱动)+ CSS 修复(#106 #105 #90 #60,附带 #52 #57 #92)#110
Menghuan1918 merged 1 commit into
mainfrom
fix/skin-compat

Conversation

@Menghuan1918

@Menghuan1918 Menghuan1918 commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

概要

本 PR 的目标是与 dsh-web-ui 皮肤中心兼容(并覆盖 #106#105#60#90),方案是令牌驱动:不引入任何自有令牌/钩子/类名契约,侧边栏只消费 DSH 标准令牌,皮肤系统覆盖什么令牌就跟随什么。附带独立修复 #52#57 前半、#92

兼容机制(调研确认)

dsh-web-ui 的 10 款皮肤全部覆盖 --dsw-static-* + --dsw-alias-* 两层令牌(--dsw-alias-bg-layer-1 做成半透明玻璃 rgba 0.16–0.7,--dsw-specific-sidebar-fill 也全部覆盖)。因此 better-sidebar 消费标准令牌即自动换肤,不需要 aionui 那种每款皮肤 remap 一套 --aion-* 令牌的重适配。

改动

🎨 令牌驱动兼容

📐 独立修复(与皮肤兼容无关)

🗑️ 按 KISS 回退(首版方案)

  • 首版曾实现 panel 家族类名 kebab-case 改名(breaking)与 data-bs-* 语义钩子——令牌驱动下均不需要,已全部回退tests/skin-hooks.spec.tsx 删除;mount e2e 改为断言 --dsh-sidebar-width 布局变量随面板挂载生效)。
  • 文档:AGENTS.md §8 重写为「皮肤兼容(令牌驱动)」;docs/plans/2026-08-15-skin-compat-design.md 记录决策与回退。
  • 不改版本号、不更新 README——发布时统一处理。

测试

  • tests/theme.spec.tscolorAlpha(hex/rgb/hsl/不可解析)+ effectiveTokenValue(transparent/关键词/半透明回退/0.96 放行/缺失)。
  • tests/e2e/mount.e2e.ts:布局变量挂载断言;tests/e2e/drag-layout.e2e.ts:拖拽逐帧回归。
  • pnpm typecheck && pnpm test(511)&& pnpm build && pnpm pack && pnpm test:mount 全绿(真实 DSH 挂载 + 无头渲染 + 拖拽逐帧验证)。

@Menghuan1918

Copy link
Copy Markdown
Collaborator Author

@codex CR

@chatgpt-codex-connector

Copy link
Copy Markdown

Code Review

[P2] Correct the corner handle’s vertical offset

The corner handle is 12 px too high. Because it is absolutely positioned inside the full-height right panel, bottom measures the distance from the panel’s bottom edge to the handle’s bottom edge. For a 12 px handle centered on the bottom-panel seam, the correct offset is sidebar height - 6px, not sidebar height + 6px.

With a 300 px bottom panel, the current declaration places the handle from 318–306 px above the viewport bottom, while the seam is 300 px above it. This contradicts the documented “intersection” behavior and makes the diagonal resize target visually and interactively detached from the panel corner. Change the expression to:

bottom: calc(var(--dsh-sidebar-height, 0px) - 6px);

The existing structural test only checks that the handle has no inline style, so it cannot detect this geometry regression. Consider adding an actual bounding-box assertion to the mount test. src/client/sidebar.module.cssL271-L285

Checks

  • pnpm typecheck
  • ⚠️ pnpm test (Vitest did not complete in the available run and was terminated; no test failure was reported before termination.)
  • git diff --check HEAD^ HEAD

No repository changes were made, so no commit or follow-up pull request was created.

View task →

@Menghuan1918
Menghuan1918 force-pushed the fix/skin-compat branch 2 times, most recently from ae60462 to 95303fe Compare August 16, 2026 08:11
@Menghuan1918 Menghuan1918 changed the title feat: 皮肤/主题适配契约 + CSS 修复(#106 #105 #90 #60,附带 #52 #57 #92) feat: 皮肤兼容(令牌驱动)+ CSS 修复(#106 #105 #90 #60,附带 #52 #57 #92) Aug 16, 2026
令牌驱动方案(主目标:与 dsh-web-ui 皮肤中心兼容):
- 面板表面改用通用卡片令牌 --dsw-alias-bg-layer-1,不再消费宿主左导航专属
  --dsw-specific-sidebar-fill——dsh-web-ui 10 款皮肤全部覆盖 --dsw-alias-*
  层,换肤后侧边栏自动跟随,零每皮肤适配(#60/#105/#106)。
- effectiveTokenValue 增加 alpha 阈值(新增 colorAlpha 解析 computed 颜色):
  transparent 与 alpha<0.9 的半透明玻璃值(dsh-web-ui 皮肤 bg-base 为
  rgba 0.16–0.7)一律回退不透明底色,终端/编辑器文字永不叠在皮肤背景画上
  (#90);≥0.9 的近不透明值放行,皮肤仍可控终端表面。

独立修复(保留):
- z-index 降到 DSH 浮层栈(100+)之下:面板 40 / 按钮簇 45 / 角手柄面板内
  局部 2,Cordis 弹出框不再被底部工作台遮挡(#52)。
- 角手柄移入右面板、CSS 相对定位(bottom: calc(var(--dsh-sidebar-height)
  + 6px)),删除 JS 内联 viewport 坐标。
- 刷新按钮统一 14px(#57 前半)。
- 拖拽逐帧回归 e2e(#92):真实挂载下 rAF 采样(拖条以 cursor: col-resize
  语义定位),断言拖拽期间 data-dsh-sidebar-dragging 存在、#root transition
  为 none、会话列与面板边单调 1:1 跟随(实测通过)。

按 KISS 回退首版契约:类名 kebab-case 改名与 data-bs-* 语义钩子全部移除
(令牌驱动下不需要,改名引入无谓 breaking),skin-hooks 测试删除;
mount e2e 改为断言 --dsh-sidebar-width 布局变量随面板挂载生效。

文档:AGENTS.md §8 重写为「皮肤兼容(令牌驱动)」;设计文档记录决策与
回退。README 与版本号不在本批更新(发布流程统一处理)。

测试:tests/theme.spec.ts(colorAlpha + effectiveTokenValue 阈值);
typecheck/vitest(511)/build/consumer-types/test:mount 全绿。
@Menghuan1918
Menghuan1918 merged commit 3c196ff into main Aug 16, 2026
2 checks passed
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.

1 participant