fix(override): 半透明侧栏开启时钉住设置页背板(修设置页重影) - #4
Open
ase-sketch wants to merge 1 commit into
Open
ase-sketch wants to merge 1 commit into
ase-sketch wants to merge 1 commit into
Conversation
设置页全屏背板(--cx-sm-surface-backdrop)复用 --dsw-alias-bg-sidebar;translucentSidebar 把该令牌改写成 rgba(·, 0.72) 后,全屏 overlay 透出压在下面的主窗口,设置页导航与主侧栏文字重影。settings-modal.css §1 早已裁决背板必须不透明(毛玻璃版 2026-09-27 被否决删除),本修补把开关与裁决对齐:覆盖层按主题向 div[data-cx-sm-panel] 钉回实色侧栏色(浅色连 --cx-sm-card-edge 一起钉,深色卡边由皮肤的 border-l1 分主题规则保持)。 - scripts/check.mjs 新增回归断言:背板双色钉实色、浅色卡边钉实色、深色卡边不被压 - 双语 README 半透明条目补记该行为
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.
问题
开启设置卡里的「半透明侧边栏」(
translucentSidebar)后,打开宿主设置子页会出现文字重影:设置页导航与主侧栏(插件管理 / 工作区列表等)的文字叠在一起。根因
两条各自正确的设计撞在一起:
themeOverrideCss()的半透明分支把--dsw-alias-bg-sidebar全局改写成rgba(surface, 0.72)(src/client/override.js);--cx-sm-surface-backdrop复用的正是--dsw-alias-bg-sidebar(skins/codex-ink/settings-modal.css §1)。而设置页是
position: fixed; inset: 0的全屏 overlay,主窗口(含主侧栏)并未卸载、就压在下面——背板变成 72% 不透明后,底层文字直接透上来。settings-modal.css §1 的注释里其实已经裁决过这件事:早年的「78% alpha + 毛玻璃」背板在 2026-09-27 被否决删除,结论是「页面颜色必须钉死」。半透明开关是后加的,无意中把这个被否决的效果又引了回来(且没有毛玻璃)。
修法
覆盖层在
translucentSidebar === true时额外输出两条面板作用域规则,把设置页背板按主题钉回实色侧栏色(SKIN_DEFAULTS的#f6f6f6/#0f0f0f):--cx-sm-card-edge(它同吃 bg-sidebar 令牌,否则白卡的发丝边会变成 72% 白、几近消失);body[data-ds-dark-theme]的分主题规则(border-l1),元素数更多,本规则压不过它,行为保持原样。特异性:覆盖层选择器比皮肤多一个
[data-codex-ui-override]属性,与本模块既有「特异性 +1」约定一致,不依赖样式表顺序。主界面的半透明侧栏效果不受影响。验证
scripts/check.mjs新增回归断言(背板双色钉实色 / 浅色卡边钉实色 / 深色卡边不被压),68/68 ALL PASS;scripts/build.mjs重新生成 client.js / theme.css;Problem
With
translucentSidebaron, the host settings subpage shows double text: the settings nav overlaps the still-mounted main sidebar. The full-screen settings backdrop (--cx-sm-surface-backdrop) reuses--dsw-alias-bg-sidebar, which the switch rewrites torgba(surface, 0.72)— so the whole overlay becomes translucent and the main window bleeds through. The skin had already ruled this backdrop must stay opaque (frosted-glass variant rejected on 2026-09-27); the newer switch accidentally reintroduced it.Fix
When the switch is on, the override layer additionally pins the settings panel backdrop (and, in light,
--cx-sm-card-edge) to the solid per-theme sidebar colour. Main-window sidebar translucency is unaffected. New regression assertions inscripts/check.mjs(68/68 pass).