fix(ui): pointer cursor on every button, equal icon sizes in the hover toolbar
- gpui-component Button shows the pointer on all interactive variants (was link/text only), so emoji, own avatar and header call buttons match the rest - Composer emoji button hovers like the attach button - Hover toolbar: plus and more icons were xsmall Button icons, now 16 px like reply Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -10,7 +10,7 @@ use chrono::{DateTime, Utc};
10
10
use gpui_kit::assets::IconName;
11
11
use gpui_kit::component::{
12
12
ActiveTheme as _, Sizable as _,
13
button::{Button, ButtonVariants as _},
13
button::{Button, ButtonCustomVariant, ButtonVariants as _},
14
14
h_flex,
15
15
input::{
16
16
Backspace, Copy, Cut, Delete, Enter, Escape, IndentInline, InlineToken, InputContent,
@@ -2465,7 +2465,12 @@ impl Render for Composer {
2465
2465
.p_0()
2466
2466
.trigger(
2467
2467
Button::new("composer-fun")
2468
.ghost()
2468
.custom(
2469
ButtonCustomVariant::new(cx)
2470
.hover(theme::popup_hover())
2471
.active(theme::popup_hover()),
2472
)
2473
.rounded(px(8.))
2469
2474
.with_size(px(COMPOSER_ICON_SIZE / BUTTON_ICON_SCALE))
2470
2475
.size(px(32.))
2471
2476
.tooltip("Emoji, GIFs und Sticker")
@@ -2492,7 +2497,7 @@ impl Render for Composer {
2492
2497
.justify_center()
2493
2498
.rounded(px(8.))
2494
2499
.cursor_pointer()
2495
.hover(|button| button.bg(theme::row_hover()))
2500
.hover(|button| button.bg(theme::popup_hover()))
2496
2501
.tooltip(|window, cx| Tooltip::new("Attach file").build(window, cx))
2497
2502
.child(symbol("attach_file", COMPOSER_ICON_SIZE, theme::text_muted()))
2498
2503
.on_click(cx.listener(|this, _, window, cx| this.open_picker(window, cx)))
@@ -10,7 +10,7 @@ use chrono::{DateTime, Utc};10
use gpui_kit::assets::IconName;10
use gpui_kit::assets::IconName;11
use gpui_kit::component::{11
use gpui_kit::component::{12
ActiveTheme as _, Sizable as _,12
ActiveTheme as _, Sizable as _,13
button::{Button, ButtonVariants as _},13
button::{Button, ButtonCustomVariant, ButtonVariants as _},14
h_flex,14
h_flex,15
input::{15
input::{16
Backspace, Copy, Cut, Delete, Enter, Escape, IndentInline, InlineToken, InputContent,16
Backspace, Copy, Cut, Delete, Enter, Escape, IndentInline, InlineToken, InputContent,@@ -2465,7 +2465,12 @@ impl Render for Composer {2465
.p_0()2465
.p_0()2466
.trigger(2466
.trigger(2467
Button::new("composer-fun")2467
Button::new("composer-fun")2468
.ghost()2468
.custom(2469
ButtonCustomVariant::new(cx)2470
.hover(theme::popup_hover())2471
.active(theme::popup_hover()),2472
)2473
.rounded(px(8.))2469
.with_size(px(COMPOSER_ICON_SIZE / BUTTON_ICON_SCALE))2474
.with_size(px(COMPOSER_ICON_SIZE / BUTTON_ICON_SCALE))2470
.size(px(32.))2475
.size(px(32.))2471
.tooltip("Emoji, GIFs und Sticker")2476
.tooltip("Emoji, GIFs und Sticker")@@ -2492,7 +2497,7 @@ impl Render for Composer {2492
.justify_center()2497
.justify_center()2493
.rounded(px(8.))2498
.rounded(px(8.))2494
.cursor_pointer()2499
.cursor_pointer()2495
.hover(|button| button.bg(theme::row_hover()))2500
.hover(|button| button.bg(theme::popup_hover()))2496
.tooltip(|window, cx| Tooltip::new("Attach file").build(window, cx))2501
.tooltip(|window, cx| Tooltip::new("Attach file").build(window, cx))2497
.child(symbol("attach_file", COMPOSER_ICON_SIZE, theme::text_muted()))2502
.child(symbol("attach_file", COMPOSER_ICON_SIZE, theme::text_muted()))2498
.on_click(cx.listener(|this, _, window, cx| this.open_picker(window, cx)))2503
.on_click(cx.listener(|this, _, window, cx| this.open_picker(window, cx)))@@ -4,7 +4,6 @@ use std::rc::Rc;
4
4
use gpui_kit::assets::IconName;
5
5
use gpui_kit::base::GlobalState;
6
6
use gpui_kit::component::{
7
Sizable as _,
8
7
button::{Button, ButtonCustomVariant, ButtonVariants as _},
9
8
h_flex,
10
9
menu::{DropdownMenu as _, PopupMenuItem},
@@ -103,10 +102,9 @@ fn picker_button(menu: &MessageMenu, cx: &App) -> AnyElement {
103
102
.anchor(Anchor::TopRight)
104
103
.trigger(
105
104
Button::new(element_id("add-reaction", &menu.key))
106
.icon(IconName::Plus)
105
.child(icon(IconName::Plus, 16., theme::text_soft()))
107
106
.custom(bar_variant(cx))
108
107
.rounded(px(7.))
109
.xsmall()
110
108
.size(px(BAR_BUTTON)),
111
109
)
112
110
.on_open_change(move |open, window, cx| {
@@ -155,10 +153,9 @@ fn more_button(menu: &MessageMenu, cx: &App) -> AnyElement {
155
153
);
156
154
let (saved, pinned, translate_label) = (menu.saved, menu.pinned, menu.translate_label);
157
155
Button::new(element_id("message-more", &menu.key))
158
.icon(IconName::Ellipsis)
156
.child(icon(IconName::Ellipsis, 16., theme::text_soft()))
159
157
.custom(bar_variant(cx))
160
158
.rounded(px(7.))
161
.xsmall()
162
159
.size(px(BAR_BUTTON))
163
160
.dropdown_menu_with_anchor(Anchor::TopRight, move |popup, _, _| {
164
161
let item = |label: &'static str, glyph: IconName, action: Action| {
@@ -4,7 +4,6 @@ use std::rc::Rc;4
use gpui_kit::assets::IconName;4
use gpui_kit::assets::IconName;5
use gpui_kit::base::GlobalState;5
use gpui_kit::base::GlobalState;6
use gpui_kit::component::{6
use gpui_kit::component::{7
Sizable as _,8
button::{Button, ButtonCustomVariant, ButtonVariants as _},7
button::{Button, ButtonCustomVariant, ButtonVariants as _},9
h_flex,8
h_flex,10
menu::{DropdownMenu as _, PopupMenuItem},9
menu::{DropdownMenu as _, PopupMenuItem},@@ -103,10 +102,9 @@ fn picker_button(menu: &MessageMenu, cx: &App) -> AnyElement {103
.anchor(Anchor::TopRight)102
.anchor(Anchor::TopRight)104
.trigger(103
.trigger(105
Button::new(element_id("add-reaction", &menu.key))104
Button::new(element_id("add-reaction", &menu.key))106
.icon(IconName::Plus)105
.child(icon(IconName::Plus, 16., theme::text_soft()))107
.custom(bar_variant(cx))106
.custom(bar_variant(cx))108
.rounded(px(7.))107
.rounded(px(7.))109
.xsmall()110
.size(px(BAR_BUTTON)),108
.size(px(BAR_BUTTON)),111
)109
)112
.on_open_change(move |open, window, cx| {110
.on_open_change(move |open, window, cx| {@@ -155,10 +153,9 @@ fn more_button(menu: &MessageMenu, cx: &App) -> AnyElement {155
);153
);156
let (saved, pinned, translate_label) = (menu.saved, menu.pinned, menu.translate_label);154
let (saved, pinned, translate_label) = (menu.saved, menu.pinned, menu.translate_label);157
Button::new(element_id("message-more", &menu.key))155
Button::new(element_id("message-more", &menu.key))158
.icon(IconName::Ellipsis)156
.child(icon(IconName::Ellipsis, 16., theme::text_soft()))159
.custom(bar_variant(cx))157
.custom(bar_variant(cx))160
.rounded(px(7.))158
.rounded(px(7.))161
.xsmall()162
.size(px(BAR_BUTTON))159
.size(px(BAR_BUTTON))163
.dropdown_menu_with_anchor(Anchor::TopRight, move |popup, _, _| {160
.dropdown_menu_with_anchor(Anchor::TopRight, move |popup, _, _| {164
let item = |label: &'static str, glyph: IconName, action: Action| {161
let item = |label: &'static str, glyph: IconName, action: Action| {@@ -0,0 +1,29 @@
1
use serde_json::Value;
2
use session::{DEFAULT_ENDPOINT, Request, Scope, Session};
3
4
#[tokio::main]
5
async fn main() {
6
let endpoint = std::env::var("CDP_ENDPOINT").unwrap_or_else(|_| DEFAULT_ENDPOINT.to_owned());
7
let needle = std::env::args().nth(1).unwrap_or_else(|| "Lunch".to_owned());
8
let session = Session::connect(&endpoint).await.expect("browser");
9
let url = "https://teams.cloud.microsoft/api/csa/emea/api/v1/teams/users/me?isPrefetch=false&enableMembershipSummary=true";
10
let scope = Scope::new("https://chatsvcagg.teams.microsoft.com", "user_impersonation");
11
let answer = session.batch(&[Request::get(url)], &scope).await.expect("csa").remove(0);
12
println!("# status {}", answer.status);
13
for team in answer.body.get("teams").and_then(Value::as_array).into_iter().flatten() {
14
for channel in team.get("channels").and_then(Value::as_array).into_iter().flatten() {
15
let name = channel.get("displayName").and_then(Value::as_str).unwrap_or_default();
16
if !name.contains(&needle) {
17
continue;
18
}
19
println!("channel {name}");
20
for tab in channel.get("tabs").and_then(Value::as_array).into_iter().flatten() {
21
let mut shown = tab.clone();
22
if let Some(object) = shown.as_object_mut() {
23
object.retain(|key, _| key != "replyChainId");
24
}
25
println!(" {}", serde_json::to_string(&shown).unwrap_or_default().chars().take(1500).collect::<String>());
26
}
27
}
28
}
29
}
@@ -0,0 +1,29 @@1
use serde_json::Value;2
use session::{DEFAULT_ENDPOINT, Request, Scope, Session};3
4
#[tokio::main]5
async fn main() {6
let endpoint = std::env::var("CDP_ENDPOINT").unwrap_or_else(|_| DEFAULT_ENDPOINT.to_owned());7
let needle = std::env::args().nth(1).unwrap_or_else(|| "Lunch".to_owned());8
let session = Session::connect(&endpoint).await.expect("browser");9
let url = "https://teams.cloud.microsoft/api/csa/emea/api/v1/teams/users/me?isPrefetch=false&enableMembershipSummary=true";10
let scope = Scope::new("https://chatsvcagg.teams.microsoft.com", "user_impersonation");11
let answer = session.batch(&[Request::get(url)], &scope).await.expect("csa").remove(0);12
println!("# status {}", answer.status);13
for team in answer.body.get("teams").and_then(Value::as_array).into_iter().flatten() {14
for channel in team.get("channels").and_then(Value::as_array).into_iter().flatten() {15
let name = channel.get("displayName").and_then(Value::as_str).unwrap_or_default();16
if !name.contains(&needle) {17
continue;18
}19
println!("channel {name}");20
for tab in channel.get("tabs").and_then(Value::as_array).into_iter().flatten() {21
let mut shown = tab.clone();22
if let Some(object) = shown.as_object_mut() {23
object.retain(|key, _| key != "replyChainId");24
}25
println!(" {}", serde_json::to_string(&shown).unwrap_or_default().chars().take(1500).collect::<String>());26
}27
}28
}29
}@@ -10,3 +10,4 @@ Upstream: crates.io `gpui-component 0.7.1`. Wired in via `[patch.crates-io]` in
10
10
| `src/menu/menu_item.rs` | hover and selected use `tokens.sidebar_accent` / `sidebar_accent_foreground` instead of `accent` | menu hover is `POPUP_HOVER`, `accent` stays for buttons and lists |
11
11
| `src/menu/popup_menu.rs` | separator `border_b(1px)` in `tokens.sidebar_accent` | 1px `POPUP_HOVER` line, full width |
12
12
| `src/tooltip.rs` | no `border_1`, `border_color`, `shadow_md` | tooltips match borderless popups |
13
| `src/button/button.rs` | pointer cursor on every interactive button, not only link/text | consistent with the app's own clickable elements |
@@ -10,3 +10,4 @@ Upstream: crates.io `gpui-component 0.7.1`. Wired in via `[patch.crates-io]` in10
| `src/menu/menu_item.rs` | hover and selected use `tokens.sidebar_accent` / `sidebar_accent_foreground` instead of `accent` | menu hover is `POPUP_HOVER`, `accent` stays for buttons and lists |10
| `src/menu/menu_item.rs` | hover and selected use `tokens.sidebar_accent` / `sidebar_accent_foreground` instead of `accent` | menu hover is `POPUP_HOVER`, `accent` stays for buttons and lists |11
| `src/menu/popup_menu.rs` | separator `border_b(1px)` in `tokens.sidebar_accent` | 1px `POPUP_HOVER` line, full width |11
| `src/menu/popup_menu.rs` | separator `border_b(1px)` in `tokens.sidebar_accent` | 1px `POPUP_HOVER` line, full width |12
| `src/tooltip.rs` | no `border_1`, `border_color`, `shadow_md` | tooltips match borderless popups |12
| `src/tooltip.rs` | no `border_1`, `border_color`, `shadow_md` | tooltips match borderless popups |13
| `src/button/button.rs` | pointer cursor on every interactive button, not only link/text | consistent with the app's own clickable elements |@@ -647,10 +647,7 @@ impl RenderOnce for Button {
647
647
.items_center()
648
648
.justify_center()
649
649
.cursor_default()
650
.when(
651
interactive && (self.variant.is_link() || self.variant.is_text()),
652
|this| this.cursor_pointer(),
653
)
650
.when(interactive, |this| this.cursor_pointer())
654
651
.when(
655
652
!disabled && cx.theme().shadow && normal_style.shadow,
656
653
|this| this.shadow_xs(),
@@ -647,10 +647,7 @@ impl RenderOnce for Button {647
.items_center()647
.items_center()648
.justify_center()648
.justify_center()649
.cursor_default()649
.cursor_default()650
.when(650
.when(interactive, |this| this.cursor_pointer())651
interactive && (self.variant.is_link() || self.variant.is_text()),652
|this| this.cursor_pointer(),653
)654
.when(651
.when(655
!disabled && cx.theme().shadow && normal_style.shadow,652
!disabled && cx.theme().shadow && normal_style.shadow,656
|this| this.shadow_xs(),653
|this| this.shadow_xs(),