Skip to content

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

fix(topics): polish result spacing and processing time ranges (#18876)

Lysander Kiesel35a9ddad9d03
diff --git a/web/src/features/topics/CurrentTopicsView.stories.tsx b/web/src/features/topics/CurrentTopicsView.stories.tsx
index 95f99c2627..1057655ca4 100644
--- a/web/src/features/topics/CurrentTopicsView.stories.tsx
+++ b/web/src/features/topics/CurrentTopicsView.stories.tsx
@@ -80,6 +80,44 @@ const meta = preview.meta({
export const Default = meta.story({});
+export const LongTopicNames = meta.story({
+ args: {
+ facet: {
+ ...facet,
+ topics: [
+ { ...topic, name: "Unresolved issue handling failures" },
+ {
+ ...topic,
+ id: "results",
+ name: "Unsupported or incomplete final task results",
+ },
+ ],
+ rows: [
+ {
+ ...rows[0],
+ topicName: "Unresolved issue handling failures",
+ summary:
+ "The troubleshooting step claimed success without verifying that sending messages worked.",
+ },
+ {
+ ...rows[1],
+ topicId: "results",
+ topicName: "Unsupported or incomplete final task results",
+ outcome: "assigned",
+ },
+ { ...rows[2], topicId: null, topicName: null, outcome: "outlier" },
+ {
+ ...rows[3],
+ topicId: null,
+ topicName: null,
+ outcome: "insufficient_input",
+ summary: "",
+ },
+ ],
+ },
+ },
+});
+
export const FilteringResetsPagination = meta.story({
name: "(Test) Filtering Resets Pagination and Shares Map Matches",
play: async ({ canvasElement }) => {
diff --git a/web/src/features/topics/CurrentTopicsView.tsx b/web/src/features/topics/CurrentTopicsView.tsx
index 07fe9eeecf..86c01fa1de 100644
--- a/web/src/features/topics/CurrentTopicsView.tsx
+++ b/web/src/features/topics/CurrentTopicsView.tsx
@@ -315,7 +315,7 @@ function CurrentTraceTable({
});
}
return (
- <div className="flex flex-col items-start gap-1 py-1">
+ <div className="flex flex-col items-start gap-1">
{isMobile && (
<div className="flex w-full min-w-0 items-center justify-between gap-2">
<div className="min-w-0">
@@ -373,7 +373,7 @@ function CurrentTraceTable({
}}
topAlignCells
className="min-h-0 overscroll-contain"
- cellPadding="compact"
+ cellPadding="comfortable"
noResultsMessage="No matches. Adjust or clear your filters."
peekView={peekView}
/>
diff --git a/web/src/features/topics/ManualTopicsDialog.stories.tsx b/web/src/features/topics/ManualTopicsDialog.stories.tsx
index 99a2b535f8..33e5a51c1c 100644
--- a/web/src/features/topics/ManualTopicsDialog.stories.tsx
+++ b/web/src/features/topics/ManualTopicsDialog.stories.tsx
@@ -585,3 +585,29 @@ export const PastedBatch = meta.story({
await expect(args.onSubmit).toHaveBeenCalledTimes(1);
},
});
+
+export const MultiMonthSummaryRange = meta.story({
+ name: "(Test) Selects trace summaries across multiple months",
+ args: {
+ operation: "update",
+ generationTimeRange: {
+ from: new Date(2025, 7, 1),
+ to: new Date(2025, 7, 7),
+ },
+ },
+ play: async ({ canvasElement, args }) => {
+ const body = within(canvasElement.ownerDocument.body);
+ const dialog = within(
+ body.getByRole("dialog", { name: "Manual processing" }),
+ );
+ await userEvent.click(dialog.getByRole("button", { name: /Aug/ }));
+ await userEvent.click(body.getByText("Select from calendar"));
+ await userEvent.click(await body.findByLabelText(/August 1st, 2025/));
+ await userEvent.click(body.getByLabelText(/next month/i));
+ await userEvent.click(body.getByLabelText(/September 15th, 2025/));
+ await expect(args.onGenerationTimeRangeChange).toHaveBeenLastCalledWith({
+ from: new Date(2025, 7, 1),
+ to: new Date(2025, 8, 15, 23, 59, 59, 999),
+ });
+ },
+});
diff --git a/web/src/features/topics/ManualTopicsDialog.tsx b/web/src/features/topics/ManualTopicsDialog.tsx
index 165240a014..cc2250ef77 100644
--- a/web/src/features/topics/ManualTopicsDialog.tsx
+++ b/web/src/features/topics/ManualTopicsDialog.tsx
@@ -147,12 +147,14 @@ export function ManualTopicsDialog({
<Stepper
number={2}
title={
- operation === "process" ? "Select traces" : "Select summaries"
+ operation === "process"
+ ? "Select traces"
+ : "Select trace summaries"
}
description={
operation === "process"
? "Set your filters or paste trace IDs. Preview matching traces and choose the batch to run. Previewing does not use a model."
- : "Time range of stored summaries to use for clustering and topic generation."
+ : "Use stored summaries of traces that started within this time range for clustering and topic generation."
}
>
<section hidden={operation !== "process"}>
@@ -163,8 +165,13 @@ export function ManualTopicsDialog({
<TimeRangePicker
timeRange={generationTimeRange}
onTimeRangeChange={onGenerationTimeRangeChange}
- timeRangePresets={["last1Day", "last7Days", "last30Days"]}
- maxRangeMs={30 * 86_400_000}
+ timeRangePresets={[
+ "last1Day",
+ "last7Days",
+ "last30Days",
+ "last90Days",
+ ]}
+ maxRangeMs={90 * 86_400_000}
className="my-0"
/>
</section>
diff --git a/web/src/features/topics/README.md b/web/src/features/topics/README.md
index 7abeebadf1..687dfc21d4 100644
--- a/web/src/features/topics/README.md
+++ b/web/src/features/topics/README.md
@@ -69,7 +69,9 @@ project permissions. Processing additionally requires the project allowlist.
topics. Trace selection includes filters, IDs, time ranges, a maximum batch size,
and exclusions. Stored summary and embedding reuse is enabled by default in Review & Run.
The dialog uses the evaluator stepper: Choose facets, Select traces, and
- Review & Run. Generate topics uses Select summaries for the second step.
+ Review & Run. Generate topics uses Select trace summaries for the second step;
+ its time range filters by the trace start time. Both manual-processing pickers
+ limit custom ranges to 90 days, matching the Topics header.
All steps start expanded; model details and reuse settings live in review.
Preview trace clicks open a new tab, preserving the run dialog and selection.
Without a compatible map, summaries wait for an explicit Update topics run.
diff --git a/web/src/features/topics/TopicTraceSelectorView.tsx b/web/src/features/topics/TopicTraceSelectorView.tsx
index 1456f89410..0eb54dfec3 100644
--- a/web/src/features/topics/TopicTraceSelectorView.tsx
+++ b/web/src/features/topics/TopicTraceSelectorView.tsx
@@ -139,7 +139,7 @@ export function TopicTraceSelectorView({
"last30Days",
"last90Days",
]}
- maxRangeMs={93 * 86_400_000}
+ maxRangeMs={90 * 86_400_000}
className="my-0"
/>
</div>
@@ -227,7 +227,7 @@ export function TopicTraceSelectorView({
<Alert variant="destructive" size="sm">
<Alert.Description>
<p className="break-words">
- Choose a start before the end, within a 93-day window.
+ Choose a start before the end, within a 90-day window.
</p>
</Alert.Description>
</Alert>
diff --git a/web/src/features/topics/TopicsFilters.stories.tsx b/web/src/features/topics/TopicsFilters.stories.tsx
index 8d35f6aa84..380ba0ba45 100644
--- a/web/src/features/topics/TopicsFilters.stories.tsx
+++ b/web/src/features/topics/TopicsFilters.stories.tsx
@@ -7,6 +7,8 @@ import { TopicsFilters } from "./TopicsFilters";
const filterArgs = {
facets: [
{ facetId: "intent", name: "Intent" },
+ { facetId: "sentiment", name: "Sentiment" },
+ { facetId: "outcome", name: "Outcome" },
{ facetId: "issues", name: "Issues" },
],
selectedFacetId: undefined,
diff --git a/web/src/features/topics/TopicsFilters.tsx b/web/src/features/topics/TopicsFilters.tsx
index 268a5995fb..6df589bb9a 100644
--- a/web/src/features/topics/TopicsFilters.tsx
+++ b/web/src/features/topics/TopicsFilters.tsx
@@ -26,7 +26,7 @@ export function TopicsFilters({
label={facet.name}
/>
))}
- <div className="flex shrink-0 items-center gap-2 px-3">
+ <div className="flex shrink-0 items-center gap-1 px-2">
<Button
text="Custom facet"
icon={Plus}
diff --git a/web/src/features/topics/time-range.ts b/web/src/features/topics/time-range.ts
index cf563fbcb4..f8eaa35698 100644
--- a/web/src/features/topics/time-range.ts
+++ b/web/src/features/topics/time-range.ts
@@ -10,7 +10,7 @@ export function relativeTopicTimeRange(days: number, to = new Date()) {
export function isValidTopicTimeRange(range: TopicTimeRange) {
return (
range.from < range.to &&
- range.to.getTime() - range.from.getTime() <= 93 * DAY
+ range.to.getTime() - range.from.getTime() <= 90 * DAY
);
}