Skip to content

fix(override): 半透明侧栏开启时钉住设置页背板(修设置页重影) - #4

Open
ase-sketch wants to merge 1 commit into
rinDBeans:mainfrom
ase-sketch:fix/translucent-settings-backdrop
Open

ase-sketch wants to merge 1 commit into
rinDBeans:mainfrom
ase-sketch:fix/translucent-settings-backdrop

Conversation

@ase-sketch

Copy link
Copy Markdown

问题

开启设置卡里的「半透明侧边栏」(translucentSidebar)后,打开宿主设置子页会出现文字重影:设置页导航与主侧栏(插件管理 / 工作区列表等)的文字叠在一起。

根因

两条各自正确的设计撞在一起:

  1. themeOverrideCss() 的半透明分支把 --dsw-alias-bg-sidebar 全局改写成 rgba(surface, 0.72)(src/client/override.js);
  2. 设置页的全屏背板 --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;
  • 真机复现路径:开「半透明侧边栏」→ 设置子页。已在本机 profile 的安装副本以同一补丁做过热修(生成产物逐字节一致),视觉复核需要维护者刷新页面确认。

Problem

With translucentSidebar on, 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 to rgba(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 in scripts/check.mjs (68/68 pass).

设置页全屏背板(--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 半透明条目补记该行为
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