From 63043c9cfe5c8bc65a5dc70689df7fa6e1f801ff Mon Sep 17 00:00:00 2001 From: "factorize-sh[bot]" <330188778+factorize-sh[bot]@users.noreply.github.com> Date: Mon, 30 Nov 2026 20:08:04 +0000 Subject: [PATCH] Simplify Events dashboard navigation --- packages/app/src/features/events/events.tsx | 38 ++++---------- packages/app/src/features/events/routes.tsx | 2 +- .../app/test/functional/critical.spec.mjs | 50 ++++++++++--------- 3 files changed, 38 insertions(+), 52 deletions(-) diff --git a/packages/app/src/features/events/events.tsx b/packages/app/src/features/events/events.tsx index 2783a8a5..b6eccb07 100644 --- a/packages/app/src/features/events/events.tsx +++ b/packages/app/src/features/events/events.tsx @@ -6,39 +6,30 @@ import { api } from "factorize-api-client"; import { Button, Page, PageHeader, Table, tableCellClasses, tableHeadClasses, tableRowClasses } from "../../shared/ui"; import { OccurrenceTable } from "./occurrence-table"; import { eventsQuery, subscriptionsQuery } from "./queries"; -import { EventSubscriptions, SubscriptionsTable, SubscriptionTime } from "./subscriptions-table"; +import { SubscriptionsTable, SubscriptionTime } from "./subscriptions-table"; -const linkClass = "rounded-lg px-3 py-2 hover:bg-stone-100 dark:hover:bg-slate-800"; -const activeClass = "bg-factorize-50 text-factorize-700 dark:bg-factorize-500/10 dark:text-factorize-500"; -function EventsLayout({ title, description, children, subscriptions }: { title: string; description?: string; children: ReactNode; subscriptions?: boolean }) { - return
- -
{children}
-
; +function EventsLayout({ title, description, children, back }: { title: string; description?: string; children: ReactNode; back?: boolean }) { + return + {back && Back to Events} + + {children} + ; } export function EventsPage() { const events = useQuery(eventsQuery); - const subscriptions = useQuery(subscriptionsQuery); - const counts = new Map(); - for (const row of subscriptions.data ?? []) if (row.status === "active") counts.set(row.eventId, (counts.get(row.eventId) ?? 0) + 1); return {events.isPending &&

Loading Events…

} {events.error &&

{events.error.message}

} - {subscriptions.error &&

Subscriber counts could not be loaded.

} {events.data?.length === 0 &&

No Events yet.

} {!!events.data?.length && - {["Name", "Description", "Subscribers"].map(label => - )} + {["Name", "Description"].map(label => + )}{events.data.map(item => - )}
{label}
{label}
{item.name} {item.description || "No description"}{subscriptions.error ? "—" : subscriptions.isPending ? "…" : counts.get(item.id) ?? 0}
}
; @@ -70,7 +61,7 @@ export function EventPage() { await navigate({ to: "/events" }); }, }); - return + return {events.isPending &&

Loading Event…

} {events.error &&

{events.error.message}

} {!events.isPending && !events.error && !event &&

Event not found.

} @@ -109,7 +100,6 @@ export function EventPage() {
{detail.data.enrichment.rule}

Read only. Edit this rule through the Factorize API or MCP.

} -

Subscriptions