Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Dropdown menus across the app now match the branch selector's popover
style: one surface treatment, roomier rows with the same hover, and the
current choice marked with the active fill and a check. This covers the Git
page's Sync and "…" menus, changed-file and merge/rebase menus, the Review
source menu, the Usage filter and row menus, the composer's add/mode
popups, and the sidebar session menu; the branch, label, template, and
Settings pickers now share the same row treatment. Right-click context
menus stay compact.

### Fixed

- The Issue page's **Label** dropdown now closes when its trigger is clicked a
second time. The popup dismissed on mouse-down and the trigger's mouse-up
re-opened it on the same click; the trigger now honors the same gesture
guard every other dropdown uses.

### Fixed

- **New Task** now starts a fresh session when pi has exited instead of doing
Expand Down
4 changes: 3 additions & 1 deletion crates/orbit-pi/src/app/composer_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ impl OrbitApp {
);
}
// Full width of the chat box, so long paths are never cut.
let popup = context_menu_surface(div(), &theme)
let popup = picker_surface(div(), &theme)
.w(px(CONTENT_MAX_W))
.py(picker::list_padding_y(&theme))
.flex()
.flex_col()
.gap(DynamicSpacing::Base01.px(&theme))
.overflow_hidden()
.occlude()
.on_mouse_down_out(cx.listener(Self::on_autocomplete_outside_down))
Expand Down
11 changes: 4 additions & 7 deletions crates/orbit-pi/src/app/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5937,19 +5937,16 @@ impl OrbitApp {
.h(row_h)
.justify_between()
.cursor_pointer()
// The keyboard cursor is a wash; the
// chosen option keeps the fill.
.when(highlighted_row, |row| row.bg(theme.overlay_strong))
.when(!highlighted_row && selected_row, |row| {
// The chosen option keeps the fill; the
// keyboard cursor rides the same wash.
.when(highlighted_row || selected_row, |row| {
row.bg(theme.active)
})
.when(!highlighted_row && !selected_row, |row| {
row.hover(|style| style.bg(theme.overlay))
})
.text_color(if selected_row {
.text_color(if selected_row || highlighted_row {
theme.active_fg
} else if highlighted_row {
theme.text
} else {
theme.text_2
})
Expand Down
22 changes: 16 additions & 6 deletions crates/orbit-pi/src/app/sidebar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,8 @@ pub(crate) fn session_menu_popup(
.w_full()
.flex()
.flex_col()
.py(picker::list_padding_y(&theme))
.gap(DynamicSpacing::Base01.px(&theme))
.child(menu_item(
"menu-pin",
"icons/pin.svg",
Expand Down Expand Up @@ -1090,9 +1092,9 @@ pub(crate) fn session_menu_popup(
.into_any_element()
};

// Zed's context-menu shell sizes the action list to its entries from a
// 200px minimum; the delete confirmation keeps its own fixed card.
let popup = context_menu_surface(div(), &theme)
// The branch selector's picker shell sizes the action list to its
// entries; the delete confirmation keeps its own fixed card.
let popup = picker_surface(div(), &theme)
.when(confirm, |pop| {
pop.w(px(210.)).p(DynamicSpacing::Base12.px(&theme))
})
Expand Down Expand Up @@ -1656,9 +1658,11 @@ where
let (hover_bg, text_color, icon_color) = if danger {
(theme.stop_red_hover, theme.send_fg, theme.send_fg)
} else {
(theme.bg_hover, theme.text_2, theme.text_3)
(theme.overlay, theme.text_2, theme.text_3)
};
context_menu_entry(div().id(id), &theme)
picker_entry(div().id(id), &theme)
.h(picker::entry_height(&theme))
.flex_none()
.cursor_pointer()
.when(danger, |s| s.bg(theme.stop_red))
.hover(move |s| s.bg(hover_bg))
Expand All @@ -1668,7 +1672,13 @@ where
this.update(cx, |app, cx| (on_click)(app, cx));
})
.child(icon(icon_path, context_menu::ICON.px(&theme), icon_color))
.child(label.to_string())
.child(
div()
.flex_1()
.min_w_0()
.truncate()
.child(label.to_string()),
)
}

/// Reveal a session file in the OS file manager (macOS first, matching the
Expand Down
62 changes: 42 additions & 20 deletions crates/orbit-pi/src/app/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1604,11 +1604,10 @@ impl OrbitApp {
list = list.child(
picker_entry(entry, &theme)
.cursor_pointer()
.when(highlighted, |row| row.bg(theme.overlay_strong))
.when(selected && !highlighted, |row| {
row.bg(theme.accent.opacity(0.1))
.when(selected || highlighted, |row| row.bg(theme.active))
.when(!selected && !highlighted, |row| {
row.hover(|style| style.bg(theme.overlay))
})
.hover(|style| style.bg(theme.overlay_strong))
.on_hover(move |hovered, _, cx| {
if *hovered {
this.update(cx, |app, cx| {
Expand All @@ -1635,8 +1634,8 @@ impl OrbitApp {
.flex()
.items_center()
.justify_center()
.bg(if selected {
theme.accent.opacity(0.16)
.bg(if selected || highlighted {
theme.active_fg.opacity(0.14)
} else {
theme.overlay
})
Expand All @@ -1655,15 +1654,23 @@ impl OrbitApp {
.child(
div()
.font_weight(FontWeight::MEDIUM)
.text_color(if selected { theme.text } else { theme.text_2 })
.text_color(if selected || highlighted {
theme.active_fg
} else {
theme.text_2
})
.child(mode.label()),
)
.child(
div()
.mt(DynamicSpacing::Base02.px(&theme))
.whitespace_normal()
.text_size(picker::SECONDARY_TEXT.px(&theme))
.text_color(theme.text_3)
.text_color(if selected || highlighted {
theme.active_fg.opacity(0.75)
} else {
theme.text_3
})
.child(mode.description()),
),
)
Expand All @@ -1677,10 +1684,12 @@ impl OrbitApp {
);
}

let popup = context_menu_surface(div(), &theme)
let popup = picker_surface(div(), &theme)
.w(px(300.))
.py(picker::list_padding_y(&theme))
.flex()
.flex_col()
.gap(DynamicSpacing::Base01.px(&theme))
.overflow_hidden()
.occlude()
.key_context("AccessMenu")
Expand Down Expand Up @@ -1791,11 +1800,10 @@ impl OrbitApp {
list = list.child(
picker_entry(entry, &theme)
.cursor_pointer()
.when(highlighted, |row| row.bg(theme.overlay_strong))
.when(selected && !highlighted, |row| {
row.bg(theme.accent.opacity(0.1))
.when(selected || highlighted, |row| row.bg(theme.active))
.when(!selected && !highlighted, |row| {
row.hover(|style| style.bg(theme.overlay))
})
.hover(|style| style.bg(theme.overlay_strong))
.on_hover(move |hovered, _, cx| {
if *hovered {
this.update(cx, |app, cx| {
Expand All @@ -1822,8 +1830,8 @@ impl OrbitApp {
.flex()
.items_center()
.justify_center()
.bg(if selected {
theme.accent.opacity(0.16)
.bg(if selected || highlighted {
theme.active_fg.opacity(0.14)
} else {
theme.overlay
})
Expand All @@ -1842,15 +1850,23 @@ impl OrbitApp {
.child(
div()
.font_weight(FontWeight::MEDIUM)
.text_color(if selected { theme.text } else { theme.text_2 })
.text_color(if selected || highlighted {
theme.active_fg
} else {
theme.text_2
})
.child(mode.label()),
)
.child(
div()
.mt(DynamicSpacing::Base02.px(&theme))
.whitespace_normal()
.text_size(picker::SECONDARY_TEXT.px(&theme))
.text_color(theme.text_3)
.text_color(if selected || highlighted {
theme.active_fg.opacity(0.75)
} else {
theme.text_3
})
.child(mode.description()),
),
)
Expand All @@ -1864,10 +1880,12 @@ impl OrbitApp {
);
}

let popup = context_menu_surface(div(), &theme)
let popup = picker_surface(div(), &theme)
.w(px(300.))
.py(picker::list_padding_y(&theme))
.flex()
.flex_col()
.gap(DynamicSpacing::Base01.px(&theme))
.overflow_hidden()
.occlude()
.key_context("WorkflowMenu")
Expand Down Expand Up @@ -2032,7 +2050,9 @@ impl OrbitApp {
let this = this.clone();
let entry = div().id(ElementId::NamedInteger("add-menu-row".into(), ix as u64));
list = list.child(
context_menu_entry(entry, &theme)
picker_entry(entry, &theme)
.h(picker::entry_height(&theme))
.flex_none()
.cursor_pointer()
.when(highlighted, |row| row.bg(theme.active))
.hover(|style| style.bg(theme.overlay))
Expand Down Expand Up @@ -2079,9 +2099,11 @@ impl OrbitApp {
);
}

let popup = context_menu_surface(div(), &theme)
let popup = picker_surface(div(), &theme)
.py(picker::list_padding_y(&theme))
.flex()
.flex_col()
.gap(DynamicSpacing::Base01.px(&theme))
.overflow_hidden()
.occlude()
// The menu owns the keyboard while open (`AddMenu` bindings in
Expand Down
Loading
Loading