chore(app-iced): M95 解 rebase 冲突的收尾 —— pages/mod.rs 收到 400 行

M94 合入后 `pages/mod.rs` 两侧增量叠加到了 **406 行**(全仓硬上限 400)。本提交只做三件
等价收紧,没有行为变化:

1. `demo_model` 的三个 `if` 收成一个 `match screen`(「哪页带演示数据」也更好读);
2. 我给 `Message::CopySummary` 写的 3 行 doc 收成 1 行(M94 的变体 doc 都是单行);
3. 删掉 `#[cfg(test)] mod tests;` 与 `pub use` 之间的一行空行。

顺带把 `demo_model` 的「只有实例页带数据」改成事实(实例/下载/日志三页都有演示数据——
这句在 M94 合入后就不成立了)。

收完 **正好 400 行**,仓库自己的守门测试(`components::gate` 的
`every_source_file_stays_under_the_line_limit`,扫 `src/**`)仍然绿。
This commit is contained in:
AskaEth committed 2026-11-02 22:31:47 +08:00
1 parent 0eb069fa37
commit 4fde22067e
1 file changed
+7 -13
+7 -13
View File
@@ -105,7 +105,6 @@ mod settings;
#[cfg(test)]
mod tests;
pub use download::{Category, Download};
pub use layout::{FrameMetrics, PageLayout, PaneKit, WidthClass};
pub use logs::{Confidence, Finding, Level, Line, Logs, Outcome};
@@ -151,9 +150,7 @@ pub enum Message {
CancelInstall,
/// 切换下载页分类(M94;app 层翻成 `AppCommand::ListVersions`,`All` 只画现有快照)。
SetCategory(Category),
/// 把一段现成的文本塞进剪贴板(**M95 日志页**:诊断卡片的一行摘要)。
///
/// 文本由页面造(它是唯一同时看得见规则 id / 分类 / 置信度的地方),app 层只负责落剪贴板。
/// 把现成文本塞进剪贴板(**M95**:诊断卡片的一行摘要,文本由页面造,app 只搬)。
CopySummary(String),
}
@@ -361,17 +358,14 @@ pub fn app<'a>(ui: &'a Ui, model: &'a Model) -> Element<'a, Message> {
/// 演示模型(`pages_demo` example 与单测用;真页面走 `app/view.rs` 的 `AppState` 转换)。
///
/// 只有实例页带数据,其余三页是占位视觉(不读数据)。
/// 实例 / 下载 / 日志三页带演示数据,设置页仍是占位视觉。
pub fn demo_model(screen: Screen, window_width: f32) -> Model {
let mut model = Model::new(screen, window_width, Some(screen.nav()));
if screen == Screen::Instances {
model.instances = instances::demo();
}
if screen == Screen::Download {
model.download = download::demo(unlucky_i18n::Lang::En.catalog());
}
if screen == Screen::Logs {
model.logs = logs::demo(model.lang);
match screen {
Screen::Instances => model.instances = instances::demo(),
Screen::Download => model.download = download::demo(unlucky_i18n::Lang::En.catalog()),
Screen::Logs => model.logs = logs::demo(model.lang),
Screen::Settings => {}
}
model
}