feat: 皮肤兼容(令牌驱动)+ CSS 修复(#106 #105 #90 #60,附带 #52 #57 #92) - #110
Conversation
|
@codex CR |
Code Review[P2] Correct the corner handle’s vertical offsetThe corner handle is 12 px too high. Because it is absolutely positioned inside the full-height right panel, 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
No repository changes were made, so no commit or follow-up pull request was created. |
ae60462 to
95303fe
Compare
令牌驱动方案(主目标:与 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 全绿。
95303fe to
e996505
Compare
概要
本 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-*令牌的重适配。改动
🎨 令牌驱动兼容
.panel/.bottomPanel背景从var(--dsw-specific-sidebar-fill)(宿主左导航专属令牌,皮肤按左导航语义覆盖它)改为var(--dsw-alias-bg-layer-1)(通用卡片表面,10 款皮肤全覆盖)——dsh-web-ui 皮肤中心换肤后面板自动跟随,零每皮肤适配(UI字体没有跟随主题色 #60/希望可以配置透明度、颜色等,和其他主题根本不搭配 #105/适配DSH-Transparent-UI-Plugin的实践 #106)。stock 外观色阶仅 ±8 RGB 差异。effectiveTokenValue新增 alpha 阈值——transparent与 alpha < 0.9 的半透明玻璃值(dsh-web-ui 皮肤 bg-base 为 rgba 0.16–0.7)一律回退不透明底色,文字永不叠在皮肤背景画上滚动;≥ 0.9 的近不透明值(如皮肤作用域 0.96 瓷器玻璃)放行,皮肤仍可控终端表面。新增colorAlpha()解析 computed 颜色(rgb/rgba/hsl/hsla 逗号与空格语法、#hex 家族)。📐 独立修复(与皮肤兼容无关)
position: absolute; left: -6px; bottom: calc(var(--dsh-sidebar-height) + 6px),删除 JS 内联 viewport 坐标(cornerRef一并移除)。cursor: col-resize语义定位),断言拖拽期间data-dsh-sidebar-dragging存在、#roottransition 为 none、会话列与面板边单调 1:1 跟随(实测通过,现行代码无抖动)。🗑️ 按 KISS 回退(首版方案)
data-bs-*语义钩子——令牌驱动下均不需要,已全部回退(tests/skin-hooks.spec.tsx删除;mount e2e 改为断言--dsh-sidebar-width布局变量随面板挂载生效)。docs/plans/2026-08-15-skin-compat-design.md记录决策与回退。测试
tests/theme.spec.ts:colorAlpha(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 挂载 + 无头渲染 + 拖拽逐帧验证)。