Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(nav): promote the Assistant launcher to the mobile top bar (LFE-11067) (#15378)

Nikita Kabardina65dbebf3e61
diff --git a/web/src/components/layouts/mobile-page-title.tsx b/web/src/components/layouts/mobile-page-title.tsx
index 7f737f63de..cdbeff15e8 100644
--- a/web/src/components/layouts/mobile-page-title.tsx
+++ b/web/src/components/layouts/mobile-page-title.tsx
@@ -2,7 +2,6 @@ import { ItemBadge } from "@/src/components/ItemBadge";
import BreadcrumbComponent from "@/src/components/layouts/breadcrumb";
import DocPopup from "@/src/components/layouts/doc-popup";
import { PageHeaderControlsSlotTarget } from "@/src/components/layouts/page-header-controls-slot";
-import { InAppAiAgentButton } from "@/src/components/nav/in-app-ai-agent-button";
import { PageTabs } from "@/src/components/layouts/page-tabs";
import { type PageHeaderProps } from "@/src/components/layouts/page-header";
import {
@@ -106,11 +105,12 @@ export const MobilePageTitle = ({
</div>
)}
- {/* Hoisted page controls (time range, auto-refresh) + agent launcher.
- Temporary home until the expandable bottom bar owns them. */}
+ {/* Hoisted page controls (time range, auto-refresh). The assistant
+ launcher lives in the sticky MobileTopBar now (prominent + always
+ reachable), not here where it wrapped onto its own line and shrank to
+ an easily-missed icon. */}
<div className="mt-2 flex flex-wrap items-center gap-2">
<PageHeaderControlsSlotTarget />
- <InAppAiAgentButton />
</div>
{tabsProps && <PageTabs {...tabsProps} scrollable className="mt-2" />}
diff --git a/web/src/components/layouts/mobile-top-bar.tsx b/web/src/components/layouts/mobile-top-bar.tsx
index b645076412..0870339362 100644
--- a/web/src/components/layouts/mobile-top-bar.tsx
+++ b/web/src/components/layouts/mobile-top-bar.tsx
@@ -5,6 +5,7 @@ import { useSidebar } from "@/src/components/ui/sidebar";
import { TopbarBrand } from "@/src/components/nav/topbar-brand";
import { useHasAppSidebar } from "@/src/components/nav/sidebar-presence";
import { TopbarAccount } from "@/src/components/nav/topbar-account";
+import { InAppAiAgentButton } from "@/src/components/nav/in-app-ai-agent-button";
import { EnvLabel } from "@/src/components/EnvLabel";
/**
@@ -53,8 +54,11 @@ export const MobileTopBar = ({
{/* Center: the Langfuse wordmark. */}
<TopbarBrand variant="wordmark" />
- {/* Right: account. Balances the left slot so the brand stays centered. */}
- <div className="flex min-w-0 flex-1 items-center justify-end">
+ {/* Right: the assistant launcher (prominent, gradient-bordered so it
+ reads as a real entry point here) + account. Balances the left slot
+ so the brand stays centered. */}
+ <div className="flex min-w-0 flex-1 items-center justify-end gap-1">
+ <InAppAiAgentButton prominent />
<TopbarAccount />
</div>
</div>
diff --git a/web/src/components/nav/in-app-ai-agent-button.tsx b/web/src/components/nav/in-app-ai-agent-button.tsx
index f1ad7e22c3..0f5697e3e9 100644
--- a/web/src/components/nav/in-app-ai-agent-button.tsx
+++ b/web/src/components/nav/in-app-ai-agent-button.tsx
@@ -12,8 +12,17 @@ import { cn } from "@/src/utils/tailwind";
/** Launcher only — the assistant window itself is rendered by
* InAppAgentWindowHost from the persistent authenticated layout, so it
- * survives the per-page remount of this button on navigation. */
-export const InAppAiAgentButton = () => {
+ * survives the per-page remount of this button on navigation.
+ *
+ * `prominent` is the compact, icon-only launcher for the mobile top bar: a
+ * gradient border in the agent's own palette (the colors of its window's
+ * conic-gradient) so the entry point stands out, instead of the easily-missed
+ * ghost icon it became when buried in the wrapping page controls row. */
+export const InAppAiAgentButton = ({
+ prominent = false,
+}: {
+ prominent?: boolean;
+} = {}) => {
const { open, setOpen, openAssistant } = useInAppAiAgent();
const canUseAssistant = useCanUseInAppAgent();
@@ -65,24 +74,49 @@ export const InAppAiAgentButton = () => {
aria-pressed={open}
data-ignore-outside-interaction
onClick={() => toggleAssistant("top_nav")}
+ // Gradient border in the agent palette (its window's conic-gradient
+ // colors). Inline style rather than Tailwind arbitrary values: a
+ // two-layer background with per-layer clip is fiddly to quote, and this
+ // also overrides the outline variant's own border/bg cleanly.
+ style={
+ prominent
+ ? {
+ border: "1.5px solid transparent",
+ background:
+ "linear-gradient(hsl(var(--background)), hsl(var(--background))) padding-box, linear-gradient(130deg, var(--color-2), var(--color-3)) border-box",
+ }
+ : undefined
+ }
className={cn(
"gap-2",
- open &&
+ // Compact icon-only launcher for the top bar.
+ prominent && "size-9 shrink-0 px-0",
+ !prominent &&
+ open &&
"border-primary-accent bg-primary-accent/10 hover:bg-primary-accent/15",
)}
>
- <BotMessageSquare className="h-4 w-4" />
- <span className="hidden sm:inline">Assistant</span>
- <KeyboardShortcut
- className="bg-transparent shadow-none"
- keys={[
- typeof navigator !== "undefined" &&
- navigator.userAgent.includes("Mac")
- ? "⌘"
- : "Ctrl",
- "I",
- ]}
+ <BotMessageSquare
+ className={cn("h-4 w-4", prominent && open && "text-primary-accent")}
/>
+ {/* The prominent launcher is a fixed 36px square (top bar, below md), so
+ it stays strictly icon-only — the `sm:inline` label would otherwise
+ reveal in the 640–767px band and overflow the box. */}
+ {!prominent && (
+ <>
+ <span className="hidden sm:inline">Assistant</span>
+ <KeyboardShortcut
+ className="bg-transparent shadow-none"
+ keys={[
+ typeof navigator !== "undefined" &&
+ navigator.userAgent.includes("Mac")
+ ? "⌘"
+ : "Ctrl",
+ "I",
+ ]}
+ />
+ </>
+ )}
</Button>
);
};