fix(app-iced): M104 App::width 改名 rail_width,别撞 tests/no_hardcoded_tokens 的尺寸字面量门禁

那条门禁扫 src/{shell,pages,app},把任何 `.width(数字)` 都当成「布局尺寸写死」拦下来
——测试里 `agent.width(1180.0)` 被误判成控件调用点。改名后语义还更准(它返回的是右栗宽度,
不是「这个控件多宽」)。cargo test -p unlucky-app-iced(含集成测试)418 + 6 全绿。
This commit is contained in:
AskaEth committed 2026-11-04 00:21:32 +08:00
1 parent ecb3d08445
commit 6eb2846313
3 files changed
+8 -4

No files matched your search

+2 -2
View File
@@ -327,7 +327,7 @@ fn the_detached_state_frees_the_rail_slot() {
let mut agent = AgentUi::new();
agent.detach();
assert!(docked(&ui, &agent, 1180.0).is_none());
assert_eq!(agent.width(1180.0), 0.0);
assert_eq!(agent.rail_width(1180.0), 0.0);
assert_eq!(agent.content_width(1180.0), 1180.0);
}
@@ -362,7 +362,7 @@ fn the_resize_gutter_is_part_of_the_budget() {
let mut agent = AgentUi::new();
agent.expand();
assert_eq!(
agent.width(1180.0) + RESIZE_GUTTER,
agent.rail_width(1180.0) + RESIZE_GUTTER,
1180.0 - agent.content_width(1180.0)
);