From 8db1c5ab16a87b47f818229abb81125bd3dfc82a Mon Sep 17 00:00:00 2001 From: AskaEth Date: Tue, 3 Nov 2026 21:38:32 +0800 Subject: [PATCH] =?UTF-8?q?test(app-iced):=20M104=20=E6=95=B0=E5=80=BC?= =?UTF-8?q?=E8=A1=A8=E8=A1=A5=E4=B8=A4=E8=A1=8C=EF=BC=88900=20Detached=20?= =?UTF-8?q?=3D=20404=E3=80=811180@360=20=3D=20812=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 报告里贴的那张表要和测试里的表逐行对上:新增的两行证明「拆出后中栗拿回整窗宽,实例详情列 404」 与「360 档把实例页挤成单列(812 < 816 的两列门槛)」这两条结论都是断言的,不是手算的。 --- crates/app-iced/src/pages/agent/metrics/tests.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/app-iced/src/pages/agent/metrics/tests.rs b/crates/app-iced/src/pages/agent/metrics/tests.rs index 3cd7722..444b226 100644 --- a/crates/app-iced/src/pages/agent/metrics/tests.rs +++ b/crates/app-iced/src/pages/agent/metrics/tests.rs @@ -20,6 +20,8 @@ use super::{ #[test] fn the_column_table_matches_the_mission_widths() { // (窗口, 档位, 右栗面板, 拖拽缝, 中栗, 实例详情列, 单列页列宽) + // + // 第三列是**面板宽度**,前两列的「展开档」用默认锚 320;360 那一行显式给值(见 `set_expanded`)。 let expect = [ (1180.0, RailState::Detached, 0.0, 0.0, 1180.0, 424.0, 424.0), ( @@ -32,11 +34,14 @@ fn the_column_table_matches_the_mission_widths() { 424.0, ), (1180.0, RailState::Expanded, 320.0, 8.0, 852.0, 356.0, 424.0), + // 360 档:中栗 812 掉到 medium 档 ⇒ 实例页退化单列(不再有两列硬挤) + (1180.0, RailState::Expanded, 360.0, 8.0, 812.0, 424.0, 424.0), (1024.0, RailState::Detached, 0.0, 0.0, 1024.0, 424.0, 424.0), (1024.0, RailState::Collapsed, 48.0, 0.0, 976.0, 424.0, 424.0), // 1024 展开:中栗 696 掉到 medium 档 ⇒ 实例页退化成单列(不再两列硬挤) (1024.0, RailState::Expanded, 320.0, 8.0, 696.0, 424.0, 424.0), // 900 收起:中栗 852 仍够 list-detail(几何门槛 816),详情列 356 + (900.0, RailState::Detached, 0.0, 0.0, 900.0, 404.0, 424.0), (900.0, RailState::Collapsed, 48.0, 0.0, 852.0, 356.0, 424.0), (900.0, RailState::Expanded, 320.0, 8.0, 572.0, 424.0, 424.0), // 700 < 进程最小窗宽 880:展开档不成立(中栗会被压到 472 以下),退回收起档 @@ -44,7 +49,13 @@ fn the_column_table_matches_the_mission_widths() { ]; for (window, rail, width, gutter, content, detail, single) in expect { - let laid_out = layout_for(window, rail, DEFAULT_EXPANDED_WIDTH); + // 展开档用「锚 320」或表里显式给的更宽档(360)——收起/拆出的行也给 320,不影响结果 + let expanded = if width > DEFAULT_EXPANDED_WIDTH { + width + } else { + DEFAULT_EXPANDED_WIDTH + }; + let laid_out = layout_for(window, rail, expanded); assert_eq!( (laid_out.rail, laid_out.gutter, laid_out.content), (width, gutter, content),