fix(app-iced): M125 r2 —— chips 档「还没选版本」不再对半切;宽度表换成实测值
r1 复审 p2-1:`TailShare::of` 只判档位,于是 chips 档「刚进页面」(面板只有一行 提示)也被五五分——700×760 下列表 8 个版本只显示 4 个、下半块 ≈160px 空画布, 而修前(main)这一态是 7 整行。修法:判据加**面板形态**,`Hint` 在任何档位都钉死, `Chips` + `Options`/`Install` 才共享。实测回到 7 整行(与 main 同一水位)。 守门:新增 `options_shot/ready.rs`(`ULL_DL_READY_SHOT`,不设 `ULL_DL_DEMO` 出的 700×760 图):列表区至少读出 6 个版本号。它在 r1 的图上**红**(4 个,原生输出见 mission 报告),在修后图上绿(7 个)。三条旧守门照旧(chips / compact / wide), chips 与 compact 换修前图仍红。 r1 复审 p2-2:宽度表的实测值改正(同一张 736 图逐项量): `1.21` 26(余 6)、`1.20` 28(余 4)、`24w` **29**(余 3)、`All versions` 墨迹画到 x=247(裁切边 248,只差 1px)⇒ 桶标签余量是 **3~6px** 而不是 6;「短标签『全部』= 32 零余量」这条论证的对比强度随之写准(比桶标签的 3~6px 更薄)。 `rails/major.rs` 的表格、`options_shot/compact.rs` 的测试文档一并改成实测值; 「墨迹右边界」那条反例也从 216..244 改成实测 216..247。 r1 复审 p3-1:第二级「全部版本」的图标从网格(与第一级同字形同药丸、像素级同形) 换成文档/清单字形 `IconKind::Logs`,理由与「图标集里没有版本/历史字形」写进 `major_shape` 文档。 r1 复审 p3-2:chips 档最多三层滚动(列表 / 面板 / loader 菜单)作为**已知风险** 登记在 `install.rs` 文档里,并写明为什么「把实例名移出滚动区」本轮不做(要拆 `options::section`,动三个文件,而且改完仍无法验证滚轮冒泡——没有通道)。
This commit is contained in:
1 parent
9c623a6fd3
commit
0f26ed3753
9 files changed
+283
-58
No files matched your search
@@ -146,37 +146,94 @@ fn the_demo_data_is_sane() {
|
||||
assert!(demo.rows.iter().all(|row| !row.supporting.contains('版')));
|
||||
}
|
||||
|
||||
/// 列表与尾部面板怎么分高,跟着**档位**走(M125 缺陷 1 的决策面)。
|
||||
/// 列表与尾部面板怎么分高:**档位 × 面板形态**两个条件同时成立才对半分。
|
||||
///
|
||||
/// 修前:面板一律按内容高钉在底部,700×760 的 chips 档里列表只剩 18px(0.4 行)。
|
||||
/// 修后:chips 档两半各 `Fill`(面板自己可滚),三栏三档照旧钉死(760 高下列表还有 3 整行、
|
||||
/// 面板整块在屏内,两样都对)。
|
||||
/// 修前(M123):面板一律按内容高钉在底部,700×760 的 chips 档里列表只剩 18px(0.4 行)。
|
||||
/// M125 r1 修法只判档位,又踩出另一条回归:chips 档「刚进页面还没选版本」(`Hint`,面板只有
|
||||
/// 一行提示)也被五五分,700×760 下 8 个版本只显示 4 个、下半块留 ≈160px 空画布
|
||||
/// (复审 P2-1 实测,修前是 8 行全在屏)。
|
||||
///
|
||||
/// 抓得住:有人把 chips 档改回 `Pinned`(700 下的像素守门 `a_chips_tier_shot_…` 立刻红);
|
||||
/// 或者把三栏档也改成 `Shared`(1180 下选项面板被切成一半,`an_options_shot_…` 会红)。
|
||||
/// 抓不住:**实际分到多少像素**(`iced` 的 `Element` 没有几何内省,那只能出图量,
|
||||
/// 见 `options_shot` 的像素断言与报告里的数值表)。
|
||||
/// 现在的判据:`Chips` **且**面板真占高度(`Options` / `Install`)才 `Shared`;
|
||||
/// `Hint` 在任何档位都 `Pinned`。
|
||||
///
|
||||
/// 抓得住:①chips 档改回「只判档位」(`Hint` 跟着对半分 ⇒ 列表掉到 4 行,像素守门
|
||||
/// `ready::a_ready_shot_keeps_the_whole_visible_list` 立刻红);②三栏档也改成 `Shared`
|
||||
/// (1180 下选项面板被切成一半,`an_options_shot_…` 会红)。
|
||||
/// 抓不住:**实际分到多少像素**(`iced` 的 `Element` 没有几何内省,那只能出图量)。
|
||||
#[test]
|
||||
fn the_chips_tier_shares_the_height_and_the_rails_tiers_pin_it() {
|
||||
fn the_chips_tier_shares_the_height_only_when_the_panel_takes_room() {
|
||||
use crate::pages::download::install::panel_state;
|
||||
use crate::pages::download::options::{InstallDraft, Loader, OptionsView};
|
||||
use crate::pages::download::rows::TailShare;
|
||||
use crate::pages::layout::VersionRailTier;
|
||||
use unlucky_presenter::state::AppState;
|
||||
|
||||
assert_eq!(TailShare::of(VersionRailTier::Chips), TailShare::Shared);
|
||||
let catalog = Lang::En.catalog();
|
||||
let mut app = AppState::new();
|
||||
app.apply(unlucky_presenter::dto::AppEvent::Core(
|
||||
unlucky_presenter::dto::CoreEvent::VersionListChanged(vec![version(
|
||||
"1.21.9",
|
||||
VersionKind::Release,
|
||||
false,
|
||||
)]),
|
||||
));
|
||||
|
||||
let row = VersionRow::of(&version("1.21.9", VersionKind::Release, false), catalog);
|
||||
// 选中版本 ⇒ 选项区(面板真的占高度)
|
||||
let options = Download {
|
||||
options: Some(OptionsView::of(
|
||||
&row,
|
||||
&app,
|
||||
&InstallDraft {
|
||||
selected: Some("1.21.9".to_string()),
|
||||
loader: Loader::Vanilla,
|
||||
loader_version: String::new(),
|
||||
instance_name: String::new(),
|
||||
},
|
||||
catalog,
|
||||
)),
|
||||
install: None,
|
||||
loaded: true,
|
||||
..Download::default()
|
||||
};
|
||||
// 刚进页面 ⇒ 只有一行提示
|
||||
let hint = Download {
|
||||
options: None,
|
||||
install: None,
|
||||
loaded: true,
|
||||
..Download::default()
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
TailShare::of(VersionRailTier::Chips, &panel_state(&options)),
|
||||
TailShare::Shared,
|
||||
"chips 档 + 选项区展开:对半分(列表 4 整行、面板自己可滚)"
|
||||
);
|
||||
assert_eq!(
|
||||
TailShare::of(VersionRailTier::Chips, &panel_state(&hint)),
|
||||
TailShare::Pinned,
|
||||
"chips 档 + 只有一行提示:钉死(8 个版本要在屏)"
|
||||
);
|
||||
for tier in [
|
||||
VersionRailTier::Wide,
|
||||
VersionRailTier::Narrow,
|
||||
VersionRailTier::Compact,
|
||||
] {
|
||||
assert_eq!(TailShare::of(tier), TailShare::Pinned, "{tier:?}");
|
||||
assert_eq!(
|
||||
TailShare::of(tier, &panel_state(&options)),
|
||||
TailShare::Pinned,
|
||||
"{tier:?}:三栏档一律钉死(面板整块在屏)"
|
||||
);
|
||||
assert_eq!(TailShare::of(tier, &panel_state(&hint)), TailShare::Pinned);
|
||||
}
|
||||
|
||||
// 两个装配点(三栏装配 / chips 分支)都**按档位**传,不许在某一处写死一个字面量
|
||||
// 两个装配点(三栏装配 / chips 分支)都**按档位 + 面板形态**传
|
||||
let chips_branch = include_str!("../../download.rs");
|
||||
let three_column = include_str!("../rails.rs");
|
||||
assert_eq!(
|
||||
chips_branch.matches("TailShare::of(rails.tier)").count()
|
||||
+ three_column.matches("TailShare::of(rails.tier)").count(),
|
||||
chips_branch.matches("TailShare::of(rails.tier,").count()
|
||||
+ three_column.matches("TailShare::of(rails.tier,").count(),
|
||||
2,
|
||||
"三栏装配与 chips 分支都要按档位传 TailShare"
|
||||
"三栏装配与 chips 分支都要把面板形态传进 TailShare::of"
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user