(null);
- const shown = typing ?? analyzed?.toLocaleString() ?? "";
- const finishTyping = () => {
- setTyping(null);
- if (cap != null && sampled !== undefined && cap >= sampled) setCap(null);
- };
return (
<>
@@ -47,7 +95,15 @@ export function SampleFields({ eligible }: SampleFieldsProps) {
control={control}
name="selection.lookback_hours"
render={({ field }) => (
-
+ {
+ if (hours !== field.value) dropPicks();
+ field.onChange(hours);
+ }}
+ />
)}
/>
{selectionErrors?.lookback_hours?.message}
@@ -60,38 +116,18 @@ export function SampleFields({ eligible }: SampleFieldsProps) {
{eligible === undefined ? `${percent}% of matching runs` : `${percent}% of ${eligible.toLocaleString()}`}
-
-
- {capped ? (
-
- ) : (
- Type a number to cap
)}
-
+ />
();
+ const dropPicks = useDropPicks();
return (
Runs to review
@@ -16,7 +17,17 @@ export function ScopeFields({ runs, range }: ScopeOptions) {
}
+ render={({ field }) => (
+ {
+ if (q !== field.value) dropPicks();
+ field.onChange(q);
+ }}
+ runs={runs}
+ range={range}
+ />
+ )}
/>
diff --git a/ui/litellm-dashboard/src/components/lens/setup/useMatchingActivity.ts b/ui/litellm-dashboard/src/components/lens/setup/useMatchingActivity.ts
index 8384e717c16..4c417d68734 100644
--- a/ui/litellm-dashboard/src/components/lens/setup/useMatchingActivity.ts
+++ b/ui/litellm-dashboard/src/components/lens/setup/useMatchingActivity.ts
@@ -18,6 +18,14 @@ type PreviewPageData = Pick;
export type { Execution };
+/** Hand-picked runs belong to the search and window they were picked from, so changing either drops them. */
+export function useDropPicks(): () => void {
+ const { getValues, setValue } = useFormContext();
+ return useCallback(() => {
+ if (getValues("selection.execution_ids").length) setValue("selection.execution_ids", []);
+ }, [getValues, setValue]);
+}
+
/** What the search box needs: the runs already previewed suggest values, and the window bounds the copied query. */
export interface ScopeOptions {
readonly runs: readonly TraceSummary[];