fix(webui): 候选菜单改用不透明弹层表面 —— 半透明+背景模糊把背后的表单糊进了列表

用户(2026-09-15,看着抄送/转发两处的候选):「你在选择框的模糊逻辑上用力过猛,
导致只能显示一条信息」。

实测(生产构建 4c2bf26,浏览器里读计算样式,壁纸开):
  菜单 background: rgba(255,255,255,0.5) + backdrop-filter: blur(8px) saturate(1.1)
  而它浮在**表单自己**之上(主题输入框 y=294 正落在菜单 284-510 下面)
⇒ 背后的输入框/标签被糊一遍再从半透明列表底下透上来,只有顶行还读得清。

根因与 2026-09-14 那次「模糊叠模糊」同族:把**控件档**(0.5 透 + 8px 模糊)用在
**弹层**上。控件背后是面板自身,透一点好看;弹层背后是别的内容,透就是叠两份内容。

- 新增 .popup-surface(rgb(var(--c-white)),不取 backdrop-filter;壁纸开时单独压回不透明,
  否则会撞上 html[data-bg='on'] .bg-white 那条接管规则)
- .popup-surface 并入「滚动区不淡」豁免(原来只认 .glass-control,换类会漏掉 → 弹层又被洗白)
- AddressInput 菜单 glass-control → popup-surface;旧断言 nav-merge.test.mjs:109 钉的正是
  那个错的意图(『地址建议菜单』必须用控件档),已改钉新意图

判据:narrow-layout 新增 4 条(表面不透明/不取模糊/壁纸开时也压回/菜单穿的类)+
nav-merge 反向对照。两侧都验:变异①换回 glass-control → 红;变异②改回 0.5 → 红;
复原 → 71 通过 0 失败。生产实测:rgba(...,0.5)+blur → rgb(255,255,255)+无模糊。
This commit is contained in:
2026-09-15 07:46:54 +08:00
parent 00df6bea74
commit e6048e9914
5 changed files with 88 additions and 9 deletions

View File

@ -181,7 +181,7 @@ export default function AddressInput({
{open && items.length > 0 && (
<div
className={`absolute z-20 w-full overflow-y-auto glass-control border border-gray-200 rounded-lg shadow-2 ${
className={`absolute z-20 w-full overflow-y-auto popup-surface border border-gray-200 rounded-lg shadow-2 ${
menuLayout.flip ? 'bottom-full mb-1' : 'top-full mt-1'
}`}
style={{ maxHeight: menuLayout.maxHeight }}

View File

@ -754,6 +754,9 @@ html[data-bg='on'] .bg-slate-100 {
*
* 必须显式加在元素上、并且**不要同时写 bg-white**:我的 `html[data-bg='on'] .bg-white`
* 接管规则会把任何 bg-white 拉回正文面那一档(0.88),写在这儿的透度会被它盖掉。
*
* ★ 只给**贴着面板、背后是自己人**的小控件用(按钮、输入框底)。
* 浮在别的内容**之上**的弹层不能用它 —— 见 .popup-surface。
*/
html[data-bg='on'] .glass-control {
background-color: rgb(var(--glass-base) / var(--bg-glass-control));
@ -761,6 +764,34 @@ html[data-bg='on'] .glass-control {
-webkit-backdrop-filter: blur(8px) saturate(1.1);
}
/*
* .popup-surface —— 浮在**别的内容之上**的弹层表面(候选菜单、下拉)。
*
* ★ 2026-09-15 用户(看着抄送/转发两处的候选列表):
* 「你在选择框的模糊逻辑上用力过猛,导致只能显示一条信息」
*
* 实测(壁纸开、生产构建 4c2bf26,在浏览器里读计算样式):
* 菜单 `background-color: rgba(255,255,255,0.5)` + `backdrop-filter: blur(8px)`,
* 而它压着的是**表单自己**(主题输入框、各段标签)⇒ 背后的控件被糊成一片灰、
* 从半透明的列表底下透上来。列表越往下,越分不清哪行是候选、哪行是背后的输入框。
*
* 根因与 2026-09-14 那次「模糊叠模糊」同族:把**控件档**(0.5 透 + 8px 模糊)
* 用在了**弹层**上。控件背后是面板自身,透一点好看;弹层背后是别的内容,
* 透就是把两份内容叠在一起。所以弹层给**不透明**表面,且不取背景模糊。
*/
.popup-surface {
background-color: rgb(var(--c-white));
backdrop-filter: none;
-webkit-backdrop-filter: none;
}
/* 壁纸开着也**不透明**:弹层不是壁纸的一部分,没有人希望壁纸从候选列表里透出来 */
html[data-bg='on'] .popup-surface {
background-color: rgb(var(--c-white));
backdrop-filter: none;
-webkit-backdrop-filter: none;
}
html[data-bg='on'] .bg-white {
background-color: rgb(var(--glass-base) / var(--bg-glass));
}
@ -1500,7 +1531,8 @@ html[data-bg='on'] .glass-card:hover {
* 已经「有交代」了 —— 那个淡出本来是为了不让长列表的卡片显得被硬切断的。
* 而弹层高度本来就小,淡出只会把首尾项洗白(实测:候选菜单 58px,淡掉 24px)。
*/
.overflow-y-auto.glass-control {
.overflow-y-auto.glass-control,
.overflow-y-auto.popup-surface {
-webkit-mask-image: none;
mask-image: none;
}