Skip to content

Commit e3470ae

Browse files
authored
@ context menu fixes. (#9237)
## Description <!-- Please remember to add your design buddy onto the PR for review, if it contains any UI changes! --> WISOTT! Fixes: - positioning of the menu in the new cloud mode input - some sharp corners poking through rounded ones for the selected item <img width="588" height="312" alt="Screenshot 2026-04-27 at 9 01 19 PM" src="https://github.com/user-attachments/assets/03cd565a-e869-4a3a-9ae3-98dd3d86c068" /> ## Testing <!-- How did you test this change? What automated tests did you add? If you didn't add any new tests, what's your justification for not adding any? If you're not sure whether you should add a test, check our testing policy: https://www.notion.so/warpdev/How-We-Code-at-Warp-257fe43d556e4b3c8dfd42f70004cc72#1f97825450504baa9c5fd87a737daa09 --> See image! ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
1 parent 84592e2 commit e3470ae

4 files changed

Lines changed: 22 additions & 3 deletions

File tree

app/src/search/ai_context_menu/styles.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ pub const MARGIN_RIGHT: f32 = 8.0;
33
pub const ESTIMATED_RESULT_HEIGHT: f32 = 24.0;
44
pub const MENU_ITEM_HORIZONTAL_PADDING: f32 = 16.0;
55
pub const MENU_ITEM_VERTICAL_PADDING: f32 = 4.0;
6+
pub const MENU_ITEM_HIGHLIGHT_CORNER_RADIUS: f32 = 8.0;

app/src/search/ai_context_menu/view.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,8 +1287,11 @@ impl AIContextMenu {
12871287
return self.render_no_results(app);
12881288
}
12891289

1290+
let last_display_index = filtered_categories.len().saturating_sub(1);
12901291
for (display_index, category) in filtered_categories.iter().enumerate() {
12911292
let is_selected = display_index == self.state.selected_category_index;
1293+
let is_first = display_index == 0;
1294+
let is_last = display_index == last_display_index;
12921295
let text_color = if is_selected {
12931296
theme.main_text_color(theme.accent()).into_solid()
12941297
} else {
@@ -1347,11 +1350,20 @@ impl AIContextMenu {
13471350
let accent_color = theme.accent();
13481351
let accent_overlay_color = theme.accent_overlay();
13491352

1353+
let highlight_radius = Radius::Pixels(styles::MENU_ITEM_HIGHLIGHT_CORNER_RADIUS);
1354+
let highlight_corner_radius = match (is_first, is_last) {
1355+
(true, true) => CornerRadius::with_all(highlight_radius),
1356+
(true, false) => CornerRadius::with_top(highlight_radius),
1357+
(false, true) => CornerRadius::with_bottom(highlight_radius),
1358+
(false, false) => CornerRadius::default(),
1359+
};
1360+
13501361
let category_clone_for_click = *category;
13511362
let category_row = Hoverable::new(hover_state, move |hover_state| {
13521363
let mut container = Container::new(row)
13531364
.with_horizontal_padding(styles::MENU_ITEM_HORIZONTAL_PADDING)
1354-
.with_vertical_padding(styles::MENU_ITEM_VERTICAL_PADDING);
1365+
.with_vertical_padding(styles::MENU_ITEM_VERTICAL_PADDING)
1366+
.with_corner_radius(highlight_corner_radius);
13551367
if is_selected {
13561368
container = container.with_background(accent_color);
13571369
} else if hover_state.is_hovered() {

app/src/terminal/input.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3429,6 +3429,12 @@ impl Input {
34293429
if let Some(ai_context_menu) = self.editor.as_ref(app).render_ai_context_menu() {
34303430
let position = position_id_for_cursor(self.editor.id());
34313431

3432+
let y_anchor = if self.is_cloud_mode_input_v2_composing(app) {
3433+
AnchorPair::new(YAxisAnchor::Bottom, YAxisAnchor::Top)
3434+
} else {
3435+
menu_positioning.completion_suggestions_y_anchor()
3436+
};
3437+
34323438
stack.add_positioned_overlay_child(
34333439
ai_context_menu,
34343440
OffsetPositioning::from_axes(
@@ -3442,7 +3448,7 @@ impl Input {
34423448
&position,
34433449
PositionedElementOffsetBounds::Unbounded,
34443450
OffsetType::Pixel(0.),
3445-
menu_positioning.completion_suggestions_y_anchor(),
3451+
y_anchor,
34463452
),
34473453
),
34483454
);

app/src/terminal/input/agent.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ impl Input {
333333
let menu_positioning = self.menu_positioning(app);
334334
let model = self.model.lock();
335335

336-
let mut stack = Stack::new().with_constrain_absolute_children();
336+
let mut stack = Stack::new();
337337

338338
// Apply the V2 gutter symmetrically (left + right) so the floating
339339
// input keeps equal breathing room on both sides as the pane shrinks.

0 commit comments

Comments
 (0)