Skip to content

Commit 99edcb2

Browse files
committed
fix(webapp): correct webhook delivery empty-state and sample-picker loading
Two webhook dashboard views showed a misleading state. An empty deliveries list always rendered 'No deliveries match these filters' because the detail routes default the window to 7 days, so the presenter treated that default as an active filter. It now derives hasFilters from whether the user explicitly set a window, so a webhook that has never received anything shows the real empty state. The sample-event picker treated the provider list as loaded before its fetch had started, flashing 'No providers' on first open. It now shows the spinner until the data arrives.
1 parent 46da2cb commit 99edcb2

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

apps/webapp/app/components/webhookConsole/SampleSourcePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function SampleSourcePicker({
4242
const manifest = listFetcher.data?.kind === "manifest" ? listFetcher.data : undefined;
4343
const providers = manifest?.providers ?? [];
4444
const samples = manifest?.samples ?? [];
45-
const listLoading = listFetcher.data === undefined && listFetcher.state !== "idle";
45+
const listLoading = listFetcher.data === undefined;
4646

4747
useEffect(() => {
4848
if (providers.length === 0) return;

apps/webapp/app/presenters/v3/WebhookDetailPresenter.server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,7 @@ export class WebhookDetailPresenter {
577577
period,
578578
from,
579579
to,
580+
hasExplicitWindow,
580581
cursor,
581582
direction,
582583
}: {
@@ -587,6 +588,7 @@ export class WebhookDetailPresenter {
587588
period?: string;
588589
from?: number;
589590
to?: number;
591+
hasExplicitWindow?: boolean;
590592
cursor?: string;
591593
direction?: Direction;
592594
}): Promise<WebhookDeliveriesList> {
@@ -640,7 +642,7 @@ export class WebhookDetailPresenter {
640642
previous: pagination.previousCursor ?? undefined,
641643
},
642644
filters: { from, to },
643-
hasFilters: Boolean(period || from || to),
645+
hasFilters: hasExplicitWindow ?? Boolean(from || to),
644646
};
645647
}
646648
}

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.webhooks.$webhookParam/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
178178
period,
179179
from,
180180
to,
181+
hasExplicitWindow,
181182
cursor: deliveriesCursor,
182183
direction: deliveriesDirection,
183184
})

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.webhooks.endpoints.$endpointParam/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
131131
period,
132132
from,
133133
to,
134+
hasExplicitWindow,
134135
cursor,
135136
direction,
136137
})

0 commit comments

Comments
 (0)