From e7d7a9cc90ac4b90c5ef56f0d9cc9b46bc22e8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sat, 9 May 2026 20:46:11 -0400 Subject: [PATCH] Use real Notion brand glyph on the home Open Notion pill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit home.jsx renders the Open Notion pill with `` — the actual N-in-a-rounded-square mark. We were drawing a generic BookOpen icon there, so the pill read as just another quick action instead of a branded shortcut. Split `render_pill` so it accepts an `AnyElement` leading slot; the two icon-only pills go through `render_pill_icon`, the Notion pill hands in `render_glyph_for(Some("notion.so"), …, 14.0)` directly. cargo test --workspace: 440 passed, 0 failed. --- crates/ely_app/src/shell/chrome/home/hero.rs | 35 ++++++++++++++------ 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/crates/ely_app/src/shell/chrome/home/hero.rs b/crates/ely_app/src/shell/chrome/home/hero.rs index d7f9a66..0464b4e 100644 --- a/crates/ely_app/src/shell/chrome/home/hero.rs +++ b/crates/ely_app/src/shell/chrome/home/hero.rs @@ -7,7 +7,7 @@ use gpui_component::IconName; use crate::shell::ElyShell; -use crate::shell::chrome::SERIF_FAMILY; +use crate::shell::chrome::{SERIF_FAMILY, render_glyph_for}; use super::style::{ ARROW_CHIP_BG, PILL_BG, PILL_BG_HOVER, SEARCH_BG, card_shadow, soft_shadow, @@ -121,14 +121,14 @@ fn render_suggestion_pills(cx: &mut Context) -> AnyElement { .items_center() .justify_center() .gap(px(8.0)) - .child(render_pill( + .child(render_pill_icon( "pill-search-tabs", IconName::Search, "Search Tabs", cx, |shell, window, cx| shell.focus_address_bar(window, cx), )) - .child(render_pill( + .child(render_pill_icon( "pill-switch-workspace", IconName::LayoutDashboard, "Switch Workspace", @@ -137,7 +137,7 @@ fn render_suggestion_pills(cx: &mut Context) -> AnyElement { )) .child(render_pill( "pill-open-notion", - IconName::BookOpen, + render_glyph_for(Some("notion.so"), "N", 14.0), "Open Notion", cx, |shell, window, cx| shell.open_internal_tab("https://www.notion.so", window, cx), @@ -145,13 +145,31 @@ fn render_suggestion_pills(cx: &mut Context) -> AnyElement { .into_any_element() } -fn render_pill( +fn render_pill_icon( id: &'static str, icon: IconName, label: &'static str, cx: &mut Context, handler: F, ) -> AnyElement +where + F: Fn(&mut ElyShell, &mut gpui::Window, &mut Context) + 'static, +{ + let leading = div() + .text_color(rgb(colors::INK_3)) + .text_size(px(12.0)) + .child(icon) + .into_any_element(); + render_pill(id, leading, label, cx, handler) +} + +fn render_pill( + id: &'static str, + leading: AnyElement, + label: &'static str, + cx: &mut Context, + handler: F, +) -> AnyElement where F: Fn(&mut ElyShell, &mut gpui::Window, &mut Context) + 'static, { @@ -169,12 +187,7 @@ where .hover(|style| style.bg(rgba(PILL_BG_HOVER))) .active(|style| style.opacity(0.82)) .on_click(cx.listener(move |shell, _, window, cx| handler(shell, window, cx))) - .child( - div() - .text_color(rgb(colors::INK_3)) - .text_size(px(12.0)) - .child(icon), - ) + .child(leading) .child( div() .text_size(px(12.0))