From 2852ab63ee9abd6a5947ceab5c92a1ee03ce1c8c 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 22:30:34 -0400 Subject: [PATCH] Mirror omnibar value into the home search shortcut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The home page hero search showed a static "Search the web or ELY" placeholder regardless of what the user had typed in the omnibar. Click the home search → focus the omnibar → start typing → omnibar shows the text but the home search still says "Search the web or ELY". The user reasonably reads that as "my typing went nowhere." Read `command_input.value()` from the home search renderer and echo it (in INK when set, INK_4 placeholder when empty). Single Input still owns the actual state — the home search is a click-to-focus shortcut, this is a read-only echo so the user sees their typing reflected here too. Truncate so long URLs don't blow the row. Plumb `&ElyShell` through `render_home_page → render_hero → render_search_bar`. --- crates/ely_app/src/shell/chrome/home/hero.rs | 23 +++++++++++++++---- crates/ely_app/src/shell/chrome/home/mod.rs | 3 ++- .../src/shell/internal_pages/new_tab.rs | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/crates/ely_app/src/shell/chrome/home/hero.rs b/crates/ely_app/src/shell/chrome/home/hero.rs index 0464b4e..9da60ef 100644 --- a/crates/ely_app/src/shell/chrome/home/hero.rs +++ b/crates/ely_app/src/shell/chrome/home/hero.rs @@ -15,6 +15,7 @@ use super::style::{ use super::time::DayPhase; pub(crate) fn render_hero( + shell: &ElyShell, greeting: String, phase: DayPhase, cx: &mut Context, @@ -26,7 +27,7 @@ pub(crate) fn render_hero( .gap(px(14.0)) .child(render_greeting_row(greeting, phase)) .child(render_serif_headline()) - .child(render_search_bar(cx)) + .child(render_search_bar(shell, cx)) .child(render_suggestion_pills(cx)) .into_any_element() } @@ -71,7 +72,19 @@ fn render_serif_headline() -> AnyElement { .into_any_element() } -fn render_search_bar(cx: &mut Context) -> AnyElement { +fn render_search_bar(shell: &ElyShell, cx: &mut Context) -> AnyElement { + // Reflect the omnibar's live value so typing into it from the + // home search shortcut isn't a black hole — the user sees the + // text they typed mirrored here. The home search itself stays a + // click-to-focus shortcut (single Input owns the actual state), + // so this is a read-only echo, not a parallel input. + let omnibar_value = shell.command_input.read(cx).value().to_string(); + let (display_text, display_color) = if omnibar_value.is_empty() { + ("Search the web or ELY".to_string(), colors::INK_4) + } else { + (omnibar_value, colors::INK) + }; + div() .id(SharedString::from("home-search")) .w(px(640.0)) @@ -97,9 +110,11 @@ fn render_search_bar(cx: &mut Context) -> AnyElement { .child( div() .flex_1() + .min_w_0() + .truncate() .text_size(px(14.0)) - .text_color(rgb(colors::INK_4)) - .child("Search the web or ELY"), + .text_color(rgb(display_color)) + .child(display_text), ) .child( div() diff --git a/crates/ely_app/src/shell/chrome/home/mod.rs b/crates/ely_app/src/shell/chrome/home/mod.rs index 8a0d2a3..e677559 100644 --- a/crates/ely_app/src/shell/chrome/home/mod.rs +++ b/crates/ely_app/src/shell/chrome/home/mod.rs @@ -14,6 +14,7 @@ mod style; mod time; pub(crate) fn render_home_page( + shell: &ElyShell, snapshot: &BrowserSnapshot, cx: &mut Context, ) -> AnyElement { @@ -33,7 +34,7 @@ pub(crate) fn render_home_page( .pb(px(28.0)) .flex() .flex_col() - .child(hero::render_hero(greeting, phase, cx)) + .child(hero::render_hero(shell, greeting, phase, cx)) .child(div().mt(px(48.0)).child(favorites::render_favorites_grid(snapshot, cx))) .child(div().mt(px(16.0)).child(recap::render_recap(snapshot, cx))), ) diff --git a/crates/ely_app/src/shell/internal_pages/new_tab.rs b/crates/ely_app/src/shell/internal_pages/new_tab.rs index ba32c74..d0a4905 100644 --- a/crates/ely_app/src/shell/internal_pages/new_tab.rs +++ b/crates/ely_app/src/shell/internal_pages/new_tab.rs @@ -10,6 +10,6 @@ impl ElyShell { snapshot: &BrowserSnapshot, cx: &mut Context, ) -> AnyElement { - render_home_page(snapshot, cx) + render_home_page(self, snapshot, cx) } }