Repository navigation
fix(canvas): give the selected tab the stronger state fill - #1
Open
youking-lib wants to merge 1 commit into
Open
youking-lib wants to merge 1 commit into
youking-lib wants to merge 1 commit into
Conversation
The selected tab painted the workspace base colour, the same colour as the bar behind it, so selection showed only as a hairline while a hovered tab painted a lighter overlay. The hover rule also matched the selected tab and replaced its fill. Paint the selected tab with the active overlay and exclude it from the hover rule, so hover stays below selection in both themes. Co-authored-by: Codex <codex@openai.com>
This branch has not been deployed
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.
Motivation
顶部 canvas tab 条的选中态直接使用工作区底色,与 tab 条同色、只剩一圈 0.5px 内描边;而 hover 会叠加更亮的浮层,且 hover 规则同样命中选中的 tab 并覆盖它的填充,于是“悬停”比“选中”更亮,选中态在指针移上去时直接消失,读起来像是 active 与 hover 反了。
没有对应的 Issue:问题由用户在会话中直接反馈(附截图)。
Changes
Interface changes: None。
Behavior changes:
--dsw-alias-interactive-bg-active(深色为白 14%,浅色为黑 10%),不再是工作区底色。.tab:not([data-active]):hover,只作用于未选中的 tab;选中的 tab 悬停时保持选中填充。选中 rgb(54,54,56) > hover rgb(40,40,41) > tab 条 rgb(21,21,23);浅色选中 rgb(233,235,238) > hover rgb(242,243,244) > tab 条 rgb(255,255,255)。GUI 演示:本 PR 未内嵌 GIF。当前工作区存在并发进行中的其他改动,无法从干净的树完成构建并启动真实服务录制应用级演示;改用规则级浏览器渲染对照验证(真实
design-platform.csstoken + 真实 tab 规则 + 真实 DOM 结构),覆盖“指针移开 / 悬停在其他 tab / 悬停在选中 tab”三种场景,见 Testing。Testing
Test design:本次为纯样式行为变更,用行为矩阵覆盖三种指针场景与两个主题,并读取浏览器计算后的
background-color,直接证明层级关系;现有客户端行为测试与仓库 typecheck 作为回归面。rgb(21,21,23),与 tab 条相同rgb(54,54,56)rgb(40,40,41)亮于选中rgb(40,40,41)rgb(54,54,56)rgb(255,255,255),hoverrgb(242,243,244)rgb(233,235,238),hoverrgb(242,243,244)Test entries:
node node_modules/vitest/vitest.mjs run packages/plugin-renderer/tests(本地)— Convax renderer 客户端与 Host 行为回归,42 个测试文件 / 471 个用例全部通过,其中包含 tab 切换、拖拽排序、键盘移动与焦点恢复。Proof
pnpm run typecheck(本地)— 仓库类型检查,9 个 task 全部成功(改动仅 CSS,无类型面变化)。Proof
design-platform.css真实 token)— 三种场景 × 深浅主题,读取[data-active]与 hover tab 的background-color;改动前 hover 会覆盖选中填充,改动后选中始终最高。Proof
AI Usage
AI declaration (v0.1.2):
auto