From c918dc9be7a4b07fdd56f433b79e60eaed4eb023 Mon Sep 17 00:00:00 2001 From: Fini Date: Sat, 4 Jul 2026 12:30:27 +0800 Subject: [PATCH] test(editor): re-anchor footer hover probe after layout fixes The palette slot removal shifted the right cluster 28px right, and the input-height width basis fix (measuring wrap against the real inner width) made the old probe text wrap and lift the footer band; probe with a single-line text at the new offsets. --- .../src/widget_host/chat_design_hover_tests.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/crates/op-host-native/src/widget_host/chat_design_hover_tests.rs b/crates/op-host-native/src/widget_host/chat_design_hover_tests.rs index d54f43a09..fc9f29f10 100644 --- a/crates/op-host-native/src/widget_host/chat_design_hover_tests.rs +++ b/crates/op-host-native/src/widget_host/chat_design_hover_tests.rs @@ -87,21 +87,20 @@ fn cursor_move_tracks_chat_footer_buttons() { "gpt-5", "GPT-5", )); - host.editor_state_mut() - .chat - .set_input_text("design a login page"); + host.editor_state_mut().chat.set_input_text("design"); let viewport_w = 1440.0; let viewport_h = 900.0; host.last_viewport_w = viewport_w; host.last_viewport_h = viewport_h; let chat_rect = host.ai_chat_rect(viewport_w, viewport_h).unwrap(); - // Footer right cluster (#38/#42), laid out right-to-left from the panel - // edge: ⚡ speed | 📎 attach | 🎨 palette | ↑ send. With PAD=16, a 28px - // send circle, 4px gaps and 24px icon buttons, the attach icon centres at - // `size.x - 88` (send centre ≈ -30, palette centre ≈ -60, attach ≈ -88). - // The old `-68` now lands on the palette icon. + // Footer right cluster, laid out right-to-left from the panel edge: + // ⚡ speed | 📎 attach | ↑ send (the inert palette slot is gone). With + // PAD=16, a 28px send circle, 4px gaps and 24px icon buttons, the attach + // icon centres at `size.x - 60` (send centre ≈ -30). The input text must + // stay single-line at the panel's real inner width — a wrapped line adds + // 20px to the input area and shifts the whole footer band up. let attach = Point2D::new( - chat_rect.origin.x + chat_rect.size.x - 88.0, + chat_rect.origin.x + chat_rect.size.x - 60.0, chat_rect.origin.y + chat_rect.size.y - 19.0, ); let send = Point2D::new(