Repository navigation
Conversation
The Git lens switcher borrowed the host conversation Tabs' private CSS-module class names (wSkVaW_*), generated by DSH 0.2.1-rc.1. DSH 0.2.1-rc.5 changed that module's hash (kiGsTW_*), so on rc.5 the two tabs lost every style and rendered as bare browser buttons. Own the styles instead: .lensTabs/.lensTab with the host tab look (13px/500, label-tertiary -> state-business-primary, 2px bottom rule, focus-visible outline), active state driven by the existing aria-selected attribute. Colors stay on --dsw-* tokens.
Collaborator
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.
问题
在 DSH 桌面版 0.2.1-rc.5 上,Git 面板顶部的
Git / 本轮文件视角切换标签渲染成浏览器原生<button>(方形、1px 黑边、系统字体),与宿主自己的对话 / 轨迹标签风格不一致:根因
ChangesTab借用了宿主对话 Tabs 组件的私有 CSS Module 哈希类名:这些类名来自 0.2.1-rc.1 的宿主构建(插件当前基线)。0.2.1-rc.5 中宿主该私有模块的哈希已变为
kiGsTW_*(app.asar中确认kiGsTW_tabs/kiGsTW_tab/kiGsTW_tabActive),wSkVaW_*不再匹配任何样式;插件样式表只额外补了gap与 focus 规则,于是两个标签回退为原生按钮。改动
src/client/changes/changes.module.css:视角切换标签改用插件自有类.lensTabs/.lensTab/[aria-selected='true']—— 13px/500、未选中--dsw-alias-label-tertiary、选中--dsw-alias-state-business-primary+ 底部 2px 高亮、:focus-visible轮廓;颜色全部走--dsw-*token(符合 skin contract)。删除两条:global(.wSkVaW_*)规则。src/client/changes/ChangesTab.tsx:改用css.lensTabs/css.lensTab,选中态由已有的aria-selected驱动(不再需要 active 类名)。tests/changes-tab.spec.tsx:不再断言宿主私有类名,改为断言自有样式表规则;键盘导航 / aria / 持久化等行为断言不变。验证
Chat/Trajectory标签的 computed style 一致:13px/500、透明背景无边框;选中rgb(65,118,230)+inset 0 -2px下划线;未选中rgb(129,133,140);本轮文件/Git:aria-selected、下划线移动、两个面板的显隐均正确;pnpm typecheck、pnpm lint通过;pnpm exec vitest run tests/changes-tab.spec.tsx tests/theme.spec.ts47 passed;pnpm build成功。兼容性
自有样式不依赖宿主哈希,对 0.2.1-rc.1+(当前支持线)都成立;仓库中的旧类名引用已全部清除。