Skip to content

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

fix(ui): polish trace review responsiveness (#17801)

Nikita Kabardinb53d37e14e4c
diff --git a/web/src/components/layouts/header.tsx b/web/src/components/layouts/header.tsx
index 5ba4a16495..ea8ce019ac 100644
--- a/web/src/components/layouts/header.tsx
+++ b/web/src/components/layouts/header.tsx
@@ -10,6 +10,7 @@ import { cn } from "@/src/utils/tailwind";
type HeaderProps = {
title: string;
+ titleClassName?: string;
status?: Status;
/** Plain informational badge next to the title, e.g. "Demo Org". Not a status. */
labelBadge?: string;
@@ -37,9 +38,11 @@ export function SubHeaderLabel({ ...props }: HeaderProps) {
function HeaderTitle({
level,
title,
+ className,
}: {
level: "h3" | "h4" | "h5";
title: string;
+ className?: string;
}) {
// Top-level titles are bold (the font-relative role) and sit on the
// primary emphasis tier (the shell's sidebar tint would dim them);
@@ -48,12 +51,16 @@ function HeaderTitle({
switch (level) {
case "h3":
return (
- <h3 className="text-primary text-lg leading-7 font-bold">{title}</h3>
+ <h3
+ className={cn("text-primary text-lg leading-7 font-bold", className)}
+ >
+ {title}
+ </h3>
);
case "h4":
- return <h4 className="text-lg leading-6">{title}</h4>;
+ return <h4 className={cn("text-lg leading-6", className)}>{title}</h4>;
case "h5":
- return <h5 className="text-base leading-6">{title}</h5>;
+ return <h5 className={cn("text-base leading-6", className)}>{title}</h5>;
}
}
@@ -63,7 +70,11 @@ function BaseHeader({ ...props }: HeaderProps & { level: "h3" | "h4" | "h5" }) {
<div className="flex flex-wrap items-center justify-between gap-2">
<div className="flex items-center gap-3 md:gap-5">
<div className="flex min-w-0 flex-row items-center">
- <HeaderTitle title={props.title} level={props.level} />
+ <HeaderTitle
+ title={props.title}
+ level={props.level}
+ className={props.titleClassName}
+ />
{props.help ? (
<DocPopup
description={props.help.description}
diff --git a/web/src/features/scores/actions/annotationFormActions.ts b/web/src/features/scores/actions/annotationFormActions.ts
index ed01a42341..738cf3d692 100644
--- a/web/src/features/scores/actions/annotationFormActions.ts
+++ b/web/src/features/scores/actions/annotationFormActions.ts
@@ -46,6 +46,8 @@ type Dependencies = {
deleteScore: (data: { id: string; projectId: string }) => Promise<unknown>;
};
+const SAVED_STATUS_VISIBLE_MS = 3_000;
+
// One owner per mounted form. Actions read drafts at invocation and resolve rows
// by target + config again when asynchronous operations finish.
export function createAnnotationFormActions({
@@ -87,6 +89,16 @@ export function createAnnotationFormActions({
const serverFields = new Map(
fields().map((field) => [annotationFieldKey(field), { ...field }]),
);
+ let savedStatusTimer: ReturnType<typeof setTimeout> | undefined;
+ let isClosed = true;
+ const scheduleSavedStatusClear = () => {
+ if (savedStatusTimer) clearTimeout(savedStatusTimer);
+ if (isClosed) return;
+ savedStatusTimer = setTimeout(() => {
+ saveStore.setState({ saved: false });
+ savedStatusTimer = undefined;
+ }, SAVED_STATUS_VISIBLE_MS);
+ };
const sameScore = (
left: AnnotationScoreFormData,
right: AnnotationScoreFormData | undefined,
@@ -155,6 +167,7 @@ export function createAnnotationFormActions({
saved: state.saved || changed,
};
});
+ if (changed) scheduleSavedStatusClear();
tracked?.success();
},
() => {
@@ -464,9 +477,13 @@ export function createAnnotationFormActions({
return annotationFieldKey(next);
},
open() {
+ isClosed = false;
analytics.forEach((tracker) => tracker.open());
},
close() {
+ isClosed = true;
+ if (savedStatusTimer) clearTimeout(savedStatusTimer);
+ savedStatusTimer = undefined;
analytics.forEach((tracker, key) =>
tracker.close(fields().filter((field) => field.targetKey === key)),
);
diff --git a/web/src/features/scores/components/AnnotationForm.tsx b/web/src/features/scores/components/AnnotationForm.tsx
index 863d54f663..24a172a39e 100644
--- a/web/src/features/scores/components/AnnotationForm.tsx
+++ b/web/src/features/scores/components/AnnotationForm.tsx
@@ -56,9 +56,10 @@ function AnnotateHeader({
description?: string;
}) {
return (
- <div>
+ <div className="relative">
<Header
title="Annotate"
+ titleClassName="text-foreground text-[16px] leading-6"
help={
description
? {
@@ -70,7 +71,7 @@ function AnnotateHeader({
}
actionButtons={actionButtons}
/>
- <div className="-mt-1 flex h-4 items-center justify-end overflow-hidden pr-1">
+ <div className="pointer-events-none absolute top-full right-1 flex h-4 items-center overflow-hidden">
{saveStatus}
</div>
</div>
@@ -220,49 +221,102 @@ export function AnnotationFormContent({
(field) =>
isTextDataType(field.dataType) || isNumericDataType(field.dataType),
);
+ const addScoreControl =
+ allowManualSelection && isActive ? (
+ <PopoverController
+ align="start"
+ contentClassName="w-64 p-0"
+ disabled={addableOptions.length === 0}
+ modal={false}
+ renderContent={({ closePopover }) => (
+ <InputCommand>
+ <InputCommandInput
+ placeholder="Search scores..."
+ variant="bottom"
+ />
+ <InputCommandList className="max-h-72">
+ <InputCommandEmpty>No scores found.</InputCommandEmpty>
+ <InputCommandGroup>
+ {addableOptions.map((option) => (
+ <InputCommandItem
+ key={option.value}
+ value={option.value}
+ keywords={[option.label]}
+ className="cursor-pointer"
+ onSelect={() => {
+ closePopover();
+ const controlledFields = form.getValues("scoreData");
+ getScoreConfigSelection({
+ targets,
+ controlledFields,
+ insert,
+ remove,
+ }).addScore(option.value);
+ }}
+ >
+ {option.label}
+ </InputCommandItem>
+ ))}
+ </InputCommandGroup>
+ </InputCommandList>
+ </InputCommand>
+ )}
+ >
+ {({ Trigger, disabled }) => (
+ <Trigger asChild>
+ <Button
+ data-add-score
+ type="button"
+ variant="outline"
+ size="sm"
+ className="gap-1.5 text-xs"
+ disabled={disabled}
+ >
+ <Plus className="size-3.5" aria-hidden="true" />
+ Add score
+ </Button>
+ </Trigger>
+ )}
+ </PopoverController>
+ ) : null;
+ const manageScoreConfigsControl = allowManualSelection ? (
+ <Button
+ variant="outline"
+ size="sm"
+ className="bg-accent gap-1.5 text-xs"
+ asChild
+ >
+ <Link
+ href={`/project/${scoreMetadata.projectId}/settings/scores`}
+ target="_blank"
+ onClick={() => {
+ capture("score_configs:manage_configs_item_click", analyticsData);
+ }}
+ onAuxClick={(event) => {
+ if (event.button === 1) {
+ capture("score_configs:manage_configs_item_click", analyticsData);
+ }
+ }}
+ >
+ <Settings2 className="size-3" aria-hidden="true" />
+ Manage score configs
+ </Link>
+ </Button>
+ ) : null;
return (
<div
ref={formRootRef}
data-annotation-form
tabIndex={-1}
- className="ph-no-capture mx-auto w-full space-y-4 overflow-y-auto p-1 md:max-h-full"
+ className="ph-no-capture mx-auto w-full space-y-2 overflow-y-auto p-1 md:max-h-full"
>
- <div className="sticky top-0 z-10 flex flex-col gap-4 rounded-sm bg-[hsl(var(--annotation-surface,var(--background)))] pb-2">
+ <div className="sticky top-0 z-10 flex flex-col rounded-sm bg-[hsl(var(--annotation-surface,var(--background)))] pb-2">
<AnnotateHeader
saveStatus={<AnnotationSaveStatus form={form} actions={actions} />}
actionButtons={
<>
- {allowManualSelection ? (
- <Button
- variant="outline"
- size="sm"
- className="bg-accent gap-1.5 text-xs"
- asChild
- >
- <Link
- href={`/project/${scoreMetadata.projectId}/settings/scores`}
- target="_blank"
- onClick={() => {
- capture(
- "score_configs:manage_configs_item_click",
- analyticsData,
- );
- }}
- onAuxClick={(event) => {
- if (event.button === 1) {
- capture(
- "score_configs:manage_configs_item_click",
- analyticsData,
- );
- }
- }}
- >
- <Settings2 className="size-3" aria-hidden="true" />
- Manage score configs
- </Link>
- </Button>
- ) : null}
+ {addScoreControl}
{actionButtons}
</>
}
@@ -333,65 +387,8 @@ export function AnnotationFormContent({
) : null;
})}
</div>
- {allowManualSelection && isActive ? (
- <div>
- <PopoverController
- align="start"
- contentClassName="w-64 p-0"
- disabled={addableOptions.length === 0}
- modal={false}
- renderContent={({ closePopover }) => (
- <InputCommand>
- <InputCommandInput
- placeholder="Search scores..."
- variant="bottom"
- />
- <InputCommandList className="max-h-72">
- <InputCommandEmpty>No scores found.</InputCommandEmpty>
- <InputCommandGroup>
- {addableOptions.map((option) => (
- <InputCommandItem
- key={option.value}
- value={option.value}
- keywords={[option.label]}
- className="cursor-pointer"
- onSelect={() => {
- closePopover();
- const controlledFields =
- form.getValues("scoreData");
- getScoreConfigSelection({
- targets,
- controlledFields,
- insert,
- remove,
- }).addScore(option.value);
- }}
- >
- {option.label}
- </InputCommandItem>
- ))}
- </InputCommandGroup>
- </InputCommandList>
- </InputCommand>
- )}
- >
- {({ Trigger, disabled }) => (
- <Trigger asChild>
- <Button
- data-add-score
- type="button"
- variant="outline"
- size="sm"
- className="gap-1.5 text-xs"
- disabled={disabled}
- >
- <Plus className="size-3.5" aria-hidden="true" />
- Add score
- </Button>
- </Trigger>
- )}
- </PopoverController>
- </div>
+ {manageScoreConfigsControl ? (
+ <div>{manageScoreConfigsControl}</div>
) : null}
{rowCount > 0 && (
// This legend only exists to advertise keyboard shortcuts, so hide
diff --git a/web/src/features/scores/components/AnnotationScoreRow.tsx b/web/src/features/scores/components/AnnotationScoreRow.tsx
index a83715a06d..eb881ac335 100644
--- a/web/src/features/scores/components/AnnotationScoreRow.tsx
+++ b/web/src/features/scores/components/AnnotationScoreRow.tsx
@@ -236,7 +236,7 @@ export function AnnotationScoreRow({
role="group"
aria-label={showTarget ? `${score.name} (${target.label})` : score.name}
className={cn(
- "group grid w-full grid-cols-[minmax(0,1fr)_minmax(0,2fr)] items-center gap-3 rounded-md py-1 text-left transition-colors outline-none",
+ "group grid w-full grid-cols-[minmax(0,1fr)_minmax(0,2fr)] items-center gap-3 rounded-md px-3 py-1 text-left transition-colors outline-none",
"focus-within:ring-primary/30 focus-within:bg-accent/40 focus-within:ring-1 focus-within:ring-inset",
)}
>
diff --git a/web/src/features/scores/components/DualAnnotationContent.clienttest.tsx b/web/src/features/scores/components/DualAnnotationContent.clienttest.tsx
index 1ad21d5b3c..83d3509eed 100644
--- a/web/src/features/scores/components/DualAnnotationContent.clienttest.tsx
+++ b/web/src/features/scores/components/DualAnnotationContent.clienttest.tsx
@@ -246,6 +246,7 @@ describe("unified annotation targets", () => {
});
it("focuses the first score on activation without taking focus on rerenders", async () => {
+ configs.push({ ...defaultConfig, id: "accuracy", name: "Accuracy" });
mocks.create.mockResolvedValue({});
const refreshRef = createRef<AnnotationRefreshHandle>();
const view = (isActive: boolean) => (
@@ -601,6 +602,28 @@ describe("unified annotation targets", () => {
expect(mocks.update).not.toHaveBeenCalled();
});
+ it("hides the saved status after its confirmation window", async () => {
+ vi.useFakeTimers({ shouldAdvanceTime: true });
+ try {
+ mocks.create.mockResolvedValue({});
+ renderContent();
+ fireEvent.click(screen.getByRole("radio", { name: /True/ }));
+ await waitFor(() =>
+ expect(
+ screen.getByRole("status", { name: "Score save status" }),
+ ).toHaveTextContent("Saved"),
+ );
+
+ act(() => vi.advanceTimersByTime(3_000));
+
+ expect(
+ screen.queryByRole("status", { name: "Score save status" }),
+ ).not.toBeInTheDocument();
+ } finally {
+ vi.useRealTimers();
+ }
+ });
+
it("retains an unfinished new category while its annotation panel is inactive", async () => {
mocks.hasConfigAccess = true;
configs.push({
diff --git a/web/src/features/scores/hooks/useAnnotationKeyboard.ts b/web/src/features/scores/hooks/useAnnotationKeyboard.ts
index 1f5be50df3..6e3d8ca483 100644
--- a/web/src/features/scores/hooks/useAnnotationKeyboard.ts
+++ b/web/src/features/scores/hooks/useAnnotationKeyboard.ts
@@ -49,9 +49,9 @@ export function useAnnotationKeyboard({
active.closest("[data-score-row], [data-add-score]")
)
return;
- const entry = root.querySelector<HTMLElement>(
- "[data-score-row], [data-add-score]:not(:disabled)",
- );
+ const entry =
+ root.querySelector<HTMLElement>("[data-score-row]") ??
+ root.querySelector<HTMLElement>("[data-add-score]:not(:disabled)");
(entry ?? root).focus();
});
}, [formRootRef]);
diff --git a/web/src/features/traces/components/TracePanelNavigationHeader/TracePanelNavigationHeader.tsx b/web/src/features/traces/components/TracePanelNavigationHeader/TracePanelNavigationHeader.tsx
index 92ff7ce419..137077a0c5 100644
--- a/web/src/features/traces/components/TracePanelNavigationHeader/TracePanelNavigationHeader.tsx
+++ b/web/src/features/traces/components/TracePanelNavigationHeader/TracePanelNavigationHeader.tsx
@@ -1,13 +1,14 @@
/* eslint-disable no-nested-ternary */
/**
- * NavigationHeader - Fixed-height search bar for navigation panel
+ * NavigationHeader - Responsive search and controls for the navigation panel
*
* Responsibilities:
* - Render search input
* - Render toolbar buttons (expand/collapse, settings, download, timeline)
* - Manage search input state via SearchContext
*
- * This component has a fixed height and uses shrink-0 to maintain size.
+ * Search moves to a second row when space is tight, while keeping the same DOM
+ * input so focus and the current query survive panel resizing.
*/
import { useSearch } from "@/src/features/traces/contexts/SearchContext";
@@ -31,8 +32,6 @@ import {
Download,
Loader2,
MoreHorizontal,
- Search,
- X,
} from "lucide-react";
import {
DropdownMenu,
@@ -46,7 +45,7 @@ import {
} from "@/src/components/ui/dropdown-menu";
import { StringParam, useQueryParam } from "use-query-params";
import { cn } from "@/src/utils/tailwind";
-import { useCallback, useRef, useState } from "react";
+import { useCallback } from "react";
import {
TraceSettingsDropdown,
TraceViewOptionsMenuItems,
@@ -63,6 +62,7 @@ import { useTraceAnalyticsDimensions } from "@/src/features/traces/hooks/useTrac
import { toast } from "sonner";
import { TRACE_DOWNLOAD_OMIT_LARGE_FIELDS_THRESHOLD } from "@/src/features/traces/constants/traceDownloadConfig";
import { useWatchedPromiseCallback } from "@/src/hooks/useWatchedPromiseCallback";
+import { useElementSize } from "@/src/hooks/useElementSize";
interface TracePanelNavigationHeaderProps {
isPanelCollapsed: boolean;
@@ -114,12 +114,11 @@ function TracePanelNavigationHeaderExpanded({
// transcript to offer.
const messagesEnabled = useIsFeatureEnabled("traceMessages") && isV4;
const [viewMode, setViewMode] = useQueryParam("view", StringParam);
- const [isCompactSearchOpen, setIsCompactSearchOpen] = useState(false);
- const compactSearchInputRef = useRef<HTMLInputElement>(null);
- const compactSearchTriggerRef = useRef<HTMLButtonElement>(null);
- const shouldFocusCompactSearchRef = useRef(false);
const capture = usePostHogClientCapture();
const analyticsDimensions = useTraceAnalyticsDimensions();
+ const [headerContainerRef, headerContainerSize] =
+ useElementSize<HTMLDivElement>();
+ const isSearchWrapped = (headerContainerSize?.width ?? Infinity) <= 439;
// When the detail (info) panel is closed, the tree/timeline owns the whole
// surface — so the left "collapse panel" toggle would only shrink the one
@@ -128,11 +127,6 @@ function TracePanelNavigationHeaderExpanded({
const layout = useDesktopLayoutContextOptional();
const isDetailPanelCollapsed = layout?.isDetailPanelCollapsed ?? false;
- const closeCompactSearch = () => {
- setIsCompactSearchOpen(false);
- requestAnimationFrame(() => compactSearchTriggerRef.current?.focus());
- };
-
const handleSearchKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (e.key === "Enter") {
// Skip debouncing and search immediately
@@ -140,16 +134,6 @@ function TracePanelNavigationHeaderExpanded({
}
};
- const handleCompactSearchKeyDown = (
- e: React.KeyboardEvent<HTMLInputElement>,
- ) => {
- if (e.key === "Escape") {
- closeCompactSearch();
- return;
- }
- handleSearchKeyDown(e);
- };
-
// Check if everything is collapsed (all roots collapsed)
const isEverythingCollapsed =
roots.length > 0 && roots.every((r) => collapsedNodes.has(r.id));
@@ -243,22 +227,8 @@ function TracePanelNavigationHeaderExpanded({
if (view === "messages") layout?.detailPanelRef.current?.collapse();
};
- const renderOverflowMenuItems = (includeSearch: boolean) => (
+ const renderOverflowMenuItems = () => (
<>
- {includeSearch && (
- <>
- <DropdownMenuItem
- onSelect={() => {
- shouldFocusCompactSearchRef.current = true;
- setIsCompactSearchOpen(true);
- }}
- >
- <Search className="mr-2 h-3.5 w-3.5" />
- Search
- </DropdownMenuItem>
- <DropdownMenuSeparator />
- </>
- )}
<DropdownMenuItem onSelect={handleToggleTreeNodes}>
{isEverythingCollapsed ? (
<UnfoldVertical className="mr-2 h-3.5 w-3.5" />
@@ -279,57 +249,40 @@ function TracePanelNavigationHeaderExpanded({
<TraceViewOptionsMenuItems />
</>
);
+ const searchControl = (
+ <div
+ key="search"
+ className={cn(
+ "@max-[439px]/navheader:bg-background @max-[439px]/navheader:focus-within:border-ring @max-[439px]/navheader:focus-within:ring-ring/30 relative col-start-2 row-start-1 min-w-0 @max-[439px]/navheader:col-span-3 @max-[439px]/navheader:col-start-1 @max-[439px]/navheader:row-start-2 @max-[439px]/navheader:ml-1 @max-[439px]/navheader:rounded-md @max-[439px]/navheader:border @max-[439px]/navheader:shadow-xs @max-[439px]/navheader:focus-within:ring-2 @max-[439px]/navheader:[&>div]:p-0",
+ isDetailPanelCollapsed && "pl-1",
+ )}
+ >
+ <CommandInput
+ showBorder={false}
+ placeholder="Search"
+ className="@max-[439px]/navheader:placeholder:text-muted-foreground h-7 min-w-0 border-0 pr-0 focus:ring-0 @max-[439px]/navheader:h-[1.625rem]"
+ value={searchInputValue}
+ onValueChange={setSearchInputValue}
+ onKeyDown={handleSearchKeyDown}
+ />
+ </div>
+ );
return (
- <Command className="flex h-auto shrink-0 flex-col gap-1 overflow-hidden rounded-none border-b">
- {/* Responsive toolbar via container queries on this row's own width — no JS
- measurement. The breakpoints are tuned to the row's actual content
- minimums. Measured states:
-
- ≥ 510px search, labelled views, tools and transport inline
- 440-510 tools and transport folded into the "…" menu
- 360-440 labelled views collapse to a current-view dropdown
- < 360px search moves into "…" and opens a full-row search mode
-
- If you add anything to this row, re-measure and retune all three
- thresholds. */}
- <div className="@container/navheader flex min-h-8 flex-row items-center pr-2 pl-1">
- {isCompactSearchOpen && (
- <div className="hidden min-w-0 flex-1 items-center @max-[359px]/navheader:flex">
- <div className="min-w-0 flex-1">
- <CommandInput
- ref={compactSearchInputRef}
- showBorder={false}
- placeholder="Search"
- className="h-7 min-w-0 border-0 pr-0 focus:ring-0"
- value={searchInputValue}
- onValueChange={setSearchInputValue}
- onKeyDown={handleCompactSearchKeyDown}
- />
- </div>
- <Button
- variant="ghost"
- size="icon"
- title="Close search"
- aria-label="Close search"
- className="h-7 w-7 shrink-0"
- onClick={closeCompactSearch}
- >
- <X className="h-3.5 w-3.5" />
- </Button>
- </div>
- )}
- <div
- className={cn(
- "flex min-w-0 flex-1 flex-row items-center justify-between",
- isCompactSearchOpen && "@max-[359px]/navheader:hidden",
- )}
- >
+ <Command className="h-auto shrink-0 overflow-hidden rounded-none border-b">
+ {/* Container queries keep the primary view switch visible for as long as
+ it fits. Search moves below the controls before that switch collapses,
+ and remains the same input across every layout. */}
+ <div ref={headerContainerRef} className="@container/navheader">
+ <div className="grid min-h-8 grid-cols-[auto_minmax(0,1fr)_auto] items-center pr-2 pl-1 @max-[439px]/navheader:min-h-0 @max-[439px]/navheader:gap-y-1 @max-[439px]/navheader:pt-1 @max-[439px]/navheader:pb-1.5">
{/* Panel Toggle Button; special p-0.5 offset to pixel align with closed
version. Hidden while the detail panel is closed (nothing useful to
collapse the full-width tree/timeline into). */}
{!isDetailPanelCollapsed && (
- <div className="flex flex-row items-center p-0.5">
+ <div
+ key="toggle"
+ className="col-start-1 row-start-1 flex flex-row items-center p-0.5"
+ >
<TracePanelNavigationButton
isPanelCollapsed={isPanelCollapsed}
onTogglePanel={onTogglePanel}
@@ -337,23 +290,14 @@ function TracePanelNavigationHeaderExpanded({
/>
</div>
)}
- {/* Search Input */}
+ {/* Keep keyboard order in sync when search wraps below the tools.
+ The keyed element is moved rather than duplicated, preserving its
+ value and focus across panel resizing. */}
+ {!isSearchWrapped ? searchControl : null}
<div
- className={cn(
- "relative min-w-0 flex-1 @max-[359px]/navheader:hidden",
- isDetailPanelCollapsed && "pl-1",
- )}
+ key="tools"
+ className="col-start-3 row-start-1 flex shrink-0 flex-row items-center gap-0.5"
>
- <CommandInput
- showBorder={false}
- placeholder="Search"
- className="h-7 min-w-0 border-0 pr-0 focus:ring-0"
- value={searchInputValue}
- onValueChange={setSearchInputValue}
- onKeyDown={handleSearchKeyDown}
- />
- </div>
- <div className="flex shrink-0 flex-row items-center gap-0.5">
{/* Minor tools — inline when the panel is wide enough. */}
<div className="hidden flex-row items-center gap-0.5 @min-[510px]/navheader:flex">
<Button
@@ -388,9 +332,7 @@ function TracePanelNavigationHeaderExpanded({
</Button>
</div>
- {/* Search remains inline at the intermediate width, so this menu
- contains only the folded tools. */}
- <div className="hidden @min-[360px]/navheader:block @min-[510px]/navheader:hidden">
+ <div className="@min-[510px]/navheader:hidden">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
@@ -404,39 +346,7 @@ function TracePanelNavigationHeaderExpanded({
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="center" className="w-64">
- {renderOverflowMenuItems(false)}
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
-
- {/* At the narrowest width Search joins the folded tools. */}
- <div className="@min-[360px]/navheader:hidden">
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <Button
- ref={compactSearchTriggerRef}
- variant="ghost"
- size="icon"
- title="More"
- aria-label="More options"
- className="h-7 w-7"
- >
- <MoreHorizontal className="h-3.5 w-3.5" />
- </Button>
- </DropdownMenuTrigger>
- <DropdownMenuContent
- align="center"
- className="w-64"
- onCloseAutoFocus={(event) => {
- if (!shouldFocusCompactSearchRef.current) return;
- event.preventDefault();
- shouldFocusCompactSearchRef.current = false;
- requestAnimationFrame(() =>
- compactSearchInputRef.current?.focus(),
- );
- }}
- >
- {renderOverflowMenuItems(true)}
+ {renderOverflowMenuItems()}
</DropdownMenuContent>
</DropdownMenu>
</div>
@@ -448,7 +358,7 @@ function TracePanelNavigationHeaderExpanded({
<PlaybackControls />
</div>
- <div className="ml-2 hidden @min-[440px]/navheader:block">
+ <div className="ml-2 hidden @min-[330px]/navheader:block">
<ViewModeSwitch
activeView={activeView}
graphDisabledReason={graphDisabledReason}
@@ -456,7 +366,7 @@ function TracePanelNavigationHeaderExpanded({
onSelect={handleSelectView}
/>
</div>
- <div className="ml-2 @min-[440px]/navheader:hidden">
+ <div className="ml-2 @min-[330px]/navheader:hidden">
<DropdownMenuController
align="end"
renderMenu={() => (
@@ -518,6 +428,7 @@ function TracePanelNavigationHeaderExpanded({
TraceLayoutDesktop, mirroring the navigation panel's rail), so the
header needs no re-open button of its own. */}
</div>
+ {isSearchWrapped ? searchControl : null}
</div>
</div>
</Command>
diff --git a/web/src/features/traces/components/TraceReviewPanel.tsx b/web/src/features/traces/components/TraceReviewPanel.tsx
index 11dd512dea..cbab1d403d 100644
--- a/web/src/features/traces/components/TraceReviewPanel.tsx
+++ b/web/src/features/traces/components/TraceReviewPanel.tsx
@@ -86,7 +86,7 @@ function TraceAnnotationPanel() {
return (
<section
aria-label="Annotate"
- className="h-full overflow-y-auto p-4 [--annotation-surface:var(--background)]"
+ className="h-full overflow-y-auto p-1 [--annotation-surface:var(--background)]"
hidden={!active}
>
<AnnotationPanelContent