Skip to content
Open
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: 11 additions & 7 deletions apps/desktop-gpui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,17 @@ must retain the dirty draft and expose reload/merge recovery.

The native app uses calibrated, consistent corner radii from `ui::theme::radius` (`XS` 2 px,
`SM` 4 px, `MD` 6 px, `LG` 8 px, `XL` 12 px, `FULL` pill/circle) while leaving full-window
roots, split-pane dividers, edge-to-edge banners, and hairlines sharp. `clippy.toml` disallows
GPUI's uncalibrated Tailwind rounding shortcuts (`rounded_sm`, `rounded_md`, etc.) so rounded
surfaces go through `ui::theme::radius`. Motion remains near-instant: functional transitions,
such as a toast entering or leaving and the chat panel's reveal, take 70 ms with linear easing;
decorative reveals are gone. Continuous indicators (spinners, audio meters, the recording pulse
and progress) keep their timing. Parity comparisons judge layout, copy and behavior, not exact
web radii or easing.
roots, split-pane dividers, edge-to-edge banners, and hairlines sharp. Single-line interactive
controls (buttons, icon buttons, single-line inputs/search, selects, segmented controls,
chips/badges, collapsed chat bar) and single-line nav/menu rows use `radius::FULL`
(pills/circles), while containers (cards, popovers, dialogs, textareas, multi-line rows) keep
calibrated rounded-rectangle radii (`SM`–`XL`). `clippy.toml` disallows GPUI's uncalibrated
Tailwind rounding shortcuts (`rounded_sm`, `rounded_md`, etc.) so rounded surfaces go through
`ui::theme::radius`. Motion remains near-instant: functional transitions, such as a toast
entering or leaving and the chat panel's reveal, take 70 ms with linear easing; decorative
reveals are gone. Continuous indicators (spinners, audio meters, the recording pulse and
progress) keep their timing. Parity comparisons judge layout, copy and behavior, not exact web
radii or easing.

## Visual parity

Expand Down
5 changes: 3 additions & 2 deletions apps/desktop-gpui/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2359,8 +2359,9 @@ impl Render for ApplicationView {
.id("hide-meeting")
.a11y_button(hide.text)
.a11y_language(hide.locale)
.p_2()
.rounded(crate::ui::theme::radius::MD)
.px_3()
.py_2()
.rounded(crate::ui::theme::radius::FULL)
.cursor_pointer()
.child(hide.text)
.on_click(cx.listener(|this, _, _, cx| {
Expand Down
8 changes: 4 additions & 4 deletions apps/desktop-gpui/src/application/chrome.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl ApplicationView {
.ml_2()
.size(px(28.))
.id("title-sidebar")
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.justify_center()
Expand All @@ -310,7 +310,7 @@ impl ApplicationView {
.a11y_language(label.locale)
.w(px(46.))
.h(px(28.))
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.justify_center()
Expand Down Expand Up @@ -473,9 +473,9 @@ impl ApplicationView {
.id(("application-menu-entry", index))
.a11y_menu_item(label.text)
.a11y_language(label.locale)
.px_2()
.px_3()
.py(px(6.))
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.justify_between()
Expand Down
10 changes: 5 additions & 5 deletions apps/desktop-gpui/src/application/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ impl Instruction {
.a11y_language(back.locale)
.h(px(36.))
.px_3()
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.gap(px(6.))
Expand Down Expand Up @@ -329,7 +329,7 @@ impl Instruction {
.w_full()
.h(px(40.))
.px_4()
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.justify_center()
Expand Down Expand Up @@ -410,8 +410,8 @@ impl Instruction {
.child(
div()
.h(px(40.))
.px_3()
.rounded(radius::MD)
.px_4()
.rounded(radius::FULL)
.flex()
.items_center()
.border_1()
Expand All @@ -431,7 +431,7 @@ impl Instruction {
.a11y_disabled_language(!enabled, submit.locale)
.h(px(40.))
.px_4()
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.justify_center()
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop-gpui/src/application/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ fn screen_for_locale(
.mt_6()
.h(px(36.))
.px_4()
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.justify_center()
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop-gpui/src/application/startup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ pub fn gate(window: &mut Window, cx: &mut App) -> Option<Div> {
.a11y_button(copy_label)
.h(px(36.))
.px_4()
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.justify_center()
Expand Down Expand Up @@ -451,7 +451,7 @@ pub fn gate(window: &mut Window, cx: &mut App) -> Option<Div> {
.a11y_language(quit.locale)
.h(px(36.))
.px_4()
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.justify_center()
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop-gpui/src/application/toasts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ fn button(
.id(id)
.min_h(px(28.))
.min_w_0()
.px(px(10.))
.px_3()
.py(px(4.))
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.justify_center()
Expand Down
15 changes: 10 additions & 5 deletions apps/desktop-gpui/src/chat/composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,14 +812,19 @@ impl Composer {
) -> AnyElement {
let attr = |key| node.attr(key).and_then(Value::as_str).unwrap_or_default();
let thumbnail = self.thumbnails.get(attr("id")).cloned();
let has_thumbnail = thumbnail.is_some();
div()
.mt(px(-1.))
.flex()
.items_center()
.gap_1()
.px(px(6.))
.when_else(
has_thumbnail,
|view| view.pl(px(4.)).pr_2(),
|view| view.px_2(),
)
.py(px(2.))
.rounded(radius::MD)
.rounded(radius::FULL)
.border_1()
.border_color(colors.border)
.bg(colors.muted)
Expand Down Expand Up @@ -859,7 +864,7 @@ impl Composer {
})
.flex_shrink_0()
.p(px(2.))
.rounded(radius::SM)
.rounded(radius::FULL)
.cursor_pointer()
.hover(|style| style.bg(colors.accent))
.on_mouse_down(
Expand Down Expand Up @@ -1065,8 +1070,8 @@ impl Composer {
.a11y_press(cx, move |this, _, cx| this.insert_mention(index, cx))
.w_full()
.h(px(32.))
.px_2()
.rounded(radius::MD)
.px_3()
.rounded(radius::FULL)
.flex()
.items_center()
.gap(px(6.))
Expand Down
6 changes: 3 additions & 3 deletions apps/desktop-gpui/src/chat/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,9 @@ fn render_block(block: &Block, style: &Style, id: &str) -> AnyElement {
.flex()
.items_center()
.gap_2()
.px(px(6.))
.px_2()
.py_1()
.rounded(radius::MD)
.rounded(radius::FULL)
.border_1()
.border_color(colors.border)
.child(download_button(
Expand Down Expand Up @@ -917,7 +917,7 @@ fn control(
.a11y_disabled(style.streaming)
.group(group.clone())
.p_1()
.rounded(radius::SM)
.rounded(radius::FULL)
.when(style.streaming, |view| view.opacity(0.5))
.when(!style.streaming, |view| view.cursor_pointer())
.child(
Expand Down
26 changes: 13 additions & 13 deletions apps/desktop-gpui/src/chat/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub fn overlay(
.flex()
.items_center()
.px_4()
.rounded(radius::XL)
.rounded(radius::FULL)
.border_1()
.border_color(colors.border.opacity(0.7))
.bg(if dark(window) {
Expand Down Expand Up @@ -320,7 +320,7 @@ impl ChatView {
.a11y_language(label.locale)
.group(id)
.size(px(size))
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.flex_none()
.items_center()
Expand Down Expand Up @@ -397,8 +397,8 @@ impl ChatView {
.relative()
.h(px(button))
.ml(px(-8.))
.px(px(10.))
.rounded(radius::MD)
.px_3()
.rounded(radius::FULL)
.flex()
.flex_none()
.items_center()
Expand Down Expand Up @@ -721,7 +721,7 @@ impl ChatView {
.a11y_button(copy_message_label.text)
.a11y_language(copy_message_label.locale)
.p_1()
.rounded(radius::SM)
.rounded(radius::FULL)
.cursor_pointer()
.on_click(cx.listener(move |this, _, _, cx| {
this.copy(id.clone(), text.clone(), cx)
Expand All @@ -739,7 +739,7 @@ impl ChatView {
.a11y_button(regenerate_message_label.text)
.a11y_language(regenerate_message_label.locale)
.p_1()
.rounded(radius::SM)
.rounded(radius::FULL)
.cursor_pointer()
.on_click(
cx.listener(|this, _, _, cx| this.regenerate(cx)),
Expand Down Expand Up @@ -826,7 +826,7 @@ impl ChatView {
.gap(px(6.))
.px_3()
.py(px(6.))
.rounded(radius::MD)
.rounded(radius::FULL)
.border_1()
.border_color(colors.primary)
.bg(colors.primary)
Expand Down Expand Up @@ -940,8 +940,8 @@ impl ChatView {
.items_center()
.gap(px(6.))
.py_2()
.pr_3()
.rounded(radius::MD)
.px_3()
.rounded(radius::FULL)
.cursor_pointer()
.text_sm()
.line_height(px(20.))
Expand Down Expand Up @@ -1260,9 +1260,9 @@ impl ChatView {
.flex()
.items_center()
.gap_2()
.px_2()
.px_3()
.py_1()
.rounded(radius::MD)
.rounded(radius::FULL)
.text_xs()
.line_height(px(16.))
.text_color(colors.muted_foreground)
Expand All @@ -1284,7 +1284,7 @@ impl ChatView {
.id(SharedString::from(format!("chat-queued-remove-{id}")))
.a11y_button(format!("Remove queued message: {text}"))
.size(px(24.))
.rounded(radius::SM)
.rounded(radius::FULL)
.flex()
.items_center()
.justify_center()
Expand Down Expand Up @@ -1786,7 +1786,7 @@ impl ChatView {
.a11y_language(close_label.locale)
.group("chat-table-fullscreen-close")
.p_1()
.rounded(radius::MD)
.rounded(radius::FULL)
.cursor_pointer()
.hover(|style| style.bg(colors.muted))
.on_click(cx.listener(|this, _, _, cx| {
Expand Down
8 changes: 4 additions & 4 deletions apps/desktop-gpui/src/editor/app_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,14 @@ pub fn reserve(
}

impl Chip {
/// `border`, `px-1.5`, the mark, then `gap-1.5` between the mark, header and subline.
/// `border`, `px-2`, the mark, then `gap-1.5` between the mark, header and subline.
fn width(&self) -> Pixels {
let mark = if self.mark == Mark::Checkbox {
20.
} else {
14.
};
px(2. + 12. + mark + 6. + 6.) + self.header.width + self.subline.width
px(2. + 16. + mark + 6. + 6.) + self.header.width + self.subline.width
}
}

Expand Down Expand Up @@ -457,7 +457,7 @@ fn paint_chip(hitbox: &Hitbox, chip: &Chip, colors: Theme, window: &mut Window,
let bounds = hitbox.bounds;
window.paint_quad(quad(
bounds,
radius::clamped_quad_radii(radius::MD, bounds.size),
radius::clamped_quad_radii(radius::FULL, bounds.size),
if hovered {
colors.accent
} else {
Expand All @@ -468,7 +468,7 @@ fn paint_chip(hitbox: &Hitbox, chip: &Chip, colors: Theme, window: &mut Window,
BorderStyle::Solid,
));
let middle = bounds.center().y;
let mut x = bounds.left() + px(7.);
let mut x = bounds.left() + px(9.);
let square = |x: Pixels, side: f32| {
Bounds::new(point(x, middle - px(side / 2.)), size(px(side), px(side)))
};
Expand Down
6 changes: 3 additions & 3 deletions apps/desktop-gpui/src/editor/find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ impl FindBar {
)
.a11y_disabled(disabled)
.p(px(2.))
.rounded(radius::SM)
.rounded(radius::FULL)
.flex_shrink_0()
.when(active, |view| view.bg(colors.accent))
.when(!disabled, |view| {
Expand Down Expand Up @@ -488,11 +488,11 @@ impl Render for FindBar {
let row = || {
div()
.h(px(28.))
.rounded(radius::MD)
.rounded(radius::FULL)
.flex()
.items_center()
.gap(px(6.))
.px_2()
.px_3()
.bg(colors.muted)
.text_xs()
};
Expand Down
Loading