🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
fix(tables): unify mobile search and filters (#17931)
Nikita Kabardinee1e9c026476
diff --git a/web/src/components/BatchExportTableButton.tsx b/web/src/components/BatchExportTableButton.tsxindex 08294f9489..e351fca141 100644--- a/web/src/components/BatchExportTableButton.tsx+++ b/web/src/components/BatchExportTableButton.tsx@@ -90,7 +90,12 @@ export const BatchExportTableButton: React.FC<BatchExportTableButtonProps> = (return (<DropdownMenu><DropdownMenuTrigger asChild>- <Button variant="outline" size="icon" title="Export">+ <Button+ variant="outline"+ size="icon"+ title="Export"+ className="hidden md:inline-flex"+ >{isExporting ? (<Spinner size="sm" />) : (diff --git a/web/src/components/layouts/app-shell-chrome.clienttest.tsx b/web/src/components/layouts/app-shell-chrome.clienttest.tsxindex 1f7b402a2d..9f708530b6 100644--- a/web/src/components/layouts/app-shell-chrome.clienttest.tsx+++ b/web/src/components/layouts/app-shell-chrome.clienttest.tsx@@ -161,6 +161,23 @@ describe("mobile page action focus handoff", () => {vi.useRealTimers();});+ it("keeps an explicit mobile primary action out of the overflow menu", () => {+ render(+ <MobilePageTitle+ headerProps={{+ title: "Evaluators",+ mobileActionButtons: <button>New evaluator</button>,+ actionButtonsRight: <button>Desktop evaluator actions</button>,+ }}+ />,+ );++ expect(screen.getByRole("button", { name: "New evaluator" })).toBeVisible();+ expect(+ screen.queryByRole("button", { name: "More actions" }),+ ).not.toBeInTheDocument();+ });+it("closes before panel focus and restores the trigger only on ordinary dismissals", async () => {vi.useFakeTimers();const openReview = vi.fn();diff --git a/web/src/components/layouts/mobile-page-actions-content.stories.tsx b/web/src/components/layouts/mobile-page-actions-content.stories.tsxnew file mode 100644index 0000000000..3571483334--- /dev/null+++ b/web/src/components/layouts/mobile-page-actions-content.stories.tsx@@ -0,0 +1,53 @@+import { LayoutDashboard, PencilIcon, SlidersHorizontal } from "lucide-react";+import { fn } from "storybook/test";++import preview from "../../../.storybook/preview";+import { Button } from "@/src/components/ui/button";+import { Popover, PopoverTrigger } from "@/src/components/ui/popover";+import { MobilePageActionsContent } from "@/src/components/layouts/mobile-page-actions-content";++const meta = preview.meta({+ component: MobilePageActionsContent,+});++export const MixedPageControls = meta.story({+ name: "Mixed page controls",+ globals: { viewport: { value: "page-actions-phone", isRotated: false } },+ parameters: {+ viewport: {+ options: {+ "page-actions-phone": {+ name: "Phone",+ styles: { width: "390px", height: "844px" },+ },+ },+ },+ },+ render: () => (+ <Popover defaultOpen>+ <PopoverTrigger asChild>+ <Button variant="outline">More actions</Button>+ </PopoverTrigger>+ <MobilePageActionsContent onCloseAutoFocus={fn()}>+ <div className="flex flex-col gap-1">+ <span className="text-muted-foreground px-2 text-xs">Dashboard</span>+ <Button variant="outline" className="w-full justify-start gap-2">+ <LayoutDashboard className="h-4 w-4" />+ Langfuse Home+ </Button>+ <Button variant="ghost" className="w-full justify-start gap-2">+ <PencilIcon className="h-4 w-4" />+ Edit dashboard+ </Button>+ </div>+ <div className="flex flex-col gap-1 border-t pt-2">+ <span className="text-muted-foreground px-2 text-xs">Data</span>+ <Button variant="outline" className="w-full justify-start gap-2">+ <SlidersHorizontal className="h-4 w-4" />+ Environment and filters+ </Button>+ </div>+ </MobilePageActionsContent>+ </Popover>+ ),+});diff --git a/web/src/components/layouts/mobile-page-actions-content.tsx b/web/src/components/layouts/mobile-page-actions-content.tsxnew file mode 100644index 0000000000..de3495638f--- /dev/null+++ b/web/src/components/layouts/mobile-page-actions-content.tsx@@ -0,0 +1,30 @@+import { PopoverContent } from "@/src/components/ui/popover";+import { type ComponentPropsWithoutRef, type ReactNode } from "react";++type MobilePageActionsContentProps = {+ children: ReactNode;+ onCloseAutoFocus: NonNullable<+ ComponentPropsWithoutRef<typeof PopoverContent>["onCloseAutoFocus"]+ >;+};++/**+ * Responsive content surface for the compact page header's overflow actions.+ * It keeps mixed page controls usable at phone widths while individual pages+ * remain responsible for giving their actions meaningful labels and grouping.+ */+export function MobilePageActionsContent({+ children,+ onCloseAutoFocus,+}: MobilePageActionsContentProps) {+ return (+ <PopoverContent+ align="end"+ collisionPadding={12}+ className="w-[calc(100vw-1.5rem)] max-w-sm p-2"+ onCloseAutoFocus={onCloseAutoFocus}+ >+ <div className="flex flex-col items-stretch gap-2">{children}</div>+ </PopoverContent>+ );+}diff --git a/web/src/components/layouts/mobile-page-title.tsx b/web/src/components/layouts/mobile-page-title.tsxindex e610a49317..7d011a3249 100644--- a/web/src/components/layouts/mobile-page-title.tsx+++ b/web/src/components/layouts/mobile-page-title.tsx@@ -1,16 +1,13 @@/* eslint-disable no-nested-ternary */import { ItemBadge } from "@/src/components/ItemBadge";import BreadcrumbComponent from "@/src/components/layouts/breadcrumb";+import { MobilePageActionsContent } from "@/src/components/layouts/mobile-page-actions-content";import DocPopup from "@/src/components/layouts/doc-popup";import { PageHeaderControlsSlotTarget } from "@/src/components/layouts/page-header-controls-slot";import { PageTabs } from "@/src/components/layouts/page-tabs";import { type PageHeaderProps } from "@/src/components/layouts/page-header";import { Button } from "@/src/components/ui/button";-import {- Popover,- PopoverContent,- PopoverTrigger,-} from "@/src/components/ui/popover";+import { Popover, PopoverTrigger } from "@/src/components/ui/popover";import {Tooltip,TooltipContent,@@ -45,6 +42,7 @@ export const MobilePageTitle = ({itemType,actionButtonsLeft,actionButtonsRight,+ mobileActionButtons,actionButtonsMenu,titleBadges,breadcrumb,@@ -62,6 +60,10 @@ export const MobilePageTitle = ({menuTriggerRef.current?.focus({ preventScroll: true });}};+ const hasOverflowActions = Boolean(+ actionButtonsMenu ||+ (!mobileActionButtons && (actionButtonsRight || actionButtonsLeft)),+ );return (<div className="bg-background border-b px-3 pt-2 pb-3">@@ -74,11 +76,10 @@ export const MobilePageTitle = ({{/* Title row. On desktop the PageHeader packs the title and its actionclusters onto one justified row; at phone width the compact mobile- header keeps the type icon + title on the left and collapses every- action cluster into a single `⋯` overflow popover pinned to the right,- 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). */}+ header keeps the type icon + title on the left. Pages can keep one+ primary action visible; remaining action clusters collapse into a+ single `⋯` overflow popover pinned to the right, so the header top+ block stays ~2 rows instead of the 4–5 it used to take. */}<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 fullsession id, the common case) squeezes it. */}@@ -127,14 +128,19 @@ export const MobilePageTitle = ({{titleBadges && (<div className="flex shrink-0 items-center gap-1">{titleBadges}</div>)}- {/* Actions collapse into a single right-aligned overflow popover of+ {mobileActionButtons ? (+ <div className="ml-auto flex shrink-0 items-center">+ {mobileActionButtons}+ </div>+ ) : null}+ {/* Remaining actions collapse into a right-aligned overflow popover offull-width labeled rows (icon + label) — the same pattern the tablepeek uses. Pages pass `actionButtonsMenu` (a `layout="menu"` variantof their actions) for proper menu rows; when they don't, we fallback to folding the inline `actionButtonsRight`/`actionButtonsLeft`nodes as-is. Either way the actions' own dialogs/drawers portalthrough the layer system, so they keep working from the popover. */}- {(actionButtonsMenu || actionButtonsRight || actionButtonsLeft) && (+ {hasOverflowActions && (<Popoveropen={isMenuOpen}onOpenChange={(open) => {@@ -153,9 +159,7 @@ export const MobilePageTitle = ({<MoreHorizontal className="h-4 w-4" /></Button></PopoverTrigger>- <PopoverContent- align="end"- className="w-auto min-w-44 p-1"+ <MobilePageActionsContentonCloseAutoFocus={(event) => {if (!restoreFocus.current) event.preventDefault();restoreFocus.current = true;@@ -171,7 +175,7 @@ export const MobilePageTitle = ({</>))}</div>- </PopoverContent>+ </MobilePageActionsContent></Popover>)}</div>diff --git a/web/src/components/layouts/page-header.tsx b/web/src/components/layouts/page-header.tsxindex f7f59de77b..7383b5bb71 100644--- a/web/src/components/layouts/page-header.tsx+++ b/web/src/components/layouts/page-header.tsx@@ -44,6 +44,9 @@ export type PageHeaderProps = {actionButtonsLeft?: React.ReactNode; // Right-side actions (buttons, etc.)actionButtonsRight?: React.ReactNode; // Right-side actions (buttons, etc.)actionButtonsRightClassName?: string;+ /** Mobile-only primary action rendered directly beside the page title. Use+ * this when collapsing the action would add an unnecessary overflow menu. */+ mobileActionButtons?: ReactNode;/** Mobile-only: the same actions rendered as full-width labeled menu rows* (icon + label), for the compact header's `⋯` overflow. Pages pass a* `layout="menu"` variant of their actions here (mirrors the table peek'sdiff --git a/web/src/components/table/data-table-controls.clienttest.tsx b/web/src/components/table/data-table-controls.clienttest.tsxindex 9568b2dc7f..2426c61b37 100644--- a/web/src/components/table/data-table-controls.clienttest.tsx+++ b/web/src/components/table/data-table-controls.clienttest.tsx@@ -7,6 +7,7 @@ import { TooltipProvider } from "@/src/components/ui/tooltip";import {CategoricalFacet,DataTableControls,+ DataTableControlsProvider,type QueryFilter,} from "./data-table-controls";import {@@ -16,6 +17,8 @@ import {} from "@/src/features/filters/hooks/useSidebarFilterState";import type { FilterConfig } from "@/src/features/filters/lib/filter-config";import { useEventsSearchBar } from "@/src/features/search-bar/hooks/useEventsSearchBar";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { FilterToggleButton } from "@/src/components/table/FilterToggleButton";vi.mock("use-query-params", async () => ({...(await vi.importActual("use-query-params")),@@ -44,6 +47,36 @@ beforeAll(() => {Element.prototype.scrollIntoView = vi.fn();});+function MobileDraftSearchInput() {+ const { store } = useEventsSearchBar({+ tableName: "draft-persistence-test",+ enabled: true,+ isV4: false,+ filterState: [],+ searchQuery: null,+ searchType: ["id"],+ observed: undefined,+ setFilterState: vi.fn(),+ setSearchQuery: vi.fn(),+ setSearchType: vi.fn(),+ });+ const draft = useStore(store, (state) => state.draft);++ return (+ <input+ aria-label="Mobile grammar search"+ value={draft}+ onChange={(event) =>+ store.getState().actions.setDraft(event.target.value)+ }+ />+ );+}++function TestFilterSidebar({ layout }: { layout?: "panel" | "inline" }) {+ return <div data-layout={layout}>Facet controls</div>;+}+describe("delayed sidebar edits and search-bar commits", () => {const config: FilterConfig = {tableName: "observations-events",@@ -218,6 +251,68 @@ describe("DataTableControls numeric conditions", () => {});});+describe("mobile searchable filter layout", () => {+ it("keeps secondary controls inside the Filters sheet", () => {+ render(+ <DataTableControlsProvider tableName="mobile-controls-test">+ <SearchableTableFilterLayout+ search={<MobileDraftSearchInput />}+ toolbar={<FilterToggleButton />}+ mobileControls={<button>Past 30 days</button>}+ >+ <TestFilterSidebar />+ <div>Table content</div>+ </SearchableTableFilterLayout>+ </DataTableControlsProvider>,+ );++ expect(+ screen.queryByRole("button", { name: "Past 30 days" }),+ ).not.toBeInTheDocument();++ fireEvent.click(screen.getByRole("button", { name: "Filters" }));++ expect(+ screen.getByRole("button", { name: "Past 30 days" }),+ ).toBeInTheDocument();+ });++ it("preserves an unsubmitted grammar-search draft across sheet close", () => {+ const layout = (searchKey: string) => (+ <DataTableControlsProvider tableName="draft-persistence-test">+ <SearchableTableFilterLayout+ search={<MobileDraftSearchInput key={searchKey} />}+ toolbar={<FilterToggleButton />}+ >+ <TestFilterSidebar />+ <div>Table content</div>+ </SearchableTableFilterLayout>+ </DataTableControlsProvider>+ );+ const { rerender } = render(layout("initial"));++ fireEvent.click(screen.getByRole("button", { name: "Filters" }));+ fireEvent.change(+ screen.getByRole("textbox", { name: "Mobile grammar search" }),+ { target: { value: "level:ERROR" } },+ );+ fireEvent.click(screen.getByRole("button", { name: "Close filters" }));+ fireEvent.click(screen.getByRole("button", { name: "Filters" }));++ expect(+ screen.getByRole("textbox", { name: "Mobile grammar search" }),+ ).toHaveValue("level:ERROR");++ fireEvent.click(screen.getByRole("button", { name: "Close filters" }));+ rerender(layout("new-search-scope"));+ fireEvent.click(screen.getByRole("button", { name: "Filters" }));++ expect(+ screen.getByRole("textbox", { name: "Mobile grammar search" }),+ ).toHaveValue("");+ });+});+describe("CategoricalFacet", () => {it("uses a custom option hover title", () => {render(diff --git a/web/src/components/table/data-table-toolbar.clienttest.tsx b/web/src/components/table/data-table-toolbar.clienttest.tsxindex a5b6330d94..0d5a587052 100644--- a/web/src/components/table/data-table-toolbar.clienttest.tsx+++ b/web/src/components/table/data-table-toolbar.clienttest.tsx@@ -1,10 +1,44 @@import { fireEvent, render, screen } from "@testing-library/react";import { vi } from "vitest";+import type { ColumnDefinition } from "@langfuse/shared";import { ExperimentDisplaySettings } from "@/src/features/experiments";import {DataTableToolbar,type MultiSelect,} from "@/src/components/table/data-table-toolbar";+import { useEventsSearchBar } from "@/src/features/search-bar/hooks/useEventsSearchBar";+import { useStore } from "zustand";++const captureSpy = vi.fn();+vi.mock("posthog-js/react", () => ({+ usePostHog: () => ({ capture: captureSpy }),+}));++function MobileSearchHarness() {+ const { store } = useEventsSearchBar({+ tableName: "test-table",+ enabled: true,+ isV4: false,+ filterState: [],+ searchQuery: null,+ searchType: ["id"],+ observed: undefined,+ setFilterState: vi.fn(),+ setSearchQuery: vi.fn(),+ setSearchType: vi.fn(),+ });+ const draft = useStore(store, (state) => state.draft);++ return (+ <input+ aria-label="Mobile search"+ value={draft}+ onChange={(event) =>+ store.getState().actions.setDraft(event.target.value)+ }+ />+ );+}const baseMultiSelect = (overrides: Partial<MultiSelect>): MultiSelect => ({selectAll: false,@@ -245,4 +279,81 @@ describe("DataTableToolbar presentation controls", () => {expect(screen.getByRole("button", { name: "Row height" })).toBeVisible();expect(screen.getByRole("button", { name: "Display" })).toBeVisible();});++ it("opens legacy filters and search together in the mobile sheet", () => {+ captureSpy.mockClear();+ const filterColumns: ColumnDefinition[] = [+ {+ id: "status",+ name: "Status",+ type: "stringOptions",+ internal: "status",+ options: [{ value: "active" }],+ },+ ];++ render(+ <DataTableToolbar+ columns={[]}+ tableName="test-table"+ filterColumnDefinition={filterColumns}+ filterState={[]}+ setFilterState={vi.fn()}+ mobileSearch={<MobileSearchHarness />}+ />,+ );++ fireEvent.click(screen.getAllByRole("button", { name: "Filters" })[0]!);++ expect(screen.getByRole("dialog", { name: "Filters" })).toBeInTheDocument();+ expect(+ screen.getByRole("button", { name: "Add filter" }),+ ).toBeInTheDocument();++ fireEvent.change(screen.getByRole("textbox", { name: "Mobile search" }), {+ target: { value: "unsubmitted draft" },+ });+ fireEvent.click(screen.getByRole("button", { name: "Close filters" }));+ fireEvent.click(screen.getAllByRole("button", { name: "Filters" })[0]!);++ expect(screen.getByRole("textbox", { name: "Mobile search" })).toHaveValue(+ "unsubmitted draft",+ );+ expect(+ captureSpy.mock.calls.filter(+ ([event]) => event === "filters:sidebar_toggled",+ ),+ ).toEqual([+ [+ "filters:sidebar_toggled",+ {+ tableName: "test-table",+ isV4: false,+ open: true,+ trigger: "toolbar",+ },+ undefined,+ ],+ [+ "filters:sidebar_toggled",+ {+ tableName: "test-table",+ isV4: false,+ open: false,+ trigger: "header",+ },+ undefined,+ ],+ [+ "filters:sidebar_toggled",+ {+ tableName: "test-table",+ isV4: false,+ open: true,+ trigger: "toolbar",+ },+ undefined,+ ],+ ]);+ });});diff --git a/web/src/components/table/data-table-toolbar.tsx b/web/src/components/table/data-table-toolbar.tsxindex 0921dda7a3..d0fb3f7768 100644--- a/web/src/components/table/data-table-toolbar.tsx+++ b/web/src/components/table/data-table-toolbar.tsx@@ -1,12 +1,20 @@/* eslint-disable @repo/no-style-props */-import React, { type Dispatch, type SetStateAction, useState } from "react";+import React, {+ type Dispatch,+ type ReactNode,+ type SetStateAction,+ useState,+} from "react";import { SearchInput } from "@/src/components/design-system/SearchInput/SearchInput";import {DataTableColumnVisibilityFilter,type ColumnGroupTogglePayload,} from "@/src/components/table/data-table-column-visibility-filter";import { FilterToggleButton } from "@/src/components/table/FilterToggleButton";-import { PopoverFilterBuilder } from "@/src/features/filters/components/filter-builder";+import {+ InlineFilterBuilder,+ PopoverFilterBuilder,+} from "@/src/features/filters/components/filter-builder";import {type FilterState,type ColumnDefinition,@@ -54,6 +62,19 @@ import {hasFullTextSearchType,searchModeToType,} from "@/src/components/table/utils/searchUtils";+import {+ Sheet,+ SheetContent,+ SheetTitle,+ SheetTrigger,+} from "@/src/components/ui/sheet";+import { Button } from "@/src/components/ui/button";+import { Filter, X } from "lucide-react";+import { useMediaQuery } from "react-responsive";+import {+ SearchBarDraftCacheContext,+ useSearchBarDraftCache,+} from "@/src/features/search-bar/hooks/useEventsSearchBar";export interface MultiSelect {selectAll: boolean;@@ -157,6 +178,9 @@ interface DataTableToolbarProps<TData, TValue> {* the fallback is the v4 events view, not a safe default. */isV4?: boolean;filterWithAI?: boolean;+ /** Search composer rendered inside the mobile legacy-filter sheet. New+ * sidebar tables compose this through SearchableTableFilterLayout instead. */+ mobileSearch?: ReactNode;className?: string;rowClassName?: string;viewModeToggle?: React.ReactNode;@@ -166,6 +190,9 @@ interface DataTableToolbarProps<TData, TValue> {leadingControls?: React.ReactNode;/** Surface-specific controls immediately before Columns and row height. */toolbarSettings?: React.ReactNode;+ /** Saved views and time range are rendered by the owning searchable layout+ * inside its mobile Filters sheet. Their desktop toolbar placement remains. */+ hideMobileFilterControls?: boolean;additionalColumnSettings?: {content: React.ReactNode;isDefault: boolean;@@ -176,6 +203,95 @@ interface DataTableToolbarProps<TData, TValue> {onColumnGroupToggle?: (payload: ColumnGroupTogglePayload) => void;}+type TableViewControlProps = {+ viewConfig: TableViewConfig;+ orderByState?: OrderByState;+ filterState?: FilterState;+ columnOrder: ColumnOrderState;+ columnVisibility: VisibilityState;+ searchQuery?: string;+};++function TableViewControl({+ viewConfig,+ orderByState,+ filterState,+ columnOrder,+ columnVisibility,+ searchQuery,+}: TableViewControlProps) {+ return (+ <TableViewPresetsDrawer+ viewConfig={viewConfig}+ currentState={{+ orderBy: orderByState ?? null,+ filters: filterState ?? [],+ columnOrder,+ columnVisibility,+ searchQuery: searchQuery ?? "",+ }}+ systemFilterPresets={viewConfig.systemFilterPresets}+ />+ );+}++function TableTimeRangeControl({+ timeRange,+ setTimeRange,+ compact = false,+}: {+ timeRange: TimeRange;+ setTimeRange: (timeRange: TimeRange) => void;+ compact?: boolean;+}) {+ return (+ <TimeRangePicker+ timeRange={timeRange}+ onTimeRangeChange={setTimeRange}+ timeRangePresets={TABLE_AGGREGATION_OPTIONS}+ className="my-0 max-w-full overflow-x-auto"+ compact={compact}+ />+ );+}++/** Saved views and time-range controls for searchable tables' mobile sheet. */+export function DataTableMobileFilterControls({+ viewConfig,+ orderByState,+ filterState,+ columnOrder,+ columnVisibility,+ searchQuery,+ timeRange,+ setTimeRange,+}: Partial<TableViewControlProps> & {+ timeRange?: TimeRange;+ setTimeRange?: (timeRange: TimeRange) => void;+}) {+ return (+ <>+ {viewConfig && columnOrder && columnVisibility && (+ <TableViewControl+ viewConfig={viewConfig}+ orderByState={orderByState}+ filterState={filterState}+ columnOrder={columnOrder}+ columnVisibility={columnVisibility}+ searchQuery={searchQuery}+ />+ )}+ {timeRange && setTimeRange && (+ <TableTimeRangeControl+ timeRange={timeRange}+ setTimeRange={setTimeRange}+ compact+ />+ )}+ </>+ );+}+/*** Every toolbar must be able to name its own table, because four analytics* events fire from inside it. One of the two sources has to be present:@@ -253,15 +369,22 @@ export function DataTableToolbar<TData, TValue>({tableName,isV4,filterWithAI = false,+ mobileSearch,viewModeToggle,leadingControls,toolbarSettings,+ hideMobileFilterControls = false,additionalColumnSettings,onColumnGroupToggle,}: DataTableToolbarProps<TData, TValue> & ToolbarTableIdentity) {const [searchString, setSearchString] = useState(searchConfig?.currentQuery ?? "",);+ const [legacyMobileFiltersOpen, setLegacyMobileFiltersOpen] = useState(false);+ const legacyMobileSearchDraftCache = useSearchBarDraftCache(+ React.isValidElement(mobileSearch) ? mobileSearch.key : null,+ );+ const isDesktop = useMediaQuery({ query: "(min-width: 768px)" });const capture = usePostHogClientCapture();// One definition of the two analytics dimensions for everything the toolbar@@ -274,6 +397,17 @@ export function DataTableToolbar<TData, TValue>({const analyticsIsV4 =isV4 ??viewConfig?.tableName === TableViewPresetTableName.ObservationsEvents;+ const emitLegacyMobileFiltersToggled = (+ open: boolean,+ trigger: "toolbar" | "header" | "mobile_sheet_dismiss",+ ) => {+ capture("filters:sidebar_toggled", {+ tableName: analyticsTableName,+ isV4: analyticsIsV4,+ open,+ trigger,+ });+ };const showSearchTypeSelector = Boolean(searchConfig?.setSearchType && searchConfig.tableAllowsFullTextSearch,);@@ -324,17 +458,16 @@ export function DataTableToolbar<TData, TValue>({<FilterToggleButton filterState={filterState} className="md:hidden" />)}{!!columnVisibility && !!columnOrder && !!viewConfig && (- <TableViewPresetsDrawer- viewConfig={viewConfig}- currentState={{- orderBy: orderByState ?? null,- filters: filterState ?? [],- columnOrder,- columnVisibility,- searchQuery: currentSearchQuery ?? searchString,- }}- systemFilterPresets={viewConfig.systemFilterPresets}- />+ <div className={cn(hideMobileFilterControls && "hidden md:contents")}>+ <TableViewControl+ viewConfig={viewConfig}+ orderByState={orderByState}+ filterState={filterState}+ columnOrder={columnOrder}+ columnVisibility={columnVisibility}+ searchQuery={currentSearchQuery ?? searchString}+ />+ </div>)}{searchConfig && (<div className="flex max-w-120 shrink-0 items-stretch md:min-w-96">@@ -457,12 +590,12 @@ export function DataTableToolbar<TData, TValue>({)}{viewModeToggle}{timeRange && setTimeRange && (- <TimeRangePicker- timeRange={timeRange}- onTimeRangeChange={setTimeRange}- timeRangePresets={TABLE_AGGREGATION_OPTIONS}- className="my-0 max-w-full overflow-x-auto"- />+ <div className={cn(hideMobileFilterControls && "hidden md:contents")}>+ <TableTimeRangeControl+ timeRange={timeRange}+ setTimeRange={setTimeRange}+ />+ </div>)}{refreshConfig && (<DataTableRefreshButton@@ -483,43 +616,117 @@ export function DataTableToolbar<TData, TValue>({/>)}{!!filterColumnDefinition && !!filterState && !!setFilterState && (- <PopoverFilterBuilder- columns={filterColumnDefinition}- filterState={filterState}- onChange={setFilterState}- columnsWithCustomSelect={columnsWithCustomSelect}- filterWithAI={filterWithAI}- // Analytics (LFE-10781): the table's own identity, so popover- // filters:applied/cleared events aren't mislabeled "unknown". Shares- // the toolbar's single definition of both dimensions.- tableName={analyticsTableName}- isV4={analyticsIsV4}- />+ <>+ {mobileSearch && !isDesktop && (+ <SearchBarDraftCacheContext.Provider+ value={legacyMobileSearchDraftCache}+ >+ <Sheet+ open={legacyMobileFiltersOpen}+ onOpenChange={(open) => {+ setLegacyMobileFiltersOpen(open);+ emitLegacyMobileFiltersToggled(+ open,+ open ? "toolbar" : "mobile_sheet_dismiss",+ );+ }}+ >+ <SheetTrigger asChild>+ <Button+ variant="outline"+ size="sm"+ className="flex h-8 items-center gap-2 text-sm md:hidden"+ >+ <Filter className="h-4 w-4" />+ <span>Filters</span>+ {filterState.length > 0 && (+ <span className="bg-input ml-1 rounded-sm px-1.5 text-xs shadow-xs">+ {filterState.length}+ </span>+ )}+ </Button>+ </SheetTrigger>+ <SheetContent+ side="bottom"+ aria-describedby={undefined}+ className="flex h-[85svh] flex-col gap-0 p-0 [&>button]:hidden"+ >+ <SheetTitle className="sr-only">Filters</SheetTitle>+ <div className="flex shrink-0 items-center gap-2 border-b px-4 py-3">+ <span className="text-foreground text-lg font-bold">+ Filters+ </span>+ <Button+ variant="ghost"+ size="icon"+ aria-label="Close filters"+ className="ml-auto h-8 w-8 shrink-0"+ onClick={() => {+ setLegacyMobileFiltersOpen(false);+ emitLegacyMobileFiltersToggled(false, "header");+ }}+ >+ <X className="h-4 w-4" />+ </Button>+ </div>+ <div className="shrink-0 border-b px-2 py-2">+ {mobileSearch}+ </div>+ <div className="min-h-0 flex-1 overflow-y-auto p-4">+ <InlineFilterBuilder+ columns={filterColumnDefinition}+ filterState={filterState}+ onChange={setFilterState}+ columnsWithCustomSelect={columnsWithCustomSelect}+ compact+ />+ </div>+ </SheetContent>+ </Sheet>+ </SearchBarDraftCacheContext.Provider>+ )}+ {(!mobileSearch || isDesktop) && (+ <PopoverFilterBuilder+ columns={filterColumnDefinition}+ filterState={filterState}+ onChange={setFilterState}+ columnsWithCustomSelect={columnsWithCustomSelect}+ filterWithAI={filterWithAI}+ // Analytics (LFE-10781): the table's own identity, so popover+ // filters:applied/cleared events aren't mislabeled "unknown". Shares+ // the toolbar's single definition of both dimensions.+ tableName={analyticsTableName}+ isV4={analyticsIsV4}+ />+ )}+ </>)}<div className="flex flex-row flex-wrap gap-2 pr-0.5 @3xl:ml-auto">- {toolbarSettings}- {!!columnVisibility && !!setColumnVisibility && (- <DataTableColumnVisibilityFilter- columns={columns}- columnVisibility={columnVisibility}- setColumnVisibility={setColumnVisibility}- columnOrder={columnOrder}- setColumnOrder={setColumnOrder}- tableName={analyticsTableName}- isV4={analyticsIsV4}- onColumnGroupToggle={onColumnGroupToggle}- additionalColumnSettings={additionalColumnSettings}- />- )}- {!!rowHeight && !!setRowHeight && (- <DataTableRowHeightSwitch- rowHeight={rowHeight}- setRowHeight={setRowHeight}- tableName={analyticsTableName}- isV4={analyticsIsV4}- />- )}+ <div className="hidden flex-row flex-wrap gap-2 md:flex">+ {toolbarSettings}+ {!!columnVisibility && !!setColumnVisibility && (+ <DataTableColumnVisibilityFilter+ columns={columns}+ columnVisibility={columnVisibility}+ setColumnVisibility={setColumnVisibility}+ columnOrder={columnOrder}+ setColumnOrder={setColumnOrder}+ tableName={analyticsTableName}+ isV4={analyticsIsV4}+ onColumnGroupToggle={onColumnGroupToggle}+ additionalColumnSettings={additionalColumnSettings}+ />+ )}+ {!!rowHeight && !!setRowHeight && (+ <DataTableRowHeightSwitch+ rowHeight={rowHeight}+ setRowHeight={setRowHeight}+ tableName={analyticsTableName}+ isV4={analyticsIsV4}+ />+ )}+ </div>{actionButtons}</div></div>diff --git a/web/src/components/table/resizable-filter-layout.tsx b/web/src/components/table/resizable-filter-layout.tsxindex 8664517756..3379fd4101 100644--- a/web/src/components/table/resizable-filter-layout.tsx+++ b/web/src/components/table/resizable-filter-layout.tsx@@ -1,9 +1,21 @@"use client";-import { type PropsWithChildren, Children } from "react";+import {+ type PropsWithChildren,+ type ReactNode,+ Children,+ cloneElement,+ isValidElement,+} from "react";+import { X } from "lucide-react";import { ResizableSplitLayout } from "@/src/components/ui/resizable-split-layout";import { Sheet, SheetContent, SheetTitle } from "@/src/components/ui/sheet";+import { Button } from "@/src/components/ui/button";import { usePostHogClientCapture } from "@/src/features/posthog-analytics";+import {+ SearchBarDraftCacheContext,+ useSearchBarDraftCache,+} from "@/src/features/search-bar/hooks/useEventsSearchBar";import { useDataTableControls } from "./data-table-controls";// Mirrors the trace peek's collapsed-panel rail (TraceLayoutDesktop): instead@@ -29,6 +41,92 @@ const FILTER_PANEL_MAX_DEFAULT_PCT = 30;* Expects exactly 2 children: filter sidebar (DataTableControls) and table content.*/export function ResizableFilterLayout({ children }: PropsWithChildren) {+ return <FilterPanels>{children}</FilterPanels>;+}++/**+ * Responsive composition for searchable filter tables.+ *+ * Desktop keeps the search bar and toolbar above the resizable sidebar/table+ * split. Mobile keeps the compact toolbar row visible, moves the large search+ * bar into the same Filters sheet as the facets, and leaves the table at full+ * width. The layout caches unsubmitted search text while the mobile sheet is+ * closed, without keeping the modal mounted while it is hidden.+ */+export function SearchableTableFilterLayout({+ search,+ toolbar,+ mobileControls,+ children,+}: PropsWithChildren<{+ search: ReactNode;+ toolbar: ReactNode;+ /** Compact context controls that belong in the mobile Filters sheet rather+ * than consuming a second toolbar row (for example saved views and time). */+ mobileControls?: ReactNode;+}>) {+ const { isMobile } = useDataTableControls();+ const searchDraftCache = useSearchBarDraftCache(+ isValidElement(search) ? search.key : null,+ );++ return (+ <SearchBarDraftCacheContext.Provider value={searchDraftCache}>+ {isMobile ? null : search}+ {toolbar}+ <FilterPanels+ mobileSearch={isMobile ? search : null}+ mobileControls={isMobile ? mobileControls : null}+ >+ {children}+ </FilterPanels>+ </SearchBarDraftCacheContext.Provider>+ );+}++/** Sticky-header variant for tables whose search and toolbar must scroll as one band. */+export function StickySearchableTableFilterLayout({+ search,+ toolbar,+ mobileControls,+ nonStickyContent,+ children,+}: PropsWithChildren<{+ search: ReactNode;+ toolbar: ReactNode;+ mobileControls?: ReactNode;+ nonStickyContent?: ReactNode;+}>) {+ const { isMobile } = useDataTableControls();+ const searchDraftCache = useSearchBarDraftCache(+ isValidElement(search) ? search.key : null,+ );++ return (+ <SearchBarDraftCacheContext.Provider value={searchDraftCache}>+ <div className="bg-background sticky top-0 z-30 pb-1.5">+ {isMobile ? null : search}+ {toolbar}+ </div>+ {nonStickyContent}+ <FilterPanels+ mobileSearch={isMobile ? search : null}+ mobileControls={isMobile ? mobileControls : null}+ >+ {children}+ </FilterPanels>+ </SearchBarDraftCacheContext.Provider>+ );+}++function FilterPanels({+ children,+ mobileSearch,+ mobileControls,+}: PropsWithChildren<{+ mobileSearch?: ReactNode;+ mobileControls?: ReactNode;+}>) {const { open, setOpen, tableName, isMobile } = useDataTableControls();const capture = usePostHogClientCapture();// Single-source the breakpoint from the controls provider (which derives@@ -48,6 +146,24 @@ export function ResizableFilterLayout({ children }: PropsWithChildren) {? childrenArray.slice(1): childrenArray;+ const emitMobileClose = (trigger: "header" | "mobile_sheet_dismiss") => {+ capture("filters:sidebar_toggled", {+ tableName,+ open: false,+ trigger,+ });+ };++ // Searchable tables use the same single-scroll presentation as the Events+ // Filters sheet. The first child is always DataTableControls; override only+ // its presentation while it is mounted in the sheet so the sheet owns the+ // title/close chrome and the facet list contributes natural height.+ const mobileFilterSidebar = isValidElement<{ layout?: "panel" | "inline" }>(+ filterSidebar,+ )+ ? cloneElement(filterSidebar, { layout: "inline" })+ : filterSidebar;+// On mobile the desktop rail doesn't fit — the table takes the full width and// the filter panel opens in a bottom sheet (driven by the same open state the// "Filters" toggle in the toolbar controls), rather than squeezing the@@ -66,27 +182,50 @@ export function ResizableFilterLayout({ children }: PropsWithChildren) {// Radix callbacks don't run for the programmatic close from the// header X, so this counts the previously-silent dismiss path// without double-counting the others.- onInteractOutside={() =>- capture("filters:sidebar_toggled", {- tableName,- open: false,- trigger: "mobile_sheet_dismiss",- })- }- onEscapeKeyDown={() =>- capture("filters:sidebar_toggled", {- tableName,- open: false,- trigger: "mobile_sheet_dismiss",- })- }+ onInteractOutside={() => emitMobileClose("mobile_sheet_dismiss")}+ onEscapeKeyDown={() => emitMobileClose("mobile_sheet_dismiss")}// Hide the Sheet's own close button — the filter panel header// renders its own close (X), so a second one just collides with// the panel's controls.className="flex h-[85svh] flex-col gap-0 p-0 [&>button]:hidden"><SheetTitle className="sr-only">Filters</SheetTitle>- {filterSidebar}+ {mobileSearch || mobileControls ? (+ <>+ <div className="flex shrink-0 items-center gap-2 border-b px-4 py-3">+ <span className="text-foreground text-lg font-bold">+ Filters+ </span>+ <Button+ variant="ghost"+ size="icon"+ aria-label="Close filters"+ className="ml-auto h-8 w-8 shrink-0"+ onClick={() => {+ setOpen(false);+ emitMobileClose("header");+ }}+ >+ <X className="h-4 w-4" />+ </Button>+ </div>+ {mobileSearch && (+ <div className="shrink-0 border-b px-2 py-2">+ {mobileSearch}+ </div>+ )}+ {mobileControls && (+ <div className="flex shrink-0 flex-wrap items-center gap-2 border-b px-2 py-2">+ {mobileControls}+ </div>+ )}+ <div className="min-h-0 flex-1 overflow-y-auto">+ {mobileFilterSidebar}+ </div>+ </>+ ) : (+ filterSidebar+ )}</SheetContent></Sheet>)}diff --git a/web/src/components/table/table-header-controls.tsx b/web/src/components/table/table-header-controls.tsxindex c1919e1f71..d5594b6426 100644--- a/web/src/components/table/table-header-controls.tsx+++ b/web/src/components/table/table-header-controls.tsx@@ -6,6 +6,7 @@ import {TABLE_AGGREGATION_OPTIONS,type TimeRange,} from "@/src/utils/date-range-utils";+import { cn } from "@/src/utils/tailwind";type RefreshControls = {onRefresh: () => void;@@ -28,28 +29,34 @@ export function TableHeaderControls({timeRange,setTimeRange,refresh,+ desktopOnly = false,}: {timeRange: TimeRange;setTimeRange: (timeRange: TimeRange) => void;refresh?: RefreshControls;+ /** Hide the header controls on mobile when the owning table places them in+ * its Filters sheet instead. */+ desktopOnly?: boolean;}) {return (<PageHeaderControlsPortal>- <TimeRangePicker- timeRange={timeRange}- onTimeRangeChange={setTimeRange}- timeRangePresets={TABLE_AGGREGATION_OPTIONS}- className="my-0 max-w-full overflow-x-auto"- triggerClassName="px-2"- />- {refresh && (- <DataTableRefreshButton- onRefresh={refresh.onRefresh}- isRefreshing={refresh.isRefreshing}- interval={refresh.interval}- setInterval={refresh.setInterval}+ <div className={cn("contents", desktopOnly && "hidden md:contents")}>+ <TimeRangePicker+ timeRange={timeRange}+ onTimeRangeChange={setTimeRange}+ timeRangePresets={TABLE_AGGREGATION_OPTIONS}+ className="my-0 max-w-full overflow-x-auto"+ triggerClassName="px-2"/>- )}+ {refresh && (+ <DataTableRefreshButton+ onRefresh={refresh.onRefresh}+ isRefreshing={refresh.isRefreshing}+ interval={refresh.interval}+ setInterval={refresh.setInterval}+ />+ )}+ </div></PageHeaderControlsPortal>);}diff --git a/web/src/features/ai-gateway/components/GatewayModelsPage/components/GatewayModelsView/GatewayModelsView.tsx b/web/src/features/ai-gateway/components/GatewayModelsPage/components/GatewayModelsView/GatewayModelsView.tsxindex c372d57053..810442dd92 100644--- a/web/src/features/ai-gateway/components/GatewayModelsPage/components/GatewayModelsView/GatewayModelsView.tsx+++ b/web/src/features/ai-gateway/components/GatewayModelsPage/components/GatewayModelsView/GatewayModelsView.tsx@@ -18,7 +18,7 @@ import {DataTableControlsProvider,} from "@/src/components/table/data-table-controls";import { DataTableToolbar } from "@/src/components/table/data-table-toolbar";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import type { LangfuseColumnDef } from "@/src/components/table/types";import { useSidebarFilterState } from "@/src/features/filters";import { providerLabels } from "@/src/features/ai-gateway/constants/providerLabels";@@ -269,43 +269,48 @@ export function GatewayModelsView({<DataTableControlsProvider tableName={TABLE_NAME}><div className="flex min-h-0 w-full flex-1 flex-col overflow-hidden rounded-md border">- <TableSearchBar- key={queryFilter.draftResetKey}- tableName={TABLE_NAME}- registry={searchRegistry}- filterState={queryFilter.searchBarFilterState}- setFilterState={(filters) =>- queryFilter.setFilterState(- filters.map((filter) =>- filter.column === "connection" &&- filter.type === "arrayOptions"- ? {- ...filter,- value: filter.value.map(- (value) =>- connectionSearchOptions.connectionIdByDisplayValue.get(- value,- ) ?? value,- ),- }- : filter,- ),- )- }- observed={observedOptions}- isV4={false}- search={{- query: searchQuery,- setQuery: (query) => setSearchQuery(query ?? ""),- }}- />- <DataTableToolbar- tableName={TABLE_NAME}- columns={columns}- filterState={queryFilter.filterState}- />- <div className="min-h-0 flex-1 overflow-hidden">- <ResizableFilterLayout>+ <div className="flex min-h-0 flex-1 flex-col overflow-hidden">+ <SearchableTableFilterLayout+ search={+ <TableSearchBar+ key={queryFilter.draftResetKey}+ tableName={TABLE_NAME}+ registry={searchRegistry}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={(filters) =>+ queryFilter.setFilterState(+ filters.map((filter) =>+ filter.column === "connection" &&+ filter.type === "arrayOptions"+ ? {+ ...filter,+ value: filter.value.map(+ (value) =>+ connectionSearchOptions.connectionIdByDisplayValue.get(+ value,+ ) ?? value,+ ),+ }+ : filter,+ ),+ )+ }+ observed={observedOptions}+ isV4={false}+ search={{+ query: searchQuery,+ setQuery: (query) => setSearchQuery(query ?? ""),+ }}+ />+ }+ toolbar={+ <DataTableToolbar+ tableName={TABLE_NAME}+ columns={columns}+ filterState={queryFilter.filterState}+ />+ }+ ><DataTableControls queryFilter={queryFilter} /><div className="flex min-h-0 flex-1 flex-col overflow-hidden"><DataTable@@ -341,7 +346,7 @@ export function GatewayModelsView({cellPadding="comfortable"/></div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout></div></div></DataTableControlsProvider>diff --git a/web/src/features/dashboard/ProjectHomePage.tsx b/web/src/features/dashboard/ProjectHomePage.tsxindex 0632f8274e..f969cd718c 100644--- a/web/src/features/dashboard/ProjectHomePage.tsx+++ b/web/src/features/dashboard/ProjectHomePage.tsx@@ -126,6 +126,8 @@ function HomeDashboard({ readPath }: { readPath: ResolvedReadPath }) {const { selectedEnvironments, setSelectedEnvironments } =useEnvironmentFilter(environmentOptions, projectId);+ const setSelectedEnvironmentsDebounced = useDebounce(setSelectedEnvironments);+ const setUserFilterStateDebounced = useDebounce(setUserFilterState);const filterColumns: ColumnDefinition[] = [{@@ -305,6 +307,33 @@ function HomeDashboard({ readPath }: { readPath: ResolvedReadPath }) {resetKey: schedulerResetKey,});+ const handleDashboardChange = (id: string) => {+ capture("dashboard:home_dashboard_peeked", {+ dashboard_id: id,+ is_default: id === appliedDefaultId,+ });+ setPeekId(id === appliedDefaultId ? null : id);+ };++ const handleSetDefaultDashboard = () => {+ capture("dashboard:home_dashboard_set_default", {+ dashboard_id: dashboardId,+ source: "home_selector",+ });+ setHomeDashboard.mutate({+ projectId,+ dashboardId:+ dashboardId === LANGFUSE_HOME_DASHBOARD_ID ? null : dashboardId,+ });+ };++ const handleEditDashboard = () => {+ capture("dashboard:home_edit_pencil_click", {+ dashboard_id: dashboardId,+ dashboard_owner: dashboardOwner,+ });+ };+return (<DashboardQuerySchedulerProviderstore={schedulerStore}@@ -321,7 +350,7 @@ function HomeDashboard({ readPath }: { readPath: ResolvedReadPath }) {title="Environment"label="Env"values={selectedEnvironments}- onValueChange={useDebounce(setSelectedEnvironments)}+ onValueChange={setSelectedEnvironmentsDebounced}options={environmentOptions.map((env) => ({value: env,}))}@@ -330,7 +359,7 @@ function HomeDashboard({ readPath }: { readPath: ResolvedReadPath }) {<PopoverFilterBuildercolumns={filterColumns}filterState={userFilterState}- onChange={useDebounce(setUserFilterState)}+ onChange={setUserFilterStateDebounced}// Analytics (LFE-10781): project-home dashboard filter — a// v3/legacy surface (not the v4 events table).tableName="home-dashboard"@@ -344,13 +373,7 @@ function HomeDashboard({ readPath }: { readPath: ResolvedReadPath }) {projectId={projectId}value={dashboardId}defaultDashboardId={appliedDefaultId}- onValueChange={(id) => {- capture("dashboard:home_dashboard_peeked", {- dashboard_id: id,- is_default: id === appliedDefaultId,- });- setPeekId(id === appliedDefaultId ? null : id);- }}+ onValueChange={handleDashboardChange}currentDashboardName={dashboardName}/>{Boolean(peekId) && hasRbacCUDAccess && (@@ -358,19 +381,7 @@ function HomeDashboard({ readPath }: { readPath: ResolvedReadPath }) {variant="outline"loading={setHomeDashboard.isPending}title="Show this dashboard on Home for everyone in this project"- onClick={() => {- capture("dashboard:home_dashboard_set_default", {- dashboard_id: dashboardId,- source: "home_selector",- });- setHomeDashboard.mutate({- projectId,- dashboardId:- dashboardId === LANGFUSE_HOME_DASHBOARD_ID- ? null- : dashboardId,- });- }}+ onClick={handleSetDefaultDashboard}>Set default</Button>@@ -383,12 +394,7 @@ function HomeDashboard({ readPath }: { readPath: ResolvedReadPath }) {><Linkhref={`/project/${projectId}/dashboards/${encodeURIComponent(dashboardId)}`}- onClick={() =>- capture("dashboard:home_edit_pencil_click", {- dashboard_id: dashboardId,- dashboard_owner: dashboardOwner,- })- }+ onClick={handleEditDashboard}><PencilIcon className="h-4 w-4" /><span className="sr-only">@@ -414,6 +420,100 @@ function HomeDashboard({ readPath }: { readPath: ResolvedReadPath }) {))}</>),+ actionButtonsMenu: ({ closeMenu }) => (+ <>+ <div className="flex flex-col gap-1">+ <span className="text-muted-foreground px-2 text-xs">+ Dashboard+ </span>+ <div className="[&_[role=combobox]]:w-full [&_[role=combobox]]:max-w-none">+ <HomeDashboardSelect+ projectId={projectId}+ value={dashboardId}+ defaultDashboardId={appliedDefaultId}+ onValueChange={handleDashboardChange}+ currentDashboardName={dashboardName}+ />+ </div>+ {Boolean(peekId) && hasRbacCUDAccess && (+ <Button+ variant="ghost"+ size="sm"+ loading={setHomeDashboard.isPending}+ onClick={handleSetDefaultDashboard}+ className="w-full justify-start font-normal"+ >+ Set as project default+ </Button>+ )}+ <Button+ variant="ghost"+ size="sm"+ asChild+ className="w-full justify-start gap-2 font-normal"+ >+ <Link+ href={`/project/${projectId}/dashboards/${encodeURIComponent(dashboardId)}`}+ onClick={() => {+ handleEditDashboard();+ closeMenu();+ }}+ >+ <PencilIcon className="h-4 w-4" />+ Edit dashboard+ </Link>+ </Button>+ {!isTracingCheckLoading &&+ !hasTracingConfigured &&+ project &&+ (hasSetupTracingAccess ? (+ <Button+ asChild+ size="sm"+ className="w-full justify-start font-normal"+ >+ <Link+ href={setupTracingRoute(project.id)}+ onClick={() => closeMenu()}+ >+ Configure tracing+ </Link>+ </Button>+ ) : (+ <Button+ disabled+ size="sm"+ className="w-full justify-start gap-2 font-normal"+ >+ <LockIcon className="h-4 w-4" aria-hidden="true" />+ Configure tracing+ </Button>+ ))}+ </div>+ <div className="grid grid-cols-2 gap-2 border-t pt-2">+ <span className="text-muted-foreground col-span-2 px-2 text-xs">+ Data+ </span>+ <MultiSelect+ title="Environment"+ label="Environment"+ values={selectedEnvironments}+ onValueChange={setSelectedEnvironmentsDebounced}+ options={environmentOptions.map((env) => ({ value: env }))}+ className="my-0 w-full overflow-hidden"+ />+ <div className="[&_button]:w-full [&_button]:justify-between [&>div]:w-full">+ <PopoverFilterBuilder+ columns={filterColumns}+ filterState={userFilterState}+ onChange={setUserFilterStateDebounced}+ tableName="home-dashboard"+ isV4={false}+ />+ </div>+ </div>+ </>+ ),}}><PageHeaderControlsPortal>diff --git a/web/src/features/datasets/components/DatasetItemsTable.tsx b/web/src/features/datasets/components/DatasetItemsTable.tsxindex 13b76ccfa9..33e32db499 100644--- a/web/src/features/datasets/components/DatasetItemsTable.tsx+++ b/web/src/features/datasets/components/DatasetItemsTable.tsx@@ -10,6 +10,7 @@ import {DropdownMenuLabel,} from "@/src/components/ui/dropdown-menu";import { useQueryParams, withDefault, NumberParam } from "use-query-params";+import { useMediaQuery } from "react-responsive";import { Archive, Edit, ListTree, Trash2 } from "lucide-react";import {datasetItemFilterColumns,@@ -357,25 +358,31 @@ export function DatasetItemsTable({) : null;const setFilterStateWithDebounce = useDebounce(setFilterState);+ // Below `md` the Filters sheet is the only mounted search bar. The query+ // starts unmatched, and `hidden md:block` hides this slot until then.+ const isMobile = useMediaQuery({ query: "(max-width: 767.98px)" });+ const searchBar = (+ <TableSearchBar+ key={`${projectId}:${datasetId}:${selectedVersion?.toISOString() ?? "latest"}`}+ projectId={projectId}+ tableName="dataset-items"+ registry={DATASET_ITEMS_FIELD_REGISTRY}+ filterState={filterState}+ setFilterState={setFilterState}+ observed={undefined}+ isV4={false}+ search={{+ query: searchQuery,+ type: searchType,+ setQuery: setSearchQuery,+ setType: setSearchType,+ }}+ />+ );return (<>- <TableSearchBar- key={`${projectId}:${datasetId}:${selectedVersion?.toISOString() ?? "latest"}`}- projectId={projectId}- tableName="dataset-items"- registry={DATASET_ITEMS_FIELD_REGISTRY}- filterState={filterState}- setFilterState={setFilterState}- observed={undefined}- isV4={false}- search={{- query: searchQuery,- type: searchType,- setQuery: setSearchQuery,- setType: setSearchType,- }}- />+ {isMobile ? null : <div className="hidden md:block">{searchBar}</div>}<DataTableToolbarcolumns={columns}tableName="dataset-items"@@ -389,6 +396,7 @@ export function DatasetItemsTable({setColumnOrder={setColumnOrder}rowHeight={rowHeight}setRowHeight={setRowHeight}+ mobileSearch={searchBar}actionButtons={[menuItems, batchExportButton].filter(Boolean)}/><DataTablediff --git a/web/src/features/evals/components/eval-log.tsx b/web/src/features/evals/components/eval-log.tsxindex 62b4c60534..1085172c01 100644--- a/web/src/features/evals/components/eval-log.tsx+++ b/web/src/features/evals/components/eval-log.tsx@@ -10,7 +10,7 @@ import {DataTableControlsProvider,DataTableControls,} from "@/src/components/table/data-table-controls";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { type LangfuseColumnDef } from "@/src/components/table/types";import { createDateTableColumn } from "@/src/components/design-system/table/columns/createDateTableColumn";import { createIdTableColumn } from "@/src/components/design-system/table/columns/createIdTableColumn";@@ -262,29 +262,33 @@ export default function EvalLogTable({defaultSidebarCollapsed={evalLogFilterConfig.defaultSidebarCollapsed}><div className="flex h-full w-full flex-col">- <TableSearchBar- key={queryFilter.draftResetKey}- projectId={projectId}- tableName={evalLogFilterConfig.tableName}- registry={EVAL_LOGS_FIELD_REGISTRY}- filterState={queryFilter.searchBarFilterState}- setFilterState={queryFilter.setFilterState}- observed={toObservedOptions(filterOptions, false)}- isV4={false}- />- <DataTableToolbar- tableName="evalLogs"- columns={columns}- columnVisibility={columnVisibility}- setColumnVisibility={setColumnVisibility}- columnOrder={columnOrder}- setColumnOrder={setColumnOrder}- rowHeight={rowHeight}- setRowHeight={setRowHeight}- filterState={queryFilter.filterState}- />-- <ResizableFilterLayout>+ <SearchableTableFilterLayout+ search={+ <TableSearchBar+ key={queryFilter.draftResetKey}+ projectId={projectId}+ tableName={evalLogFilterConfig.tableName}+ registry={EVAL_LOGS_FIELD_REGISTRY}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={queryFilter.setFilterState}+ observed={toObservedOptions(filterOptions, false)}+ isV4={false}+ />+ }+ toolbar={+ <DataTableToolbar+ tableName="evalLogs"+ columns={columns}+ columnVisibility={columnVisibility}+ setColumnVisibility={setColumnVisibility}+ columnOrder={columnOrder}+ setColumnOrder={setColumnOrder}+ rowHeight={rowHeight}+ setRowHeight={setRowHeight}+ filterState={queryFilter.filterState}+ />+ }+ ><DataTableControlskey={queryFilter.draftResetKey}queryFilter={queryFilter}@@ -324,7 +328,7 @@ export default function EvalLogTable({rowHeight={rowHeight}/></div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout></div></DataTableControlsProvider>);diff --git a/web/src/features/evals/components/evaluator-table.tsx b/web/src/features/evals/components/evaluator-table.tsxindex 81600bc97d..867ebcfc46 100644--- a/web/src/features/evals/components/evaluator-table.tsx+++ b/web/src/features/evals/components/evaluator-table.tsx@@ -7,7 +7,7 @@ import {DataTableControlsProvider,DataTableControls,} from "@/src/components/table/data-table-controls";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { type LangfuseColumnDef } from "@/src/components/table/types";import { useColumnVisibility } from "@/src/features/column-visibility";import { EvaluatorFilterCell } from "@/src/features/evals/components/EvaluatorFilterCell";@@ -440,28 +440,30 @@ export default function EvaluatorTable({ projectId }: { projectId: string }) {defaultSidebarCollapsed={evaluatorFilterConfig.defaultSidebarCollapsed}><div className="flex h-full w-full flex-col">- <TableSearchBar- key={queryFilter.draftResetKey}- projectId={projectId}- tableName={evaluatorFilterConfig.tableName}- registry={LEGACY_EVALUATORS_FIELD_REGISTRY}- filterState={queryFilter.searchBarFilterState}- setFilterState={queryFilter.setFilterState}- observed={toObservedOptions(newFilterOptions, false)}- search={{ query: searchQuery, setQuery: setSearchQuery }}- isV4={false}- />- {/* Toolbar spanning full width */}- <DataTableToolbar- tableName="evaluators"- columns={columns}- filterState={queryFilter.filterState}- columnVisibility={columnVisibility}- setColumnVisibility={setColumnVisibility}- />-- {/* Content area with sidebar and table */}- <ResizableFilterLayout>+ <SearchableTableFilterLayout+ search={+ <TableSearchBar+ key={queryFilter.draftResetKey}+ projectId={projectId}+ tableName={evaluatorFilterConfig.tableName}+ registry={LEGACY_EVALUATORS_FIELD_REGISTRY}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={queryFilter.setFilterState}+ observed={toObservedOptions(newFilterOptions, false)}+ search={{ query: searchQuery, setQuery: setSearchQuery }}+ isV4={false}+ />+ }+ toolbar={+ <DataTableToolbar+ tableName="evaluators"+ columns={columns}+ filterState={queryFilter.filterState}+ columnVisibility={columnVisibility}+ setColumnVisibility={setColumnVisibility}+ />+ }+ ><DataTableControlskey={queryFilter.draftResetKey}queryFilter={queryFilter}@@ -499,7 +501,7 @@ export default function EvaluatorTable({ projectId }: { projectId: string }) {onColumnVisibilityChange={setColumnVisibility}/></div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout><TablePeekViewEvaluatorConfigDetail{...peekConfig}projectId={projectId}diff --git a/web/src/features/evals/v2/components/EvaluatorGalleryDialog/EvaluatorGalleryDialog.tsx b/web/src/features/evals/v2/components/EvaluatorGalleryDialog/EvaluatorGalleryDialog.tsxindex 869aaa22de..cb41ec2918 100644--- a/web/src/features/evals/v2/components/EvaluatorGalleryDialog/EvaluatorGalleryDialog.tsx+++ b/web/src/features/evals/v2/components/EvaluatorGalleryDialog/EvaluatorGalleryDialog.tsx@@ -123,15 +123,17 @@ export function EvaluatorGalleryDialog({return (<Dialog open={open} onOpenChange={onOpenChange}><DialogContent- className="flex h-[80dvh] w-[calc(100vw-2rem)] max-w-none flex-col gap-0 p-0 sm:w-[70vw]"+ className="flex h-[calc(100dvh-1rem)] max-h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] max-w-none flex-col gap-0 rounded-lg p-0 sm:h-[80dvh] sm:max-h-[85vh] sm:w-[70vw]"closeOnInteractionOutsideonOpenAutoFocus={(event) => {event.preventDefault();searchInputRef.current?.focus();}}>- <DialogHeader className="[&>div]:items-start [&>div>button]:-mt-1 [&>div>button]:-mr-2 [&>div>button]:flex [&>div>button]:size-8 [&>div>button]:items-center [&>div>button]:justify-center">- <DialogTitle>Add an evaluator</DialogTitle>+ <DialogHeader className="p-3 sm:p-4 [&>div]:items-start [&>div]:text-left [&>div>button]:-mt-1 [&>div>button]:-mr-2 [&>div>button]:flex [&>div>button]:size-8 [&>div>button]:items-center [&>div>button]:justify-center">+ <DialogTitle className="text-lg sm:text-xl">+ Add an evaluator+ </DialogTitle><DialogDescription>Pick a template to start from or create a new evaluator fromscratch.diff --git a/web/src/features/evals/v2/components/EvaluatorGalleryView/EvaluatorGalleryView.stories.tsx b/web/src/features/evals/v2/components/EvaluatorGalleryView/EvaluatorGalleryView.stories.tsxindex 8aaf79ed5e..90c4c9ed81 100644--- a/web/src/features/evals/v2/components/EvaluatorGalleryView/EvaluatorGalleryView.stories.tsx+++ b/web/src/features/evals/v2/components/EvaluatorGalleryView/EvaluatorGalleryView.stories.tsx@@ -251,6 +251,26 @@ export const DecisionModels = meta.story({render: StatefulEvaluatorGalleryView,});+export const DecisionModelsNarrow = meta.story({+ globals: { viewport: { value: "evaluator-gallery-phone", isRotated: false } },+ parameters: {+ viewport: {+ options: {+ "evaluator-gallery-phone": {+ name: "Phone",+ styles: { width: "390px", height: "844px" },+ },+ },+ },+ },+ args: {+ ...defaultArgs,+ sections: sectionsWithDecisionModelCard,+ decisionModelBannerDismissed: false,+ },+ render: StatefulEvaluatorGalleryView,+});+export const DecisionModelsBannerDismissed = meta.story({args: {...defaultArgs,diff --git a/web/src/features/evals/v2/components/EvaluatorGalleryView/components/EvaluatorGalleryDecisionModelBanner/EvaluatorGalleryDecisionModelBanner.tsx b/web/src/features/evals/v2/components/EvaluatorGalleryView/components/EvaluatorGalleryDecisionModelBanner/EvaluatorGalleryDecisionModelBanner.tsxindex 9793125e8b..425dfa9e8b 100644--- a/web/src/features/evals/v2/components/EvaluatorGalleryView/components/EvaluatorGalleryDecisionModelBanner/EvaluatorGalleryDecisionModelBanner.tsx+++ b/web/src/features/evals/v2/components/EvaluatorGalleryView/components/EvaluatorGalleryDecisionModelBanner/EvaluatorGalleryDecisionModelBanner.tsx@@ -10,26 +10,34 @@ export function EvaluatorGalleryDecisionModelBanner({onDismiss: () => void;}) {return (- <div className="border-primary-accent/30 bg-primary-accent/5 flex flex-wrap items-center gap-3 rounded-md border px-4 py-3 text-sm">- <Scale- className="text-primary-accent h-4 w-4 shrink-0"- aria-hidden="true"- />- <div className="min-w-0 flex-1">- <span className="font-bold">New: decision-model evaluators.</span>{" "}- <span className="text-muted-foreground">- Ask TypeSafe Jev typed questions about each observation and get- calibrated answers in one call, at a fraction of an LLM judge's- cost. Experimental.- </span>+ <div className="border-primary-accent/30 bg-primary-accent/5 relative flex flex-col gap-3 rounded-md border px-4 py-3 pr-10 text-sm @3xl:flex-row @3xl:items-center">+ <div className="flex min-w-0 items-start gap-3">+ <Scale+ className="text-primary-accent mt-0.5 h-4 w-4 shrink-0"+ aria-hidden="true"+ />+ <div className="min-w-0 flex-1">+ <span className="font-bold">New: decision-model evaluators.</span>{" "}+ <span className="text-muted-foreground">+ Ask TypeSafe Jev typed questions about each observation and get+ calibrated answers in one call, at a fraction of an LLM judge's+ cost. Experimental.+ </span>+ </div></div>- <Button type="button" size="sm" onClick={onTry}>+ <Button+ type="button"+ size="sm"+ className="shrink-0 @sm:self-start @3xl:self-auto"+ onClick={onTry}+ >Try a decision model</Button><Buttontype="button"variant="ghost"size="icon-xs"+ className="absolute top-2 right-2"aria-label="Dismiss"onClick={onDismiss}>diff --git a/web/src/features/evals/v2/components/Evaluators/EvaluationTypeConfiguration/components/EvaluationTypeToggle/EvaluationTypeToggle.stories.tsx b/web/src/features/evals/v2/components/Evaluators/EvaluationTypeConfiguration/components/EvaluationTypeToggle/EvaluationTypeToggle.stories.tsxindex 86b8ea38d6..621712a46d 100644--- a/web/src/features/evals/v2/components/Evaluators/EvaluationTypeConfiguration/components/EvaluationTypeToggle/EvaluationTypeToggle.stories.tsx+++ b/web/src/features/evals/v2/components/Evaluators/EvaluationTypeConfiguration/components/EvaluationTypeToggle/EvaluationTypeToggle.stories.tsx@@ -38,6 +38,21 @@ export const Code = meta.story({args: { value: EvalTemplateTypeEnum.CODE, onValueChange: fn() },render: StatefulEvaluationTypeToggle,});+export const Narrow = meta.story({+ globals: { viewport: { value: "evaluation-type-phone", isRotated: false } },+ parameters: {+ viewport: {+ options: {+ "evaluation-type-phone": {+ name: "Phone",+ styles: { width: "390px", height: "844px" },+ },+ },+ },+ },+ args: { value: EvalTemplateTypeEnum.LLM_AS_JUDGE, onValueChange: fn() },+ render: StatefulEvaluationTypeToggle,+});export const LockedForEdit = meta.story({args: {value: EvalTemplateTypeEnum.LLM_AS_JUDGE,diff --git a/web/src/features/evals/v2/components/Evaluators/EvaluationTypeConfiguration/components/EvaluationTypeToggle/EvaluationTypeToggle.tsx b/web/src/features/evals/v2/components/Evaluators/EvaluationTypeConfiguration/components/EvaluationTypeToggle/EvaluationTypeToggle.tsxindex 7e866c4a0b..1a6fe59ef4 100644--- a/web/src/features/evals/v2/components/Evaluators/EvaluationTypeConfiguration/components/EvaluationTypeToggle/EvaluationTypeToggle.tsx+++ b/web/src/features/evals/v2/components/Evaluators/EvaluationTypeConfiguration/components/EvaluationTypeToggle/EvaluationTypeToggle.tsx@@ -2,6 +2,31 @@ import { Code2, Scale, Sparkles } from "lucide-react";import { EvalTemplateTypeEnum, type EvalTemplateType } from "@langfuse/shared";import { Tabs } from "@/src/components/design-system/Tabs/Tabs";+import {+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+} from "@/src/components/ui/select";++const evaluationTypes = [+ {+ value: EvalTemplateTypeEnum.LLM_AS_JUDGE,+ label: "LLM-as-a-judge",+ icon: Sparkles,+ },+ {+ value: EvalTemplateTypeEnum.CODE,+ label: "Code evaluator",+ icon: Code2,+ },+ {+ value: EvalTemplateTypeEnum.DECISION_MODEL,+ label: "Decision model (experimental)",+ icon: Scale,+ },+] as const;/** Selects the evaluator implementation. */export function EvaluationTypeToggle({@@ -13,37 +38,61 @@ export function EvaluationTypeToggle({onValueChange: (value: EvalTemplateType) => void;disabled?: boolean;}) {+ const selectedType =+ evaluationTypes.find((type) => type.value === value) ?? evaluationTypes[0];+ const visibleTypes = disabled+ ? evaluationTypes.filter((type) => type.value === value)+ : evaluationTypes;+ const SelectedIcon = selectedType.icon;+return (- <Tabs- value={value}- onValueChange={(mode) => onValueChange(mode as EvalTemplateType)}- >- <Tabs.List variant="outline">- {!disabled || value === EvalTemplateTypeEnum.LLM_AS_JUDGE ? (- <Tabs.Trigger- value={EvalTemplateTypeEnum.LLM_AS_JUDGE}- disabled={disabled}- icon={Sparkles}- label="LLM-as-a-judge"- />- ) : null}- {!disabled || value === EvalTemplateTypeEnum.CODE ? (- <Tabs.Trigger- value={EvalTemplateTypeEnum.CODE}- disabled={disabled}- icon={Code2}- label="Code evaluator"- />- ) : null}- {!disabled || value === EvalTemplateTypeEnum.DECISION_MODEL ? (- <Tabs.Trigger- value={EvalTemplateTypeEnum.DECISION_MODEL}- disabled={disabled}- icon={Scale}- label="Decision model (experimental)"- />- ) : null}- </Tabs.List>- </Tabs>+ <>+ <div className="min-w-52 flex-1 md:hidden">+ <Select+ value={value}+ onValueChange={(mode) => onValueChange(mode as EvalTemplateType)}+ disabled={disabled}+ >+ <SelectTrigger aria-label="Evaluation type">+ <SelectValue>+ <span className="flex min-w-0 items-center gap-2">+ <SelectedIcon className="h-4 w-4 shrink-0" />+ <span className="truncate" title={selectedType.label}>+ {selectedType.label}+ </span>+ </span>+ </SelectValue>+ </SelectTrigger>+ <SelectContent>+ {visibleTypes.map(({ value: typeValue, label, icon: Icon }) => (+ <SelectItem key={typeValue} value={typeValue}>+ <span className="flex items-center gap-2">+ <Icon className="h-4 w-4 shrink-0" />+ {label}+ </span>+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ </div>+ <div className="hidden md:block">+ <Tabs+ value={value}+ onValueChange={(mode) => onValueChange(mode as EvalTemplateType)}+ >+ <Tabs.List variant="outline">+ {visibleTypes.map(({ value: typeValue, label, icon }) => (+ <Tabs.Trigger+ key={typeValue}+ value={typeValue}+ disabled={disabled}+ icon={icon}+ label={label}+ />+ ))}+ </Tabs.List>+ </Tabs>+ </div>+ </>);}diff --git a/web/src/features/evals/v2/components/Rules/RulesTable/RulesTable.tsx b/web/src/features/evals/v2/components/Rules/RulesTable/RulesTable.tsxindex fbdae67620..84bad3339a 100644--- a/web/src/features/evals/v2/components/Rules/RulesTable/RulesTable.tsx+++ b/web/src/features/evals/v2/components/Rules/RulesTable/RulesTable.tsx@@ -9,7 +9,7 @@ import {DataTableControls,DataTableControlsProvider,} from "@/src/components/table/data-table-controls";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { TablePeekViewEvaluatorConfigDetail } from "@/src/components/table/peek/peek-evaluator-config-detail";import { usePeekNavigation } from "@/src/components/table/peek/hooks/usePeekNavigation";import { useRowHeightLocalStorage } from "@/src/components/table/data-table-row-height-switch";@@ -566,43 +566,51 @@ export function RulesTable({tableName={evaluationRuleTableFilterConfig.tableName}><div className="flex h-full min-h-0 w-full min-w-0 flex-1 flex-col overflow-hidden">- <TableSearchBar- key={`${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}- projectId={projectId}- tableName={filterConfig.tableName}- registry={evaluationRulesListFieldRegistry(filterConfig)}- filterState={queryFilter.searchBarFilterState}- setFilterState={queryFilter.setFilterState}- observed={toObservedOptions(- filterOptions,- filterOptionsQuery.isPending,- )}- search={{ query: searchQuery ?? null, setQuery: handleSearchChange }}- isV4={false}- />- <RulesTableToolbar- columns={columns}- currentQuery={searchQuery ?? ""}- pageRowIds={rules.data?.rules.map(({ id }) => id) ?? []}- pageSize={pagination.limit}- pageIndex={pagination.page - 1}- totalCount={rules.data?.totalItems ?? null}- selectionStore={selectionStore}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- rowHeight={rowHeight}- setRowHeight={setRowHeight}- filterState={filterState}- orderByState={orderBy}- viewConfig={{- tableName: TableViewPresetTableName.EvaluationRules,- projectId,- controllers: viewControllers,- }}- />- <ResizableFilterLayout>+ <SearchableTableFilterLayout+ search={+ <TableSearchBar+ key={`${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}+ projectId={projectId}+ tableName={filterConfig.tableName}+ registry={evaluationRulesListFieldRegistry(filterConfig)}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={queryFilter.setFilterState}+ observed={toObservedOptions(+ filterOptions,+ filterOptionsQuery.isPending,+ )}+ search={{+ query: searchQuery ?? null,+ setQuery: handleSearchChange,+ }}+ isV4={false}+ />+ }+ toolbar={+ <RulesTableToolbar+ columns={columns}+ currentQuery={searchQuery ?? ""}+ pageRowIds={rules.data?.rules.map(({ id }) => id) ?? []}+ pageSize={pagination.limit}+ pageIndex={pagination.page - 1}+ totalCount={rules.data?.totalItems ?? null}+ selectionStore={selectionStore}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ rowHeight={rowHeight}+ setRowHeight={setRowHeight}+ filterState={filterState}+ orderByState={orderBy}+ viewConfig={{+ tableName: TableViewPresetTableName.EvaluationRules,+ projectId,+ controllers: viewControllers,+ }}+ />+ }+ ><DataTableControlskey={`${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}queryFilter={queryFilter}@@ -679,7 +687,7 @@ export function RulesTable({}}/></div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout><TablePeekViewEvaluatorConfigDetail{...legacyPeekConfig}projectId={projectId}diff --git a/web/src/features/evals/v2/pages/EvaluatorsPage.tsx b/web/src/features/evals/v2/pages/EvaluatorsPage.tsxindex ca86a3771f..a1581da11b 100644--- a/web/src/features/evals/v2/pages/EvaluatorsPage.tsx+++ b/web/src/features/evals/v2/pages/EvaluatorsPage.tsx@@ -19,7 +19,7 @@ import {DataTableControls,DataTableControlsProvider,} from "@/src/components/table/data-table-controls";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import type { LangfuseColumnDef } from "@/src/components/table/types";import { Badge } from "@/src/components/ui/badge";import { Button } from "@/src/components/ui/button";@@ -619,6 +619,12 @@ export default function EvaluatorsPage() {description:"Create reusable evaluator definitions and test them before activation.",},+ mobileActionButtons: showOnboarding ? (+ <Button size="sm" onClick={() => setGalleryOpen(true)}>+ <Plus className="mr-2 h-4 w-4" />+ New evaluator+ </Button>+ ) : undefined,actionButtonsRight: (<div className="flex gap-2">{showOnboarding ? null : (@@ -694,46 +700,51 @@ export default function EvaluatorsPage() {) : (<DataTableControlsProvider tableName={filterConfig.tableName}><div className="flex h-full min-h-0 w-full flex-1 flex-col overflow-hidden">- <TableSearchBar- key={`${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}- projectId={projectId}- tableName={filterConfig.tableName}- registry={EVALUATORS_LIST_FIELD_REGISTRY}- filterState={queryFilter.searchBarFilterState}- setFilterState={queryFilter.setFilterState}- observed={toObservedOptions(- filterOptions,- filterOptionsQuery.isPending,- )}- search={{- query: searchQuery ?? null,- setQuery: handleSearchChange,- }}- isV4={false}- />- <EvaluatorsTableToolbar- selectionStore={selectionStore}- pageRowIds={evaluatorIds}- pageSize={pagination.limit}- pageIndex={pagination.page - 1}- totalCount={evaluators.data?.totalItems ?? null}- columns={columns}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- rowHeight={rowHeight}- setRowHeight={setRowHeight}- filterState={filterState}- orderByState={orderBy}- currentSearchQuery={searchQuery ?? ""}- viewConfig={{- tableName: TableViewPresetTableName.Evaluators,- projectId,- controllers: viewControllers,- }}- />- <ResizableFilterLayout>+ <SearchableTableFilterLayout+ search={+ <TableSearchBar+ key={`${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}+ projectId={projectId}+ tableName={filterConfig.tableName}+ registry={EVALUATORS_LIST_FIELD_REGISTRY}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={queryFilter.setFilterState}+ observed={toObservedOptions(+ filterOptions,+ filterOptionsQuery.isPending,+ )}+ search={{+ query: searchQuery ?? null,+ setQuery: handleSearchChange,+ }}+ isV4={false}+ />+ }+ toolbar={+ <EvaluatorsTableToolbar+ selectionStore={selectionStore}+ pageRowIds={evaluatorIds}+ pageSize={pagination.limit}+ pageIndex={pagination.page - 1}+ totalCount={evaluators.data?.totalItems ?? null}+ columns={columns}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ rowHeight={rowHeight}+ setRowHeight={setRowHeight}+ filterState={filterState}+ orderByState={orderBy}+ currentSearchQuery={searchQuery ?? ""}+ viewConfig={{+ tableName: TableViewPresetTableName.Evaluators,+ projectId,+ controllers: viewControllers,+ }}+ />+ }+ ><DataTableControlskey={`${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}queryFilter={queryFilter}@@ -791,7 +802,7 @@ export default function EvaluatorsPage() {noResultsMessage="No evaluators found."/></div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout></div></DataTableControlsProvider>)}diff --git a/web/src/features/experiments/components/table/ExperimentItemsTable.tsx b/web/src/features/experiments/components/table/ExperimentItemsTable.tsxindex 414bd87495..2b33a12a4c 100644--- a/web/src/features/experiments/components/table/ExperimentItemsTable.tsx+++ b/web/src/features/experiments/components/table/ExperimentItemsTable.tsx@@ -6,7 +6,7 @@ import {DataTableControlsProvider,DataTableControls,} from "@/src/components/table/data-table-controls";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { useEffect, useMemo, useState, useRef, useCallback } from "react";import { RunEvaluationDialog } from "@/src/features/batch-actions";import { LightbulbIcon } from "lucide-react";@@ -1976,111 +1976,122 @@ export default function ExperimentItemsTable({tableName={experimentItemsFilterConfig.tableName}><div className="flex h-full w-full flex-col">- {!hideControls && (- <TableSearchBar- key={`${projectId}:${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}- projectId={projectId}- tableName="experiment-items"- registry={searchRegistry}- filterState={queryFilter.searchBarFilterState}- setFilterState={queryFilter.setFilterState}- observed={toObservedOptions(- scoreFilterOptions,- isFilterOptionsLoading,- )}- isV4={true}- />- )}- {/* Toolbar spanning full width */}- {!hideControls && (- <DataTableToolbar- columns={columns}- filterState={queryFilter.filterState}- viewConfig={{- tableName: TableViewPresetTableName.ExperimentItems,- projectId,- controllers: {- ...viewControllers,- applyViewState: (- ...args: Parameters<typeof viewControllers.applyViewState>- ) => {- setFilterTargetState({ filters: [], targets: {} });- viewControllers.applyViewState(...args);- },- },- }}- tableName={experimentItemsFilterConfig.tableName}- isV4={true}- onColumnGroupToggle={handleColumnGroupToggle}- columnsWithCustomSelect={["datasetItemId"]}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- orderByState={orderByState}- rowHeight={rowHeight}- setRowHeight={setRowHeight}- toolbarSettings={toolbarSettings}- multiSelect={{- selectAll,- setSelectAll,- selectedRowIds:- Object.keys(selectedRows).filter((itemId) =>- items.rows- ?.map((item: ExperimentItemsTableRow) => item.itemId)- .includes(itemId),- ) ?? [],- setRowSelection: setSelectedRows,- totalCount,- pageSize: paginationState.pageSize,- pageIndex: paginationState.pageIndex,- }}- actionButtons={- (selectAll || selectedItemCount > 0) && tableActions.length > 0- ? [- <TableActionMenu- key="experiment-items-multi-select-actions"- projectId={projectId}- actions={tableActions}- tableName={BatchExportTableName.Sessions}- selectedCount={selectAll ? totalCount : selectedItemCount}- onClearSelection={() => {- setSelectedRows({});- setSelectAll(false);- }}- onCustomAction={(actionId) => {- if (actionId === ActionId.ObservationBatchEvaluation) {- setShowRunEvaluationDialog(true);- }- }}- />,- ]- : undefined- }- />- )}-- {/* Score comparison filters — evaluated over the loaded page */}- {scoreComparisonPills.length > 0 && (- <ScoreComparisonFilterPills- pills={scoreComparisonPills}- onRemove={removeScoreComparisonFilter}- />- )}-- {/* Filter Pills with Experiment Targeting */}- {filtersByExperiment.length > 0 && (- <ExperimentFilterPills- selectedExperimentNames={selectedExperimentNames}- filtersByExperiment={filtersByExperiment}- onFilterTargetChange={handleFilterTargetChange}- onFilterRemove={handleFilterRemove}- className="border-b"- />- )}+ <SearchableTableFilterLayout+ search={+ hideControls ? null : (+ <TableSearchBar+ key={`${projectId}:${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}+ projectId={projectId}+ tableName="experiment-items"+ registry={searchRegistry}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={queryFilter.setFilterState}+ observed={toObservedOptions(+ scoreFilterOptions,+ isFilterOptionsLoading,+ )}+ isV4={true}+ />+ )+ }+ toolbar={+ <>+ {!hideControls && (+ <DataTableToolbar+ columns={columns}+ filterState={queryFilter.filterState}+ viewConfig={{+ tableName: TableViewPresetTableName.ExperimentItems,+ projectId,+ controllers: {+ ...viewControllers,+ applyViewState: (+ ...args: Parameters<+ typeof viewControllers.applyViewState+ >+ ) => {+ setFilterTargetState({ filters: [], targets: {} });+ viewControllers.applyViewState(...args);+ },+ },+ }}+ tableName={experimentItemsFilterConfig.tableName}+ isV4={true}+ onColumnGroupToggle={handleColumnGroupToggle}+ columnsWithCustomSelect={["datasetItemId"]}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ orderByState={orderByState}+ rowHeight={rowHeight}+ setRowHeight={setRowHeight}+ toolbarSettings={toolbarSettings}+ multiSelect={{+ selectAll,+ setSelectAll,+ selectedRowIds:+ Object.keys(selectedRows).filter((itemId) =>+ items.rows+ ?.map((item: ExperimentItemsTableRow) => item.itemId)+ .includes(itemId),+ ) ?? [],+ setRowSelection: setSelectedRows,+ totalCount,+ pageSize: paginationState.pageSize,+ pageIndex: paginationState.pageIndex,+ }}+ actionButtons={+ (selectAll || selectedItemCount > 0) &&+ tableActions.length > 0+ ? [+ <TableActionMenu+ key="experiment-items-multi-select-actions"+ projectId={projectId}+ actions={tableActions}+ tableName={BatchExportTableName.Sessions}+ selectedCount={+ selectAll ? totalCount : selectedItemCount+ }+ onClearSelection={() => {+ setSelectedRows({});+ setSelectAll(false);+ }}+ onCustomAction={(actionId) => {+ if (+ actionId === ActionId.ObservationBatchEvaluation+ ) {+ setShowRunEvaluationDialog(true);+ }+ }}+ />,+ ]+ : undefined+ }+ />+ )}- {/* Content area with sidebar and table */}- <ResizableFilterLayout>+ {/* Score comparison filters — evaluated over the loaded page */}+ {scoreComparisonPills.length > 0 && (+ <ScoreComparisonFilterPills+ pills={scoreComparisonPills}+ onRemove={removeScoreComparisonFilter}+ />+ )}++ {/* Filter Pills with Experiment Targeting */}+ {filtersByExperiment.length > 0 && (+ <ExperimentFilterPills+ selectedExperimentNames={selectedExperimentNames}+ filtersByExperiment={filtersByExperiment}+ onFilterTargetChange={handleFilterTargetChange}+ onFilterRemove={handleFilterRemove}+ className="border-b"+ />+ )}+ </>+ }+ >{!hideControls && (<DataTableControlskey={viewControllers.filterEditorResetKey}@@ -2182,7 +2193,7 @@ export default function ExperimentItemsTable({/>)}</div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout>{/* Peek view panel */}{peekConfig && (diff --git a/web/src/features/experiments/components/table/ExperimentsTable.tsx b/web/src/features/experiments/components/table/ExperimentsTable.tsxindex 149a6eaf23..68cefaaf5e 100644--- a/web/src/features/experiments/components/table/ExperimentsTable.tsx+++ b/web/src/features/experiments/components/table/ExperimentsTable.tsx@@ -2,12 +2,15 @@/* eslint-disable @repo/no-null-render */import { MAX_SELECTED_EXPERIMENTS } from "@/src/features/experiments/constants/comparison";import { DataTable } from "@/src/components/table/data-table";-import { DataTableToolbar } from "@/src/components/table/data-table-toolbar";+import {+ DataTableMobileFilterControls,+ DataTableToolbar,+} from "@/src/components/table/data-table-toolbar";import {DataTableControlsProvider,DataTableControls,} from "@/src/components/table/data-table-controls";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { StickySearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { useEffect, useMemo, useState, useRef, useCallback } from "react";import {useQueryFilterState,@@ -951,68 +954,85 @@ export default function ExperimentsTable({<TableHeaderControlstimeRange={timeRange}setTimeRange={setTimeRange}+ desktopOnly/>)}- {/* The composer and the toolbar stick together as one band so the- toolbar cannot scroll under the composer and render half-clipped;- pb-1.5 matches the other bar surfaces' spacing above the table. */}- <div className="bg-background sticky top-0 z-30 pb-1.5">- <TableSearchBar- key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}- isV4={true}- filterState={queryFilter.searchBarFilterState}- setFilterState={setFiltersWrapper}- projectId={projectId}- tableName={filterConfig.tableName}- observed={observedOptions}- registry={searchRegistry}- />- {/* Toolbar spanning full width */}- <DataTableToolbar- rowClassName="my-1"- columns={columns}- filterState={queryFilter.filterState}- viewConfig={{- tableName: TableViewPresetTableName.Experiments,- projectId,- controllers: viewControllers,- }}- tableName={filterConfig.tableName}- isV4={true}- onColumnGroupToggle={handleColumnGroupToggle}- columnsWithCustomSelect={["name", "datasetId"]}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- orderByState={orderByState}- rowHeight={rowHeight}- setRowHeight={setRowHeight}- timeRange={showControlsInPageHeader ? undefined : timeRange}- setTimeRange={showControlsInPageHeader ? undefined : setTimeRange}- actionButtons={[- <ExperimentsMultiSelectActionMenu- key="experiments-multi-select-actions"- projectId={projectId}- store={experimentsTableStore}- datasetIdByExperimentId={datasetIdByExperimentId}- />,- ]}- />- </div>-- {isShowingMostRecent && (- <div className="text-muted-foreground border-t px-3 py-1.5 text-xs">- No experiments started in the selected time range. Showing the{" "}- {mostRecentCount === 1- ? "most recent run"- : `${mostRecentCount} most recent runs`}{" "}- instead.- </div>- )}-- {/* Content area with sidebar and table */}- <ResizableFilterLayout>+ <StickySearchableTableFilterLayout+ search={+ <TableSearchBar+ key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}+ isV4={true}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={setFiltersWrapper}+ projectId={projectId}+ tableName={filterConfig.tableName}+ observed={observedOptions}+ registry={searchRegistry}+ />+ }+ toolbar={+ <DataTableToolbar+ rowClassName="my-1"+ columns={columns}+ filterState={queryFilter.filterState}+ viewConfig={{+ tableName: TableViewPresetTableName.Experiments,+ projectId,+ controllers: viewControllers,+ }}+ tableName={filterConfig.tableName}+ isV4={true}+ onColumnGroupToggle={handleColumnGroupToggle}+ columnsWithCustomSelect={["name", "datasetId"]}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ orderByState={orderByState}+ rowHeight={rowHeight}+ setRowHeight={setRowHeight}+ timeRange={showControlsInPageHeader ? undefined : timeRange}+ setTimeRange={+ showControlsInPageHeader ? undefined : setTimeRange+ }+ actionButtons={[+ <ExperimentsMultiSelectActionMenu+ key="experiments-multi-select-actions"+ projectId={projectId}+ store={experimentsTableStore}+ datasetIdByExperimentId={datasetIdByExperimentId}+ />,+ ]}+ hideMobileFilterControls+ />+ }+ mobileControls={+ <DataTableMobileFilterControls+ viewConfig={{+ tableName: TableViewPresetTableName.Experiments,+ projectId,+ controllers: viewControllers,+ }}+ orderByState={orderByState}+ filterState={queryFilter.filterState}+ columnOrder={columnOrder}+ columnVisibility={columnVisibility}+ timeRange={timeRange}+ setTimeRange={setTimeRange}+ />+ }+ nonStickyContent={+ isShowingMostRecent ? (+ <div className="text-muted-foreground border-t px-3 py-1.5 text-xs">+ No experiments started in the selected time range. Showing the{" "}+ {mostRecentCount === 1+ ? "most recent run"+ : `${mostRecentCount} most recent runs`}{" "}+ instead.+ </div>+ ) : null+ }+ ><DataTableControls// Remount the sidebar when the saved view changes so the new view's filters replace any stale draft UI state.key={viewControllers.filterEditorResetKey}@@ -1098,7 +1118,7 @@ export default function ExperimentsTable({}}/></div>- </ResizableFilterLayout>+ </StickySearchableTableFilterLayout></div></DataTableControlsProvider></>diff --git a/web/src/features/monitors/components/MonitorsTable.tsx b/web/src/features/monitors/components/MonitorsTable.tsxindex 167c51fc54..4d77ebc7f1 100644--- a/web/src/features/monitors/components/MonitorsTable.tsx+++ b/web/src/features/monitors/components/MonitorsTable.tsx@@ -9,7 +9,7 @@ import { useMediaQuery } from "react-responsive";import { DeleteMonitorButton } from "@/src/components/deleteButton";import { DataTable } from "@/src/components/table/data-table";import { DataTableControls } from "@/src/components/table/data-table-controls";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { type LangfuseColumnDef } from "@/src/components/table/types";import { Button } from "@/src/components/ui/button";import { Skeleton } from "@/src/components/ui/skeleton";@@ -305,33 +305,41 @@ export function MonitorsTable() {return (<div className="flex h-full w-full flex-col">- <TableSearchBar- key={`${projectId}:${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}- projectId={projectId}- tableName="monitors"- registry={monitorsFieldRegistry(monitorFilterConfig)}- filterState={queryFilter.searchBarFilterState}- setFilterState={queryFilter.setFilterState}- observed={toObservedOptions(newFilterOptions, filterOptions.isPending)}- isV4={false}- />- <DataTableToolbar- tableName="monitors"- columns={columns}- filterState={queryFilter.explicitFilterState}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- orderByState={orderByState}- isV4={false}- viewConfig={{- tableName: TableViewPresetTableName.Monitors,- projectId,- controllers: viewControllers,- }}- />- <ResizableFilterLayout>+ <SearchableTableFilterLayout+ search={+ <TableSearchBar+ key={`${projectId}:${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}+ projectId={projectId}+ tableName="monitors"+ registry={monitorsFieldRegistry(monitorFilterConfig)}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={queryFilter.setFilterState}+ observed={toObservedOptions(+ newFilterOptions,+ filterOptions.isPending,+ )}+ isV4={false}+ />+ }+ toolbar={+ <DataTableToolbar+ tableName="monitors"+ columns={columns}+ filterState={queryFilter.explicitFilterState}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ orderByState={orderByState}+ isV4={false}+ viewConfig={{+ tableName: TableViewPresetTableName.Monitors,+ projectId,+ controllers: viewControllers,+ }}+ />+ }+ ><DataTableControlskey={viewControllers.filterEditorResetKey}queryFilter={queryFilter}@@ -376,7 +384,7 @@ export function MonitorsTable() {cellPadding="comfortable"/></div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout></div>);}diff --git a/web/src/features/prompts/components/prompt-detail.tsx b/web/src/features/prompts/components/prompt-detail.tsxindex 0ea6c1833a..b1807be233 100644--- a/web/src/features/prompts/components/prompt-detail.tsx+++ b/web/src/features/prompts/components/prompt-detail.tsx@@ -38,6 +38,7 @@ import { useReadPath } from "@/src/features/events";import {ChevronDown,FlaskConical,+ History,MessageSquare,MessageSquareOff,MoreVertical,@@ -78,6 +79,15 @@ import {} from "@/src/components/ui/PromptReferences";import { PromptVariableListPreview } from "@/src/features/prompts/components/PromptVariableListPreview";import { createBreadcrumbItems } from "@/src/features/folders";+import { useIsMobile } from "@/src/hooks/use-mobile";+import {+ Drawer,+ DrawerContent,+ DrawerDescription,+ DrawerHeader,+ DrawerTitle,+ DrawerTrigger,+} from "@/src/components/ui/drawer";const getPythonCode = (name: string,@@ -126,6 +136,7 @@ export const PromptDetail = ({const capture = usePostHogClientCapture();const router = useRouter();const { isV4 } = useReadPath();+ const isMobile = useIsMobile();const promptName =promptNameProp ||@@ -147,6 +158,7 @@ export const PromptDetail = ({const [isLabelPopoverOpen, setIsLabelPopoverOpen] = useState(false);const [isCreateExperimentDialogOpen, setIsCreateExperimentDialogOpen] =useState(false);+ const [isVersionHistoryOpen, setIsVersionHistoryOpen] = useState(false);const [resolutionMode, setResolutionMode] = useState<"tagged" | "resolved">("tagged",);@@ -286,6 +298,105 @@ export const PromptDetail = ({const folderPath = segments.length > 1 ? segments.slice(0, -1).join("/") : "";const breadcrumbItems = folderPath ? createBreadcrumbItems(folderPath) : [];+ const renderVersionHistory = ({+ mobile = false,+ onVersionSelect,+ }: {+ mobile?: boolean;+ onVersionSelect?: () => void;+ } = {}) => (+ <Command+ className={cn(+ "flex min-h-0 flex-col gap-2 overflow-hidden font-bold focus:ring-0 focus:outline-hidden focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-hidden data-focus:ring-0",+ mobile ? "rounded-none" : "rounded-none border-r pr-3",+ )}+ >+ <div+ className={cn(+ "flex shrink-0 items-center justify-between",+ mobile ? "mb-1" : "mt-3",+ )}+ >+ <CommandInput+ showBorder={false}+ placeholder="Search..."+ className="text-muted-foreground h-fit border-none py-0 text-sm focus:ring-0"+ />++ <Button+ onClick={() => {+ capture("prompts:update_form_open");+ }}+ className={cn(+ "shrink-0",+ mobile ? "h-8 w-fit px-3" : "h-6 w-6 px-1 lg:h-8 lg:w-fit lg:px-3",+ )}+ >+ <Link+ className="grid w-full grid-flow-col place-items-center"+ href={`/project/${projectId}/prompts/new?promptId=${encodeURIComponent(prompt.id)}`}+ >+ <Plus className={cn("h-4 w-4", mobile ? "mr-2" : "lg:mr-2")} />+ <span className={cn(mobile ? "inline" : "hidden lg:inline")}>+ New version+ </span>+ </Link>+ </Button>+ </div>+ <CommentDrawerController+ projectId={projectId as string}+ mode="read-only"+ onCommentChange={() =>+ utils.prompts.allVersions.invalidate(promptHistoryInput)+ }+ >+ {({ openDrawer }) => {+ const openPromptComments = (+ promptId: string,+ promptVersion: number,+ ) => {+ const { label, ...query } = router.query;+ router.push(+ {+ pathname: router.pathname,+ query: {+ ...query,+ version: promptVersion,+ comments: "open",+ commentObjectType: "PROMPT",+ commentObjectId: promptId,+ },+ },+ undefined,+ { shallow: true },+ );+ openDrawer({+ type: "comments",+ objectId: promptId,+ objectType: "PROMPT",+ });+ };++ return (+ <div className="flex min-h-0 flex-1 flex-col overflow-y-auto">+ <PromptHistoryNode+ prompts={promptHistory.data.promptVersions}+ currentPromptVersion={prompt.version}+ setCurrentPromptVersion={(version) => {+ setCurrentPromptVersion(version);+ setCurrentPromptLabel(null);+ onVersionSelect?.();+ }}+ openCommentDrawer={openPromptComments}+ commentCounts={commentCounts}+ />+ </div>+ );+ }}+ </CommentDrawerController>+ </Command>+ );+return (<PageheaderProps={{@@ -343,84 +454,48 @@ export const PromptDetail = ({),}}>- <div className="grid flex-1 grid-cols-3 gap-4 overflow-hidden px-3 md:grid-cols-4">- <Command className="flex flex-col gap-2 overflow-y-auto rounded-none border-r pr-3 font-bold focus:ring-0 focus:outline-hidden focus-visible:ring-0 focus-visible:ring-offset-0 focus-visible:outline-hidden data-focus:ring-0">- <div className="mt-3 flex items-center justify-between">- <CommandInput- showBorder={false}- placeholder="Search..."- className="text-muted-foreground h-fit border-none py-0 text-sm focus:ring-0"- />-- <Button- onClick={() => {- capture("prompts:update_form_open");- }}- className="h-6 w-6 shrink-0 px-1 lg:h-8 lg:w-fit lg:px-3"+ <div className="grid flex-1 grid-cols-1 gap-4 overflow-hidden px-3 md:grid-cols-4">+ {isMobile ? null : renderVersionHistory()}+ <div className="col-span-1 mt-3 flex max-h-full min-h-0 min-w-0 flex-col md:col-span-3">+ {isMobile ? (+ <Drawer+ open={isVersionHistoryOpen}+ onOpenChange={setIsVersionHistoryOpen}>- <Link- className="grid w-full place-items-center md:grid-flow-col"- href={`/project/${projectId}/prompts/new?promptId=${encodeURIComponent(prompt.id)}`}- >- <Plus className="h-4 w-4 md:mr-2" />- <span className="hidden lg:inline">New version</span>- </Link>- </Button>- </div>- <CommentDrawerController- projectId={projectId as string}- mode="read-only"- onCommentChange={() =>- utils.prompts.allVersions.invalidate(promptHistoryInput)- }- >- {({ openDrawer }) => {- const openPromptComments = (- promptId: string,- promptVersion: number,- ) => {- const { label, ...query } = router.query;- router.push(- {- pathname: router.pathname,- query: {- ...query,- version: promptVersion,- comments: "open",- commentObjectType: "PROMPT",- commentObjectId: promptId,- },- },- undefined,- { shallow: true },- );- openDrawer({- type: "comments",- objectId: promptId,- objectType: "PROMPT",- });- };-- return (- <div className="flex flex-col overflow-y-auto">- <PromptHistoryNode- prompts={promptHistory.data.promptVersions}- currentPromptVersion={prompt.version}- setCurrentPromptVersion={(version) => {- setCurrentPromptVersion(version);- setCurrentPromptLabel(null);- }}- openCommentDrawer={openPromptComments}- commentCounts={commentCounts}- />+ <DrawerTrigger asChild>+ <Button+ variant="outline"+ className="mb-3 w-full min-w-0 justify-start gap-2 px-3"+ >+ <History className="h-4 w-4 shrink-0" />+ <span className="shrink-0">Version #{prompt.version}</span>+ <span+ className="text-muted-foreground min-w-0 flex-1 truncate text-left font-normal"+ title={prompt.commitMessage ?? prompt.name}+ >+ {prompt.commitMessage ?? prompt.name}+ </span>+ <ChevronDown className="h-4 w-4 shrink-0" />+ </Button>+ </DrawerTrigger>+ <DrawerContent className="max-h-[85dvh]">+ <DrawerHeader className="shrink-0 border-b text-left">+ <DrawerTitle>Prompt versions</DrawerTitle>+ <DrawerDescription>+ Select a version of {prompt.name}.+ </DrawerDescription>+ </DrawerHeader>+ <div className="min-h-0 flex-1 overflow-hidden p-4 pt-2">+ {renderVersionHistory({+ mobile: true,+ onVersionSelect: () => setIsVersionHistoryOpen(false),+ })}</div>- );- }}- </CommentDrawerController>- </Command>- <div className="col-span-2 mt-3 flex max-h-full min-h-0 flex-col md:col-span-3">+ </DrawerContent>+ </Drawer>+ ) : null}<div className="flex flex-col items-start gap-2">- <div className="grid w-full min-w-0 grid-cols-[auto_auto] items-center justify-between">+ <div className="flex w-full min-w-0 flex-col gap-2 md:grid md:grid-cols-[minmax(0,1fr)_auto] md:items-start md:justify-between"><div className="flex max-w-full min-w-0 shrink flex-col"><div className="flex max-w-full min-w-0 flex-wrap items-start gap-1"><SetPromptVersionLabels@@ -449,7 +524,7 @@ export const PromptDetail = ({<div className="min-h-1 flex-1" /></div>- <div className="flex h-full flex-wrap content-start items-start justify-end gap-1 lg:flex-nowrap">+ <div className="flex h-full w-full flex-wrap content-start items-start justify-end gap-1 md:w-auto lg:flex-nowrap"><JumpToPlaygroundDropdownMenuControllersource="prompt"prompt={{diff --git a/web/src/features/prompts/components/prompts-table.tsx b/web/src/features/prompts/components/prompts-table.tsxindex 79ea9166d3..2e5cd27aed 100644--- a/web/src/features/prompts/components/prompts-table.tsx+++ b/web/src/features/prompts/components/prompts-table.tsx@@ -9,7 +9,7 @@ import {DataTableControlsProvider,DataTableControls,} from "@/src/components/table/data-table-controls";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { TextLink } from "@/src/components/design-system/TextLink/TextLink";import { createFolderKeyTableColumn } from "@/src/components/design-system/table/columns/createFolderKeyTableColumn";import { type LangfuseColumnDef } from "@/src/components/table/types";@@ -344,12 +344,14 @@ export function PromptTable() {header: "Type",enableSorting: true,size: 60,+ hideBelowMd: true,}),createDateTableColumn({accessorKey: "createdAt",header: "Latest Version Created At",enableSorting: true,size: 200,+ hideBelowMd: true,getValue: (value, context) => {if (context.row.original.type === "folder") {return undefined;@@ -363,6 +365,7 @@ export function PromptTable() {header: "Number of Observations (7d)",id: "numberOfObservations",size: 170,+ hideBelowMd: true,cell: ({ getValue, row }) => {if (row.original.type === "folder") return null;@@ -390,6 +393,7 @@ export function PromptTable() {id: "tags",enableSorting: true,size: 120,+ hideBelowMd: true,cell: ({ getValue, row }) => {// height h-6 to ensure consistent row height for normal & folder rowsif (row.original.type === "folder") return <div className="h-6" />;@@ -501,46 +505,49 @@ export function PromptTable() {navigateToFolder={navigateToFolder}/>)}- <TableSearchBar- key={`${projectId}:${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}- projectId={projectId}- tableName="prompts"- registry={PROMPTS_FIELD_REGISTRY}- filterState={queryFilter.searchBarFilterState}- setFilterState={queryFilter.setFilterState}- observed={toObservedOptions(- newFilterOptions,- promptFilterOptions.isPending,- )}- isV4={false}- search={{- query: searchQuery,- type: searchType,- setQuery: handleSearchQueryChange,- setType: handleSearchTypeChange,- }}- />- <DataTableToolbar- tableName="prompts"- columns={promptColumns}- filterState={queryFilter.filterState}- columnsWithCustomSelect={["labels", "tags"]}- isV4={false}- currentSearchQuery={searchQuery ?? ""}- orderByState={orderBy}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- viewConfig={{- tableName: TableViewPresetTableName.Prompts,- projectId,- controllers: viewControllers,- }}- />-- {/* Content area with sidebar and table */}- <ResizableFilterLayout>+ <SearchableTableFilterLayout+ search={+ <TableSearchBar+ key={`${projectId}:${viewControllers.filterEditorResetKey}:${queryFilter.draftResetKey}`}+ projectId={projectId}+ tableName="prompts"+ registry={PROMPTS_FIELD_REGISTRY}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={queryFilter.setFilterState}+ observed={toObservedOptions(+ newFilterOptions,+ promptFilterOptions.isPending,+ )}+ isV4={false}+ search={{+ query: searchQuery,+ type: searchType,+ setQuery: handleSearchQueryChange,+ setType: handleSearchTypeChange,+ }}+ />+ }+ toolbar={+ <DataTableToolbar+ tableName="prompts"+ columns={promptColumns}+ filterState={queryFilter.filterState}+ columnsWithCustomSelect={["labels", "tags"]}+ isV4={false}+ currentSearchQuery={searchQuery ?? ""}+ orderByState={orderBy}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ viewConfig={{+ tableName: TableViewPresetTableName.Prompts,+ projectId,+ controllers: viewControllers,+ }}+ />+ }+ ><DataTableControlskey={viewControllers.filterEditorResetKey}queryFilter={queryFilter}@@ -592,7 +599,7 @@ export function PromptTable() {cellPadding="comfortable"/></div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout></div></DataTableControlsProvider>);diff --git a/web/src/features/scores/ScoresTable.tsx b/web/src/features/scores/ScoresTable.tsxindex d562d1fd41..edfb2d8c81 100644--- a/web/src/features/scores/ScoresTable.tsx+++ b/web/src/features/scores/ScoresTable.tsx@@ -2,7 +2,10 @@import { type ViewVersion } from "@langfuse/shared/query";import { DataTable } from "@/src/components/table/data-table";import { useRowHeightLocalStorage } from "@/src/components/table/data-table-row-height-switch";-import { DataTableToolbar } from "@/src/components/table/data-table-toolbar";+import {+ DataTableMobileFilterControls,+ DataTableToolbar,+} from "@/src/components/table/data-table-toolbar";import {DataTableControlsProvider,DataTableControls,@@ -14,7 +17,7 @@ import { createLinkTableColumn } from "@/src/components/design-system/table/coluimport { createUserTableColumn } from "@/src/components/design-system/table/columns/createUserTableColumn";import { createIOTableColumn } from "@/src/components/design-system/table/columns/createIOTableColumn";import { createTextTableColumn } from "@/src/components/design-system/table/columns/createTextTableColumn";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { type LangfuseColumnDef } from "@/src/components/table/types";import { ConnectedIOTableCell } from "@/src/components/table/ConnectedIOTableCell";import {@@ -1138,85 +1141,108 @@ export default function ScoresTable({<TableHeaderControlstimeRange={timeRange}setTimeRange={setTimeRange}+ desktopOnly/>)}- <ScoresSearchBar- key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}- isV4={isV4}- projectId={projectId}- filterConfig={scoresFilterConfig}- filterState={queryFilter.searchBarFilterState}- setFilterState={setFiltersWrapper}- filterOptions={newFilterOptions}- isLoading={isSidebarFilterLoading}- />- {/* Toolbar spanning full width */}- <DataTableToolbar- columns={columns}- filterState={queryFilter.explicitFilterState}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- viewConfig={{- tableName: TableViewPresetTableName.Scores,- projectId,- controllers: viewControllers,- }}- actionButtons={[- visibleSelectedScoreIds.length > 0 || selectAll ? (- <TableActionMenu- key="scores-multi-select-actions"- projectId={projectId}- actions={tableActions}- tableName={BatchExportTableName.Scores}- selectedCount={selectedScoreCount}- onClearSelection={() => {- setSelectedRows({});- setSelectAll(false);- }}- />- ) : null,- hasBatchExportAccess ? (- <BatchExportTableButton- {...{- projectId,- filterState: backendFilterState,- orderByState,- }}- tableName={BatchExportTableName.Scores}- key="batchExport"- />- ) : null,- ]}- rowHeight={rowHeight}- setRowHeight={setRowHeight}- timeRange={- showControlsInPageHeader || isTraceScoped ? undefined : timeRange+ <SearchableTableFilterLayout+ search={+ <ScoresSearchBar+ key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}+ isV4={isV4}+ projectId={projectId}+ filterConfig={scoresFilterConfig}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={setFiltersWrapper}+ filterOptions={newFilterOptions}+ isLoading={isSidebarFilterLoading}+ />}- setTimeRange={- showControlsInPageHeader || isTraceScoped ? undefined : setTimeRange+ toolbar={+ <DataTableToolbar+ columns={columns}+ filterState={queryFilter.explicitFilterState}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ viewConfig={{+ tableName: TableViewPresetTableName.Scores,+ projectId,+ controllers: viewControllers,+ }}+ actionButtons={[+ visibleSelectedScoreIds.length > 0 || selectAll ? (+ <TableActionMenu+ key="scores-multi-select-actions"+ projectId={projectId}+ actions={tableActions}+ tableName={BatchExportTableName.Scores}+ selectedCount={selectedScoreCount}+ onClearSelection={() => {+ setSelectedRows({});+ setSelectAll(false);+ }}+ />+ ) : null,+ hasBatchExportAccess ? (+ <BatchExportTableButton+ {...{+ projectId,+ filterState: backendFilterState,+ orderByState,+ }}+ tableName={BatchExportTableName.Scores}+ key="batchExport"+ />+ ) : null,+ ]}+ rowHeight={rowHeight}+ setRowHeight={setRowHeight}+ timeRange={+ showControlsInPageHeader || isTraceScoped+ ? undefined+ : timeRange+ }+ setTimeRange={+ showControlsInPageHeader || isTraceScoped+ ? undefined+ : setTimeRange+ }+ viewModeToggle={+ chartEnabled && chartTimeRange ? (+ <ViewModeToggle+ mode={chartViewMode}+ onModeChange={setChartViewMode}+ />+ ) : undefined+ }+ multiSelect={{+ selectAll,+ setSelectAll,+ selectedRowIds: visibleSelectedScoreIds,+ setRowSelection: setSelectedRows,+ totalCount,+ ...paginationState,+ }}+ hideMobileFilterControls+ />}- viewModeToggle={- chartEnabled && chartTimeRange ? (- <ViewModeToggle- mode={chartViewMode}- onModeChange={setChartViewMode}- />- ) : undefined+ mobileControls={+ <DataTableMobileFilterControls+ viewConfig={{+ tableName: TableViewPresetTableName.Scores,+ projectId,+ controllers: viewControllers,+ }}+ orderByState={orderByState}+ filterState={queryFilter.explicitFilterState}+ columnOrder={columnOrder}+ columnVisibility={columnVisibility}+ timeRange={isTraceScoped ? undefined : timeRange}+ setTimeRange={isTraceScoped ? undefined : setTimeRange}+ />}- multiSelect={{- selectAll,- setSelectAll,- selectedRowIds: visibleSelectedScoreIds,- setRowSelection: setSelectedRows,- totalCount,- ...paginationState,- }}- />-- {/* Content area with sidebar and table */}- <ResizableFilterLayout>+ ><DataTableControls// Remount the sidebar when the saved view changes so the new view's filters replace any stale draft UI state.key={viewControllers.filterEditorResetKey}@@ -1300,7 +1326,7 @@ export default function ScoresTable({/>)}</div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout>{peekEnabled &&renderTracePeek?.({closePeek: closeScorePeek,diff --git a/web/src/features/search-bar/hooks/useEventsSearchBar.ts b/web/src/features/search-bar/hooks/useEventsSearchBar.tsindex d0755c52f7..d459d939f9 100644--- a/web/src/features/search-bar/hooks/useEventsSearchBar.ts+++ b/web/src/features/search-bar/hooks/useEventsSearchBar.ts@@ -11,7 +11,16 @@// The draft sync never writes back to applied state. A commit acknowledgment// keeps separately updated host lanes from projecting a half-applied query.-import { useCallback, useEffect, useMemo, useRef, useState } from "react";+import {+ createContext,+ type Key,+ useCallback,+ useContext,+ useEffect,+ useMemo,+ useRef,+ useState,+} from "react";import isEqual from "lodash/isEqual";import type { FilterState, TracingSearchType } from "@langfuse/shared";@@ -62,6 +71,31 @@ type PendingCommit = {text: string;};+type SearchBarDraftCacheSnapshot = {+ committedText: string;+ draft: string;+};++type SearchBarDraftCache = {+ current: SearchBarDraftCacheSnapshot | null;+ searchIdentity: Key | null;+};++export const SearchBarDraftCacheContext =+ createContext<SearchBarDraftCache | null>(null);++/**+ * Keeps an unsubmitted draft alive while a responsive sheet unmounts its+ * search input. A new React key represents a new search scope (for example a+ * different table view), so it intentionally starts with an empty cache.+ */+export function useSearchBarDraftCache(searchIdentity: Key | null) {+ return useMemo<SearchBarDraftCache>(+ () => ({ current: null, searchIdentity }),+ [searchIdentity],+ );+}+function sameAppliedState(a: AppliedSearchState, b: AppliedSearchState) {return (isEqual(a.filters, b.filters) &&@@ -147,6 +181,7 @@ export function useEventsSearchBar({}) => void;} {const capture = usePostHogClientCapture();+ const draftCache = useContext(SearchBarDraftCacheContext);// Latest observed options, read inside commit and by the store's draft// validation so both route `scores.<name>` by the same observed score type.@@ -213,8 +248,26 @@ export function useEventsSearchBar({// commit's own echo settles immediately without clobbering the caret.useEffect(() => {if (!enabled) return;+ const cachedDraft = draftCache?.current;store.getState().actions.resetTo(committedText);- }, [enabled, committedText, store]);+ // Only restore a draft that belongs to the same applied search state.+ // External query/filter changes must continue to reset the input.+ if (cachedDraft?.committedText === committedText) {+ store.getState().actions.setDraft(cachedDraft.draft);+ }+ }, [draftCache, enabled, committedText, store]);++ useEffect(() => {+ if (!enabled || !draftCache) return;+ const persistDraft = () => {+ draftCache.current = {+ committedText,+ draft: store.getState().draft,+ };+ };+ persistDraft();+ return store.subscribe(persistDraft);+ }, [committedText, draftCache, enabled, store]);// Re-validate when observed options or the registry load: a draft typed// before score types or dynamic allowed values were known has stalediff --git a/web/src/features/sessions/SessionsTable.tsx b/web/src/features/sessions/SessionsTable.tsxindex f64a62ba5e..488fa02858 100644--- a/web/src/features/sessions/SessionsTable.tsx+++ b/web/src/features/sessions/SessionsTable.tsx@@ -13,7 +13,7 @@ import { createLinkTableColumn } from "@/src/components/design-system/table/coluimport { createLinkListTableColumn } from "@/src/components/design-system/table/columns/createLinkListTableColumn";import { createNumberTableColumn } from "@/src/components/design-system/table/columns/createNumberTableColumn";import { createTokenUsageTableColumn } from "@/src/components/design-system/table/columns/createTokenUsageTableColumn";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { StickySearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { type LangfuseColumnDef } from "@/src/components/table/types";import {useColumnVisibility,@@ -818,79 +818,75 @@ export default function SessionsTable({setTimeRange={setTimeRange}/>)}- {/* In bar mode the composer and the toolbar stick together as one band- (matching EventsTable) so the toolbar cannot scroll under the- composer and render half-clipped; pb-1.5 gives the band the same- breathing room above the table that the events tables have. */}- <div className="bg-background sticky top-0 z-30 pb-1.5">- <TableSearchBar- key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}- isV4={isV4}- filterState={queryFilter.searchBarFilterState}- setFilterState={setFiltersWrapper}- projectId={projectId}- tableName={sessionsFilterConfig.tableName}- observed={observedOptions}- registry={searchRegistry}- />- {/* Toolbar spanning full width */}- <DataTableToolbar- rowClassName="my-1"- filterState={queryFilter.explicitFilterState}- actionButtons={[- selectedSessionIds.length > 0 || selectAll ? (- <TableActionMenu- key="sessions-multi-select-actions"- projectId={projectId}- actions={tableActions}- tableName={BatchExportTableName.Sessions}- selectedCount={selectedSessionCount}- onClearSelection={() => {- setSelectedRows({});- setSelectAll(false);- }}- />- ) : null,- hasBatchExportAccess ? (- <BatchExportTableButton- {...{- projectId,- filterState: backendFilterState,- orderByState,- }}- tableName={BatchExportTableName.Sessions}- key="batchExport"- />- ) : null,- ]}- columns={columns}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- viewConfig={{- tableName: TableViewPresetTableName.Sessions,- projectId,- controllers: viewControllers,- }}- timeRange={showControlsInPageHeader ? undefined : timeRange}- setTimeRange={showControlsInPageHeader ? undefined : setTimeRange}- columnsWithCustomSelect={["userIds"]}- rowHeight={rowHeight}- setRowHeight={setRowHeight}- multiSelect={{- selectAll,- setSelectAll,- selectedRowIds: selectedSessionIds,- setRowSelection: setSelectedRows,- totalCount,- ...paginationState,- }}- />- </div>-- {/* Content area with sidebar and table */}- <ResizableFilterLayout>+ <StickySearchableTableFilterLayout+ search={+ <TableSearchBar+ key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}+ isV4={isV4}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={setFiltersWrapper}+ projectId={projectId}+ tableName={sessionsFilterConfig.tableName}+ observed={observedOptions}+ registry={searchRegistry}+ />+ }+ toolbar={+ <DataTableToolbar+ rowClassName="my-1"+ filterState={queryFilter.explicitFilterState}+ actionButtons={[+ selectedSessionIds.length > 0 || selectAll ? (+ <TableActionMenu+ key="sessions-multi-select-actions"+ projectId={projectId}+ actions={tableActions}+ tableName={BatchExportTableName.Sessions}+ selectedCount={selectedSessionCount}+ onClearSelection={() => {+ setSelectedRows({});+ setSelectAll(false);+ }}+ />+ ) : null,+ hasBatchExportAccess ? (+ <BatchExportTableButton+ {...{+ projectId,+ filterState: backendFilterState,+ orderByState,+ }}+ tableName={BatchExportTableName.Sessions}+ key="batchExport"+ />+ ) : null,+ ]}+ columns={columns}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ viewConfig={{+ tableName: TableViewPresetTableName.Sessions,+ projectId,+ controllers: viewControllers,+ }}+ timeRange={showControlsInPageHeader ? undefined : timeRange}+ setTimeRange={showControlsInPageHeader ? undefined : setTimeRange}+ columnsWithCustomSelect={["userIds"]}+ rowHeight={rowHeight}+ setRowHeight={setRowHeight}+ multiSelect={{+ selectAll,+ setSelectAll,+ selectedRowIds: selectedSessionIds,+ setRowSelection: setSelectedRows,+ totalCount,+ ...paginationState,+ }}+ />+ }+ ><DataTableControls// Remount the sidebar when the saved view changes so the new view's filters replace any stale draft UI state.key={viewControllers.filterEditorResetKey}@@ -958,7 +954,7 @@ export default function SessionsTable({rowHeight={rowHeight}/></div>- </ResizableFilterLayout>+ </StickySearchableTableFilterLayout></div></DataTableControlsProvider>);diff --git a/web/src/features/traces/TracesTable.tsx b/web/src/features/traces/TracesTable.tsxindex e0152d22f6..cbe96eed0c 100644--- a/web/src/features/traces/TracesTable.tsx+++ b/web/src/features/traces/TracesTable.tsx@@ -16,7 +16,7 @@ import { createStatusTableColumn } from "@/src/components/design-system/table/coimport { createTagsTableColumn } from "@/src/components/design-system/table/columns/createTagsTableColumn";import { createTextTableColumn } from "@/src/components/design-system/table/columns/createTextTableColumn";import { createTokenUsageTableColumn } from "@/src/components/design-system/table/columns/createTokenUsageTableColumn";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { type LangfuseColumnDef } from "@/src/components/table/types";import {useColumnVisibility,@@ -1436,112 +1436,119 @@ function TracesTableInternal({refresh={refreshConfig}/>)}- {/* Toolbar spanning full width */}- {!hideControls && (- <div className="shrink-0 pb-1.5">- <TableSearchBar- key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}- projectId={projectId}- tableName={tracesFilterConfig.tableName}- registry={searchRegistry}- filterState={queryFilter.searchBarFilterState}- setFilterState={queryFilter.setFilterState}- observed={observedOptions}- isV4={false}- search={{- query: searchQuery,- type: searchType,- setQuery: handleSearchQueryChange,- setType: handleSearchTypeChange,- }}- />- <DataTableToolbar- rowClassName="my-1"- columns={columns}- filterWithAI- filterState={queryFilter.explicitFilterState}- tableName={tracesFilterConfig.tableName}- isV4={false}- viewConfig={{- tableName: TableViewPresetTableName.Traces,- projectId,- controllers: viewControllers,- }}- currentSearchQuery={searchQuery ?? ""}- columnsWithCustomSelect={["traceName", "traceTags"]}- actionButtons={[- selectedTraceIds.length > 0 || selectAll ? (- <AddTracesToAnnotationQueueDialogController- key="traces-multi-select-actions"- projectId={projectId}- onSuccess={() => {- setSelectedRows({});- setSelectAll(false);- }}- description={`Add ${displayCount} selected traces to an annotation queue.`}- onAddToQueue={handleAddToAnnotationQueue}- >- {({ openDialog }) => (- <TableActionMenu+ <SearchableTableFilterLayout+ search={+ hideControls ? null : (+ <TableSearchBar+ key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}+ projectId={projectId}+ tableName={tracesFilterConfig.tableName}+ registry={searchRegistry}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={queryFilter.setFilterState}+ observed={observedOptions}+ isV4={false}+ search={{+ query: searchQuery,+ type: searchType,+ setQuery: handleSearchQueryChange,+ setType: handleSearchTypeChange,+ }}+ />+ )+ }+ toolbar={+ hideControls ? null : (+ <div className="shrink-0 pb-1.5">+ <DataTableToolbar+ rowClassName="my-1"+ columns={columns}+ filterWithAI+ filterState={queryFilter.explicitFilterState}+ tableName={tracesFilterConfig.tableName}+ isV4={false}+ viewConfig={{+ tableName: TableViewPresetTableName.Traces,+ projectId,+ controllers: viewControllers,+ }}+ currentSearchQuery={searchQuery ?? ""}+ columnsWithCustomSelect={["traceName", "traceTags"]}+ actionButtons={[+ selectedTraceIds.length > 0 || selectAll ? (+ <AddTracesToAnnotationQueueDialogController+ key="traces-multi-select-actions"projectId={projectId}- actions={tableActions}- tableName={BatchExportTableName.Traces}- selectedCount={selectedTraceCount}- onClearSelection={() => {+ onSuccess={() => {setSelectedRows({});setSelectAll(false);}}- onCustomAction={(actionType) => {- if (- actionType === ActionId.TraceAddToAnnotationQueue- ) {- openDialog();- }+ description={`Add ${displayCount} selected traces to an annotation queue.`}+ onAddToQueue={handleAddToAnnotationQueue}+ >+ {({ openDialog }) => (+ <TableActionMenu+ projectId={projectId}+ actions={tableActions}+ tableName={BatchExportTableName.Traces}+ selectedCount={selectedTraceCount}+ onClearSelection={() => {+ setSelectedRows({});+ setSelectAll(false);+ }}+ onCustomAction={(actionType) => {+ if (+ actionType ===+ ActionId.TraceAddToAnnotationQueue+ ) {+ openDialog();+ }+ }}+ />+ )}+ </AddTracesToAnnotationQueueDialogController>+ ) : null,+ hasBatchExportAccess ? (+ <BatchExportTableButton+ {...{+ projectId,+ filterState,+ orderByState,+ searchQuery,+ searchType,}}+ tableName={BatchExportTableName.Traces}+ key="batchExport"/>- )}- </AddTracesToAnnotationQueueDialogController>- ) : null,- hasBatchExportAccess ? (- <BatchExportTableButton- {...{- projectId,- filterState,- orderByState,- searchQuery,- searchType,- }}- tableName={BatchExportTableName.Traces}- key="batchExport"- />- ) : null,- ]}- orderByState={orderByState}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- rowHeight={rowHeight}- setRowHeight={setRowHeight}- timeRange={showControlsInPageHeader ? undefined : timeRange}- setTimeRange={showControlsInPageHeader ? undefined : setTimeRange}- refreshConfig={- showControlsInPageHeader ? undefined : refreshConfig- }- multiSelect={{- selectAll,- setSelectAll,- selectedRowIds: selectedTraceIds,- setRowSelection: setSelectedRows,- totalCount,- ...paginationState,- }}- />- </div>- )}-- {/* Content area with sidebar and table */}- <ResizableFilterLayout>+ ) : null,+ ]}+ orderByState={orderByState}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ rowHeight={rowHeight}+ setRowHeight={setRowHeight}+ timeRange={showControlsInPageHeader ? undefined : timeRange}+ setTimeRange={+ showControlsInPageHeader ? undefined : setTimeRange+ }+ refreshConfig={+ showControlsInPageHeader ? undefined : refreshConfig+ }+ multiSelect={{+ selectAll,+ setSelectAll,+ selectedRowIds: selectedTraceIds,+ setRowSelection: setSelectedRows,+ totalCount,+ ...paginationState,+ }}+ />+ </div>+ )+ }+ >{!hideControls && (<DataTableControlskey={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}@@ -1608,7 +1615,7 @@ function TracesTableInternal({tableName="traces"/></div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout>{peekConfig && (<TablePeekViewTraceDetail {...peekConfig} projectId={projectId} />)}diff --git a/web/src/features/tracing-tables/observations/ObservationsTable.tsx b/web/src/features/tracing-tables/observations/ObservationsTable.tsxindex 993fb34c2e..378df0a4f8 100644--- a/web/src/features/tracing-tables/observations/ObservationsTable.tsx+++ b/web/src/features/tracing-tables/observations/ObservationsTable.tsx@@ -7,7 +7,7 @@ import {DataTableControlsProvider,DataTableControls,} from "@/src/components/table/data-table-controls";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { SearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import {useEffect,useLayoutEffect,@@ -1387,67 +1387,71 @@ export default function ObservationsTable({/>)}<div className="flex h-full w-full flex-col">- {/* Toolbar spanning full width */}- {!hideControls && (- <div className="shrink-0 pb-1.5">- <TableSearchBar- key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}- projectId={projectId}- tableName={observationsFilterConfig.tableName}- registry={searchRegistry}- filterState={queryFilter.searchBarFilterState}- setFilterState={queryFilter.setFilterState}- observed={observedOptions}- isV4={false}- search={{- query: searchQuery,- type: searchType,- setQuery: handleSearchQueryChange,- setType: handleSearchTypeChange,- }}- />- <ObservationsDataTableToolbar- rowClassName="my-1"- isV4={false}- columns={columns}- filterState={queryFilter.explicitFilterState}- viewConfig={{- tableName: TableViewPresetTableName.Observations,- projectId,- controllers: viewControllers,- }}- currentSearchQuery={searchQuery ?? ""}- columnsWithCustomSelect={[- "model",- "name",- "traceName",- "promptName",- ]}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- orderByState={orderBy}- rowHeight={rowHeight}- setRowHeight={setRowHeight}- timeRange={showControlsInPageHeader ? undefined : timeRange}- setTimeRange={showControlsInPageHeader ? undefined : setTimeRange}- refreshConfig={- showControlsInPageHeader ? undefined : refreshConfig- }- projectId={projectId}- backendFilterState={backendFilterState}- searchQuery={searchQuery}- searchType={searchType}- tableActions={tableActions}- totalCount={totalCount}- paginationState={paginationState}- />- </div>- )}-- {/* Content area with sidebar and table */}- <ResizableFilterLayout>+ <SearchableTableFilterLayout+ search={+ !hideControls ? (+ <TableSearchBar+ key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}+ projectId={projectId}+ tableName={observationsFilterConfig.tableName}+ registry={searchRegistry}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={queryFilter.setFilterState}+ observed={observedOptions}+ isV4={false}+ search={{+ query: searchQuery,+ type: searchType,+ setQuery: handleSearchQueryChange,+ setType: handleSearchTypeChange,+ }}+ />+ ) : null+ }+ toolbar={+ !hideControls ? (+ <ObservationsDataTableToolbar+ rowClassName="my-1"+ isV4={false}+ columns={columns}+ filterState={queryFilter.explicitFilterState}+ viewConfig={{+ tableName: TableViewPresetTableName.Observations,+ projectId,+ controllers: viewControllers,+ }}+ currentSearchQuery={searchQuery ?? ""}+ columnsWithCustomSelect={[+ "model",+ "name",+ "traceName",+ "promptName",+ ]}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ orderByState={orderBy}+ rowHeight={rowHeight}+ setRowHeight={setRowHeight}+ timeRange={showControlsInPageHeader ? undefined : timeRange}+ setTimeRange={+ showControlsInPageHeader ? undefined : setTimeRange+ }+ refreshConfig={+ showControlsInPageHeader ? undefined : refreshConfig+ }+ projectId={projectId}+ backendFilterState={backendFilterState}+ searchQuery={searchQuery}+ searchType={searchType}+ tableActions={tableActions}+ totalCount={totalCount}+ paginationState={paginationState}+ />+ ) : null+ }+ >{!hideControls && (<DataTableControlskey={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}@@ -1523,7 +1527,7 @@ export default function ObservationsTable({}}/></div>- </ResizableFilterLayout>+ </SearchableTableFilterLayout>{peekConfig && (<TablePeekViewObservationDetail{...peekConfig}diff --git a/web/src/features/users/UsersTable.tsx b/web/src/features/users/UsersTable.tsxindex dbb852e949..db2a575f85 100644--- a/web/src/features/users/UsersTable.tsx+++ b/web/src/features/users/UsersTable.tsx@@ -14,7 +14,7 @@ import {DataTableControls,DataTableControlsProvider,} from "@/src/components/table/data-table-controls";-import { ResizableFilterLayout } from "@/src/components/table/resizable-filter-layout";+import { StickySearchableTableFilterLayout } from "@/src/components/table/resizable-filter-layout";import { createBadgeTableColumn } from "@/src/components/design-system/table/columns/createBadgeTableColumn";import { createLinkTableColumn } from "@/src/components/design-system/table/columns/createLinkTableColumn";import { createTextTableColumn } from "@/src/components/design-system/table/columns/createTextTableColumn";@@ -524,44 +524,46 @@ export function UsersTable({setTimeRange={setTimeRange}/>)}- {/* In bar mode the composer and the toolbar stick together as one band- so the toolbar cannot scroll under the composer and render- half-clipped. */}- <div className="bg-background sticky top-0 z-30 pb-1.5">- <TableSearchBar- key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}- isV4={isV4}- filterState={queryFilter.searchBarFilterState}- setFilterState={setFiltersWrapper}- search={{ query: searchQuery, setQuery: handleSearchChange }}- projectId={projectId}- tableName={usersFilterConfig.tableName}- observed={observedOptions}- erroredColumns={erroredColumns}- onRequestColumns={requestColumns}- registry={isV4 ? USERS_FIELD_REGISTRY : LEGACY_USERS_FIELD_REGISTRY}- />- <DataTableToolbar- tableName={usersFilterConfig.tableName}- isV4={isV4}- rowClassName="my-1"- filterState={queryFilter.explicitFilterState}- columns={columns}- timeRange={showControlsInPageHeader ? undefined : timeRange}- setTimeRange={showControlsInPageHeader ? undefined : setTimeRange}- currentSearchQuery={searchQuery ?? ""}- columnVisibility={columnVisibility}- setColumnVisibility={handleColumnVisibilityChange}- columnOrder={columnOrder}- setColumnOrder={handleColumnOrderChange}- viewConfig={{- tableName: TableViewPresetTableName.Users,- projectId,- controllers: viewControllers,- }}- />- </div>- <ResizableFilterLayout>+ <StickySearchableTableFilterLayout+ search={+ <TableSearchBar+ key={`${viewControllers.filterEditorResetKey}-${queryFilter.draftResetKey}`}+ isV4={isV4}+ filterState={queryFilter.searchBarFilterState}+ setFilterState={setFiltersWrapper}+ search={{ query: searchQuery, setQuery: handleSearchChange }}+ projectId={projectId}+ tableName={usersFilterConfig.tableName}+ observed={observedOptions}+ erroredColumns={erroredColumns}+ onRequestColumns={requestColumns}+ registry={+ isV4 ? USERS_FIELD_REGISTRY : LEGACY_USERS_FIELD_REGISTRY+ }+ />+ }+ toolbar={+ <DataTableToolbar+ tableName={usersFilterConfig.tableName}+ isV4={isV4}+ rowClassName="my-1"+ filterState={queryFilter.explicitFilterState}+ columns={columns}+ timeRange={showControlsInPageHeader ? undefined : timeRange}+ setTimeRange={showControlsInPageHeader ? undefined : setTimeRange}+ currentSearchQuery={searchQuery ?? ""}+ columnVisibility={columnVisibility}+ setColumnVisibility={handleColumnVisibilityChange}+ columnOrder={columnOrder}+ setColumnOrder={handleColumnOrderChange}+ viewConfig={{+ tableName: TableViewPresetTableName.Users,+ projectId,+ controllers: viewControllers,+ }}+ />+ }+ ><DataTableControlskey={viewControllers.filterEditorResetKey}queryFilter={queryFilter}@@ -620,7 +622,7 @@ export function UsersTable({cellPadding="comfortable"/></div>- </ResizableFilterLayout>+ </StickySearchableTableFilterLayout></div></DataTableControlsProvider>);