fix(app-iced): 下载页页头「内容库」选中态反转(M229 复审 F3)

`pages/content.rs::section_switcher` 把 `on_content` 写死成 `true`,而下载页也调它,
于是版本管理页的页头把「内容库」画成选中、「版本管理」画成未选中。

改成由调用方给位置:下载页传 false、内容库页自己传 true;并加一条源码层面的调用点断言
(iced 的 Element 不可内省,判据只有一行,写错必红)。

不是 M229 引入的缺陷(M109 就有),按复审要求单独提交,不与收官换肤混在一起。
This commit is contained in:
AskaEth committed 2026-11-11 01:49:14 +08:00
1 parent db541c820e
commit f9877a89d8
3 files changed
+27 -2

No files matched your search

@@ -98,3 +98,22 @@ fn the_default_demo_screen_has_no_retry_surface() {
);
}
}
/// M229 复审 F3 的回归门:页头一级切换的选中态由**调用方所在页**决定,不是写死「内容库」。
///
/// 抓得住:`download.rs` 又传回 `true`(下载页页头的「内容库」被画成选中,正是 F3 的现场)。
/// 抓不住:像素长什么样(那要截图);iced 的 `Element` 不可内省,所以这条从源码层面钉住调用点——
/// 判据只有一行,读的人也不会误解。
#[test]
fn the_download_header_marks_versions_selected_not_content() {
let download = include_str!("../download.rs");
assert!(
download.contains("section_switcher(ui, catalog, false)"),
"下载页是「版本管理」那一侧,必须传 false(传 true = F3 复发)"
);
let content_view = include_str!("view.rs");
assert!(
content_view.contains("section_switcher(ui, catalog, true)"),
"内容库页自己那一份必须传 true"
);
}