Skip to content

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

fix(mobile): header title crush on long labels + tighten spacing (LFE-11067) (#15420)

Nikita Kabardin92911c3cf2c8
diff --git a/web/src/components/layouts/mobile-page-title.tsx b/web/src/components/layouts/mobile-page-title.tsx
index b4dfc9dc8b..03ec478ffa 100644
--- a/web/src/components/layouts/mobile-page-title.tsx
+++ b/web/src/components/layouts/mobile-page-title.tsx
@@ -66,9 +66,21 @@ export const MobilePageTitle = ({
so the header top block stays ~2 rows instead of the 4–5 it used to
take (a big labelled type chip, a text-2xl title, then each action
cluster wrapping onto its own row). */}
- <div className="mt-1 flex min-w-0 items-center gap-2">
- {itemType && <ItemBadge type={itemType} />}
- <h1 className="text-primary text-base leading-tight font-bold wrap-break-word">
+ <div className="mt-2 flex min-w-0 items-center gap-2">
+ {/* Icon keeps its size — without shrink-0 a long title (e.g. a full
+ session id, the common case) squeezes it. */}
+ {itemType && (
+ <span className="flex shrink-0 items-center">
+ <ItemBadge type={itemType} />
+ </span>
+ )}
+ {/* min-w-0 + truncate: long titles ellipsize on one line instead of
+ pushing the ⋯ flush against the edge or crushing the icon. Full value
+ stays in the title attribute (and the ⋯ menu's Copy row). */}
+ <h1
+ title={title}
+ className="text-primary min-w-0 truncate text-base leading-tight font-bold"
+ >
{titleContent ? (
titleContent
) : titleTooltip ? (
@@ -85,19 +97,22 @@ export const MobilePageTitle = ({
) : (
<span title={title}>{title}</span>
)}
- {help && (
- <span className="align-middle whitespace-nowrap">
- &nbsp;
- <DocPopup
- description={help.description}
- href={help.href}
- className={help.className}
- />
- </span>
- )}
</h1>
+ {/* Help lives OUTSIDE the truncating h1 (like titleBadges): kept inside,
+ a title long enough to fill the row clips the `?` past the overflow
+ boundary, making it invisible/untappable. As a shrink-0 sibling it
+ stays put. */}
+ {help && (
+ <span className="shrink-0 align-middle whitespace-nowrap">
+ <DocPopup
+ description={help.description}
+ href={help.href}
+ className={help.className}
+ />
+ </span>
+ )}
{titleBadges && (
- <div className="flex items-center gap-1">{titleBadges}</div>
+ <div className="flex shrink-0 items-center gap-1">{titleBadges}</div>
)}
{/* Actions collapse into a single right-aligned overflow popover of
full-width labeled rows (icon + label) — the same pattern the table
@@ -135,8 +150,12 @@ export const MobilePageTitle = ({
{/* 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">
+ an easily-missed icon. The slot target is `display:contents`, so on
+ pages that hoist nothing (traces, session/trace detail) this wrapper is
+ empty — gate its top margin on actually having portaled controls
+ (`:has(>*>*)` = the contents target has children), so an empty slot
+ adds no phantom gap below the title. */}
+ <div className="flex flex-wrap items-center gap-2 [&:has(>*>*)]:mt-2">
<PageHeaderControlsSlotTarget />
</div>