Skip to content

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

feat(tables): collapse filter sidebar to a rail and move date picker into the page header (LFE-10663) (#14763)

Nikita Kabardin27bf33ee2d11
diff --git a/web/src/components/table/FilterToggleButton.tsx b/web/src/components/table/FilterToggleButton.tsx
index c6cd59dcbb..450c2cc295 100644
--- a/web/src/components/table/FilterToggleButton.tsx
+++ b/web/src/components/table/FilterToggleButton.tsx
@@ -3,21 +3,33 @@ import { PanelLeftClose, PanelLeftOpen } from "lucide-react";
import { useDataTableControls } from "@/src/components/table/data-table-controls";
import { Badge } from "@/src/components/ui/badge";
import { Button } from "@/src/components/ui/button";
+import { cn } from "@/src/utils/tailwind";
import { type FilterState } from "@langfuse/shared";
-/** FilterToggleButton shows / hides the table's sidebar filter panel and exposes the active filter count. */
+/** FilterToggleButton shows / hides the table's sidebar filter panel and exposes the active filter count.
+ * On desktop the sidebar carries its own collapse toggle and collapses to a
+ * rail with a re-open button (see DataTableControls), so this button is only
+ * rendered on mobile, where the stacked layout has no rail. */
export function FilterToggleButton({
filterState,
+ className,
}: {
filterState?: FilterState;
+ className?: string;
}) {
const { open, setOpen } = useDataTableControls();
+ // Count filtered COLUMNS (facets), not raw FilterState entries — one facet
+ // can emit several entries (e.g. a numeric range writes >= and <=). Keeps
+ // this badge consistent with the desktop rail's active-facet count.
+ const activeFacetCount = filterState
+ ? new Set(filterState.map((filter) => filter.column)).size
+ : 0;
return (
<Button
variant="outline"
size="sm"
onClick={() => setOpen(!open)}
- className="flex h-8 items-center gap-2 text-sm"
+ className={cn("flex h-8 items-center gap-2 text-sm", className)}
>
{open ? (
<PanelLeftClose className="h-4 w-4" />
@@ -25,9 +37,9 @@ export function FilterToggleButton({
<PanelLeftOpen className="h-4 w-4" />
)}
<span>{open ? "Hide" : "Show"} filters</span>
- {filterState && filterState.length > 0 && (
+ {activeFacetCount > 0 && (
<Badge variant="secondary" className="ml-1 h-5 px-1.5 text-xs">
- {filterState.length}
+ {activeFacetCount}
</Badge>
)}
</Button>
diff --git a/web/src/components/table/data-table-controls.tsx b/web/src/components/table/data-table-controls.tsx
index 737340e4af..43ebaf7d05 100644
--- a/web/src/components/table/data-table-controls.tsx
+++ b/web/src/components/table/data-table-controls.tsx
@@ -8,12 +8,13 @@ import {
useCallback,
} from "react";
import { useMediaQuery } from "react-responsive";
-import useSessionStorage from "@/src/components/useSessionStorage";
+import useLocalStorage from "@/src/components/useLocalStorage";
import { cn } from "@/src/utils/tailwind";
import { compactNumberFormatter } from "@/src/utils/numbers";
import { Accordion } from "@/src/components/ui/accordion";
import * as AccordionPrimitive from "@radix-ui/react-accordion";
-import { ChevronDown } from "lucide-react";
+import { ChevronDown, PanelLeftClose, PanelLeftOpen } from "lucide-react";
+import { Badge } from "@/src/components/ui/badge";
import { Checkbox } from "@/src/components/ui/checkbox";
import { Button } from "@/src/components/ui/button";
import {
@@ -65,15 +66,18 @@ export function DataTableControlsProvider({
const storageKey = tableName
? `data-table-controls-${tableName}`
: "data-table-controls";
- const defaultOpen = isDesktop ? !defaultSidebarCollapsed : false;
- const [open, setOpen] = useSessionStorage(storageKey, defaultOpen);
-
- // sessionStorage may carry a previously-open state from a wider viewport.
- // On mobile, force the sidebar closed on each (re)mount so the filter
- // panel doesn't cover the table by default.
- useEffect(() => {
- if (!isDesktop) setOpen(false);
- }, [isDesktop, setOpen]);
+ // The desktop preference persists across tabs and sessions (localStorage,
+ // aligned with the peek-panel persistence direction — LFE-10601). Mobile
+ // uses per-mount local state instead, so the filter panel never covers the
+ // table by default and a narrow tab neither inherits nor overwrites the
+ // desktop preference.
+ const [desktopOpen, setDesktopOpen] = useLocalStorage(
+ storageKey,
+ !defaultSidebarCollapsed,
+ );
+ const [mobileOpen, setMobileOpen] = useState(false);
+ const open = isDesktop ? desktopOpen : mobileOpen;
+ const setOpen = isDesktop ? setDesktopOpen : setMobileOpen;
return (
<ControlsContext.Provider value={{ open, setOpen, tableName }}>
@@ -118,7 +122,11 @@ export function DataTableControls({
filterWithAI,
}: DataTableControlsProps) {
const { isLangfuseCloud } = useLangfuseCloudRegion();
+ const { setOpen } = useDataTableControls();
const [aiPopoverOpen, setAiPopoverOpen] = useState(false);
+ const activeFilterCount = queryFilter.filters.filter(
+ (filter) => filter.isActive,
+ ).length;
const handleFiltersGenerated = useCallback(
(filters: FilterState) => {
@@ -142,203 +150,257 @@ export function DataTableControls({
);
return (
- <div
- className={cn(
- "bg-background flex h-full w-full flex-col overflow-auto border-t",
- "group-data-[expanded=false]/controls:hidden",
- )}
- >
- <div className="bg-background sticky top-0 z-20 mb-1 flex h-10 shrink-0 items-center justify-between border-b px-3">
- <span className="text-sm font-medium">Filters</span>
- <div className="flex items-center gap-1">
- {queryFilter.isFiltered && (
+ <>
+ {/* Collapsed rail: shown when the sidebar is collapsed on desktop, where
+ the resizable panel keeps a thin strip (see ResizableFilterLayout).
+ Mirrors the trace peek's collapsed-panel rail. */}
+ <div className="bg-background hidden h-full w-full flex-col items-center border-t group-data-[expanded=false]/controls:flex">
+ {/* Mirror the expanded header's metrics (h-10 row, border-b, 24px
+ button) so the toggle icon doesn't shift when collapsing. */}
+ <div className="flex h-10 w-full shrink-0 items-center justify-center border-b">
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ variant="ghost"
+ size="icon"
+ onClick={() => setOpen(true)}
+ aria-label="Show filters"
+ className="h-6 w-6"
+ >
+ <PanelLeftOpen className="h-3.5 w-3.5" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="right">Show filters</TooltipContent>
+ </Tooltip>
+ </div>
+ {activeFilterCount > 0 && (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Badge variant="secondary" className="mt-2 h-5 px-1.5 text-xs">
+ {activeFilterCount}
+ </Badge>
+ </TooltipTrigger>
+ <TooltipContent side="right">
+ {activeFilterCount} active{" "}
+ {activeFilterCount === 1 ? "filter" : "filters"}
+ </TooltipContent>
+ </Tooltip>
+ )}
+ </div>
+ <div
+ className={cn(
+ "bg-background flex h-full w-full flex-col overflow-auto border-t",
+ "group-data-[expanded=false]/controls:hidden",
+ )}
+ >
+ <div className="bg-background sticky top-0 z-20 mb-1 flex h-10 shrink-0 items-center justify-between border-b px-3">
+ <div className="flex items-center gap-1.5">
<Tooltip>
<TooltipTrigger asChild>
<Button
variant="ghost"
- size="sm"
- onClick={() => queryFilter.clearAll()}
- className="h-7 px-2 text-xs"
+ size="icon"
+ onClick={() => setOpen(false)}
+ aria-label="Hide filters"
+ className="-ml-1 h-6 w-6"
>
- Clear all
+ <PanelLeftClose className="h-3.5 w-3.5" />
</Button>
</TooltipTrigger>
- <TooltipContent>Clear all filters</TooltipContent>
+ <TooltipContent>Hide filters</TooltipContent>
</Tooltip>
- )}
- {filterWithAI && isLangfuseCloud && (
- <Popover open={aiPopoverOpen} onOpenChange={setAiPopoverOpen}>
+ <span className="text-sm font-medium">Filters</span>
+ </div>
+ <div className="flex items-center gap-1">
+ {queryFilter.isFiltered && (
<Tooltip>
<TooltipTrigger asChild>
- <PopoverTrigger asChild>
- <Button variant="ghost" size="icon" className="h-8 w-8">
- <WandSparkles className="h-4 w-4" />
- </Button>
- </PopoverTrigger>
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => queryFilter.clearAll()}
+ className="h-7 px-2 text-xs"
+ >
+ Clear all
+ </Button>
</TooltipTrigger>
- <TooltipContent>Filter with AI</TooltipContent>
+ <TooltipContent>Clear all filters</TooltipContent>
</Tooltip>
- <PopoverContent align="center" className="w-[400px]">
- <DataTableAIFilters
- onFiltersGenerated={handleFiltersGenerated}
- />
- </PopoverContent>
- </Popover>
- )}
+ )}
+ {filterWithAI && isLangfuseCloud && (
+ <Popover open={aiPopoverOpen} onOpenChange={setAiPopoverOpen}>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <PopoverTrigger asChild>
+ <Button variant="ghost" size="icon" className="h-8 w-8">
+ <WandSparkles className="h-4 w-4" />
+ </Button>
+ </PopoverTrigger>
+ </TooltipTrigger>
+ <TooltipContent>Filter with AI</TooltipContent>
+ </Tooltip>
+ <PopoverContent align="center" className="w-[400px]">
+ <DataTableAIFilters
+ onFiltersGenerated={handleFiltersGenerated}
+ />
+ </PopoverContent>
+ </Popover>
+ )}
+ </div>
</div>
- </div>
- <div className="pb-10">
- <Accordion
- type="multiple"
- className="w-full"
- value={queryFilter.expanded}
- onValueChange={queryFilter.onExpandedChange}
- >
- {queryFilter.filters.map((filter) => {
- if (filter.type === "categorical") {
- return (
- <CategoricalFacet
- key={filter.column}
- filterKey={filter.column}
- label={filter.label}
- tooltip={filter.tooltip}
- help={filter.help}
- expanded={filter.expanded}
- options={filter.options}
- counts={filter.counts}
- displayByValue={filter.displayByValue}
- loading={filter.loading}
- value={filter.value}
- onChange={filter.onChange}
- onOnlyChange={filter.onOnlyChange}
- renderIcon={filter.renderIcon}
- isActive={filter.isActive}
- onReset={filter.onReset}
- operator={filter.operator}
- onOperatorChange={filter.onOperatorChange}
- textFilters={filter.textFilters}
- onTextFilterAdd={filter.onTextFilterAdd}
- onTextFilterRemove={filter.onTextFilterRemove}
- isDisabled={filter.isDisabled}
- disabledReason={filter.disabledReason}
- />
- );
- }
-
- if (filter.type === "numeric") {
- return (
- <NumericFacet
- key={filter.column}
- filterKey={filter.column}
- label={filter.label}
- tooltip={filter.tooltip}
- help={filter.help}
- expanded={filter.expanded}
- loading={filter.loading}
- min={filter.min}
- max={filter.max}
- value={filter.value}
- onChange={filter.onChange}
- unit={filter.unit}
- isActive={filter.isActive}
- onReset={filter.onReset}
- isDisabled={filter.isDisabled}
- disabledReason={filter.disabledReason}
- />
- );
- }
-
- if (filter.type === "string") {
- return (
- <StringFacet
- key={filter.column}
- filterKey={filter.column}
- label={filter.label}
- tooltip={filter.tooltip}
- help={filter.help}
- expanded={filter.expanded}
- loading={filter.loading}
- value={filter.value}
- onChange={filter.onChange}
- isActive={filter.isActive}
- onReset={filter.onReset}
- isDisabled={filter.isDisabled}
- disabledReason={filter.disabledReason}
- />
- );
- }
-
- if (filter.type === "keyValue") {
- return (
- <KeyValueFacet
- key={filter.column}
- filterKey={filter.column}
- label={filter.label}
- tooltip={filter.tooltip}
- help={filter.help}
- expanded={filter.expanded}
- loading={filter.loading}
- keyOptions={filter.keyOptions}
- availableValues={filter.availableValues}
- value={filter.value}
- onChange={filter.onChange}
- isActive={filter.isActive}
- onReset={filter.onReset}
- keyPlaceholder="Name"
- isDisabled={filter.isDisabled}
- disabledReason={filter.disabledReason}
- />
- );
- }
-
- if (filter.type === "numericKeyValue") {
- return (
- <NumericKeyValueFacet
- key={filter.column}
- filterKey={filter.column}
- label={filter.label}
- tooltip={filter.tooltip}
- help={filter.help}
- expanded={filter.expanded}
- loading={filter.loading}
- keyOptions={filter.keyOptions}
- value={filter.value}
- onChange={filter.onChange}
- isActive={filter.isActive}
- onReset={filter.onReset}
- keyPlaceholder="Name"
- isDisabled={filter.isDisabled}
- disabledReason={filter.disabledReason}
- />
- );
- }
-
- if (filter.type === "stringKeyValue") {
- return (
- <StringKeyValueFacet
- key={filter.column}
- filterKey={filter.column}
- label={filter.label}
- tooltip={filter.tooltip}
- help={filter.help}
- expanded={filter.expanded}
- loading={filter.loading}
- keyOptions={filter.keyOptions}
- value={filter.value}
- onChange={filter.onChange}
- isActive={filter.isActive}
- onReset={filter.onReset}
- isDisabled={filter.isDisabled}
- disabledReason={filter.disabledReason}
- />
- );
- }
+ <div className="pb-10">
+ <Accordion
+ type="multiple"
+ className="w-full"
+ value={queryFilter.expanded}
+ onValueChange={queryFilter.onExpandedChange}
+ >
+ {queryFilter.filters.map((filter) => {
+ if (filter.type === "categorical") {
+ return (
+ <CategoricalFacet
+ key={filter.column}
+ filterKey={filter.column}
+ label={filter.label}
+ tooltip={filter.tooltip}
+ help={filter.help}
+ expanded={filter.expanded}
+ options={filter.options}
+ counts={filter.counts}
+ displayByValue={filter.displayByValue}
+ loading={filter.loading}
+ value={filter.value}
+ onChange={filter.onChange}
+ onOnlyChange={filter.onOnlyChange}
+ renderIcon={filter.renderIcon}
+ isActive={filter.isActive}
+ onReset={filter.onReset}
+ operator={filter.operator}
+ onOperatorChange={filter.onOperatorChange}
+ textFilters={filter.textFilters}
+ onTextFilterAdd={filter.onTextFilterAdd}
+ onTextFilterRemove={filter.onTextFilterRemove}
+ isDisabled={filter.isDisabled}
+ disabledReason={filter.disabledReason}
+ />
+ );
+ }
+
+ if (filter.type === "numeric") {
+ return (
+ <NumericFacet
+ key={filter.column}
+ filterKey={filter.column}
+ label={filter.label}
+ tooltip={filter.tooltip}
+ help={filter.help}
+ expanded={filter.expanded}
+ loading={filter.loading}
+ min={filter.min}
+ max={filter.max}
+ value={filter.value}
+ onChange={filter.onChange}
+ unit={filter.unit}
+ isActive={filter.isActive}
+ onReset={filter.onReset}
+ isDisabled={filter.isDisabled}
+ disabledReason={filter.disabledReason}
+ />
+ );
+ }
+
+ if (filter.type === "string") {
+ return (
+ <StringFacet
+ key={filter.column}
+ filterKey={filter.column}
+ label={filter.label}
+ tooltip={filter.tooltip}
+ help={filter.help}
+ expanded={filter.expanded}
+ loading={filter.loading}
+ value={filter.value}
+ onChange={filter.onChange}
+ isActive={filter.isActive}
+ onReset={filter.onReset}
+ isDisabled={filter.isDisabled}
+ disabledReason={filter.disabledReason}
+ />
+ );
+ }
+
+ if (filter.type === "keyValue") {
+ return (
+ <KeyValueFacet
+ key={filter.column}
+ filterKey={filter.column}
+ label={filter.label}
+ tooltip={filter.tooltip}
+ help={filter.help}
+ expanded={filter.expanded}
+ loading={filter.loading}
+ keyOptions={filter.keyOptions}
+ availableValues={filter.availableValues}
+ value={filter.value}
+ onChange={filter.onChange}
+ isActive={filter.isActive}
+ onReset={filter.onReset}
+ keyPlaceholder="Name"
+ isDisabled={filter.isDisabled}
+ disabledReason={filter.disabledReason}
+ />
+ );
+ }
+
+ if (filter.type === "numericKeyValue") {
+ return (
+ <NumericKeyValueFacet
+ key={filter.column}
+ filterKey={filter.column}
+ label={filter.label}
+ tooltip={filter.tooltip}
+ help={filter.help}
+ expanded={filter.expanded}
+ loading={filter.loading}
+ keyOptions={filter.keyOptions}
+ value={filter.value}
+ onChange={filter.onChange}
+ isActive={filter.isActive}
+ onReset={filter.onReset}
+ keyPlaceholder="Name"
+ isDisabled={filter.isDisabled}
+ disabledReason={filter.disabledReason}
+ />
+ );
+ }
+
+ if (filter.type === "stringKeyValue") {
+ return (
+ <StringKeyValueFacet
+ key={filter.column}
+ filterKey={filter.column}
+ label={filter.label}
+ tooltip={filter.tooltip}
+ help={filter.help}
+ expanded={filter.expanded}
+ loading={filter.loading}
+ keyOptions={filter.keyOptions}
+ value={filter.value}
+ onChange={filter.onChange}
+ isActive={filter.isActive}
+ onReset={filter.onReset}
+ isDisabled={filter.isDisabled}
+ disabledReason={filter.disabledReason}
+ />
+ );
+ }
- return null;
- })}
- </Accordion>
+ return null;
+ })}
+ </Accordion>
+ </div>
</div>
- </div>
+ </>
);
}
diff --git a/web/src/components/table/data-table-toolbar.tsx b/web/src/components/table/data-table-toolbar.tsx
index 57a2d37950..c46ad5bee0 100644
--- a/web/src/components/table/data-table-toolbar.tsx
+++ b/web/src/components/table/data-table-toolbar.tsx
@@ -260,7 +260,11 @@ export function DataTableToolbar<TData, TValue>({
rowClassName,
)}
>
- {hasNewSidebar && <FilterToggleButton filterState={filterState} />}
+ {/* Desktop uses the sidebar's own header toggle + collapsed rail; this
+ toolbar toggle only remains for the mobile stacked layout. */}
+ {hasNewSidebar && (
+ <FilterToggleButton filterState={filterState} className="md:hidden" />
+ )}
{!!columnVisibility && !!columnOrder && !!viewConfig && (
<TableViewPresetsDrawer
viewConfig={viewConfig}
diff --git a/web/src/components/table/resizable-filter-layout.tsx b/web/src/components/table/resizable-filter-layout.tsx
index d98e26b437..64bad49766 100644
--- a/web/src/components/table/resizable-filter-layout.tsx
+++ b/web/src/components/table/resizable-filter-layout.tsx
@@ -5,12 +5,18 @@ import { useMediaQuery } from "react-responsive";
import { ResizableSplitLayout } from "@/src/components/ui/resizable-split-layout";
import { useDataTableControls } from "./data-table-controls";
+// Mirrors the trace peek's collapsed-panel rail (TraceLayoutDesktop): instead
+// of hiding, the sidebar collapses to a thin rail carrying a re-open button
+// (rendered by DataTableControls). Dragging below the min snaps to the rail.
+const FILTER_PANEL_COLLAPSED_PX = 40;
+const FILTER_PANEL_MIN_PX = 160;
+
/** Resizable layout for filter sidebar and table content.
* On mobile, renders a stacked layout instead of resizable panels.
* Expects exactly 2 children: filter sidebar (DataTableControls) and table content.
*/
export function ResizableFilterLayout({ children }: PropsWithChildren) {
- const { open, tableName } = useDataTableControls();
+ const { open, setOpen, tableName } = useDataTableControls();
const isDesktop = useMediaQuery({ query: "(min-width: 768px)" });
// Extract filter sidebar and table content from children
@@ -53,10 +59,13 @@ export function ResizableFilterLayout({ children }: PropsWithChildren) {
}
secondaryContent={filterSidebar}
open={open}
+ onOpenChange={setOpen}
defaultPrimarySize={tableDefault}
defaultSecondarySize={filterDefault}
minPrimarySize={50}
maxSecondarySize={50}
+ collapsedSecondarySize={`${FILTER_PANEL_COLLAPSED_PX}px`}
+ minSecondarySize={`${FILTER_PANEL_MIN_PX}px`}
secondaryPosition="left"
persistId={tableName ? `filter-layout-${tableName}` : "filter-layout"}
/>
diff --git a/web/src/components/table/table-time-range-header-picker.tsx b/web/src/components/table/table-time-range-header-picker.tsx
new file mode 100644
index 0000000000..0c3f7c5bb9
--- /dev/null
+++ b/web/src/components/table/table-time-range-header-picker.tsx
@@ -0,0 +1,24 @@
+import { TimeRangePicker } from "@/src/components/date-picker";
+import { useTableDateRange } from "@/src/hooks/useTableDateRange";
+import { TABLE_AGGREGATION_OPTIONS } from "@/src/utils/date-range-utils";
+
+/** Page-header date/time picker for table pages (traces, sessions, scores, …).
+ * Backed by the same shared per-project time-range state the tables read
+ * internally (useTableDateRange), so it can live in the page header — like
+ * Home — while the table below stays in sync. Pages using it should pass
+ * `hideTimeRangePicker` to their table to avoid a duplicate toolbar picker. */
+export function TableTimeRangeHeaderPicker({
+ projectId,
+}: {
+ projectId: string;
+}) {
+ const { timeRange, setTimeRange } = useTableDateRange(projectId);
+ return (
+ <TimeRangePicker
+ timeRange={timeRange}
+ onTimeRangeChange={setTimeRange}
+ timeRangePresets={TABLE_AGGREGATION_OPTIONS}
+ className="my-0 max-w-full overflow-x-auto"
+ />
+ );
+}
diff --git a/web/src/components/table/use-cases/observations.tsx b/web/src/components/table/use-cases/observations.tsx
index 919d0e6479..809e0e296d 100644
--- a/web/src/components/table/use-cases/observations.tsx
+++ b/web/src/components/table/use-cases/observations.tsx
@@ -158,6 +158,10 @@ export type ObservationsTableProps = {
omittedFilter?: ObservationsOmittableFilterColumn[];
// External control props for embedded preview tables
hideControls?: boolean;
+ /** Hide the toolbar time-range picker. Set by pages that render the picker
+ * in the page header (TableTimeRangeHeaderPicker) — both read the same
+ * shared per-project range, so embedded usages keep the toolbar picker. */
+ hideTimeRangePicker?: boolean;
externalFilterState?: FilterState;
externalDateRange?: TableDateRange;
limitRows?: number;
@@ -170,6 +174,7 @@ export default function ObservationsTable({
modelId,
omittedFilter = [],
hideControls = false,
+ hideTimeRangePicker = false,
externalFilterState,
externalDateRange,
limitRows,
@@ -1412,8 +1417,8 @@ export default function ObservationsTable({
orderByState={orderByState}
rowHeight={rowHeight}
setRowHeight={setRowHeight}
- timeRange={timeRange}
- setTimeRange={setTimeRange}
+ timeRange={hideTimeRangePicker ? undefined : timeRange}
+ setTimeRange={hideTimeRangePicker ? undefined : setTimeRange}
refreshConfig={{
onRefresh: handleRefresh,
isRefreshing:
diff --git a/web/src/components/table/use-cases/scores.tsx b/web/src/components/table/use-cases/scores.tsx
index 01c1357675..99efa1c21f 100644
--- a/web/src/components/table/use-cases/scores.tsx
+++ b/web/src/components/table/use-cases/scores.tsx
@@ -96,6 +96,10 @@ export type ScoresTableProps = {
hiddenColumns?: ScoresTableHiddenColumn[];
localStorageSuffix?: string;
disableUrlPersistence?: boolean;
+ /** Hide the toolbar time-range picker. Set by pages that render the picker
+ * in the page header (TableTimeRangeHeaderPicker) — both read the same
+ * shared per-project range, so embedded usages keep the toolbar picker. */
+ hideTimeRangePicker?: boolean;
};
function createFilterState(
@@ -122,6 +126,7 @@ export default function ScoresTable({
hiddenColumns = [],
localStorageSuffix = "",
disableUrlPersistence = false,
+ hideTimeRangePicker = false,
}: ScoresTableProps) {
const peekContext = usePeekTableState();
@@ -956,8 +961,8 @@ export default function ScoresTable({
]}
rowHeight={rowHeight}
setRowHeight={setRowHeight}
- timeRange={timeRange}
- setTimeRange={setTimeRange}
+ timeRange={hideTimeRangePicker ? undefined : timeRange}
+ setTimeRange={hideTimeRangePicker ? undefined : setTimeRange}
multiSelect={{
selectAll,
setSelectAll,
diff --git a/web/src/components/table/use-cases/sessions.tsx b/web/src/components/table/use-cases/sessions.tsx
index eb69f2fc16..88773a2346 100644
--- a/web/src/components/table/use-cases/sessions.tsx
+++ b/web/src/components/table/use-cases/sessions.tsx
@@ -88,6 +88,10 @@ export type SessionTableProps = {
userId?: string;
omittedFilter?: SessionOmittableFilterColumn[];
isBetaEnabled?: boolean;
+ /** Hide the toolbar time-range picker. Set by pages that render the picker
+ * in the page header (TableTimeRangeHeaderPicker) — both read the same
+ * shared per-project range, so embedded usages keep the toolbar picker. */
+ hideTimeRangePicker?: boolean;
};
export default function SessionsTable({
@@ -95,6 +99,7 @@ export default function SessionsTable({
userId,
omittedFilter = [],
isBetaEnabled = false,
+ hideTimeRangePicker = false,
}: SessionTableProps) {
const sessionsFilterConfig = useMemo(
() => getSessionFilterConfig(omittedFilter),
@@ -851,8 +856,8 @@ export default function SessionsTable({
projectId,
controllers: viewControllers,
}}
- timeRange={timeRange}
- setTimeRange={setTimeRange}
+ timeRange={hideTimeRangePicker ? undefined : timeRange}
+ setTimeRange={hideTimeRangePicker ? undefined : setTimeRange}
columnsWithCustomSelect={["userIds"]}
rowHeight={rowHeight}
setRowHeight={setRowHeight}
diff --git a/web/src/components/table/use-cases/traces.tsx b/web/src/components/table/use-cases/traces.tsx
index ec9ec9136e..fbef422807 100644
--- a/web/src/components/table/use-cases/traces.tsx
+++ b/web/src/components/table/use-cases/traces.tsx
@@ -150,6 +150,10 @@ export type TracesTableProps = {
userId?: string;
omittedFilter?: TraceOmittableFilterColumn[];
hideControls?: boolean;
+ /** Hide the toolbar time-range picker. Set by pages that render the picker
+ * in the page header (TableTimeRangeHeaderPicker) — both read the same
+ * shared per-project range, so embedded usages keep the toolbar picker. */
+ hideTimeRangePicker?: boolean;
externalFilterState?: FilterState;
externalDateRange?: TableDateRange;
limitRows?: number;
@@ -160,6 +164,7 @@ export default function TracesTable({
userId,
omittedFilter = [],
hideControls = false,
+ hideTimeRangePicker = false,
externalFilterState,
externalDateRange,
limitRows,
@@ -1460,8 +1465,8 @@ export default function TracesTable({
setColumnOrder={setColumnOrder}
rowHeight={rowHeight}
setRowHeight={setRowHeight}
- timeRange={timeRange}
- setTimeRange={setTimeRange}
+ timeRange={hideTimeRangePicker ? undefined : timeRange}
+ setTimeRange={hideTimeRangePicker ? undefined : setTimeRange}
refreshConfig={{
onRefresh: handleRefresh,
isRefreshing:
diff --git a/web/src/components/ui/resizable-split-layout.tsx b/web/src/components/ui/resizable-split-layout.tsx
index e6f873e7f1..9a67edc70f 100644
--- a/web/src/components/ui/resizable-split-layout.tsx
+++ b/web/src/components/ui/resizable-split-layout.tsx
@@ -1,4 +1,4 @@
-import { type ReactNode, useId, useLayoutEffect } from "react";
+import { type ReactNode, useCallback, useId, useLayoutEffect } from "react";
import {
ResizableHandle,
ResizablePanel,
@@ -16,6 +16,18 @@ interface ResizableSplitLayoutProps {
defaultSecondarySize?: number;
minPrimarySize?: number;
maxSecondarySize?: number;
+ /** Collapse the secondary panel to this width instead of hiding it ("rail"
+ * mode, e.g. "40px"). The panel content stays mounted and visible, so the
+ * caller must render its own collapsed state (rail) when `open` is false.
+ * Also keeps the resize handle while collapsed and reports drag-driven
+ * collapse/expand via `onOpenChange`. */
+ collapsedSecondarySize?: string;
+ /** Floor for the secondary panel while open; dragging below it snaps to
+ * `collapsedSecondarySize` when rail mode is active. */
+ minSecondarySize?: string;
+ /** Called when a drag collapses or expands the secondary panel so the caller
+ * can keep its controlled `open` state in sync (rail mode only). */
+ onOpenChange?: (open: boolean) => void;
className?: string;
secondaryPosition?: "left" | "right";
keepSecondaryMounted?: boolean;
@@ -46,11 +58,15 @@ export function ResizableSplitLayout({
defaultSecondarySize = 30,
minPrimarySize = 30,
maxSecondarySize = 60,
+ collapsedSecondarySize = "0%",
+ minSecondarySize = "0%",
+ onOpenChange,
className = "flex h-full w-full",
secondaryPosition = "right",
keepSecondaryMounted = true,
persistId,
}: ResizableSplitLayoutProps) {
+ const hasCollapsedRail = collapsedSecondarySize !== "0%";
const instanceId = useId().replace(/[^a-zA-Z0-9_-]/g, "");
const groupId = persistId
? `resizable-layout-${persistId}`
@@ -84,18 +100,44 @@ export function ResizableSplitLayout({
if (open) {
// v4 react-resizable-panel `expand()` depends on internal collapsed bookkeeping.
- // Fallback to default size if the panel remains effectively closed.
+ // Fallback to default size if the panel remains effectively closed: still
+ // collapsed (a no-op expand in rail mode, where the collapsed rail is
+ // wider than any fixed percentage threshold) or near-zero width (the
+ // "0%"-collapse mode).
if (panel.isCollapsed()) {
panel.expand();
}
- if (panel.getSize().asPercentage < 2) {
+ if (panel.isCollapsed() || panel.getSize().asPercentage < 2) {
panel.resize(`${defaultSecondarySize}%`);
}
- } else {
+ } else if (!panel.isCollapsed()) {
panel.collapse();
}
}, [keepSecondaryMounted, open, secondaryPanelRef, defaultSecondarySize]);
+ // Rail mode: a drag can snap the panel to its collapsed rail (or pull it back
+ // open) without going through the caller's toggle, so report the panel's
+ // collapsed state back whenever it disagrees with the controlled `open`.
+ const handleSecondaryResizeCallback = useCallback(() => {
+ const panel = secondaryPanelRef.current;
+ if (!panel || !onOpenChange) return;
+ const panelOpen = !panel.isCollapsed();
+ if (panelOpen !== open) onOpenChange(panelOpen);
+ }, [secondaryPanelRef, onOpenChange, open]);
+ const handleSecondaryResize =
+ hasCollapsedRail && onOpenChange
+ ? handleSecondaryResizeCallback
+ : undefined;
+
+ // In rail mode the collapsed panel stays visible (the caller renders a rail
+ // in it) and keeps its handle so it can be dragged back open.
+ const secondaryPanelClassName = hasCollapsedRail
+ ? undefined
+ : open
+ ? "visible"
+ : "invisible";
+ const showSecondaryHandle = showHandle && (open || hasCollapsedRail);
+
return (
<ResizablePanelGroup
id={groupId}
@@ -112,17 +154,18 @@ export function ResizableSplitLayout({
id={SECONDARY_PANEL_ID}
panelRef={secondaryPanelRef}
defaultSize={`${defaultSecondarySize}%`}
- minSize="0%"
+ minSize={minSecondarySize}
maxSize={`${maxSecondarySize}%`}
collapsible={true}
- collapsedSize="0%"
- className={open ? "visible" : "invisible"}
+ collapsedSize={collapsedSecondarySize}
+ onResize={handleSecondaryResize}
+ className={secondaryPanelClassName}
style={{ overscrollBehaviorY: "none" }}
>
{secondaryContent}
</ResizablePanel>
)}
- {secondaryPosition === "left" && open && showHandle && (
+ {secondaryPosition === "left" && showSecondaryHandle && (
<ResizableHandle key="secondary-handle" withHandle />
)}
<ResizablePanel
@@ -138,7 +181,7 @@ export function ResizableSplitLayout({
{primaryContent}
</div>
</ResizablePanel>
- {secondaryPosition === "right" && open && showHandle && (
+ {secondaryPosition === "right" && showSecondaryHandle && (
<ResizableHandle key="secondary-handle" withHandle />
)}
{secondaryPosition === "right" && renderSecondaryPanel && (
@@ -147,11 +190,12 @@ export function ResizableSplitLayout({
id={SECONDARY_PANEL_ID}
panelRef={secondaryPanelRef}
defaultSize={`${defaultSecondarySize}%`}
- minSize="0%"
+ minSize={minSecondarySize}
maxSize={`${maxSecondarySize}%`}
collapsible={true}
- collapsedSize="0%"
- className={open ? "visible" : "invisible"}
+ collapsedSize={collapsedSecondarySize}
+ onResize={handleSecondaryResize}
+ className={secondaryPanelClassName}
style={{ overscrollBehaviorY: "none" }}
>
{secondaryContent}
diff --git a/web/src/features/events/components/EventsTable.tsx b/web/src/features/events/components/EventsTable.tsx
index eeb0c39425..f88002acdc 100644
--- a/web/src/features/events/components/EventsTable.tsx
+++ b/web/src/features/events/components/EventsTable.tsx
@@ -183,6 +183,10 @@ export type EventsTableProps = {
userId?: string;
omittedFilter?: ObservationEventsOmittableFilterColumn[];
hideControls?: boolean;
+ /** Hide the toolbar time-range picker. Set by pages that render the picker
+ * in the page header (TableTimeRangeHeaderPicker) — both read the same
+ * shared per-project range, so embedded usages keep the toolbar picker. */
+ hideTimeRangePicker?: boolean;
// External control props for embedded preview tables
externalFilterState?: FilterState;
externalDateRange?: TableDateRange;
@@ -220,6 +224,7 @@ export default function ObservationsEventsTable({
userId,
omittedFilter = [],
hideControls = false,
+ hideTimeRangePicker = false,
externalFilterState,
externalDateRange,
limitRows,
@@ -1604,8 +1609,8 @@ export default function ObservationsEventsTable({
orderByState={orderByState}
rowHeight={rowHeight}
setRowHeight={setRowHeight}
- timeRange={timeRange}
- setTimeRange={setTimeRange}
+ timeRange={hideTimeRangePicker ? undefined : timeRange}
+ setTimeRange={hideTimeRangePicker ? undefined : setTimeRange}
// Disabled, for now moved to filter sidebar
// TODO: remove this toggle once v4 looks good as is
// viewModeToggle={
diff --git a/web/src/features/experiments/components/table/ExperimentsTable.tsx b/web/src/features/experiments/components/table/ExperimentsTable.tsx
index 02e762b90a..b59777c175 100644
--- a/web/src/features/experiments/components/table/ExperimentsTable.tsx
+++ b/web/src/features/experiments/components/table/ExperimentsTable.tsx
@@ -241,6 +241,7 @@ export default function ExperimentsTable({
defaultFilter,
fixedFilter = [],
sessionFilterContextId,
+ hideTimeRangePicker = false,
}: ExperimentsTableProps) {
const router = useRouter();
const filterConfig = useMemo(
@@ -748,8 +749,8 @@ export default function ExperimentsTable({
orderByState={orderByState}
rowHeight={rowHeight}
setRowHeight={setRowHeight}
- timeRange={timeRange}
- setTimeRange={setTimeRange}
+ timeRange={hideTimeRangePicker ? undefined : timeRange}
+ setTimeRange={hideTimeRangePicker ? undefined : setTimeRange}
actionButtons={[
<ExperimentsMultiSelectActionMenu
key="experiments-multi-select-actions"
diff --git a/web/src/features/experiments/components/table/types.ts b/web/src/features/experiments/components/table/types.ts
index 7ca82eb109..baa7e1d4bf 100644
--- a/web/src/features/experiments/components/table/types.ts
+++ b/web/src/features/experiments/components/table/types.ts
@@ -90,6 +90,10 @@ export type ExperimentsTableRow = {
export type ExperimentsTableProps = {
projectId: string;
hideControls?: boolean;
+ /** Hide the toolbar time-range picker. Set by pages that render the picker
+ * in the page header (TableTimeRangeHeaderPicker) — both read the same
+ * shared per-project range, so embedded usages keep the toolbar picker. */
+ hideTimeRangePicker?: boolean;
/** Default filters to apply on mount when no existing filters are set */
defaultFilter?: FilterState;
/** Hidden filters that scope the table but should not be user-visible */
diff --git a/web/src/features/monitors/pages/ListMonitorsPage.tsx b/web/src/features/monitors/pages/ListMonitorsPage.tsx
index 19729b431f..f04e4136c8 100644
--- a/web/src/features/monitors/pages/ListMonitorsPage.tsx
+++ b/web/src/features/monitors/pages/ListMonitorsPage.tsx
@@ -94,7 +94,10 @@ const MainPage = ({ projectId }: { projectId: string }) => {
...headerProps,
actionButtonsRight: (
<>
- <FilterToggleButton />
+ {/* Desktop uses the sidebar's own header toggle + collapsed
+ rail; this toggle only remains for the mobile stacked
+ layout. */}
+ <FilterToggleButton className="md:hidden" />
<AutomationButton projectId={projectId} />
<ActionButton
icon={<PlusIcon className="h-4 w-4" aria-hidden="true" />}
diff --git a/web/src/pages/project/[projectId]/datasets/[datasetId]/experiments/index.tsx b/web/src/pages/project/[projectId]/datasets/[datasetId]/experiments/index.tsx
index 0f79636b6d..4170edb2dc 100644
--- a/web/src/pages/project/[projectId]/datasets/[datasetId]/experiments/index.tsx
+++ b/web/src/pages/project/[projectId]/datasets/[datasetId]/experiments/index.tsx
@@ -34,6 +34,7 @@ import {
DATASET_TABS,
} from "@/src/features/navigation/utils/dataset-tabs";
import { TemplateSelector } from "@/src/features/evals/components/template-selector";
+import { TableTimeRangeHeaderPicker } from "@/src/components/table/table-time-range-header-picker";
import { useEvaluatorDefaults } from "@/src/features/experiments/hooks/useEvaluatorDefaults";
import { useExperimentEvaluatorData } from "@/src/features/experiments/hooks/useExperimentEvaluatorData";
import { useExperimentAccess } from "@/src/features/experiments/hooks/useExperimentAccess";
@@ -159,6 +160,9 @@ export default function Dataset() {
title: dataset.data?.name ?? "",
itemType: "DATASET",
breadcrumb,
+ actionButtonsLeft: (
+ <TableTimeRangeHeaderPicker projectId={projectId} />
+ ),
tabsProps: {
tabs: getDatasetTabs(projectId, datasetId),
activeTab: DATASET_TABS.EXPERIMENTS,
@@ -222,6 +226,7 @@ export default function Dataset() {
},
]}
sessionFilterContextId={`dataset-${datasetId}`}
+ hideTimeRangePicker
/>
</Page>
);
diff --git a/web/src/pages/project/[projectId]/experiments/index.tsx b/web/src/pages/project/[projectId]/experiments/index.tsx
index 3d2d5ebab0..ab34ff1857 100644
--- a/web/src/pages/project/[projectId]/experiments/index.tsx
+++ b/web/src/pages/project/[projectId]/experiments/index.tsx
@@ -15,6 +15,7 @@ import { FlaskConical } from "lucide-react";
import { useEffect, useState } from "react";
import { useRouter } from "next/router";
import Spinner from "@/src/components/design-system/Spinner/Spinner";
+import { TableTimeRangeHeaderPicker } from "@/src/components/table/table-time-range-header-picker";
export default function Experiments() {
const router = useRouter();
@@ -59,6 +60,7 @@ export default function Experiments() {
<Page
headerProps={{
title: "Experiments",
+ actionButtonsLeft: <TableTimeRangeHeaderPicker projectId={projectId} />,
actionButtonsRight: (
<div className="flex items-center gap-2">
<Dialog
@@ -88,7 +90,7 @@ export default function Experiments() {
),
}}
>
- <ExperimentsTable projectId={projectId} />
+ <ExperimentsTable projectId={projectId} hideTimeRangePicker />
</Page>
);
}
diff --git a/web/src/pages/project/[projectId]/observations/index.tsx b/web/src/pages/project/[projectId]/observations/index.tsx
index e2b85ecc02..bd21500571 100644
--- a/web/src/pages/project/[projectId]/observations/index.tsx
+++ b/web/src/pages/project/[projectId]/observations/index.tsx
@@ -10,6 +10,7 @@ import {
import { useV4Beta } from "@/src/features/events/hooks/useV4Beta";
import ObservationsEventsTable from "@/src/features/events/components/EventsTable";
import { useQueryProject } from "@/src/features/projects/hooks";
+import { TableTimeRangeHeaderPicker } from "@/src/components/table/table-time-range-header-picker";
export default function Generations() {
const router = useRouter();
@@ -46,6 +47,9 @@ export default function Generations() {
"An observation captures a single function call in an application. See docs to learn more.",
href: "https://langfuse.com/docs/observability/data-model",
},
+ actionButtonsLeft: showOnboarding ? undefined : (
+ <TableTimeRangeHeaderPicker projectId={projectId} />
+ ),
tabsProps:
isBetaEnabled || isInitializing
? undefined
@@ -67,9 +71,9 @@ export default function Generations() {
resolves. */}
</>
) : isBetaEnabled ? (
- <ObservationsEventsTable projectId={projectId} />
+ <ObservationsEventsTable projectId={projectId} hideTimeRangePicker />
) : (
- <ObservationsTable projectId={projectId} />
+ <ObservationsTable projectId={projectId} hideTimeRangePicker />
)}
</Page>
);
diff --git a/web/src/pages/project/[projectId]/observations/new.tsx b/web/src/pages/project/[projectId]/observations/new.tsx
index 11eae998f9..b4ad604477 100644
--- a/web/src/pages/project/[projectId]/observations/new.tsx
+++ b/web/src/pages/project/[projectId]/observations/new.tsx
@@ -9,6 +9,7 @@ import {
TRACING_TABS,
} from "@/src/features/navigation/utils/tracing-tabs";
import { useQueryProject } from "@/src/features/projects/hooks";
+import { TableTimeRangeHeaderPicker } from "@/src/components/table/table-time-range-header-picker";
export default function Events() {
const router = useRouter();
@@ -44,6 +45,9 @@ export default function Events() {
"An observation captures a single function call in an application. This view uses the new ClickHouse events table.",
href: "https://langfuse.com/docs/observability/data-model",
},
+ actionButtonsLeft: showOnboarding ? undefined : (
+ <TableTimeRangeHeaderPicker projectId={projectId} />
+ ),
tabsProps: {
tabs: getTracingTabs(projectId),
activeTab: TRACING_TABS.OBSERVATIONS,
@@ -55,7 +59,7 @@ export default function Events() {
{showOnboarding ? (
<TracesOnboarding projectId={projectId} />
) : (
- <ObservationsEventsTable projectId={projectId} />
+ <ObservationsEventsTable projectId={projectId} hideTimeRangePicker />
)}
</Page>
);
diff --git a/web/src/pages/project/[projectId]/prompts/metrics.tsx b/web/src/pages/project/[projectId]/prompts/metrics.tsx
index 156c42f80b..94e5a295d7 100644
--- a/web/src/pages/project/[projectId]/prompts/metrics.tsx
+++ b/web/src/pages/project/[projectId]/prompts/metrics.tsx
@@ -28,7 +28,11 @@ import {
} from "@/src/features/scores/lib/scoreColumns";
import useProjectIdFromURL from "@/src/hooks/useProjectIdFromURL";
import { useTableDateRange } from "@/src/hooks/useTableDateRange";
-import { toAbsoluteTimeRange } from "@/src/utils/date-range-utils";
+import {
+ toAbsoluteTimeRange,
+ TABLE_AGGREGATION_OPTIONS,
+} from "@/src/utils/date-range-utils";
+import { TimeRangePicker } from "@/src/components/date-picker";
import { useMemo } from "react";
export type PromptVersionTableRow = {
@@ -412,6 +416,16 @@ export default function PromptVersionTable({
},
{ name: `Metrics` },
],
+ // Rendered directly (not TableTimeRangeHeaderPicker) because this page
+ // resolves the shared range with a custom last30Days fallback.
+ actionButtonsLeft: (
+ <TimeRangePicker
+ timeRange={timeRange}
+ onTimeRangeChange={setTimeRange}
+ timeRangePresets={TABLE_AGGREGATION_OPTIONS}
+ className="my-0 max-w-full overflow-x-auto"
+ />
+ ),
actionButtonsRight: (
<DetailPageNav
key="nav"
@@ -429,8 +443,6 @@ export default function PromptVersionTable({
<div className="gap-3">
<DataTableToolbar
columns={columns}
- timeRange={timeRange}
- setTimeRange={setTimeRange}
rowHeight={rowHeight}
setRowHeight={setRowHeight}
columnVisibility={columnVisibility}
diff --git a/web/src/pages/project/[projectId]/scores/index.tsx b/web/src/pages/project/[projectId]/scores/index.tsx
index bde2e9baf1..016ba42ebe 100644
--- a/web/src/pages/project/[projectId]/scores/index.tsx
+++ b/web/src/pages/project/[projectId]/scores/index.tsx
@@ -7,6 +7,7 @@ import {
getScoresTabs,
SCORES_TABS,
} from "@/src/features/navigation/utils/scores-tabs";
+import { TableTimeRangeHeaderPicker } from "@/src/components/table/table-time-range-header-picker";
export default function ScoresPage() {
const router = useRouter();
@@ -37,6 +38,9 @@ export default function ScoresPage() {
"A scores is an evaluation of a traces or observations. It can be created from user feedback, model-based evaluations, or manual review. See docs to learn more.",
href: "https://langfuse.com/docs/evaluation/overview",
},
+ actionButtonsLeft: showOnboarding ? undefined : (
+ <TableTimeRangeHeaderPicker projectId={projectId} />
+ ),
tabsProps: {
tabs: getScoresTabs(projectId),
activeTab: SCORES_TABS.SCORES,
@@ -48,7 +52,7 @@ export default function ScoresPage() {
{showOnboarding ? (
<ScoresOnboarding />
) : (
- <ScoresTable projectId={projectId} />
+ <ScoresTable projectId={projectId} hideTimeRangePicker />
)}
</Page>
);
diff --git a/web/src/pages/project/[projectId]/sessions/index.tsx b/web/src/pages/project/[projectId]/sessions/index.tsx
index 4f36c78891..4622b3a24b 100644
--- a/web/src/pages/project/[projectId]/sessions/index.tsx
+++ b/web/src/pages/project/[projectId]/sessions/index.tsx
@@ -5,6 +5,7 @@ import Page from "@/src/components/layouts/page";
import { SessionsOnboarding } from "@/src/components/onboarding/SessionsOnboarding";
import { api } from "@/src/utils/api";
import { useV4Beta } from "@/src/features/events/hooks/useV4Beta";
+import { TableTimeRangeHeaderPicker } from "@/src/components/table/table-time-range-header-picker";
export default function Sessions() {
const router = useRouter();
@@ -66,6 +67,9 @@ export default function Sessions() {
),
href: "https://langfuse.com/docs/observability/features/sessions",
},
+ actionButtonsLeft: showOnboarding ? undefined : (
+ <TableTimeRangeHeaderPicker projectId={projectId} />
+ ),
}}
scrollable={showOnboarding}
>
@@ -73,7 +77,11 @@ export default function Sessions() {
{showOnboarding ? (
<SessionsOnboarding />
) : (
- <SessionsTable projectId={projectId} isBetaEnabled={isBetaEnabled} />
+ <SessionsTable
+ projectId={projectId}
+ isBetaEnabled={isBetaEnabled}
+ hideTimeRangePicker
+ />
)}
</Page>
);
diff --git a/web/src/pages/project/[projectId]/traces/index.tsx b/web/src/pages/project/[projectId]/traces/index.tsx
index feee969b24..8dd67e0c92 100644
--- a/web/src/pages/project/[projectId]/traces/index.tsx
+++ b/web/src/pages/project/[projectId]/traces/index.tsx
@@ -10,6 +10,7 @@ import {
import { useV4Beta } from "@/src/features/events/hooks/useV4Beta";
import ObservationsEventsTable from "@/src/features/events/components/EventsTable";
import { useQueryProject } from "@/src/features/projects/hooks";
+import { TableTimeRangeHeaderPicker } from "@/src/components/table/table-time-range-header-picker";
export default function Traces() {
const router = useRouter();
@@ -78,6 +79,7 @@ export default function Traces() {
),
href: "https://langfuse.com/docs/observability/data-model",
},
+ actionButtonsLeft: <TableTimeRangeHeaderPicker projectId={projectId} />,
tabsProps:
isBetaEnabled || isInitializing
? undefined
@@ -95,9 +97,9 @@ export default function Traces() {
resolves. */}
</>
) : isBetaEnabled ? (
- <ObservationsEventsTable projectId={projectId} />
+ <ObservationsEventsTable projectId={projectId} hideTimeRangePicker />
) : (
- <TracesTable projectId={projectId} />
+ <TracesTable projectId={projectId} hideTimeRangePicker />
)}
</Page>
);
diff --git a/web/src/pages/project/[projectId]/users/index.tsx b/web/src/pages/project/[projectId]/users/index.tsx
index 149825bbe4..f551c78f52 100644
--- a/web/src/pages/project/[projectId]/users/index.tsx
+++ b/web/src/pages/project/[projectId]/users/index.tsx
@@ -28,6 +28,7 @@ import { toAbsoluteTimeRange } from "@/src/utils/date-range-utils";
import { useDebounce } from "@/src/hooks/useDebounce";
import Page from "@/src/components/layouts/page";
import { UsersOnboarding } from "@/src/components/onboarding/UsersOnboarding";
+import { TableTimeRangeHeaderPicker } from "@/src/components/table/table-time-range-header-picker";
import {
useEnvironmentFilter,
convertSelectedEnvironmentsToFilter,
@@ -104,6 +105,9 @@ export default function UsersPage() {
),
href: "https://langfuse.com/docs/observability/features/users",
},
+ actionButtonsLeft: showOnboarding ? undefined : (
+ <TableTimeRangeHeaderPicker projectId={projectId} />
+ ),
}}
scrollable={showOnboarding}
>
@@ -134,7 +138,9 @@ const UsersTable = ({ isBetaEnabled }: { isBetaEnabled: boolean }) => {
pageSize: withDefault(NumberParam, 50),
});
- const { timeRange, setTimeRange } = useTableDateRange(projectId);
+ // The picker lives in the page header (TableTimeRangeHeaderPicker); this
+ // reads the same shared per-project range to filter the table.
+ const { timeRange } = useTableDateRange(projectId);
// Convert timeRange to absolute date range for compatibility
const dateRange = useMemo(() => {
@@ -420,8 +426,6 @@ const UsersTable = ({ isBetaEnabled }: { isBetaEnabled: boolean }) => {
filterState={userFilterState}
setFilterState={useDebounce(setUserFilterState)}
columns={columns}
- timeRange={timeRange}
- setTimeRange={setTimeRange}
searchConfig={{
metadataSearchFields: ["User ID"],
updateQuery: setSearchQuery,