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
@@ -22,10 +22,14 @@
|
||||
//!
|
||||
//! | 状态 | 条件 | 组件 |
|
||||
//! |---|---|---|
|
||||
//! | 加载 | 快照里没有版本列表([`Download::is_loading`]) | 不确定态进度条 + 文案([`states::loading`]) |
|
||||
//! | 空 | 列表拉到了、过滤后为空([`Download::is_empty`]) | `EmptyState` + 刷新 CTA([`states::empty`]) |
|
||||
//! | 加载 | 快照里没有版本列表([`Download::is_loading`]) | 标题 + 说明,**居中、无进度形状**([`states::loading`]) |
|
||||
//! | 空 | 列表拉到了、过滤后为空([`Download::is_empty`]) | `EmptyState` + 刷新 CTA,**同样居中**([`states::empty`]) |
|
||||
//! | 有数据 | 有版本行 | Tabs + 计数头 + `ListItem` 列表([`rows`]) |
|
||||
//! | 安装中 / 失败 | `AppState::install` 不为空 | 进度条 + 阶段 + 「取消」/「打开日志」([`install`]) |
|
||||
//! | 安装中 | `AppState::install` 在跑 | 阶段 + **进度条(仅当进度已知)** + 计数 + 「取消」([`install`]) |
|
||||
//! | 失败 | `install.stage == Failed` | **`ErrorContainer` 面板**:`Error` 图标/标题 + 实心「打开日志」,**没有进度条**([`install`]) |
|
||||
//!
|
||||
//! 两个占位状态(加载 / 空)走**同一套规则**:内容在可用区居中(依据:`feedback::empty_state`
|
||||
//! 的既有口径 `12b §15.4`,且两态互切时内容不会纵向跳)。
|
||||
//!
|
||||
//! ## 意图 → 消息 → 指令(页面只发意图,不做乐观回显)
|
||||
//!
|
||||
|
||||
Reference in new issue
Block a user