fix(app-iced): M107 r2 复审 —— clippy needless_lifetimes + 搜索中点桶立刻生效
- **P1-1**:`group::active_bucket` 的显式生命周期是多余的(`needless_lifetimes`),省掉之后
`cargo clippy -p unlucky-app-iced -p unlucky-i18n -p unlucky-presenter --all-targets
-j 2 -- -D warnings` 才真的 exit 0。上一轮报告的那条「clippy 本轮未复跑」正是红的根因——
本轮把 clippy 纳入每次门禁(见报告)。
- **P2-1(b)**:搜索期间第二级侧栏原来「可点但没反应」(一致性放宽让桶失效,点击要等清空搜索
才生效)。现在**点桶 = 退出搜索 + 按该桶过滤**:`SelectMajor` 发现 `has_query()` 就先落选择
再 `rebuild_after_query("")`,一次点击做完「我要看这个桶」这件事。
判据:app 层 `clicking_a_bucket_during_a_search_leaves_the_search`(432 passed)。
门禁(真实退出码,无管道):
`cargo fmt --all --check` = 0;`clippy … -D warnings -j 2` = 0;`cargo test -p unlucky-app-iced --lib -j 2` = 432 passed / 0 failed
This commit is contained in:
1 parent
45544791e5
commit
f408bf5312
3 files changed
+56
-2
No files matched your search
@@ -62,6 +62,7 @@
|
||||
//! | 有命中 | 列表照常;侧栏**位置不动**;搜索条右侧给「N 个匹配」(跨类型读数) |
|
||||
//! | 一个都不命中 | [`states::no_match`]:没有匹配 + 换短片段 + 清空 |
|
||||
//! | 有命中但不在当前类型 | [`states::elsewhere`]:N 个在别的类型 + 「看全部类型」 |
|
||||
//! | 搜索中点第二级桶 | **退出搜索 + 按那个桶过滤**(点桶 = 「我就是要看这个桶」,见 `on_download`) |
|
||||
//!
|
||||
//! 查询词写在 presenter 快照的 `download_query` 里(页面无状态,见 [`model::Download::from_snapshot`]),
|
||||
//! 所以「搜索 → 任何事件回来之后仍然在搜」这条不需要页面持有任何字段。
|
||||
|
||||
@@ -151,7 +151,7 @@ pub fn buckets(rows: &[super::model::VersionRow]) -> Vec<Bucket> {
|
||||
/// 放宽之后「列表行数 = 当前分类里的命中数」,侧栏也不会有「选中项不在桶列表里」的幽灵态。
|
||||
/// `selected_major` 一直留在模型里,只是搜索期间不生效——清空搜索后原来的桶自动回来。
|
||||
#[must_use]
|
||||
pub fn active_bucket<'a>(model: &'a super::model::Download) -> Option<&'a str> {
|
||||
pub fn active_bucket(model: &super::model::Download) -> Option<&str> {
|
||||
if model.has_query() {
|
||||
None
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user