fix(app-iced): M75 复审 P1-A/P1-B/P2 —— 内容色跟态走 + 断言收紧 + 矩阵排版
P1-A 禁用内容色没下发(视觉 reviewer:text/standard 的 enabled 与 disabled 逐像素相同): assemble 里内容色恒取 ui.color(content) 再被 text().color() 钉死,Style.text_color 的 38% 永远下发不出去。新增 assemble::content_color(ui, forced, content),文字按钮与 IconButton 共用;probe 补两条像素断言(禁用 38% 墨迹必须存在、禁用容器内不得有满档 OnPrimary)。 P1-B 渲染层断言抓不住 2px 级回归(reviewer 变异验证:高度 42 仍绿): 高度改成精确 == 40;补「带图标左内边距 16(墨迹 ≈21)」断言;分隔线从「行数」改成 「墨量覆盖率 ≈1.0」(1.5dp 会到 ≈1.5)。 P2-1 probe 给了图却读不到时硬失败(只有完全没给 ULL_GALLERY_SHOT 才跳过)。 P2-2 Geometry::stroke 真正接到 Border.width;IconGeometry::icon 改由 side−2×padding 推导。 P2-3 矩阵 cell 宽 192→160(总宽 1040<1180,disabled 列不再被裁);禁用格保留前后图标。 P2-4 补注:snap 仅 wgpu 实现,CPU 验收图不受它影响。
This commit is contained in:
1 parent
8072f1cc7e
commit
e905fa3922
8 files changed
+195
-68
No files matched your search
@@ -211,36 +211,33 @@ fn every_component_file_stays_under_the_line_limit() {
|
||||
);
|
||||
}
|
||||
|
||||
/// 四个家族桩必须**只有桩**(不许顺手把别人的组件写了)。
|
||||
/// 四个家族目录必须存在且结构完整。
|
||||
///
|
||||
/// 判据:文件里 `pub fn` 只允许出现一次,且它是 `demo`。
|
||||
/// **这里刻意不再限制「pub fn 有几个」**:M76 往 `selection/` 里加 Checkbox/Radio 是它的本职工作,
|
||||
/// 而家族线被明确要求不许改 `gate.rs`——把「桩还在不在」写成 pub fn 计数,等于给 M76 埋一个
|
||||
/// 它无权拆的地雷(reviewer P1-C)。越界与否由 merge gate 的 scope 判定(各家族目录只归对应
|
||||
/// mission),门禁只管「地基还在」:
|
||||
///
|
||||
/// - 四个家族目录各有 `mod.rs`;
|
||||
/// - `components/mod.rs` 仍声明这五个家族 + gallery(谁把声明删了,这里先红)。
|
||||
#[test]
|
||||
fn the_four_family_stubs_are_still_stubs() {
|
||||
fn the_five_families_are_declared_and_present() {
|
||||
let declared =
|
||||
std::fs::read_to_string(components_dir().join("mod.rs")).expect("读 components/mod.rs");
|
||||
|
||||
for family in ["selection", "inputs", "feedback", "navigation"] {
|
||||
let path = components_dir().join(family).join("mod.rs");
|
||||
let text = std::fs::read_to_string(&path)
|
||||
.unwrap_or_else(|error| panic!("家族桩 {} 不见了:{error}", path.display()));
|
||||
let product = product_part(&text);
|
||||
|
||||
let pub_fns: Vec<&str> = product
|
||||
.lines()
|
||||
.filter(|line| line.trim_start().starts_with("pub fn "))
|
||||
.collect();
|
||||
|
||||
assert_eq!(
|
||||
pub_fns.len(),
|
||||
1,
|
||||
"{} 只该有占位 demo(),实际有 {} 个 pub fn:{pub_fns:?}(别顺手实现别人的家族)",
|
||||
path.display(),
|
||||
pub_fns.len()
|
||||
);
|
||||
let dir = components_dir().join(family);
|
||||
let file = dir.join("mod.rs");
|
||||
assert!(file.is_file(), "家族目录 {} 缺 mod.rs", dir.display());
|
||||
assert!(
|
||||
pub_fns[0].contains("fn demo"),
|
||||
"{} 里唯一那个 pub fn 应该是 demo,实际是 {:?}",
|
||||
path.display(),
|
||||
pub_fns[0]
|
||||
declared.contains(&format!("pub mod {family};")),
|
||||
"components/mod.rs 少了 `pub mod {family};` 声明"
|
||||
);
|
||||
}
|
||||
assert!(
|
||||
declared.contains("pub mod gallery;") && declared.contains("pub mod buttons;"),
|
||||
"components/mod.rs 的声明被动了"
|
||||
);
|
||||
}
|
||||
|
||||
/// gallery 的五个家族文件必须都在(`mod.rs` 声明了它们,缺一个就编译不过——
|
||||
|
||||
Reference in new issue
Block a user