fix(app-iced): 复审 r1 四条 P2 收口(M234)
- P2-1 判据恒绿:`gallery/probe/bases.rs` 的「反向检查」把字段档计数(`:172` 遮蔽后的
`hits`)拿去比按钮档 stray ⇒ 恒绿。改成 `button_hits` / `field_hits` 两个计数,各比各的
stray,失败信息的数值与单位对齐量测对象。变异自证:卡列里留一颗忘了 `.base(..)` 的按钮
⇒ 该断言单独红(2137 px vs 3178 px,退出码 101)。
- P2-2 FAB 的底错了:禁用态背景仍是满档 `PrimaryContainer`(`Disabled.layer() == None`),
38% 内容却合在画布上。改成 `Base::of(PrimaryContainer)` + `on_container = false`
(那一层 10% 在 FAB 身上不存在),两处调用收进一个 `content_color()`;新增值判据
`disabled_fab_ink_composites_over_its_own_container`(修前 #8CA0AA / 修后 #548FBC 量级)。
- P2-3 漏改:`selection::paint::state_layer()`(hover/focus/pressed)与 `list_item` 的
状态层叠底仍写死 `Role::Surface`,改成跟 `base`;同类两处(`assemble::transparent_state_color`
的 Outlined/Text hover、drawer 项药丸)一并跟上。
- P2-4 文档失真:`feedback/{action,mod}.rs` 删掉「本地 α 合成 / 规则只认两档」的旧描述
与失效链接;`list_item` 的旧签名;三处 `probe/base.rs` → `probe/bases.rs`;
新增 `surfaces::elevated::tests::the_card_base_constant_is_the_role_the_card_paints`
真断言(原来只在文档里声称那条测试守 `BASE`),并把这句描述改准。
- nit:`disabledbase.rs` 字符串里塌成一行的续行空格、probe 汇总行把列左缘横坐标说成
「像素计数」的措辞。
门禁(CARGO_TARGET_DIR=C:/Temp/ull-target/wt-234):fmt / check --all-targets /
test -p unlucky-app-iced(896 + 6 通过,0 失败)/ clippy --workspace --all-targets -D warnings /
文件 ≤400 全绿;probe 浅色与深色都过。
This commit is contained in:
1 parent
35dbefb08d
commit
9bb3c33b8c
17 files changed
+190
-72
No files matched your search
@@ -10,21 +10,21 @@
|
||||
//! 这里把三列**并排**摆出来,每列一块板、板底就是控件真踩的那层底:
|
||||
//!
|
||||
//! ```text
|
||||
//! canvas Surface ← 页面底色
|
||||
//! card SurfaceContainer ← `surfaces::elevated::card` 的底(`elevated::BASE`)
|
||||
//! panel SurfaceContainerLow ← Card 层(取景板 / 面板)
|
||||
//! canvas Surface ← 页面底色
|
||||
//! card SurfaceContainer ← `surfaces::elevated::card` 的底(`elevated::BASE`)
|
||||
//! panel SurfaceContainerLow ← Card 层(取景板 / 面板)
|
||||
//! ```
|
||||
//!
|
||||
//! 每列都是**同一族控件**:Filled/Outlined 禁用按钮、Filled 禁用字段、禁用开关与 chip、
|
||||
//! 禁用搜索条、禁用列表项、禁用滑块、禁用 tab。控件拿的都是这一列的 [`Base`],
|
||||
//! 所以列与列之间的差别只有「底」。
|
||||
//!
|
||||
//! ## 判据(数值在 `probe/base.rs`)
|
||||
//! ## 判据(数值在 `probe/bases.rs`)
|
||||
//!
|
||||
//! 像素判据判的是**精确值**:卡列里的禁用按钮容器必须等于 `on-surface@10% 叠卡片底`,
|
||||
//! 且**不等于**画布底那一档。注意量级:Ink/Silver 板上 `Surface` 与 `SurfaceContainer`
|
||||
//! 只差个位数 RGB,10% 之后差 **≈1/255**——肉眼看不出来,所以这张图的用处是**取证**,
|
||||
//! 不是「看出区别」。真判据在 `interaction::disabled::tests`(逐值)与 `probe/base.rs`(像素)。
|
||||
//! 不是「看出区别」。真判据在 `interaction::disabled::tests`(逐值)与 `probe/bases.rs`(像素)。
|
||||
//!
|
||||
//! ```text
|
||||
//! ULL_GALLERY_SECTION=disabledbase $EXE --software-renderer --screen=gallery \
|
||||
@@ -94,9 +94,7 @@ pub(super) fn section<'a>(ui: &'a Ui) -> Element<'a, DemoMessage> {
|
||||
),
|
||||
row(columns).spacing(ui.space(Space::X2)),
|
||||
text(
|
||||
"三列的控件完全相同,只有脚下的底不同。禁用容器保留 90% 的底差(10% 只叠 on-surface),
|
||||
所以列间的差别 = 底差的九成(浅色 Silver 底差 11/255、深色 Ink 底差 6/255)。
|
||||
这张图是取证;判据在 `interaction::disabled::tests`(逐值)与 `gallery::probe` 的 disabledbase 段(精确像素)",
|
||||
"三列的控件完全相同,只有脚下的底不同。禁用容器保留 90% 的底差(10% 只叠 on-surface),所以列间差别 = 底差的九成(浅色 Silver 11/255、深色 Ink 6/255)。这张图是取证;判据在 `interaction::disabled::tests`(逐值)与 `gallery::probe` 的 disabledbase 段(精确像素)",
|
||||
)
|
||||
.size(note.size_px)
|
||||
.font(ui.font_of(note))
|
||||
|
||||
@@ -155,7 +155,7 @@ fn gallery_geometry_matches_the_tokens() {
|
||||
check_divider(&shot, &ui);
|
||||
return;
|
||||
}
|
||||
// 禁用态合成底(M234):三块板各按自己的底合成,判据在 `probe/base.rs`。
|
||||
// 禁用态合成底(M234):三块板各按自己的底合成,判据在 `probe/bases.rs`。
|
||||
if section == "disabledbase" {
|
||||
bases::check(&shot, &ui, flavor);
|
||||
return;
|
||||
|
||||
@@ -105,7 +105,7 @@ fn find_plate(shot: &Shot, role: Role, ui: &Ui, name: &str) -> Rect {
|
||||
assert_eq!(
|
||||
columns.len(),
|
||||
1,
|
||||
"{name} 列({role:?} 底,{color:?})应当恰好是 1 列,实测 {}: 板子尺寸判据 MIN {MIN_PLATE_W}×{MIN_PLATE_H}",
|
||||
"{name} 列({role:?} 底,{color:?})应当恰好是 1 列,实测 {}: 板子尺寸判据 MIN {MIN_PLATE_W}×{MIN_PLATE_H}",
|
||||
columns.len()
|
||||
);
|
||||
columns.remove(0)
|
||||
@@ -162,30 +162,34 @@ pub(super) fn check(shot: &Shot, ui: &Ui, flavor: unlucky_design::color::SchemeF
|
||||
(panel_rect, panel, panel_button, panel_field, "panel"),
|
||||
] {
|
||||
let (x0, x1, y0, y1) = rect;
|
||||
let hits = count_exact(shot, wanted_button, x0, x1, y0, y1);
|
||||
// 两个计数**分开命名**:它们是不同量测对象,拿字段数去比按钮 stray 会让断言恒绿
|
||||
// (M234 复审 P2-1 的现场)。
|
||||
let button_hits = count_exact(shot, wanted_button, x0, x1, y0, y1);
|
||||
assert!(
|
||||
hits >= MIN_BUTTON_PX,
|
||||
"{name} 列里「叠 {:?}」的禁用按钮容器只有 {hits} px(应 ≥{MIN_BUTTON_PX}):\
|
||||
这一列的禁用控件没把真实父底传下去",
|
||||
button_hits >= MIN_BUTTON_PX,
|
||||
"{name} 列里「叠 {:?}」的禁用按钮容器只有 {button_hits} px(应 ≥{MIN_BUTTON_PX}): 这一列的禁用控件没把真实父底传下去",
|
||||
base.role()
|
||||
);
|
||||
let hits = count_exact(shot, wanted_field, x0, x1, y0, y1);
|
||||
let field_hits = count_exact(shot, wanted_field, x0, x1, y0, y1);
|
||||
assert!(
|
||||
hits >= MIN_FIELD_PX,
|
||||
"{name} 列里「叠 {:?}」的禁用字段容器只有 {hits} px(应 ≥{MIN_FIELD_PX})",
|
||||
field_hits >= MIN_FIELD_PX,
|
||||
"{name} 列里「叠 {:?}」的禁用字段容器只有 {field_hits} px(应 ≥{MIN_FIELD_PX})",
|
||||
base.role()
|
||||
);
|
||||
// 反向:这一列里不许出现「叠画布底」的那一档
|
||||
let stray = count_exact(shot, canvas_button, x0, x1, y0, y1);
|
||||
|
||||
// 反向 ①:**按钮**档 —— 这一列里「叠画布」的按钮容器不许和「叠该列底」的比肩。
|
||||
// 这条抓的是「只修了一半」:同列里一部分按钮仍走画布底时,正确档与错误档的像素量接近。
|
||||
let stray_button = count_exact(shot, canvas_button, x0, x1, y0, y1);
|
||||
assert!(
|
||||
hits > stray * STRAY_RATIO,
|
||||
"{name} 列里「叠 {:?}」的禁用按钮容器只有 {hits} px,而「叠画布」的有 {stray} px (要求前者 ≥ 后者 ×{STRAY_RATIO})—— 这一列的控件仍在按 Role::Surface 合成",
|
||||
button_hits > stray_button * STRAY_RATIO,
|
||||
"{name} 列里「叠 {:?}」的禁用按钮容器 {button_hits} px,而「叠画布」的**按钮容器** 有 {stray_button} px(要求前者 ≥ 后者 ×{STRAY_RATIO})—— 这一列的按钮仍在按 Role::Surface 合成",
|
||||
base.role()
|
||||
);
|
||||
let stray = count_exact(shot, canvas_field, x0, x1, y0, y1);
|
||||
// 反向 ②:**字段**档(同理,各用各的计数)
|
||||
let stray_field = count_exact(shot, canvas_field, x0, x1, y0, y1);
|
||||
assert!(
|
||||
hits > stray * STRAY_RATIO,
|
||||
"{name} 列里「叠 {:?}」的禁用字段容器只有 {hits} px,而「叠画布」的有 {stray} px (要求前者 ≥ 后者 ×{STRAY_RATIO})",
|
||||
field_hits > stray_field * STRAY_RATIO,
|
||||
"{name} 列里「叠 {:?}」的禁用字段容器 {field_hits} px,而「叠画布」的**字段容器** 有 {stray_field} px(要求前者 ≥ 后者 ×{STRAY_RATIO})—— 这一列的字段仍在按 Role::Surface 合成",
|
||||
base.role()
|
||||
);
|
||||
assert!(
|
||||
@@ -205,12 +209,14 @@ pub(super) fn check(shot: &Shot, ui: &Ui, flavor: unlucky_design::color::SchemeF
|
||||
let canvas_card_hits = count_exact(shot, card_button, cx0, cx1, cy0, cy1);
|
||||
assert!(
|
||||
canvas_hits > canvas_card_hits * STRAY_RATIO,
|
||||
"画布列里「叠画布」的禁用按钮容器 {canvas_hits} px,而「叠卡片底」的有 {canvas_card_hits} px —— 画布列的控件被传了卡片底"
|
||||
"画布列里「叠画布」的禁用按钮容器 {canvas_hits} px,而「叠卡片底」的有 {canvas_card_hits} px —— 画布列的控件被传了卡片底"
|
||||
);
|
||||
|
||||
eprintln!(
|
||||
"[probe] OK section=disabledbase flavor={flavor:?}:\
|
||||
canvas 按钮 {:?} / 卡片 {} / 面板 {} ⇒ 三列各按自己的底合成",
|
||||
canvas_button, card_rect.0, panel_rect.0
|
||||
画布列 x<{} · 卡片列左缘 x={}..{} · 面板列左缘 x={}..{};\
|
||||
按钮容器色 canvas {:?}({canvas_hits} px)⇒ 三列各按自己的底合成\
|
||||
(两个数字都是列左缘横坐标,不是像素计数)",
|
||||
card_rect.0, card_rect.0, card_rect.1, panel_rect.0, panel_rect.1, canvas_button
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user