diff --git a/apps/webapp/app/components/runs/v3/AddSmartColumnDialog.tsx b/apps/webapp/app/components/runs/v3/AddSmartColumnDialog.tsx index 1415cb9f8..ab3f27ff2 100644 --- a/apps/webapp/app/components/runs/v3/AddSmartColumnDialog.tsx +++ b/apps/webapp/app/components/runs/v3/AddSmartColumnDialog.tsx @@ -34,6 +34,12 @@ type AddSmartColumnDialogProps = { onOpenChange: (open: boolean) => void; onSubmit: (def: SmartColumnDef) => void; currentSearch: string; + /** + * Extra filters merged into the sample request so the preview samples the + * runs the host page actually lists (e.g. its task or error), for pages that + * carry that scope in the route path rather than the query string. + */ + sampleFilters?: Record; }; const SOURCE_CARDS: { value: SmartColumnSource; label: string; description: string }[] = [ @@ -55,6 +61,7 @@ export function AddSmartColumnDialog({ onOpenChange, onSubmit, currentSearch, + sampleFilters, }: AddSmartColumnDialogProps) { const organization = useOrganization(); const project = useProject(); @@ -78,10 +85,17 @@ export function AddSmartColumnDialog({ setSampleIndex(0); }, [open, editing]); + const sampleFiltersKey = sampleFilters ? JSON.stringify(sampleFilters) : ""; const sampleUrl = useMemo(() => { const base = `/resources/orgs/${organization.slug}/projects/${project.slug}/env/${environment.slug}/runs/smart-column-sample`; - return currentSearch ? `${base}?${currentSearch.replace(/^\?/, "")}` : base; - }, [organization.slug, project.slug, environment.slug, currentSearch]); + const params = new URLSearchParams(currentSearch.replace(/^\?/, "")); + if (sampleFilters) { + for (const [key, val] of Object.entries(sampleFilters)) params.set(key, val); + } + const qs = params.toString(); + return qs ? `${base}?${qs}` : base; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [organization.slug, project.slug, environment.slug, currentSearch, sampleFiltersKey]); useEffect(() => { if (open && sample.state === "idle") { diff --git a/apps/webapp/app/components/runs/v3/RunsDisplayOptions.tsx b/apps/webapp/app/components/runs/v3/RunsDisplayOptions.tsx index 6469ca31b..c516da84d 100644 --- a/apps/webapp/app/components/runs/v3/RunsDisplayOptions.tsx +++ b/apps/webapp/app/components/runs/v3/RunsDisplayOptions.tsx @@ -33,7 +33,11 @@ function keyFor(col: ResolvedColumn): string { type SmartEditTarget = { index: number; def: SmartColumnDef }; -export function RunsDisplayOptions() { +export function RunsDisplayOptions({ + sampleFilters, +}: { + sampleFilters?: Record; +} = {}) { const environment = useEnvironment(); const { isManagedCloud } = useFeatures(); const location = useOptimisticLocation(); @@ -201,6 +205,7 @@ export function RunsDisplayOptions() { }} onSubmit={submitSmart} currentSearch={location.search} + sampleFilters={sampleFilters} /> ); diff --git a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx index 3892198e1..b8bfab927 100644 --- a/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx +++ b/apps/webapp/app/components/runs/v3/TaskRunsTable.tsx @@ -91,6 +91,13 @@ type RunsTableProps = { showTopBorder?: boolean; stickyHeader?: boolean; childrenStatusesBasePath?: string; + /** + * Whether URL-driven smart columns render here. Default true; embedded run + * tables whose loader does not hydrate payload/metadata/output (schedule + * inspector, waitpoint, webhook) pass false so they never show a column they + * cannot fill. + */ + enableSmartColumns?: boolean; /** * Display-only write:runs flags from the caller's loader. Default true so * callers that don't pass them (and OSS, where the ability is permissive) @@ -573,6 +580,7 @@ export function TaskRunsTable({ showTopBorder = true, stickyHeader = false, childrenStatusesBasePath, + enableSmartColumns = true, canCancelRuns = true, canReplayRuns = true, }: RunsTableProps) { @@ -610,7 +618,10 @@ export function TaskRunsTable({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [colsParam, hideParam, scKey, isManagedCloud, isDevelopment]); - const visibleColumns = layout.visible; + const visibleColumns = useMemo( + () => (enableSmartColumns ? layout.visible : layout.visible.filter((c) => c.kind !== "smart")), + [layout, enableSmartColumns] + ); const referencedSources = useMemo(() => visibleSmartSources(visibleColumns), [visibleColumns]); const sourcesByRunId = useMemo(() => { diff --git a/apps/webapp/app/components/schedules/ScheduleInspector.tsx b/apps/webapp/app/components/schedules/ScheduleInspector.tsx index 5b65b73af..6f6874d2b 100644 --- a/apps/webapp/app/components/schedules/ScheduleInspector.tsx +++ b/apps/webapp/app/components/schedules/ScheduleInspector.tsx @@ -184,6 +184,7 @@ export function ScheduleInspector({
Last 5 runs ) : ( <> - + {(list) => (list ? : null)} diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.errors.$fingerprint/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.errors.$fingerprint/route.tsx index 3aa7f1002..f4035b622 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.errors.$fingerprint/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.errors.$fingerprint/route.tsx @@ -537,7 +537,12 @@ function ErrorGroupDetail({ > Bulk replay… - +
)} diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.tasks.scheduled.$taskParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.tasks.scheduled.$taskParam/route.tsx index 9b5d9cd72..684dceef7 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.tasks.scheduled.$taskParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.tasks.scheduled.$taskParam/route.tsx @@ -372,7 +372,7 @@ export default function Page() { onClick={() => showNewRunsRef.current()} /> ) : null} - + {(list) => (list ? : null)} diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.tasks.standard.$taskParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.tasks.standard.$taskParam/route.tsx index 673469039..ffd7a400b 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.tasks.standard.$taskParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.tasks.standard.$taskParam/route.tsx @@ -269,7 +269,7 @@ export default function Page() { onClick={() => showNewRunsRef.current()} /> ) : null} - + {(list) => (list ? : null)} diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.waitpoints.tokens.$waitpointParam/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.waitpoints.tokens.$waitpointParam/route.tsx index 232ad8d7c..8903e53ed 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.waitpoints.tokens.$waitpointParam/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.waitpoints.tokens.$waitpointParam/route.tsx @@ -136,6 +136,7 @@ export default function Page() {