fix(download): M94 r1 —— 五条复审(P2-1/2/3/4/6)
P2-1 占位规则统一:加载态原先贴顶、空态居中 → 两态都走同一套「内容在可用区居中」
(依据:components::feedback::empty_state 的既有口径 12b §15.4;两态互切不再纵向跳)。
实测两个状态的内容中心线 y=449 / y=445(差 4px)。
P2-2 文案只说真能做到的事:
- 删「The list appears after the first successful fetch; this page never goes blank.」
(工程话术 + 承诺了 UI 做不到的「永空白」)→「如果一直停在这里,点右上角的刷新。」
(对应页头那个真的 Refresh 按钮)
- 空态「Switch the category or clear the filter」删掉「清筛选」(页面没有筛选控件)
→「换一个分类,或刷新一次列表。」
- 副标题「Version list from the official manifest」去掉 manifest 这种工程词 →「可以安装的版本」
P2-3 去掉静止的 indeterminate 进度条:页面没有帧订阅,indeterminate 只会拿到一个固定相位
(看起来像 17% 卡住)。加载态改成纯文字;安装面板只在进度已知时画 determinate。
两帧证据:215/512 → 条填 177px(42%),409/512 → 338px(80%),条随事件走而不是动画。
P2-4 失败态与安装中彻底不同构:失败不再画进度条,改成整块 ErrorContainer 面板
(ErrorContainer 底 + Error 图标 + Error 色标题 + 停在哪个文件 + 说明 + 实心「打开日志」)。
实测底色:浅色 (255,218,214) / 深色 (147,0,10),安装中面板底色仍是页面底色。
P2-6 死 key 与假守卫:
- 删掉没用的 DownloadSelected;
- 用真的守卫替换原来那条「前缀遍历 + 条数下限」:every_download_key_is_referenced_by_the_page
用 include_str! 把页面源码编进来,目录里每个 Download* key 必须在源码里出现 Key::Xxx。
实证:把 DownloadSelected 放回去 → 该测试红并点名 key;删掉 → 绿。
注释里也写清抓不住的三种情况(反向是编译错误 / 译文完整性归 i18n 自己的测试 / 宏拼 key 能骗过它)。
门禁:fmt --check 干净、clippy -D warnings 干净、app-iced 276 + i18n 23 全绿;
tests.rs 384→383 行(不再贴顶),其余文件均 ≤400。
This commit is contained in:
1 parent
57e8380b24
commit
9d6ee70301
6 files changed
+229
-145
No files matched your search
@@ -18,7 +18,7 @@
|
||||
//! --screen=download --screenshot=out.png --screenshot-theme=light --software-renderer
|
||||
//! ```
|
||||
//!
|
||||
//! 取值:`ready`(缺省)/ `loading` / `empty` / `selected` / `installing` / `failed`。
|
||||
//! 取值:`ready`(缺省)/ `loading` / `empty` / `selected` / `installing` / `installing-late` / `failed`。
|
||||
//! **只有 harness 与演示走这里**:产品路径由 `app/view.rs` 从 presenter 快照建模型。
|
||||
|
||||
use unlucky_presenter::dto::{
|
||||
@@ -45,6 +45,12 @@ pub fn demo(catalog: Catalog) -> Download {
|
||||
selected: Some("1.21.9".to_string()),
|
||||
..ready(catalog)
|
||||
},
|
||||
// 同一状态的第二个采样点:进度条随**事件**推进(不是动画),出图时两帧对照
|
||||
Some("installing-late") => Download {
|
||||
install: Some(install(InstallStage::Downloading, 0.8, catalog)),
|
||||
selected: Some("1.21.9".to_string()),
|
||||
..ready(catalog)
|
||||
},
|
||||
Some("selected") => Download {
|
||||
selected: Some("1.21.9".to_string()),
|
||||
..ready(catalog)
|
||||
|
||||
Reference in new issue
Block a user