Skip to content

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

fix(web): session header drops the per-detail hide controls (#17764)

Trang Nguyen50db7223b0fb
diff --git a/web/src/features/posthog-analytics/usePostHogClientCapture.ts b/web/src/features/posthog-analytics/usePostHogClientCapture.ts
index 95ed526509..9eeb9c3173 100644
--- a/web/src/features/posthog-analytics/usePostHogClientCapture.ts
+++ b/web/src/features/posthog-analytics/usePostHogClientCapture.ts
@@ -180,7 +180,6 @@ const events = {
"inline_tools_toggled",
"system_prompt_toggled",
"metadata_jsonpath_config_changed",
- "header_detail_visibility_changed",
],
eval_config: [
"new_form_submit",
diff --git a/web/src/features/sessions/ModernSessionHeader.clienttest.tsx b/web/src/features/sessions/ModernSessionHeader.clienttest.tsx
deleted file mode 100644
index 74e77bfa45..0000000000
--- a/web/src/features/sessions/ModernSessionHeader.clienttest.tsx
+++ /dev/null
@@ -1,219 +0,0 @@
-import { fireEvent, render, screen } from "@testing-library/react";
-import { type ReactNode } from "react";
-import { afterEach, describe, expect, it, vi } from "vitest";
-
-import { ModernSessionHeader } from "@/src/features/sessions/ModernSessionHeader";
-import { sessionHeaderVisibilityStorageKey } from "@/src/features/sessions/sessionHeaderVisibility";
-
-const capture = vi.hoisted(() => vi.fn());
-
-vi.mock("@/src/features/posthog-analytics/usePostHogClientCapture", () => ({
- usePostHogClientCapture: () => capture,
-}));
-
-vi.mock("@/src/components/SingleLineOverflowList", () => ({
- SingleLineOverflowList: ({
- items,
- additionalOverflowCount,
- getKey,
- renderItem,
- renderOverflow,
- trailingContent,
- }: {
- items: readonly { key: string }[];
- additionalOverflowCount: number;
- getKey: (item: { key: string }) => string;
- renderItem: (item: { key: string }) => ReactNode;
- renderOverflow: (props: {
- hiddenItems: readonly { key: string }[];
- overflowItemCount: number;
- }) => ReactNode;
- trailingContent?: ReactNode;
- }) => (
- <div>
- {items.map((item) => (
- <div key={getKey(item)}>{renderItem(item)}</div>
- ))}
- {additionalOverflowCount > 0
- ? renderOverflow({
- hiddenItems: [],
- overflowItemCount: additionalOverflowCount,
- })
- : null}
- {trailingContent}
- </div>
- ),
-}));
-
-const defaultProps = {
- projectId: "project-1",
- countTraces: 3,
- minTimestamp: new Date("2026-01-01T00:00:00.000Z"),
- maxTimestamp: new Date("2026-01-01T00:00:01.000Z"),
- tokensIn: 0,
- tokensOut: 0,
- totalTokens: 0,
- totalCost: 0.12,
- users: [],
- metadataJsonPaths: {
- paths: [],
- source: { state: "idle" as const },
- onEditorOpenChange: vi.fn(),
- onSave: vi.fn(),
- onRemove: vi.fn(),
- },
- scores: [],
-};
-
-describe("ModernSessionHeader", () => {
- afterEach(() => {
- capture.mockClear();
- localStorage.clear();
- });
-
- it("hides and reveals a detail while persisting the preference", () => {
- render(<ModernSessionHeader {...defaultProps} />);
-
- fireEvent.click(
- screen.getByRole("button", {
- name: "Hide trace count in session header",
- }),
- );
-
- expect(
- screen.queryByRole("button", {
- name: "Hide trace count in session header",
- }),
- ).not.toBeInTheDocument();
- expect(
- localStorage.getItem(sessionHeaderVisibilityStorageKey("project-1")),
- ).toBe(JSON.stringify(["traces"]));
- expect(capture).toHaveBeenCalledWith(
- "session_detail:header_detail_visibility_changed",
- {
- action: "hide",
- detailType: "traces",
- storedHiddenDetailCount: 1,
- isV4: true,
- },
- );
-
- fireEvent.click(
- screen.getByRole("button", {
- name: "Show 1 hidden session details",
- }),
- );
- fireEvent.click(
- screen.getByRole("button", {
- name: "Show trace count in session header",
- }),
- );
-
- expect(
- screen.getByRole("button", {
- name: "Hide trace count in session header",
- }),
- ).toBeInTheDocument();
- expect(
- localStorage.getItem(sessionHeaderVisibilityStorageKey("project-1")),
- ).toBe(JSON.stringify([]));
- expect(capture).toHaveBeenCalledTimes(2);
- expect(capture).toHaveBeenLastCalledWith(
- "session_detail:header_detail_visibility_changed",
- {
- action: "show",
- detailType: "traces",
- storedHiddenDetailCount: 0,
- isV4: true,
- },
- );
- });
-
- it("restores hidden details from project-scoped local storage", () => {
- localStorage.setItem(
- sessionHeaderVisibilityStorageKey("project-1"),
- JSON.stringify(["traces"]),
- );
- render(<ModernSessionHeader {...defaultProps} />);
-
- expect(
- screen.queryByRole("button", {
- name: "Hide trace count in session header",
- }),
- ).not.toBeInTheDocument();
- fireEvent.click(
- screen.getByRole("button", {
- name: "Show 1 hidden session details",
- }),
- );
- expect(
- screen.getByRole("button", {
- name: "Show trace count in session header",
- }),
- ).toBeInTheDocument();
- });
-
- it("does not persist customer identifiers in dynamic detail keys", () => {
- const userId = "[email protected]";
- render(<ModernSessionHeader {...defaultProps} users={[userId]} />);
-
- fireEvent.click(
- screen.getByRole("button", {
- name: "Hide user 1 in session header",
- }),
- );
-
- const storedValue = localStorage.getItem(
- sessionHeaderVisibilityStorageKey("project-1"),
- );
- expect(storedValue).not.toContain(userId);
- expect(JSON.parse(storedValue ?? "[]")).toHaveLength(1);
- });
-
- it("preserves preferences for details that are temporarily unavailable", () => {
- const storageKey = sessionHeaderVisibilityStorageKey("project-1");
- localStorage.setItem(storageKey, JSON.stringify(["tokens"]));
- render(<ModernSessionHeader {...defaultProps} />);
-
- fireEvent.click(
- screen.getByRole("button", {
- name: "Hide trace count in session header",
- }),
- );
-
- expect(JSON.parse(localStorage.getItem(storageKey) ?? "[]")).toEqual([
- "tokens",
- "traces",
- ]);
- });
-
- it("lets overflow-only users participate in visibility preferences", () => {
- const users = [
- ];
- render(<ModernSessionHeader {...defaultProps} users={users} />);
-
- fireEvent.click(
- screen.getByRole("button", {
- name: "Show 1 hidden session details",
- }),
- );
- const hideOverflowUser = screen.getByRole("button", {
- name: "Hide user 4 in session header",
- });
- hideOverflowUser.focus();
- fireEvent.click(hideOverflowUser);
-
- const showOverflowUser = screen.getByRole("button", {
- name: "Show user 4 in session header",
- });
- expect(showOverflowUser).toBeInTheDocument();
- expect(showOverflowUser).toHaveFocus();
- expect(
- localStorage.getItem(sessionHeaderVisibilityStorageKey("project-1")),
- ).not.toContain(users[3]);
- });
-});
diff --git a/web/src/features/sessions/ModernSessionHeader.stories.tsx b/web/src/features/sessions/ModernSessionHeader.stories.tsx
index 5b77a4b854..1197346fa1 100644
--- a/web/src/features/sessions/ModernSessionHeader.stories.tsx
+++ b/web/src/features/sessions/ModernSessionHeader.stories.tsx
@@ -3,7 +3,6 @@ import { expect, fn, userEvent, waitFor, within } from "storybook/test";
import preview from "@/.storybook/preview";
import { ModernSessionHeader } from "@/src/features/sessions/ModernSessionHeader";
-import { sessionHeaderVisibilityStorageKey } from "@/src/features/sessions/sessionHeaderVisibility";
type SessionScore = ComponentProps<
typeof ModernSessionHeader
@@ -138,12 +137,12 @@ export const TestSearchesHiddenPills = meta.story({
await waitFor(() =>
expect(
canvas.getByRole("button", {
- name: /show \d+ hidden session details/i,
+ name: /show \d+ more session details/i,
}),
).toBeInTheDocument(),
);
const overflowButton = canvas.getByRole("button", {
- name: /show \d+ hidden session details/i,
+ name: /show \d+ more session details/i,
});
const visiblePills = canvasElement.querySelectorAll<HTMLElement>(
"[data-overflow-visible-item='true'] [data-session-header-pill='true']",
@@ -204,7 +203,7 @@ export const TestBoundsManyUsers = meta.story({
await userEvent.click(
canvas.getByRole("button", {
- name: /show \d+ hidden session details/i,
+ name: /show \d+ more session details/i,
}),
);
const body = within(canvasElement.ownerDocument.body);
@@ -340,86 +339,3 @@ export const TestCompactsTokenCounts = meta.story({
await expect(tokenPill).toHaveTextContent(/^655k\s*tokens$/);
},
});
-
-export const TestHidesAndRevealsDetails = meta.story({
- name: "(Test) Hides and reveals details",
- args: {
- ...defaultArgs,
- projectId: "project-header-visibility-story",
- },
- play: async ({ canvasElement }) => {
- const storageKey = sessionHeaderVisibilityStorageKey(
- "project-header-visibility-story",
- );
- const storedValue = JSON.stringify([]);
- localStorage.setItem(storageKey, storedValue);
- window.dispatchEvent(
- new CustomEvent("localStorageChange", {
- detail: { key: storageKey, newValue: storedValue },
- }),
- );
-
- const canvas = within(canvasElement);
- const hideTraceDetail = await canvas.findByRole("button", {
- name: "Hide trace count in session header",
- });
- const visibleTraceDetail = hideTraceDetail.closest(
- "[data-overflow-visible-item='true']",
- );
- await expect(visibleTraceDetail).toBeInTheDocument();
- hideTraceDetail.focus();
- await waitFor(() => expect(hideTraceDetail).toBeVisible());
- await expect(
- hideTraceDetail.getBoundingClientRect().width,
- ).toBeGreaterThanOrEqual(24);
- await expect(
- hideTraceDetail.getBoundingClientRect().height,
- ).toBeGreaterThanOrEqual(24);
- await userEvent.click(hideTraceDetail);
- await expect(
- canvas.queryByRole("button", {
- name: "Hide trace count in session header",
- }),
- ).not.toBeInTheDocument();
- await expect(
- JSON.parse(localStorage.getItem(storageKey) ?? "[]"),
- ).toContain("traces");
-
- const overflowButton = canvas.getByRole("button", {
- name: /show \d+ hidden session details/i,
- });
- await waitFor(() => expect(overflowButton).toHaveFocus());
- await userEvent.click(overflowButton);
- const body = within(canvasElement.ownerDocument.body);
- const overflowSearchInput = await body.findByRole("textbox", {
- name: "Search session details",
- });
- const showTraceDetail = await body.findByRole("button", {
- name: "Show trace count in session header",
- });
- showTraceDetail.focus();
- await waitFor(() => expect(showTraceDetail).toBeVisible());
- await userEvent.click(showTraceDetail);
-
- await expect(
- canvas.getByRole("button", {
- name: "Hide trace count in session header",
- }),
- ).toBeInTheDocument();
- await expect(localStorage.getItem(storageKey)).toBe(JSON.stringify([]));
- const metadataEditorButton = canvas.getByRole("button", {
- name: "Add metadata JSONPath",
- });
- await waitFor(() =>
- expect(
- [
- overflowSearchInput,
- metadataEditorButton,
- canvas.queryByRole("button", {
- name: /show \d+ hidden session details/i,
- }),
- ].filter(Boolean),
- ).toContain(canvasElement.ownerDocument.activeElement),
- );
- },
-});
diff --git a/web/src/features/sessions/ModernSessionHeader.tsx b/web/src/features/sessions/ModernSessionHeader.tsx
index 5836d30341..1eb2302920 100644
--- a/web/src/features/sessions/ModernSessionHeader.tsx
+++ b/web/src/features/sessions/ModernSessionHeader.tsx
@@ -1,20 +1,14 @@
/* eslint-disable no-nested-ternary */
import { ScoreBadge } from "@/src/components/ScoreBadge/ScoreBadge";
import { type ScoreDomain } from "@langfuse/shared";
-import { ArrowUpRight, Eye, EyeOff, Plus, Search, X } from "lucide-react";
-import { type ReactNode, type SyntheticEvent, useRef, useState } from "react";
+import { ArrowUpRight, Plus, Search, X } from "lucide-react";
+import { type ReactNode, type SyntheticEvent, useState } from "react";
import Link from "next/link";
import { Badge, BadgeShell } from "@/src/components/design-system/Badge/Badge";
import { SingleLineOverflowList } from "@/src/components/SingleLineOverflowList";
import { BreakdownTooltip } from "@/src/features/traces/components/BreakdownTooltip";
-import {
- MAX_STORED_HIDDEN_SESSION_HEADER_DETAILS,
- parseStoredHiddenSessionHeaderDetails,
- sessionHeaderDynamicDetailKey,
- sessionHeaderVisibilityStorageKey,
-} from "@/src/features/sessions/sessionHeaderVisibility";
import {
getMetadataJsonPathLabel,
resolveMetadataJsonPath,
@@ -33,7 +27,6 @@ import {
PopoverContent,
PopoverTrigger,
} from "@/src/components/ui/popover";
-import useLocalStorage from "@/src/components/useLocalStorage";
import { formatIntervalSeconds } from "@/src/utils/dates";
import { type WithStringifiedMetadata } from "@/src/utils/clientSideDomainTypes";
import {
@@ -41,7 +34,6 @@ import {
numberFormatter,
usdFormatter,
} from "@/src/utils/numbers";
-import { cn } from "@/src/utils/tailwind";
import { usePostHogClientCapture } from "@/src/features/posthog-analytics";
type ModernSessionHeaderProps = {
@@ -70,15 +62,10 @@ type SessionHeaderDetailType =
type SessionHeaderDetail = {
key: string;
searchText: string;
- visibilityLabel: string;
type: SessionHeaderDetailType;
content: ReactNode;
};
-type SessionHeaderDetailControlLocation = "header" | "overflow";
-
-const EMPTY_HIDDEN_SESSION_HEADER_DETAILS: readonly string[] = [];
-
const ChipKey = ({ children }: { children: React.ReactNode }) => (
<span>{children}</span>
);
@@ -112,50 +99,6 @@ const UserChip = ({ projectId, user }: { projectId: string; user: string }) => (
</Link>
);
-const SessionHeaderDetailWithVisibilityControl = ({
- detail,
- isHidden,
- location,
- onVisibilityChange,
-}: {
- detail: SessionHeaderDetail;
- isHidden: boolean;
- location: SessionHeaderDetailControlLocation;
- onVisibilityChange: (
- detail: SessionHeaderDetail,
- isHidden: boolean,
- location: SessionHeaderDetailControlLocation,
- control: HTMLButtonElement,
- ) => void;
-}) => {
- const action = isHidden ? "Show" : "Hide";
- return (
- <span
- className={cn(
- "group relative flex items-center",
- detail.type === "metadata" ? "pr-6" : "[@media(hover:none)]:pr-6",
- )}
- >
- {detail.content}
- <button
- type="button"
- aria-label={`${action} ${detail.visibilityLabel} in session header`}
- title={`${action} in session header`}
- className="bg-header hover:bg-muted focus-visible:ring-ring absolute right-0 inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-sm border opacity-0 shadow-sm transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 focus-visible:ring-1 focus-visible:outline-none [@media(hover:none)]:opacity-100"
- onClick={(event) =>
- onVisibilityChange(detail, !isHidden, location, event.currentTarget)
- }
- >
- {isHidden ? (
- <Eye aria-hidden="true" className="h-3 w-3" />
- ) : (
- <EyeOff aria-hidden="true" className="h-3 w-3" />
- )}
- </button>
- </span>
- );
-};
-
const resolveAgainstSource = (
source: FirstVisibleObservationMetadataState,
path: string,
@@ -334,17 +277,6 @@ export function ModernSessionHeader({
scores,
}: ModernSessionHeaderProps) {
const capture = usePostHogClientCapture();
- const [rawHiddenDetailKeys, setRawHiddenDetailKeys] =
- useLocalStorage<unknown>(
- sessionHeaderVisibilityStorageKey(projectId),
- EMPTY_HIDDEN_SESSION_HEADER_DETAILS,
- );
- const hiddenDetailKeys =
- parseStoredHiddenSessionHeaderDetails(rawHiddenDetailKeys);
- const hiddenDetailKeySet = new Set(hiddenDetailKeys);
- const overflowButtonRef = useRef<HTMLButtonElement>(null);
- const metadataEditorButtonRef = useRef<HTMLButtonElement>(null);
- const overflowSearchInputRef = useRef<HTMLInputElement>(null);
const [search, setSearch] = useState("");
const [visibleUserCount, setVisibleUserCount] = useState(
SESSION_USERS_PER_PAGE,
@@ -378,7 +310,6 @@ export function ModernSessionHeader({
{
key: "traces",
searchText: `traces ${countTraces}`,
- visibilityLabel: "trace count",
type: "traces",
content: (
<BadgeShell color="ghost" data-session-header-pill="true">
@@ -394,7 +325,6 @@ export function ModernSessionHeader({
pills.push({
key: "duration",
searchText: `duration ${durationSeconds}`,
- visibilityLabel: "duration",
type: "duration",
content: (
<Badge
@@ -409,7 +339,6 @@ export function ModernSessionHeader({
pills.push({
key: "cost",
searchText: `cost ${totalCost}`,
- visibilityLabel: "cost",
type: "cost",
content: (
<Badge
@@ -425,7 +354,6 @@ export function ModernSessionHeader({
pills.push({
key: "tokens",
searchText: `tokens ${tokensIn} ${tokensOut} ${totalTokens}`,
- visibilityLabel: "token usage",
type: "tokens",
content: (
<BreakdownTooltip
@@ -444,17 +372,17 @@ export function ModernSessionHeader({
}
const userDetails = users.map(
- (user, index): SessionHeaderDetail => ({
- key: sessionHeaderDynamicDetailKey("user", user),
+ (user): SessionHeaderDetail => ({
+ key: `user-${user}`,
searchText: `user ${user}`,
- visibilityLabel: `user ${index + 1}`,
type: "user",
content: <UserChip projectId={projectId} user={user} />,
}),
);
- const visibleUserDetails = userDetails
- .filter((detail) => !hiddenDetailKeySet.has(detail.key))
- .slice(0, INITIAL_SESSION_USERS_DISPLAY_COUNT);
+ const visibleUserDetails = userDetails.slice(
+ 0,
+ INITIAL_SESSION_USERS_DISPLAY_COUNT,
+ );
visibleUserDetails.forEach((detail) => pills.push(detail));
const visibleUserDetailKeySet = new Set(
visibleUserDetails.map((detail) => detail.key),
@@ -463,11 +391,10 @@ export function ModernSessionHeader({
(detail) => !visibleUserDetailKeySet.has(detail.key),
);
- scores.forEach((score, index) => {
+ scores.forEach((score) => {
pills.push({
- key: sessionHeaderDynamicDetailKey("score", score.id),
+ key: `score-${score.id}`,
searchText: `score ${score.name} ${scoreChipValue(score)}`,
- visibilityLabel: `score ${index + 1}`,
type: "score",
content: (
<span data-session-header-pill="true" className="inline-flex min-w-0">
@@ -477,15 +404,14 @@ export function ModernSessionHeader({
});
});
- metadataJsonPaths.paths.forEach((path, index) => {
+ metadataJsonPaths.paths.forEach((path) => {
const display = getConfiguredMetadataDisplay(
path,
metadataJsonPaths.source,
);
pills.push({
- key: sessionHeaderDynamicDetailKey("metadata", path),
+ key: `metadata-${path}`,
searchText: `metadata ${display.path} ${display.label} ${display.displayValue}`,
- visibilityLabel: `metadata ${index + 1}`,
type: "metadata",
content: (
<MetadataJsonPathPill
@@ -495,70 +421,15 @@ export function ModernSessionHeader({
),
});
});
- const visiblePills = pills.filter(
- (pill) => !hiddenDetailKeySet.has(pill.key),
- );
- const manuallyHiddenPills = pills.filter((pill) =>
- hiddenDetailKeySet.has(pill.key),
- );
- const changeDetailVisibility = (
- detail: SessionHeaderDetail,
- isHidden: boolean,
- location: SessionHeaderDetailControlLocation,
- control: HTMLButtonElement,
- ) => {
- if (hiddenDetailKeySet.has(detail.key) === isHidden) return;
-
- setRawHiddenDetailKeys((current: unknown) => {
- const currentKeys = parseStoredHiddenSessionHeaderDetails(current);
- return isHidden
- ? currentKeys
- .concat(detail.key)
- .slice(-MAX_STORED_HIDDEN_SESSION_HEADER_DETAILS)
- : currentKeys.filter((key) => key !== detail.key);
- });
- capture("session_detail:header_detail_visibility_changed", {
- action: isHidden ? "hide" : "show",
- detailType: detail.type,
- storedHiddenDetailCount: Math.min(
- Math.max(hiddenDetailKeys.length + (isHidden ? 1 : -1), 0),
- MAX_STORED_HIDDEN_SESSION_HEADER_DETAILS,
- ),
- isV4: true,
- });
- window.requestAnimationFrame(() => {
- if (control.isConnected) return;
-
- const preferredTarget =
- location === "overflow"
- ? overflowSearchInputRef.current
- : overflowButtonRef.current;
- (
- preferredTarget ??
- overflowButtonRef.current ??
- metadataEditorButtonRef.current
- )?.focus();
- });
- };
-
return (
<div className="border-b px-4 pt-0 pb-1.5">
<SingleLineOverflowList
spacing="comfortable"
- items={visiblePills}
- additionalOverflowCount={
- overflowUserDetails.length + manuallyHiddenPills.length
- }
+ items={pills}
+ additionalOverflowCount={overflowUserDetails.length}
getKey={(pill) => pill.key}
isTightItem={(pill) => pill.type === "score"}
- renderItem={(pill) => (
- <SessionHeaderDetailWithVisibilityControl
- detail={pill}
- isHidden={false}
- location="header"
- onVisibilityChange={changeDetailVisibility}
- />
- )}
+ renderItem={(pill) => pill.content}
trailingContent={
<Popover
open={isMetadataEditorOpen}
@@ -566,11 +437,7 @@ export function ModernSessionHeader({
>
<PopoverTrigger asChild>
<BadgeShell asChild data-session-header-pill="true">
- <button
- type="button"
- aria-label="Add metadata JSONPath"
- ref={metadataEditorButtonRef}
- >
+ <button type="button" aria-label="Add metadata JSONPath">
<Plus className="h-3 w-3" />
</button>
</BadgeShell>
@@ -584,16 +451,8 @@ export function ModernSessionHeader({
) : null}
</Popover>
}
- renderOverflow={({ hiddenItems: hiddenPills, overflowItemCount }) => {
+ renderOverflow={({ hiddenItems: overflowPills, overflowItemCount }) => {
const normalizedSearch = search.trim().toLocaleLowerCase();
- const overflowPillKeys = new Set(
- hiddenPills
- .map((pill) => pill.key)
- .concat(manuallyHiddenPills.map((pill) => pill.key)),
- );
- const overflowPills = pills.filter((pill) =>
- overflowPillKeys.has(pill.key),
- );
const filteredPills = normalizedSearch
? overflowPills.filter((pill) =>
pill.searchText.toLocaleLowerCase().includes(normalizedSearch),
@@ -622,8 +481,7 @@ export function ModernSessionHeader({
<BadgeShell asChild data-session-header-pill="true">
<button
type="button"
- aria-label={`Show ${overflowItemCount} hidden session details`}
- ref={overflowButtonRef}
+ aria-label={`Show ${overflowItemCount} more session details`}
>
+{overflowItemCount}
</button>
@@ -637,7 +495,6 @@ export function ModernSessionHeader({
<div className="relative border-b p-2">
<Search className="text-muted-foreground absolute top-1/2 left-4 h-3.5 w-3.5 -translate-y-1/2" />
<Input
- ref={overflowSearchInputRef}
value={search}
onChange={(event) => {
setSearch(event.target.value);
@@ -671,22 +528,14 @@ export function ModernSessionHeader({
{hasResults ? (
<>
{filteredPills.map((pill) => (
- <SessionHeaderDetailWithVisibilityControl
- key={pill.key}
- detail={pill}
- isHidden={hiddenDetailKeySet.has(pill.key)}
- location="overflow"
- onVisibilityChange={changeDetailVisibility}
- />
+ <span key={pill.key} className="flex items-center">
+ {pill.content}
+ </span>
))}
{visibleUsers.map((detail) => (
- <SessionHeaderDetailWithVisibilityControl
- key={detail.key}
- detail={detail}
- isHidden={hiddenDetailKeySet.has(detail.key)}
- location="overflow"
- onVisibilityChange={changeDetailVisibility}
- />
+ <span key={detail.key} className="flex items-center">
+ {detail.content}
+ </span>
))}
</>
) : (
diff --git a/web/src/features/sessions/sessionHeaderVisibility.ts b/web/src/features/sessions/sessionHeaderVisibility.ts
deleted file mode 100644
index b81dc648d2..0000000000
--- a/web/src/features/sessions/sessionHeaderVisibility.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/* eslint-disable @repo/no-exotic-operators */
-import { z } from "zod";
-
-export const MAX_STORED_HIDDEN_SESSION_HEADER_DETAILS = 1_000;
-
-const storedHiddenSessionHeaderDetailsSchema = z
- .array(z.string().min(1).max(2_000))
- .max(MAX_STORED_HIDDEN_SESSION_HEADER_DETAILS)
- .transform((keys) => Array.from(new Set(keys)));
-
-export type StoredHiddenSessionHeaderDetails = z.infer<
- typeof storedHiddenSessionHeaderDetailsSchema
->;
-
-export const sessionHeaderVisibilityStorageKey = (projectId: string) =>
- `modern-session:hidden-header-details:v1:${projectId}`;
-
-export const sessionHeaderDynamicDetailKey = (
- type: "metadata" | "score" | "user",
- identity: string,
-) => {
- let firstFingerprint = 2_166_136_261;
- let secondFingerprint = 2_654_435_769;
- for (let index = 0; index < identity.length; index += 1) {
- const codeUnit = identity.charCodeAt(index);
- firstFingerprint = Math.imul(firstFingerprint ^ codeUnit, 16_777_619);
- secondFingerprint = Math.imul(secondFingerprint ^ codeUnit, 2_246_822_519);
- }
- return `${type}-${(firstFingerprint >>> 0).toString(36)}-${(secondFingerprint >>> 0).toString(36)}`;
-};
-
-export const parseStoredHiddenSessionHeaderDetails = (
- raw: unknown,
-): StoredHiddenSessionHeaderDetails => {
- const result = storedHiddenSessionHeaderDetailsSchema.safeParse(raw);
- return result.success ? result.data : [];
-};