Skip to content

Open-source status page, incident response and uptime monitoring

feat(dashboard): minor improvements (#2347)

Maximilian Kaskef7dc9efe973f
diff --git a/apps/dashboard/src/app/(dashboard)/layout.tsx b/apps/dashboard/src/app/(dashboard)/layout.tsx
index 425081dcf..93d3f2b0a 100644
--- a/apps/dashboard/src/app/(dashboard)/layout.tsx
+++ b/apps/dashboard/src/app/(dashboard)/layout.tsx
@@ -2,7 +2,9 @@ import {
SidebarInset,
SidebarProvider,
} from "@openstatus/ui/components/ui/sidebar";
+import { cookies } from "next/headers";
+import { DismissedNotesProvider } from "@/components/common/note-dismissible";
import { AppSidebar } from "@/components/nav/app-sidebar";
import {
LEFT_SIDEBAR_COOKIE,
@@ -16,17 +18,24 @@ export default async function Layout({
children: React.ReactNode;
}) {
const defaultOpen = await getSidebarDefaultOpen(LEFT_SIDEBAR_COOKIE, true);
+ const cookieStore = await cookies();
+ const dismissedNotes = cookieStore
+ .getAll()
+ .filter((c) => c.name.startsWith("note_") && c.value === "false")
+ .map((c) => c.name);
return (
- <HydrateSidebar>
- <SidebarProvider
- defaultOpen={defaultOpen}
- cookieName={LEFT_SIDEBAR_COOKIE}
- >
- <AppSidebar />
- <SidebarInset>{children}</SidebarInset>
- </SidebarProvider>
- </HydrateSidebar>
+ <DismissedNotesProvider dismissed={dismissedNotes}>
+ <HydrateSidebar>
+ <SidebarProvider
+ defaultOpen={defaultOpen}
+ cookieName={LEFT_SIDEBAR_COOKIE}
+ >
+ <AppSidebar />
+ <SidebarInset>{children}</SidebarInset>
+ </SidebarProvider>
+ </HydrateSidebar>
+ </DismissedNotesProvider>
);
}
diff --git a/apps/dashboard/src/app/(dashboard)/overview/create-event-button-group.tsx b/apps/dashboard/src/app/(dashboard)/overview/create-event-button-group.tsx
new file mode 100644
index 000000000..b6993c532
--- /dev/null
+++ b/apps/dashboard/src/app/(dashboard)/overview/create-event-button-group.tsx
@@ -0,0 +1,59 @@
+"use client";
+
+import { Button } from "@openstatus/ui/components/ui/button";
+import { ButtonGroup } from "@openstatus/ui/components/ui/button-group";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@openstatus/ui/components/ui/dropdown-menu";
+import { ChevronDown, Plus } from "lucide-react";
+import { useRef } from "react";
+
+import { FormSheetMaintenanceCreate } from "@/components/forms/maintenance/sheet-create";
+import { FormSheetStatusReportCreate } from "@/components/forms/status-report/sheet-create";
+
+export function CreateEventButtonGroup() {
+ // the maintenance sheet lives outside the dropdown — a trigger inside
+ // DropdownMenuContent unmounts (and closes the sheet) when the menu closes
+ const maintenanceButtonRef = useRef<HTMLButtonElement>(null);
+
+ return (
+ <div>
+ <ButtonGroup>
+ <FormSheetStatusReportCreate>
+ <Button data-section="action" variant="outline" size="sm">
+ <Plus />
+ Create Status Report
+ </Button>
+ </FormSheetStatusReportCreate>
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button
+ variant="outline"
+ size="sm"
+ aria-label="More create options"
+ className="pl-2!"
+ >
+ <ChevronDown />
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ <DropdownMenuItem
+ onSelect={() => maintenanceButtonRef.current?.click()}
+ >
+ <Plus className="text-muted-foreground" />
+ Create Maintenance
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </ButtonGroup>
+ <FormSheetMaintenanceCreate>
+ <button ref={maintenanceButtonRef} type="button" className="sr-only">
+ Open sheet
+ </button>
+ </FormSheetMaintenanceCreate>
+ </div>
+ );
+}
diff --git a/apps/dashboard/src/app/(dashboard)/overview/data-table-status-reports.tsx b/apps/dashboard/src/app/(dashboard)/overview/data-table-status-reports.tsx
deleted file mode 100644
index 3e21a7b1e..000000000
--- a/apps/dashboard/src/app/(dashboard)/overview/data-table-status-reports.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-"use client";
-
-import type { RouterOutputs } from "@openstatus/api";
-
-import { DataTable as UpdatesDataTable } from "@/components/data-table/status-report-updates/data-table";
-import { columns as statusReportsColumns } from "@/components/data-table/status-reports/columns";
-import { DataTable } from "@/components/ui/data-table/data-table";
-
-type StatusReport = RouterOutputs["statusReport"]["list"][number];
-
-export function DataTableStatusReports({
- statusReports,
-}: {
- statusReports: StatusReport[];
-}) {
- return (
- <DataTable
- columns={statusReportsColumns}
- data={statusReports}
- onRowClick={(row) =>
- row.getCanExpand() ? row.toggleExpanded() : undefined
- }
- rowComponent={({ row }) => (
- <UpdatesDataTable
- updates={row.original.updates}
- reportId={row.original.id}
- />
- )}
- />
- );
-}
diff --git a/apps/dashboard/src/app/(dashboard)/overview/layout.tsx b/apps/dashboard/src/app/(dashboard)/overview/layout.tsx
index b205d9c87..5c7e0e83a 100644
--- a/apps/dashboard/src/app/(dashboard)/overview/layout.tsx
+++ b/apps/dashboard/src/app/(dashboard)/overview/layout.tsx
@@ -18,21 +18,10 @@ export default async function Layout({
await queryClient.prefetchQuery(trpc.monitor.list.queryOptions());
await queryClient.prefetchQuery(trpc.page.list.queryOptions());
- await queryClient.prefetchQuery(
- trpc.incident.list.queryOptions({
- period: "7d",
- }),
- );
- await queryClient.prefetchQuery(
- trpc.statusReport.list.queryOptions({
- period: "7d",
- }),
- );
- await queryClient.prefetchQuery(
- trpc.maintenance.list.queryOptions({
- period: "7d",
- }),
- );
+ // inputs must match page.tsx's queries exactly — a differing input misses the cache
+ await queryClient.prefetchQuery(trpc.incident.list.queryOptions());
+ await queryClient.prefetchQuery(trpc.statusReport.list.queryOptions({}));
+ await queryClient.prefetchQuery(trpc.maintenance.list.queryOptions());
return (
<HydrateClient>
diff --git a/apps/dashboard/src/app/(dashboard)/overview/page.tsx b/apps/dashboard/src/app/(dashboard)/overview/page.tsx
index 8bf22cc3a..dd9ac4f0f 100644
--- a/apps/dashboard/src/app/(dashboard)/overview/page.tsx
+++ b/apps/dashboard/src/app/(dashboard)/overview/page.tsx
@@ -1,11 +1,11 @@
"use client";
import { useQuery } from "@tanstack/react-query";
-import { formatDistanceToNowStrict } from "date-fns";
-import { Bot, List, Search } from "lucide-react";
+import { Bot } from "lucide-react";
import Link from "next/link";
-import { Note, NoteButton } from "@/components/common/note";
+import { NoteButton } from "@/components/common/note";
+import { NoteDismissible } from "@/components/common/note-dismissible";
import {
EmptyStateContainer,
EmptyStateTitle,
@@ -14,146 +14,72 @@ import {
SectionDescription,
SectionGroup,
SectionHeader,
+ SectionHeaderRow,
SectionTitle,
} from "@/components/content/section";
import { Section } from "@/components/content/section";
-import { columns as incidentsColumns } from "@/components/data-table/incidents/columns";
-import { columns as maintenancesColumns } from "@/components/data-table/maintenances/columns";
+import { columns } from "@/components/data-table/overview-events/columns";
import {
MetricCard,
MetricCardGroup,
MetricCardHeader,
+ MetricCardLink,
MetricCardTitle,
MetricCardValue,
} from "@/components/metric/metric-card";
import { DataTable } from "@/components/ui/data-table/data-table";
+import { buildOverviewData } from "@/data/overview-events.client";
import { useTRPC } from "@/lib/trpc/client";
-import { cn } from "@/lib/utils";
-import { DataTableStatusReports } from "./data-table-status-reports";
-
-// FIXME: the page is server side
-// whenever I change the maintenances, the page is not updated
-// we need to move the queryClient to the layout and prefetch the data there
+import { CreateEventButtonGroup } from "./create-event-button-group";
export default function Page() {
const trpc = useTRPC();
const { data: monitors } = useQuery(trpc.monitor.list.queryOptions());
const { data: pages } = useQuery(trpc.page.list.queryOptions());
- const { data: incidents } = useQuery(
- trpc.incident.list.queryOptions({
- period: "7d",
- }),
- );
+ // no period — an incident open for weeks must still surface here
+ const { data: incidents } = useQuery(trpc.incident.list.queryOptions());
const { data: statusReports } = useQuery(
- trpc.statusReport.list.queryOptions({
- period: "7d",
- }),
- );
- const { data: maintenances } = useQuery(
- trpc.maintenance.list.queryOptions({
- period: "7d",
- }),
+ trpc.statusReport.list.queryOptions({}),
);
+ const { data: maintenances } = useQuery(trpc.maintenance.list.queryOptions());
if (!monitors || !pages || !incidents || !statusReports || !maintenances)
return null;
- const lastIncident = incidents.length > 0 ? incidents[0] : null;
- const lastStatusReport = statusReports.length > 0 ? statusReports[0] : null;
- const lastMaintenance = maintenances.length > 0 ? maintenances[0] : null;
-
- const incidentDistance = lastIncident
- ? formatDistanceToNowStrict(lastIncident.startedAt, {
- addSuffix: true,
- })
- : "None";
-
- const statusReportDistance = lastStatusReport?.createdAt
- ? formatDistanceToNowStrict(lastStatusReport.createdAt, {
- addSuffix: true,
- })
- : "None";
-
- const maintenanceDistance = lastMaintenance?.createdAt
- ? formatDistanceToNowStrict(lastMaintenance.createdAt, {
- addSuffix: true,
- })
- : "None";
-
- const metrics = [
- {
- title: "Monitors",
- value: monitors.length,
- href: "/monitors",
- variant: "default" as const,
- icon: List,
- },
- {
- title: "Status Pages",
- value: pages.length,
- href: "/status-pages",
- variant: "default" as const,
- icon: List,
- },
- {
- title:
- lastIncident?.resolvedAt === undefined && lastIncident
- ? "Active Incident"
- : "Recent Incident",
- value: incidentDistance,
- disabled: !lastIncident?.monitorId,
- href: `/monitors/${lastIncident?.monitorId}/incidents`,
- variant:
- lastIncident?.resolvedAt === undefined && lastIncident
- ? ("warning" as const)
- : ("default" as const),
- icon: Search,
- },
- {
- title: "Last Report",
- value: statusReportDistance,
- disabled: !lastStatusReport?.pageId,
- href: `/status-pages/${lastStatusReport?.pageId}/status-reports`,
- variant: "default" as const,
- icon: Search,
- },
- {
- title: "Last Maintenance",
- value: maintenanceDistance,
- disabled: !lastMaintenance?.pageId,
- href: `/status-pages/${lastMaintenance?.pageId}/maintenances`,
- variant: "default" as const,
- icon: Search,
- },
- ];
+ const { needsAttention, upcomingMaintenances, recentlyResolved, metrics } =
+ buildOverviewData({
+ monitors,
+ pages,
+ incidents,
+ statusReports,
+ maintenances,
+ });
return (
<SectionGroup>
- <Note>
+ <NoteDismissible cookieKey="note_overview_slack_agent">
<Bot />
Use our Slack agent to manage your status pages and incidents.
<NoteButton variant="default" asChild>
<Link href="/agents">Learn more</Link>
</NoteButton>
- </Note>
+ </NoteDismissible>
<Section>
- <SectionHeader>
- <SectionTitle>Overview</SectionTitle>
- <SectionDescription>
- Welcome to your OpenStatus dashboard.
- </SectionDescription>
- </SectionHeader>
+ <SectionHeaderRow>
+ <SectionHeader>
+ <SectionTitle>Overview</SectionTitle>
+ <SectionDescription>
+ Welcome to your OpenStatus dashboard.
+ </SectionDescription>
+ </SectionHeader>
+ {pages.length > 0 ? <CreateEventButtonGroup /> : null}
+ </SectionHeaderRow>
<MetricCardGroup>
- {metrics.map((metric) => (
- <Link
- href={metric.href}
- key={metric.title}
- className={cn(metric.disabled && "pointer-events-none")}
- aria-disabled={metric.disabled}
- >
- <MetricCard variant={metric.variant}>
+ {metrics.map((metric) => {
+ const content = (
+ <>
<MetricCardHeader className="flex items-center justify-between gap-2">
<MetricCardTitle className="truncate">
{metric.title}
@@ -161,51 +87,80 @@ export default function Page() {
<metric.icon className="size-4" />
</MetricCardHeader>
<MetricCardValue>{metric.value}</MetricCardValue>
+ </>
+ );
+ return metric.href ? (
+ <MetricCardLink
+ key={metric.title}
+ href={metric.href}
+ variant={metric.variant}
+ >
+ {content}
+ </MetricCardLink>
+ ) : (
+ <MetricCard key={metric.title} variant={metric.variant}>
+ {content}
</MetricCard>
- </Link>
- ))}
+ );
+ })}
</MetricCardGroup>
</Section>
<Section>
<SectionHeader>
- <SectionTitle>Incidents</SectionTitle>
+ <SectionTitle>Needs Attention</SectionTitle>
<SectionDescription>
- Incidents over the last 7 days.
+ Everything currently unresolved, newest first.
</SectionDescription>
</SectionHeader>
- {incidents.length > 0 ? (
- <DataTable columns={incidentsColumns} data={incidents} />
- ) : (
- <EmptyStateContainer>
- <EmptyStateTitle>No incidents found</EmptyStateTitle>
- </EmptyStateContainer>
- )}
- </Section>
- <Section>
- <SectionHeader>
- <SectionTitle>Reports</SectionTitle>
- <SectionDescription>Reports over the last 7 days.</SectionDescription>
- </SectionHeader>
- {statusReports.length > 0 ? (
- <DataTableStatusReports statusReports={statusReports} />
+ {needsAttention.length > 0 ? (
+ <DataTable
+ columns={columns}
+ data={needsAttention}
+ defaultSorting={[{ id: "startedAt", desc: true }]}
+ defaultColumnVisibility={{ duration: false, endsAt: false }}
+ />
) : (
<EmptyStateContainer>
- <EmptyStateTitle>No reports found</EmptyStateTitle>
+ <EmptyStateTitle>
+ All clear - nothing needs your attention
+ </EmptyStateTitle>
</EmptyStateContainer>
)}
</Section>
+ {upcomingMaintenances.length > 0 ? (
+ <Section>
+ <SectionHeader>
+ <SectionTitle>Scheduled Maintenance</SectionTitle>
+ <SectionDescription>
+ Upcoming and in-progress maintenance windows.
+ </SectionDescription>
+ </SectionHeader>
+ <DataTable
+ columns={columns}
+ data={upcomingMaintenances}
+ defaultSorting={[{ id: "startedAt", desc: false }]}
+ defaultColumnVisibility={{ action: false, duration: false }}
+ />
+ </Section>
+ ) : null}
<Section>
<SectionHeader>
- <SectionTitle>Maintenance</SectionTitle>
+ <SectionTitle>Recent Activity</SectionTitle>
<SectionDescription>
- Maintenance over the last 7 days.
+ Resolved incidents and reports, and completed maintenances from the
+ last 7 days.
</SectionDescription>
</SectionHeader>
- {maintenances.length > 0 ? (
- <DataTable columns={maintenancesColumns} data={maintenances} />
+ {recentlyResolved.length > 0 ? (
+ <DataTable
+ columns={columns}
+ data={recentlyResolved}
+ defaultSorting={[{ id: "startedAt", desc: true }]}
+ defaultColumnVisibility={{ action: false, endsAt: false }}
+ />
) : (
<EmptyStateContainer>
- <EmptyStateTitle>No maintenances found</EmptyStateTitle>
+ <EmptyStateTitle>No recent activity</EmptyStateTitle>
</EmptyStateContainer>
)}
</Section>
diff --git a/apps/dashboard/src/app/(dashboard)/status-pages/(list)/client.tsx b/apps/dashboard/src/app/(dashboard)/status-pages/(list)/client.tsx
index 578744034..d9c98e801 100644
--- a/apps/dashboard/src/app/(dashboard)/status-pages/(list)/client.tsx
+++ b/apps/dashboard/src/app/(dashboard)/status-pages/(list)/client.tsx
@@ -4,7 +4,8 @@ import { useQuery } from "@tanstack/react-query";
import { Palette } from "lucide-react";
import Link from "next/link";
-import { Note, NoteButton } from "@/components/common/note";
+import { NoteButton } from "@/components/common/note";
+import { NoteDismissible } from "@/components/common/note-dismissible";
import {
SectionDescription,
SectionGroup,
@@ -25,7 +26,7 @@ export function Client() {
return (
<SectionGroup>
- <Note>
+ <NoteDismissible cookieKey="note_status_pages_themes">
<Palette />
Create your own custom themes for your status pages.
<NoteButton variant="default" asChild>
@@ -33,7 +34,7 @@ export function Client() {
Learn more
</Link>
</NoteButton>
- </Note>
+ </NoteDismissible>
<SectionHeader>
<SectionTitle>Status Pages</SectionTitle>
<SectionDescription>
diff --git a/apps/dashboard/src/app/(dashboard)/status-pages/[id]/history/client.tsx b/apps/dashboard/src/app/(dashboard)/status-pages/[id]/history/client.tsx
index 120a03159..f7b0a679e 100644
--- a/apps/dashboard/src/app/(dashboard)/status-pages/[id]/history/client.tsx
+++ b/apps/dashboard/src/app/(dashboard)/status-pages/[id]/history/client.tsx
@@ -8,7 +8,8 @@ import { useParams } from "next/navigation";
import { useQueryStates } from "nuqs";
import { useMemo, useState } from "react";
-import { Note, NoteButton } from "@/components/common/note";
+import { NoteButton } from "@/components/common/note";
+import { NoteDismissible } from "@/components/common/note-dismissible";
import {
BillingOverlay,
BillingOverlayButton,
@@ -265,13 +266,13 @@ export function Client() {
</HintCollapsibleContent>
</HintCollapsible>
{!isLimited ? (
- <Note>
+ <NoteDismissible cookieKey="note_status_page_history_missing_months">
<Info />
If there are any missing months, please contact us.
<FormDialogSupportContact>
<NoteButton variant="default">Request Backfill</NoteButton>
</FormDialogSupportContact>
- </Note>
+ </NoteDismissible>
) : null}
</Section>
</SectionGroup>
diff --git a/apps/dashboard/src/app/(dashboard)/status-pages/[id]/status-reports/page.tsx b/apps/dashboard/src/app/(dashboard)/status-pages/[id]/status-reports/page.tsx
index a9608cd86..65c1e5aaf 100644
--- a/apps/dashboard/src/app/(dashboard)/status-pages/[id]/status-reports/page.tsx
+++ b/apps/dashboard/src/app/(dashboard)/status-pages/[id]/status-reports/page.tsx
@@ -7,7 +7,8 @@ import NextLink from "next/link";
import { useParams } from "next/navigation";
import { Link } from "@/components/common/link";
-import { Note, NoteButton } from "@/components/common/note";
+import { NoteButton } from "@/components/common/note";
+import { NoteDismissible } from "@/components/common/note-dismissible";
import {
Section,
SectionDescription,
@@ -60,7 +61,7 @@ export default function Page() {
return (
<SectionGroup>
- <Note>
+ <NoteDismissible cookieKey="note_status_reports_component_impacts">
<Gauge />
Status reports now support per-component impacts.
<NoteButton variant="default" asChild>
@@ -71,7 +72,7 @@ export default function Page() {
Learn more
</NextLink>
</NoteButton>
- </Note>
+ </NoteDismissible>
<Section>
<SectionHeaderRow>
<SectionHeader>
diff --git a/apps/dashboard/src/components/common/note-dismissible.tsx b/apps/dashboard/src/components/common/note-dismissible.tsx
new file mode 100644
index 000000000..462e2d3cc
--- /dev/null
+++ b/apps/dashboard/src/components/common/note-dismissible.tsx
@@ -0,0 +1,48 @@
+"use client";
+
+import { useCookieState } from "@openstatus/ui/hooks/use-cookie-state";
+import { createContext, useContext } from "react";
+
+import { Note, NoteButtonClose } from "@/components/common/note";
+
+const DismissedNotesContext = createContext<string[]>([]);
+
+/** Server layout seeds the dismissed `note_*` cookie keys to avoid a flash before hydration. */
+export function DismissedNotesProvider({
+ dismissed,
+ children,
+}: {
+ dismissed: string[];
+ children: React.ReactNode;
+}) {
+ return (
+ <DismissedNotesContext.Provider value={dismissed}>
+ {children}
+ </DismissedNotesContext.Provider>
+ );
+}
+
+export function NoteDismissible({
+ cookieKey,
+ children,
+ ...props
+}: React.ComponentProps<typeof Note> & {
+ // the layout seeds dismissed state only for cookies matching this prefix
+ cookieKey: `note_${string}`;
+}) {
+ const dismissed = useContext(DismissedNotesContext);
+ // no config: the hook's number `expires` builds an invalid cookie (session-only); the bare setter uses a valid 1y expiry
+ const [open, setOpen] = useCookieState<"true" | "false">(cookieKey);
+
+ const visible =
+ open === undefined ? !dismissed.includes(cookieKey) : open === "true";
+
+ if (!visible) return null;
+
+ return (
+ <Note {...props}>
+ {children}
+ <NoteButtonClose onClick={() => setOpen("false")} />
+ </Note>
+ );
+}
diff --git a/apps/dashboard/src/components/common/note.tsx b/apps/dashboard/src/components/common/note.tsx
index 85f81ca50..09a9b0d41 100644
--- a/apps/dashboard/src/components/common/note.tsx
+++ b/apps/dashboard/src/components/common/note.tsx
@@ -1,6 +1,7 @@
import { Button } from "@openstatus/ui/components/ui/button";
import { cn } from "@openstatus/ui/lib/utils";
import { type VariantProps, cva } from "class-variance-authority";
+import { X } from "lucide-react";
const noteVariants = cva(
"flex items-center gap-2 rounded-lg border [&>svg]:shrink-0 [&>svg]:text-current",
@@ -64,3 +65,21 @@ export function NoteButton({
</Button>
);
}
+
+export function NoteButtonClose({
+ className,
+ ...props
+}: Omit<React.ComponentProps<typeof Button>, "children">) {
+ return (
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon-sm"
+ aria-label="Close"
+ className={cn("text-muted-foreground -mr-1 shrink-0", className)}
+ {...props}
+ >
+ <X />
+ </Button>
+ );
+}
diff --git a/apps/dashboard/src/components/data-table/incidents/data-table-row-actions.tsx b/apps/dashboard/src/components/data-table/incidents/data-table-row-actions.tsx
index 490c5c61e..65cbf6ae3 100644
--- a/apps/dashboard/src/components/data-table/incidents/data-table-row-actions.tsx
+++ b/apps/dashboard/src/components/data-table/incidents/data-table-row-actions.tsx
@@ -1,151 +1,68 @@
"use client";
import type { RouterOutputs } from "@openstatus/api";
-import {
- AlertDialog,
- AlertDialogAction,
- AlertDialogCancel,
- AlertDialogContent,
- AlertDialogDescription,
- AlertDialogFooter,
- AlertDialogHeader,
- AlertDialogTitle,
-} from "@openstatus/ui/components/ui/alert-dialog";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import type { Row } from "@tanstack/react-table";
-import { isTRPCClientError } from "@trpc/client";
-import { useMemo, useState, useTransition } from "react";
-import { toast } from "sonner";
+import { useState } from "react";
import { QuickActions } from "@/components/dropdowns/quick-actions";
import { getActions } from "@/data/incidents.client";
import { useTRPC } from "@/lib/trpc/client";
+import {
+ DialogConfirmIncident,
+ type IncidentConfirmType,
+} from "./dialog-confirm";
+
type Incident = RouterOutputs["incident"]["list"][number];
-interface DataTableRowActionsProps {
- row: Row<Incident>;
+export function DataTableRowActions({ row }: { row: Row<Incident> }) {
+ return <IncidentRowActions incident={row.original} />;
}
-export function DataTableRowActions({ row }: DataTableRowActionsProps) {
- const [isPending, startTransition] = useTransition();
+export function IncidentRowActions({ incident }: { incident: Incident }) {
const trpc = useTRPC();
const queryClient = useQueryClient();
- const acknowledgeIncidentMutation = useMutation(
- trpc.incident.acknowledge.mutationOptions({
- onSuccess: () => {
- queryClient.refetchQueries({
- queryKey: trpc.incident.list.queryKey({
- monitorId: row.original.monitorId,
- }),
- });
- },
- }),
- );
- const resolveIncidentMutation = useMutation(
- trpc.incident.resolve.mutationOptions({
- onSuccess: () => {
- queryClient.refetchQueries({
- queryKey: trpc.incident.list.queryKey({
- monitorId: row.original.monitorId,
- }),
- });
- },
- }),
- );
const deleteIncidentMutation = useMutation(
trpc.incident.delete.mutationOptions({
- onSuccess: () => {
- queryClient.refetchQueries({
- queryKey: trpc.incident.list.queryKey({
- monitorId: row.original.monitorId,
- }),
- });
- },
+ onSuccess: () =>
+ // no-input prefix key — matches every incident.list query (overview, monitor detail)
+ queryClient.invalidateQueries({
+ queryKey: trpc.incident.list.queryKey(),
+ }),
}),
);
- const [type, setType] = useState<"acknowledge" | "resolve" | null>(null);
- const open = useMemo(() => type !== null, [type]);
+ const [type, setType] = useState<IncidentConfirmType | null>(null);
const actions = getActions({
- acknowledge: row.original.acknowledgedAt
+ acknowledge: incident.acknowledgedAt
? undefined
: () => setType("acknowledge"),
- resolve: row.original.resolvedAt ? undefined : () => setType("resolve"),
+ resolve: incident.resolvedAt ? undefined : () => setType("resolve"),
});
- const handleConfirm = async () => {
- try {
- startTransition(async () => {
- const promise =
- type === "acknowledge"
- ? acknowledgeIncidentMutation.mutateAsync({
- id: row.original.id,
- })
- : resolveIncidentMutation.mutateAsync({
- id: row.original.id,
- });
- toast.promise(promise, {
- loading: "Confirming...",
- success: "Confirmed",
- error: (error) => {
- if (isTRPCClientError(error)) {
- return error.message;
- }
- return "Failed to confirm";
- },
- });
- await promise;
- setType(null);
- });
- } catch (error) {
- console.error("Failed to confirm:", error);
- }
- };
-
return (
<>
<QuickActions
actions={actions}
deleteAction={{
- confirmationValue: row.original.title || "incident",
+ confirmationValue: incident.title || "incident",
submitAction: async () => {
await deleteIncidentMutation.mutateAsync({
- id: row.original.id,
+ id: incident.id,
});
},
}}
/>
- <AlertDialog open={open} onOpenChange={() => setType(null)}>
- <AlertDialogContent
- onCloseAutoFocus={(event) => {
- // NOTE: bug where the body is not clickable after closing the alert dialog
- event.preventDefault();
- document.body.style.pointerEvents = "";
- }}
- >
- <AlertDialogHeader>
- <AlertDialogTitle>Confirm your action</AlertDialogTitle>
- <AlertDialogDescription>
- You are about to <span className="font-semibold">{type}</span>{" "}
- this incident.
- </AlertDialogDescription>
- </AlertDialogHeader>
- <AlertDialogFooter>
- <AlertDialogCancel>Cancel</AlertDialogCancel>
- <AlertDialogAction
- onClick={(e) => {
- e.preventDefault();
- handleConfirm();
- }}
- disabled={isPending}
- >
- {isPending ? "Confirming..." : "Confirm"}
- </AlertDialogAction>
- </AlertDialogFooter>
- </AlertDialogContent>
- </AlertDialog>
+ <DialogConfirmIncident
+ incident={incident}
+ type={type}
+ open={type !== null}
+ onOpenChange={(open) => {
+ if (!open) setType(null);
+ }}
+ />
</>
);
}
diff --git a/apps/dashboard/src/components/data-table/incidents/dialog-confirm.tsx b/apps/dashboard/src/components/data-table/incidents/dialog-confirm.tsx
new file mode 100644
index 000000000..85b4cd9a2
--- /dev/null
+++ b/apps/dashboard/src/components/data-table/incidents/dialog-confirm.tsx
@@ -0,0 +1,108 @@
+"use client";
+
+import type { RouterOutputs } from "@openstatus/api";
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+} from "@openstatus/ui/components/ui/alert-dialog";
+import { useMutation, useQueryClient } from "@tanstack/react-query";
+import { isTRPCClientError } from "@trpc/client";
+import { useTransition } from "react";
+import { toast } from "sonner";
+
+import { useTRPC } from "@/lib/trpc/client";
+
+type Incident = RouterOutputs["incident"]["list"][number];
+
+export type IncidentConfirmType = "acknowledge" | "resolve";
+
+/** Controlled acknowledge/resolve confirmation — stays open on error so the action can be retried. */
+export function DialogConfirmIncident({
+ incident,
+ type,
+ open,
+ onOpenChange,
+}: {
+ incident: Incident;
+ type: IncidentConfirmType | null;
+ open: boolean;
+ onOpenChange: (open: boolean) => void;
+}) {
+ const [isPending, startTransition] = useTransition();
+ const trpc = useTRPC();
+ const queryClient = useQueryClient();
+ // no-input prefix key — matches every incident.list query (overview, monitor detail)
+ const invalidateList = () =>
+ queryClient.invalidateQueries({
+ queryKey: trpc.incident.list.queryKey(),
+ });
+ const acknowledgeIncidentMutation = useMutation(
+ trpc.incident.acknowledge.mutationOptions({ onSuccess: invalidateList }),
+ );
+ const resolveIncidentMutation = useMutation(
+ trpc.incident.resolve.mutationOptions({ onSuccess: invalidateList }),
+ );
+
+ const handleConfirm = () => {
+ startTransition(async () => {
+ const promise =
+ type === "acknowledge"
+ ? acknowledgeIncidentMutation.mutateAsync({ id: incident.id })
+ : resolveIncidentMutation.mutateAsync({ id: incident.id });
+ toast.promise(promise, {
+ loading: "Confirming...",
+ success: "Confirmed",
+ error: (error) => {
+ if (isTRPCClientError(error)) {
+ return error.message;
+ }
+ return "Failed to confirm";
+ },
+ });
+ try {
+ await promise;
+ onOpenChange(false);
+ } catch (error) {
+ console.error("Failed to confirm:", error);
+ }
+ });
+ };
+
+ return (
+ <AlertDialog open={open} onOpenChange={onOpenChange}>
+ <AlertDialogContent
+ onCloseAutoFocus={(event) => {
+ // NOTE: bug where the body is not clickable after closing the alert dialog
+ event.preventDefault();
+ document.body.style.pointerEvents = "";
+ }}
+ >
+ <AlertDialogHeader>
+ <AlertDialogTitle>Confirm your action</AlertDialogTitle>
+ <AlertDialogDescription>
+ You are about to <span className="font-semibold">{type}</span> this
+ incident.
+ </AlertDialogDescription>
+ </AlertDialogHeader>
+ <AlertDialogFooter>
+ <AlertDialogCancel>Cancel</AlertDialogCancel>
+ <AlertDialogAction
+ onClick={(e) => {
+ e.preventDefault();
+ handleConfirm();
+ }}
+ disabled={isPending}
+ >
+ {isPending ? "Confirming..." : "Confirm"}
+ </AlertDialogAction>
+ </AlertDialogFooter>
+ </AlertDialogContent>
+ </AlertDialog>
+ );
+}
diff --git a/apps/dashboard/src/components/data-table/maintenances/data-table-row-actions.tsx b/apps/dashboard/src/components/data-table/maintenances/data-table-row-actions.tsx
index d6288cd57..051c54bf2 100644
--- a/apps/dashboard/src/components/data-table/maintenances/data-table-row-actions.tsx
+++ b/apps/dashboard/src/components/data-table/maintenances/data-table-row-actions.tsx
@@ -14,51 +14,38 @@ import { useTRPC } from "@/lib/trpc/client";
type Maintenance = RouterOutputs["maintenance"]["list"][number];
-interface DataTableRowActionsProps {
- row: Row<Maintenance>;
+export function DataTableRowActions({ row }: { row: Row<Maintenance> }) {
+ return <MaintenanceRowActions maintenance={row.original} />;
}
-export function DataTableRowActions({ row }: DataTableRowActionsProps) {
+export function MaintenanceRowActions({
+ maintenance,
+}: {
+ maintenance: Maintenance;
+}) {
const trpc = useTRPC();
const buttonRef = useRef<HTMLButtonElement>(null);
const actions = getActions({
edit: () => buttonRef.current?.click(),
});
const { data: statusPage } = useQuery(
- trpc.page.get.queryOptions({ id: row.original.pageId ?? 0 }),
+ trpc.page.get.queryOptions({ id: maintenance.pageId ?? 0 }),
);
const queryClient = useQueryClient();
+ // no-input prefix key — matches every maintenance.list query (overview, page detail)
+ const invalidateList = () =>
+ queryClient.invalidateQueries({
+ queryKey: trpc.maintenance.list.queryKey(),
+ });
const updateMaintenanceMutation = useMutation(
trpc.maintenance.update.mutationOptions({
- onSuccess: () => {
- queryClient.refetchQueries({
- queryKey: trpc.maintenance.list.queryKey({
- pageId: row.original.pageId ?? undefined,
- }),
- });
- queryClient.invalidateQueries({
- queryKey: trpc.maintenance.list.queryKey({
- period: "7d",
- }),
- });
- },
+ onSuccess: invalidateList,
}),
);
const deleteMaintenanceMutation = useMutation(
trpc.maintenance.delete.mutationOptions({
- onSuccess: () => {
- queryClient.refetchQueries({
- queryKey: trpc.maintenance.list.queryKey({
- pageId: row.original.pageId ?? undefined,
- }),
- });
- queryClient.invalidateQueries({
- queryKey: trpc.maintenance.list.queryKey({
- period: "7d",
- }),
- });
- },
+ onSuccess: invalidateList,
}),
);
@@ -67,10 +54,10 @@ export function DataTableRowActions({ row }: DataTableRowActionsProps) {
<QuickActions
actions={actions}
deleteAction={{
- confirmationValue: row.original.title ?? "maintenance",
+ confirmationValue: maintenance.title ?? "maintenance",
submitAction: async () => {
await deleteMaintenanceMutation.mutateAsync({
- id: row.original.id,
+ id: maintenance.id,
});
},
}}
@@ -81,15 +68,15 @@ export function DataTableRowActions({ row }: DataTableRowActionsProps) {
statusPage?.pageComponentGroups ?? [],
)}
defaultValues={{
- title: row.original.title,
- message: row.original.message,
- startDate: row.original.from,
- endDate: row.original.to,
- pageComponents: row.original.pageComponents?.map((c) => c.id) ?? [],
+ title: maintenance.title,
+ message: maintenance.message,
+ startDate: maintenance.from,
+ endDate: maintenance.to,
+ pageComponents: maintenance.pageComponents?.map((c) => c.id) ?? [],
}}
onSubmit={async (values) => {
await updateMaintenanceMutation.mutateAsync({
- id: row.original.id,
+ id: maintenance.id,
title: values.title,
message: values.message,
startDate: values.startDate,
diff --git a/apps/dashboard/src/components/data-table/overview-events/columns.tsx b/apps/dashboard/src/components/data-table/overview-events/columns.tsx
new file mode 100644
index 000000000..82980b3dd
--- /dev/null
+++ b/apps/dashboard/src/components/data-table/overview-events/columns.tsx
@@ -0,0 +1,205 @@
+"use client";
+
+import { Button } from "@openstatus/ui/components/ui/button";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger,
+} from "@openstatus/ui/components/ui/tooltip";
+import { cn } from "@openstatus/ui/lib/utils";
+import type { ColumnDef } from "@tanstack/react-table";
+import { formatDistanceStrict } from "date-fns";
+
+import { IncidentRowActions } from "@/components/data-table/incidents/data-table-row-actions";
+import { MaintenanceRowActions } from "@/components/data-table/maintenances/data-table-row-actions";
+import { StatusReportRowActions } from "@/components/data-table/status-reports/data-table-row-actions";
+import { TableCellDate } from "@/components/data-table/table-cell-date";
+import { TableCellLink } from "@/components/data-table/table-cell-link";
+import { TableCellNumber } from "@/components/data-table/table-cell-number";
+import { FormSheetStatusReportUpdateCreate } from "@/components/forms/status-report-update/sheet-create";
+import { DataTableColumnHeader } from "@/components/ui/data-table/data-table-column-header";
+import {
+ type OverviewEvent,
+ eventTypeConfig,
+ getIncidentStatus,
+ getMaintenanceStatus,
+ getResolvedAt,
+ getStartedAt,
+ incidentStatusConfig,
+ maintenanceStatusConfig,
+} from "@/data/overview-events.client";
+import { colors } from "@/data/status-report-updates.client";
+
+import { IncidentActionCell } from "./incident-action-cell";
+
+function getStatus(event: OverviewEvent): { label: string; color: string } {
+ switch (event.type) {
+ case "incident":
+ return incidentStatusConfig[getIncidentStatus(event.incident)];
+ case "report":
+ return { label: event.report.status, color: colors[event.report.status] };
+ case "maintenance":
+ return maintenanceStatusConfig[getMaintenanceStatus(event.maintenance)];
+ }
+}
+
+function getTitle(event: OverviewEvent): { title: string; href: string } {
+ switch (event.type) {
+ case "incident":
+ return {
+ title: event.incident.monitor.name,
+ href: `/monitors/${event.incident.monitor.id}/incidents`,
+ };
+ case "report":
+ return {
+ title: event.report.title,
+ href: `/status-pages/${event.report.pageId}/status-reports/${event.report.id}`,
+ };
+ case "maintenance":
+ return {
+ title: event.maintenance.title,
+ href: `/status-pages/${event.maintenance.pageId}/maintenances`,
+ };
+ }
+}
+
+function getDuration(event: OverviewEvent): string | null {
+ const startedAt = getStartedAt(event);
+ const resolvedAt = getResolvedAt(event);
+ if (!resolvedAt) return null;
+ return formatDistanceStrict(startedAt, resolvedAt);
+}
+
+export const columns: ColumnDef<OverviewEvent>[] = [
+ {
+ id: "type",
+ accessorFn: (row) => row.type,
+ header: () => null,
+ cell: ({ row }) => {
+ const config = eventTypeConfig[row.original.type];
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className="flex items-center">
+ <config.icon
+ className="text-muted-foreground size-4"
+ aria-hidden="true"
+ />
+ <span className="sr-only">{config.label}</span>
+ </span>
+ </TooltipTrigger>
+ <TooltipContent side="left">{config.label}</TooltipContent>
+ </Tooltip>
+ );
+ },
+ enableSorting: false,
+ enableHiding: false,
+ meta: {
+ headerClassName: "w-8",
+ },
+ },
+ {
+ id: "title",
+ accessorFn: (row) => getTitle(row).title,
+ header: "Title",
+ cell: ({ row }) => {
+ const { title, href } = getTitle(row.original);
+ return <TableCellLink href={href} value={title} />;
+ },
+ enableSorting: false,
+ enableHiding: false,
+ meta: {
+ cellClassName: "max-w-[200px] truncate",
+ },
+ },
+ {
+ id: "status",
+ accessorFn: (row) => getStatus(row).label,
+ header: "Status",
+ cell: ({ row }) => {
+ const { label, color } = getStatus(row.original);
+ return <div className={cn("font-mono capitalize", color)}>{label}</div>;
+ },
+ enableSorting: false,
+ enableHiding: false,
+ },
+ {
+ id: "startedAt",
+ accessorFn: (row) => getStartedAt(row),
+ header: ({ column }) => (
+ <DataTableColumnHeader column={column} title="Start" />
+ ),
+ cell: ({ row }) => <TableCellDate value={row.getValue("startedAt")} />,
+ enableHiding: false,
+ meta: {
+ cellClassName: "w-[170px]",
+ },
+ },
+ {
+ id: "endsAt",
+ accessorFn: (row) => getResolvedAt(row),
+ header: "End",
+ cell: ({ row }) => <TableCellDate value={row.getValue("endsAt")} />,
+ enableSorting: false,
+ meta: {
+ cellClassName: "w-[170px]",
+ },
+ },
+ {
+ id: "duration",
+ accessorFn: (row) => getDuration(row),
+ header: "Duration",
+ cell: ({ row }) => {
+ const value = row.getValue("duration");
+ if (typeof value !== "string") {
+ return <div className="text-muted-foreground font-mono">ongoing</div>;
+ }
+ const [amount, unit] = value.split(" ");
+ return <TableCellNumber value={amount} unit={unit} />;
+ },
+ enableSorting: false,
+ },
+ {
+ id: "action",
+ header: () => null,
+ cell: ({ row }) => {
+ const event = row.original;
+ switch (event.type) {
+ case "incident":
+ return <IncidentActionCell incident={event.incident} />;
+ case "report":
+ if (event.report.status === "resolved") return null;
+ return (
+ <FormSheetStatusReportUpdateCreate report={event.report}>
+ <Button variant="outline" size="sm" className="h-7">
+ Add Update
+ </Button>
+ </FormSheetStatusReportUpdateCreate>
+ );
+ case "maintenance":
+ return null;
+ }
+ },
+ enableSorting: false,
+ meta: {
+ cellClassName: "w-[110px] text-right",
+ },
+ },
+ {
+ id: "actions",
+ cell: ({ row }) => {
+ const event = row.original;
+ switch (event.type) {
+ case "incident":
+ return <IncidentRowActions incident={event.incident} />;
+ case "report":
+ return <StatusReportRowActions report={event.report} />;
+ case "maintenance":
+ return <MaintenanceRowActions maintenance={event.maintenance} />;
+ }
+ },
+ meta: {
+ cellClassName: "w-8",
+ },
+ },
+];
diff --git a/apps/dashboard/src/components/data-table/overview-events/incident-action-cell.tsx b/apps/dashboard/src/components/data-table/overview-events/incident-action-cell.tsx
new file mode 100644
index 000000000..a6cdd87da
--- /dev/null
+++ b/apps/dashboard/src/components/data-table/overview-events/incident-action-cell.tsx
@@ -0,0 +1,44 @@
+"use client";
+
+import type { RouterOutputs } from "@openstatus/api";
+import { Button } from "@openstatus/ui/components/ui/button";
+import { useState } from "react";
+
+import {
+ DialogConfirmIncident,
+ type IncidentConfirmType,
+} from "@/components/data-table/incidents/dialog-confirm";
+
+type Incident = RouterOutputs["incident"]["list"][number];
+
+export function IncidentActionCell({ incident }: { incident: Incident }) {
+ // capture the action at click time so a background refetch can't flip it mid-dialog
+ const [type, setType] = useState<IncidentConfirmType | null>(null);
+
+ if (incident.resolvedAt) return null;
+ const nextAction = incident.acknowledgedAt ? "resolve" : "acknowledge";
+
+ return (
+ <>
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-7"
+ onClick={(e) => {
+ e.stopPropagation();
+ setType(nextAction);
+ }}
+ >
+ {nextAction === "acknowledge" ? "Acknowledge" : "Resolve"}
+ </Button>
+ <DialogConfirmIncident
+ incident={incident}
+ type={type}
+ open={type !== null}
+ onOpenChange={(open) => {
+ if (!open) setType(null);
+ }}
+ />
+ </>
+ );
+}
diff --git a/apps/dashboard/src/components/data-table/response-logs/data-table-sheet-test.tsx b/apps/dashboard/src/components/data-table/response-logs/data-table-sheet-test.tsx
index fc9a22227..b01dd7013 100644
--- a/apps/dashboard/src/components/data-table/response-logs/data-table-sheet-test.tsx
+++ b/apps/dashboard/src/components/data-table/response-logs/data-table-sheet-test.tsx
@@ -1,6 +1,7 @@
"use client";
import type { RouterOutputs } from "@openstatus/api";
+import { calculateTiming } from "@openstatus/tinybird/src/schema";
import {
DataTableSheet,
@@ -58,13 +59,7 @@ function mapping(data: TestTCP | TestHTTP | TestDNS, monitor: Monitor) {
headers: data.headers,
region: data.region,
latency: data.latency,
- timing: {
- dns: data.timing.dnsDone - data.timing.dnsStart,
- connect: data.timing.connectDone - data.timing.connectStart,
- tls: data.timing.tlsHandshakeDone - data.timing.tlsHandshakeStart,
- ttfb: data.timing.firstByteDone - data.timing.firstByteStart,
- transfer: data.timing.transferDone - data.timing.transferStart,
- },
+ timing: calculateTiming(data.timing),
url: monitor.url,
workspaceId: String(monitor.workspaceId),
error: false,
diff --git a/apps/dashboard/src/components/data-table/status-reports/columns.tsx b/apps/dashboard/src/components/data-table/status-reports/columns.tsx
index 03aad1d53..80d9d61e9 100644
--- a/apps/dashboard/src/components/data-table/status-reports/columns.tsx
+++ b/apps/dashboard/src/components/data-table/status-reports/columns.tsx
@@ -120,7 +120,9 @@ export const columns: ColumnDef<StatusReport>[] = [
const impact = row.getValue<PageComponentImpact | null>("impact");
const config = impact ? impactConfig[impact] : untriagedImpact;
return (
- <div className={cn("font-mono", config.color)}>{config.label}</div>
+ <div className={cn("max-w-[120px] truncate font-mono", config.color)}>
+ {config.label}
+ </div>
);
},
enableSorting: false,
diff --git a/apps/dashboard/src/components/data-table/status-reports/data-table-row-actions.tsx b/apps/dashboard/src/components/data-table/status-reports/data-table-row-actions.tsx
index b449ac833..1a6c9a5e6 100644
--- a/apps/dashboard/src/components/data-table/status-reports/data-table-row-actions.tsx
+++ b/apps/dashboard/src/components/data-table/status-reports/data-table-row-actions.tsx
@@ -1,30 +1,27 @@
"use client";
import type { RouterOutputs } from "@openstatus/api";
-import { currentImpactsFromUpdates } from "@openstatus/db/src/schema/page_components/constants";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import type { Row } from "@tanstack/react-table";
import { useRef } from "react";
import { QuickActions } from "@/components/dropdowns/quick-actions";
-import { FormSheetStatusReportUpdate } from "@/components/forms/status-report-update/sheet";
+import { FormSheetStatusReportUpdateCreate } from "@/components/forms/status-report-update/sheet-create";
import { FormSheetStatusReport } from "@/components/forms/status-report/sheet";
import { toCheckboxTreeItems } from "@/components/ui/checkbox-tree";
-import { getNextStatus } from "@/data/status-report-updates.client";
import { getActions } from "@/data/status-reports.client";
import { useTRPC } from "@/lib/trpc/client";
type StatusReport = RouterOutputs["statusReport"]["list"][number];
-interface DataTableRowActionsProps {
- row: Row<StatusReport>;
-}
-
// NOTE: avoid using useParams to get status page :id
// because we are using the table in the /overview page
-export function DataTableRowActions({ row }: DataTableRowActionsProps) {
- if (!row.original.pageId) return null;
+export function DataTableRowActions({ row }: { row: Row<StatusReport> }) {
+ return <StatusReportRowActions report={row.original} />;
+}
+
+export function StatusReportRowActions({ report }: { report: StatusReport }) {
const buttonCreateRef = useRef<HTMLButtonElement>(null);
const buttonUpdateRef = useRef<HTMLButtonElement>(null);
const actions = getActions({
@@ -34,9 +31,8 @@ export function DataTableRowActions({ row }: DataTableRowActionsProps) {
if (typeof window !== "undefined") {
window.open(
`https://${
- row.original.page.customDomain ||
- `${row.original.page.slug}.openstatus.dev`
- }/events/report/${row.original.id}`,
+ report.page.customDomain || `${report.page.slug}.openstatus.dev`
+ }/events/report/${report.id}`,
"_blank",
);
}
@@ -45,88 +41,42 @@ export function DataTableRowActions({ row }: DataTableRowActionsProps) {
const trpc = useTRPC();
const queryClient = useQueryClient();
const { data: page } = useQuery(
- trpc.page.get.queryOptions({ id: row.original.pageId }),
- );
- const reportComponents =
- row.original.pageComponents?.map((c) => ({ id: c.id, name: c.name })) ?? [];
- const reportHasImpacts = row.original.updates.some(
- (u) => u.componentImpacts.length > 0,
- );
- const currentImpacts = currentImpactsFromUpdates(row.original.updates);
- const nextStatus = getNextStatus(row.original.status);
- const sendStatusReportUpdateMutation = useMutation(
- trpc.subscriberNotification.statusReport.mutationOptions(),
+ trpc.page.get.queryOptions(
+ { id: report.pageId ?? 0 },
+ { enabled: report.pageId !== null },
+ ),
);
+ // no-input prefix key — matches every statusReport.list query (overview, page detail)
+ const invalidateLists = () => {
+ queryClient.invalidateQueries({
+ queryKey: trpc.statusReport.list.queryKey(),
+ });
+ queryClient.invalidateQueries({
+ queryKey: trpc.page.list.queryKey(),
+ });
+ };
const updateStatusReportMutation = useMutation(
trpc.statusReport.updateStatus.mutationOptions({
- onSuccess: () => {
- queryClient.invalidateQueries({
- queryKey: trpc.statusReport.list.queryKey({
- pageId: row.original.pageId ?? undefined,
- }),
- });
- queryClient.invalidateQueries({
- queryKey: trpc.page.list.queryKey(),
- });
- queryClient.invalidateQueries({
- queryKey: trpc.statusReport.list.queryKey({
- period: "7d",
- }),
- });
- },
- }),
- );
- const createStatusReportUpdateMutation = useMutation(
- trpc.statusReport.createStatusReportUpdate.mutationOptions({
- onSuccess: (update) => {
- if (update?.notifySubscribers) {
- sendStatusReportUpdateMutation.mutate({ id: update.id });
- }
- queryClient.invalidateQueries({
- queryKey: trpc.statusReport.list.queryKey({
- pageId: row.original.pageId ?? undefined,
- }),
- });
- queryClient.invalidateQueries({
- queryKey: trpc.page.list.queryKey(),
- });
- queryClient.invalidateQueries({
- queryKey: trpc.statusReport.list.queryKey({
- period: "7d",
- }),
- });
- },
+ onSuccess: invalidateLists,
}),
);
const deleteStatusReportMutation = useMutation(
trpc.statusReport.delete.mutationOptions({
- onSuccess: () => {
- queryClient.invalidateQueries({
- queryKey: trpc.statusReport.list.queryKey({
- pageId: row.original.pageId ?? undefined,
- }),
- });
- queryClient.invalidateQueries({
- queryKey: trpc.page.list.queryKey(),
- });
- queryClient.invalidateQueries({
- queryKey: trpc.statusReport.list.queryKey({
- period: "7d",
- }),
- });
- },
+ onSuccess: invalidateLists,
}),
);
+ if (!report.pageId) return null;
+
return (
<>
<QuickActions
actions={actions}
deleteAction={{
- confirmationValue: row.original.title ?? "status report",
+ confirmationValue: report.title ?? "status report",
submitAction: async () => {
await deleteStatusReportMutation.mutateAsync({
- id: row.original.id,
+ id: report.id,
});
},
}}
@@ -137,16 +87,16 @@ export function DataTableRowActions({ row }: DataTableRowActionsProps) {
page?.pageComponentGroups ?? [],
)}
defaultValues={{
- title: row.original.title,
- status: row.original.status,
- pageComponents: row.original.pageComponents?.map((c) => c.id) ?? [],
+ title: report.title,
+ status: report.status,
+ pageComponents: report.pageComponents?.map((c) => c.id) ?? [],
}}
onSubmit={async (values) => {
const hasComponents =
(page?.pageComponents?.length ?? 0) > 0 ||
(page?.pageComponentGroups?.length ?? 0) > 0;
await updateStatusReportMutation.mutateAsync({
- id: row.original.id,
+ id: report.id,
pageComponents: hasComponents ? values.pageComponents : undefined,
title: values.title,
status: values.status,
@@ -157,38 +107,11 @@ export function DataTableRowActions({ row }: DataTableRowActionsProps) {
Open sheet
</button>
</FormSheetStatusReport>
- <FormSheetStatusReportUpdate
- defaultValues={{
- status: nextStatus,
- componentImpacts: reportComponents.map((c) => ({
- pageComponentId: c.id,
- impact:
- nextStatus === "resolved"
- ? "operational"
- : (currentImpacts.get(c.id) ?? "operational"),
- })),
- }}
- components={reportComponents}
- onSubmit={async (values) => {
- // a legacy report stays legacy unless the operator actively
- // sets a non-operational impact
- const sendImpacts =
- reportHasImpacts ||
- values.componentImpacts?.some((ci) => ci.impact !== "operational");
- await createStatusReportUpdateMutation.mutateAsync({
- statusReportId: row.original.id,
- message: values.message,
- status: values.status,
- componentImpacts: sendImpacts ? values.componentImpacts : undefined,
- date: values.date,
- notifySubscribers: values.notifySubscribers,
- });
- }}
- >
+ <FormSheetStatusReportUpdateCreate report={report}>
<button ref={buttonCreateRef} type="button" className="sr-only">
Open sheet
</button>
- </FormSheetStatusReportUpdate>
+ </FormSheetStatusReportUpdateCreate>
</>
);
}
diff --git a/apps/dashboard/src/components/data-table/table-cell-link.tsx b/apps/dashboard/src/components/data-table/table-cell-link.tsx
index 1f9d13b32..ff650b3e3 100644
--- a/apps/dashboard/src/components/data-table/table-cell-link.tsx
+++ b/apps/dashboard/src/components/data-table/table-cell-link.tsx
@@ -19,7 +19,7 @@ export function TableCellLink({
return (
<Link
className={cn(
- "group/link flex w-full items-center justify-between gap-2 hover:underline",
+ "group/link flex w-full items-center justify-between gap-2 rounded-lg hover:underline",
className,
)}
{...externalProps}
diff --git a/apps/dashboard/src/components/forms/components/form-components.tsx b/apps/dashboard/src/components/forms/components/form-components.tsx
index ad44d3d5c..6644b1f85 100644
--- a/apps/dashboard/src/components/forms/components/form-components.tsx
+++ b/apps/dashboard/src/components/forms/components/form-components.tsx
@@ -691,7 +691,7 @@ export function FormComponents({
<FormCardFooter>
<FormCardFooterInfo>
Learn more about{" "}
- <Link href="https://www.openstatus.dev/docs/reference/status-page/#page-components">
+ <Link href="https://www.openstatus.dev/docs/reference/page-components">
page components
</Link>
.
diff --git a/apps/dashboard/src/components/forms/components/update.tsx b/apps/dashboard/src/components/forms/components/update.tsx
index 10261ef89..b5dc196fe 100644
--- a/apps/dashboard/src/components/forms/components/update.tsx
+++ b/apps/dashboard/src/components/forms/components/update.tsx
@@ -1,7 +1,7 @@
"use client";
import type { PageConfiguration } from "@openstatus/db/src/schema";
-import { useMutation, useQuery } from "@tanstack/react-query";
+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { useParams } from "next/navigation";
import { useState } from "react";
@@ -15,6 +15,7 @@ import { FormImport, type ImportFormValues } from "./form-import";
export function FormComponentsUpdate() {
const { id } = useParams<{ id: string }>();
const trpc = useTRPC();
+ const queryClient = useQueryClient();
const [formKey, setFormKey] = useState(0);
const { data: statusPage, refetch } = useQuery(
trpc.page.get.queryOptions({ id: Number.parseInt(id) }),
@@ -35,6 +36,10 @@ export function FormComponentsUpdate() {
// "removed" (delete) and placeholders as "new" (create).
const refetchAndRemount = async (...refetches: Promise<unknown>[]) => {
await Promise.all(refetches);
+ // invalidate workspace to update the usage (getting-started checklist)
+ queryClient.invalidateQueries({
+ queryKey: trpc.workspace.get.queryKey(),
+ });
setFormKey((k) => k + 1);
};
diff --git a/apps/dashboard/src/components/forms/maintenance/sheet-create.tsx b/apps/dashboard/src/components/forms/maintenance/sheet-create.tsx
new file mode 100644
index 000000000..d6d12c700
--- /dev/null
+++ b/apps/dashboard/src/components/forms/maintenance/sheet-create.tsx
@@ -0,0 +1,156 @@
+"use client";
+
+import { Button } from "@openstatus/ui/components/ui/button";
+import { Label } from "@openstatus/ui/components/ui/label";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@openstatus/ui/components/ui/select";
+import { Separator } from "@openstatus/ui/components/ui/separator";
+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
+import { useState } from "react";
+
+import {
+ EmptyStateContainer,
+ EmptyStateTitle,
+} from "@/components/content/empty-state";
+import { FormCard, FormCardGroup } from "@/components/forms/form-card";
+import {
+ FormSheetContent,
+ FormSheetDescription,
+ FormSheetFooter,
+ FormSheetHeader,
+ FormSheetTitle,
+ FormSheetTrigger,
+ FormSheetWithDirtyProtection,
+} from "@/components/forms/form-sheet";
+import { FormMaintenance } from "@/components/forms/maintenance/form";
+import { toCheckboxTreeItems } from "@/components/ui/checkbox-tree";
+import { useTRPC } from "@/lib/trpc/client";
+
+/**
+ * Create-maintenance sheet with a status page selector — for surfaces that
+ * are not scoped to a single page (e.g. /overview). `children` is the trigger.
+ */
+export function FormSheetMaintenanceCreate({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ const [open, setOpen] = useState(false);
+ const [selectedPageId, setSelectedPageId] = useState<number | null>(null);
+ const trpc = useTRPC();
+ const queryClient = useQueryClient();
+ const { data: pages } = useQuery(trpc.page.list.queryOptions());
+
+ const pageId =
+ pages?.length === 1 ? pages[0].id : (selectedPageId ?? undefined);
+
+ const { data: page } = useQuery(
+ trpc.page.get.queryOptions(
+ { id: pageId ?? 0 },
+ { enabled: pageId !== undefined },
+ ),
+ );
+
+ const sendMaintenanceUpdateMutation = useMutation(
+ trpc.subscriberNotification.maintenance.mutationOptions(),
+ );
+ const createMaintenanceMutation = useMutation(
+ trpc.maintenance.new.mutationOptions({
+ onSuccess: (maintenance) => {
+ if (maintenance.notifySubscribers) {
+ sendMaintenanceUpdateMutation.mutate({ id: maintenance.id });
+ }
+ // no-input prefix key — matches every maintenance.list query
+ queryClient.invalidateQueries({
+ queryKey: trpc.maintenance.list.queryKey(),
+ });
+ },
+ }),
+ );
+
+ return (
+ <FormSheetWithDirtyProtection open={open} onOpenChange={setOpen}>
+ <FormSheetTrigger asChild>{children}</FormSheetTrigger>
+ <FormSheetContent className="sm:max-w-lg">
+ <FormSheetHeader>
+ <FormSheetTitle>Maintenance</FormSheetTitle>
+ <FormSheetDescription>
+ Configure and update the maintenance.
+ </FormSheetDescription>
+ </FormSheetHeader>
+ {pages && pages.length > 1 ? (
+ <>
+ <div className="grid gap-1.5 px-4 py-4">
+ <Label htmlFor="maintenance-page-select">Status Page</Label>
+ <Select
+ value={pageId !== undefined ? String(pageId) : undefined}
+ onValueChange={(value) => setSelectedPageId(Number(value))}
+ >
+ <SelectTrigger id="maintenance-page-select" size="sm">
+ <SelectValue placeholder="Select a status page" />
+ </SelectTrigger>
+ <SelectContent>
+ {pages.map((p) => (
+ <SelectItem key={p.id} value={String(p.id)}>
+ {p.title}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ <Separator />
+ </>
+ ) : null}
+ {pageId !== undefined ? (
+ <FormCardGroup className="overflow-y-auto">
+ <FormCard className="overflow-auto rounded-none border-none">
+ <FormMaintenance
+ key={pageId}
+ id="maintenance-form"
+ className="my-4"
+ items={toCheckboxTreeItems(
+ page?.pageComponents ?? [],
+ page?.pageComponentGroups ?? [],
+ )}
+ onSubmit={async (values) => {
+ await createMaintenanceMutation.mutateAsync({
+ pageId,
+ title: values.title,
+ message: values.message,
+ startDate: values.startDate,
+ endDate: values.endDate,
+ pageComponents: values.pageComponents,
+ notifySubscribers: values.notifySubscribers,
+ });
+ setOpen(false);
+ }}
+ />
+ </FormCard>
+ </FormCardGroup>
+ ) : (
+ <EmptyStateContainer className="m-4">
+ <EmptyStateTitle>
+ {pages?.length === 0
+ ? "No status pages found"
+ : "Select a status page"}
+ </EmptyStateTitle>
+ </EmptyStateContainer>
+ )}
+ <FormSheetFooter>
+ <Button
+ type="submit"
+ form="maintenance-form"
+ disabled={pageId === undefined}
+ >
+ Submit
+ </Button>
+ </FormSheetFooter>
+ </FormSheetContent>
+ </FormSheetWithDirtyProtection>
+ );
+}
diff --git a/apps/dashboard/src/components/forms/status-report-update/sheet-create.tsx b/apps/dashboard/src/components/forms/status-report-update/sheet-create.tsx
new file mode 100644
index 000000000..f1e11c6ff
--- /dev/null
+++ b/apps/dashboard/src/components/forms/status-report-update/sheet-create.tsx
@@ -0,0 +1,82 @@
+"use client";
+
+import type { RouterOutputs } from "@openstatus/api";
+import { currentImpactsFromUpdates } from "@openstatus/db/src/schema/page_components/constants";
+import { useMutation, useQueryClient } from "@tanstack/react-query";
+
+import { FormSheetStatusReportUpdate } from "@/components/forms/status-report-update/sheet";
+import { getNextStatus } from "@/data/status-report-updates.client";
+import { useTRPC } from "@/lib/trpc/client";
+
+type StatusReport = RouterOutputs["statusReport"]["list"][number];
+
+/** Create-update sheet prefilled with the report's next status — `children` is the trigger. */
+export function FormSheetStatusReportUpdateCreate({
+ report,
+ children,
+}: {
+ report: StatusReport;
+ children: React.ReactNode;
+}) {
+ const trpc = useTRPC();
+ const queryClient = useQueryClient();
+ const reportComponents =
+ report.pageComponents?.map((c) => ({ id: c.id, name: c.name })) ?? [];
+ const reportHasImpacts = report.updates.some(
+ (u) => u.componentImpacts.length > 0,
+ );
+ const currentImpacts = currentImpactsFromUpdates(report.updates);
+ const nextStatus = getNextStatus(report.status);
+ const sendStatusReportUpdateMutation = useMutation(
+ trpc.subscriberNotification.statusReport.mutationOptions(),
+ );
+ const createStatusReportUpdateMutation = useMutation(
+ trpc.statusReport.createStatusReportUpdate.mutationOptions({
+ onSuccess: (update) => {
+ if (update?.notifySubscribers) {
+ sendStatusReportUpdateMutation.mutate({ id: update.id });
+ }
+ // no-input prefix key — matches every statusReport.list query
+ queryClient.invalidateQueries({
+ queryKey: trpc.statusReport.list.queryKey(),
+ });
+ queryClient.invalidateQueries({
+ queryKey: trpc.page.list.queryKey(),
+ });
+ },
+ }),
+ );
+
+ return (
+ <FormSheetStatusReportUpdate
+ defaultValues={{
+ status: nextStatus,
+ componentImpacts: reportComponents.map((c) => ({
+ pageComponentId: c.id,
+ impact:
+ nextStatus === "resolved"
+ ? "operational"
+ : (currentImpacts.get(c.id) ?? "operational"),
+ })),
+ }}
+ components={reportComponents}
+ onSubmit={async (values) => {
+ // a legacy report stays legacy unless the operator actively
+ // sets a non-operational impact
+ const sendImpacts =
+ reportHasImpacts ||
+ values.componentImpacts?.some((ci) => ci.impact !== "operational");
+ await createStatusReportUpdateMutation.mutateAsync({
+ statusReportId: report.id,
+ message: values.message,
+ status: values.status,
+ componentImpacts: sendImpacts ? values.componentImpacts : undefined,
+ date: values.date,
+ notifySubscribers: values.notifySubscribers,
+ });
+ }}
+ >
+ {children}
+ </FormSheetStatusReportUpdate>
+ );
+}
diff --git a/apps/dashboard/src/components/forms/status-report/sheet-create.tsx b/apps/dashboard/src/components/forms/status-report/sheet-create.tsx
new file mode 100644
index 000000000..7f1bdc94e
--- /dev/null
+++ b/apps/dashboard/src/components/forms/status-report/sheet-create.tsx
@@ -0,0 +1,196 @@
+"use client";
+
+import { Button } from "@openstatus/ui/components/ui/button";
+import { Label } from "@openstatus/ui/components/ui/label";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@openstatus/ui/components/ui/select";
+import { Separator } from "@openstatus/ui/components/ui/separator";
+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
+import { useRef, useState } from "react";
+
+import {
+ EmptyStateContainer,
+ EmptyStateTitle,
+} from "@/components/content/empty-state";
+import { FormCard, FormCardGroup } from "@/components/forms/form-card";
+import {
+ FormSheetContent,
+ FormSheetDescription,
+ FormSheetFooter,
+ FormSheetHeader,
+ FormSheetTitle,
+ FormSheetTrigger,
+ FormSheetWithDirtyProtection,
+} from "@/components/forms/form-sheet";
+import { FormStatusReport } from "@/components/forms/status-report/form";
+import { toCheckboxTreeItems } from "@/components/ui/checkbox-tree";
+import { useTRPC } from "@/lib/trpc/client";
+
+/**
+ * Create-report sheet with a status page selector — for surfaces that are
+ * not scoped to a single page (e.g. /overview). `children` is the trigger.
+ */
+export function FormSheetStatusReportCreate({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ const [open, setOpen] = useState(false);
+ const [selectedPageId, setSelectedPageId] = useState<number | null>(null);
+ const trpc = useTRPC();
+ const queryClient = useQueryClient();
+ const { data: pages } = useQuery(trpc.page.list.queryOptions());
+ const { data: statusReports } = useQuery(
+ trpc.statusReport.list.queryOptions({}),
+ );
+
+ const pageId =
+ pages?.length === 1 ? pages[0].id : (selectedPageId ?? undefined);
+
+ const { data: page } = useQuery(
+ trpc.page.get.queryOptions(
+ { id: pageId ?? 0 },
+ { enabled: pageId !== undefined },
+ ),
+ );
+
+ const sendStatusReportUpdateMutation = useMutation(
+ trpc.subscriberNotification.statusReport.mutationOptions(),
+ );
+ const createStatusReportMutation = useMutation(
+ trpc.statusReport.create.mutationOptions({
+ onSuccess: (statusReport) => {
+ if (statusReport.notifySubscribers) {
+ sendStatusReportUpdateMutation.mutate({ id: statusReport.id });
+ }
+ // no-input prefix key — matches every statusReport.list query
+ queryClient.invalidateQueries({
+ queryKey: trpc.statusReport.list.queryKey(),
+ });
+ queryClient.invalidateQueries({
+ queryKey: trpc.page.list.queryKey(),
+ });
+ },
+ }),
+ );
+
+ const unresolvedReport =
+ pageId !== undefined
+ ? statusReports?.find(
+ (r) => r.pageId === pageId && r.status !== "resolved",
+ )
+ : undefined;
+
+ return (
+ <FormSheetWithDirtyProtection open={open} onOpenChange={setOpen}>
+ <FormSheetTrigger asChild>{children}</FormSheetTrigger>
+ <FormSheetContent className="sm:max-w-lg">
+ <FormSheetHeader>
+ <FormSheetTitle>Status Report</FormSheetTitle>
+ <FormSheetDescription>
+ Configure and update the status of your report.
+ </FormSheetDescription>
+ </FormSheetHeader>
+ {pages && pages.length > 1 ? (
+ <>
+ <div className="grid gap-1.5 px-4 py-4">
+ <Label htmlFor="status-page-select">Status Page</Label>
+ <Select
+ value={pageId !== undefined ? String(pageId) : undefined}
+ onValueChange={(value) => setSelectedPageId(Number(value))}
+ >
+ <SelectTrigger id="status-page-select" size="sm">
+ <SelectValue placeholder="Select a status page" />
+ </SelectTrigger>
+ <SelectContent>
+ {pages.map((p) => (
+ <SelectItem key={p.id} value={String(p.id)}>
+ {p.title}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
+ <Separator />
+ </>
+ ) : null}
+ {unresolvedReport ? (
+ <>
+ <p className="text-warning px-4 py-4 text-sm">
+ An unresolved report already exists for this page. Consider adding
+ a <span className="font-semibold">status report update</span>{" "}
+ instead.
+ </p>
+ <Separator />
+ </>
+ ) : null}
+ {pageId !== undefined ? (
+ <FormCardGroup className="overflow-y-scroll">
+ <FormCard className="overflow-auto rounded-none border-none">
+ <FormStatusReport
+ key={pageId}
+ id="status-report-form"
+ className="my-4"
+ items={toCheckboxTreeItems(
+ page?.pageComponents ?? [],
+ page?.pageComponentGroups ?? [],
+ )}
+ onSubmit={async (values) => {
+ // NOTE: for type safety, we need to check if the values have a date property
+ // because of the union type
+ if ("date" in values) {
+ // every selected component gets an impact row — fresh
+ // reports are never legacy; fallback must match the
+ // picker's defaultImpact
+ const componentImpacts = values.pageComponents.map(
+ (pageComponentId) => ({
+ pageComponentId,
+ impact:
+ values.componentImpacts?.find(
+ (ci) => ci.pageComponentId === pageComponentId,
+ )?.impact ?? ("degraded_performance" as const),
+ }),
+ );
+ await createStatusReportMutation.mutateAsync({
+ title: values.title,
+ status: values.status,
+ pageId,
+ pageComponents: values.pageComponents,
+ componentImpacts,
+ date: values.date,
+ message: values.message,
+ notifySubscribers: values.notifySubscribers,
+ });
+ setOpen(false);
+ }
+ }}
+ />
+ </FormCard>
+ </FormCardGroup>
+ ) : (
+ <EmptyStateContainer className="m-4">
+ <EmptyStateTitle>
+ {pages?.length === 0
+ ? "No status pages found"
+ : "Select a status page"}
+ </EmptyStateTitle>
+ </EmptyStateContainer>
+ )}
+ <FormSheetFooter>
+ <Button
+ type="submit"
+ form="status-report-form"
+ disabled={pageId === undefined}
+ >
+ Submit
+ </Button>
+ </FormSheetFooter>
+ </FormSheetContent>
+ </FormSheetWithDirtyProtection>
+ );
+}
diff --git a/apps/dashboard/src/components/metric/metric-card.tsx b/apps/dashboard/src/components/metric/metric-card.tsx
index c838f6016..515890964 100644
--- a/apps/dashboard/src/components/metric/metric-card.tsx
+++ b/apps/dashboard/src/components/metric/metric-card.tsx
@@ -4,6 +4,7 @@ import { cn } from "@openstatus/ui/lib/utils";
import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import { ChevronDown, ChevronUp } from "lucide-react";
+import Link from "next/link";
import type React from "react";
const metricCardVariants = cva(
@@ -16,6 +17,7 @@ const metricCardVariants = cva(
destructive: "border-destructive/80 bg-destructive/10",
success: "border-success/80 bg-success/10",
warning: "border-warning/80 bg-warning/10",
+ info: "border-info/80 bg-info/10",
},
},
defaultVariants: {
@@ -71,6 +73,7 @@ export function MetricCardHeader({
"group-data-[variant=destructive]:text-destructive",
"group-data-[variant=success]:text-success",
"group-data-[variant=warning]:text-warning",
+ "group-data-[variant=info]:text-info",
className,
)}
{...props}
@@ -183,6 +186,27 @@ export function MetricCardButton({
);
}
+export function MetricCardLink({
+ children,
+ className,
+ variant,
+ ...props
+}: React.ComponentProps<typeof Link> &
+ VariantProps<typeof metricCardVariants>) {
+ return (
+ <Link
+ data-variant={variant}
+ className={cn(
+ metricCardVariants({ variant, className }),
+ metricCardButtonVariants(),
+ )}
+ {...props}
+ >
+ {children}
+ </Link>
+ );
+}
+
export function MetricCardSkeleton({
className,
...props
@@ -193,6 +217,7 @@ export function MetricCardSkeleton({
"group-data-[variant=destructive]:bg-destructive/50",
"group-data-[variant=success]:bg-success/50",
"group-data-[variant=warning]:bg-warning/50",
+ "group-data-[variant=info]:bg-info/50",
className,
)}
{...props}
diff --git a/apps/dashboard/src/components/nav/nav-banner-checklist.tsx b/apps/dashboard/src/components/nav/nav-banner-checklist.tsx
index 4bbef8ab3..18fe04ace 100644
--- a/apps/dashboard/src/components/nav/nav-banner-checklist.tsx
+++ b/apps/dashboard/src/components/nav/nav-banner-checklist.tsx
@@ -8,7 +8,7 @@ import {
SidebarMenuItem,
} from "@openstatus/ui/components/ui/sidebar";
import { useQuery } from "@tanstack/react-query";
-import { CircleCheck, CircleDashed, X } from "lucide-react";
+import { ArrowUpRight, CircleCheck, CircleDashed, X } from "lucide-react";
import { Link } from "@/components/common/link";
import { useTRPC } from "@/lib/trpc/client";
@@ -20,14 +20,17 @@ export function NavBannerChecklist({
}) {
const trpc = useTRPC();
const { data: workspace } = useQuery(trpc.workspace.get.queryOptions());
+ const { data: pages } = useQuery(trpc.page.list.queryOptions());
if (!workspace) return null;
+ const onlyPage = pages?.length === 1 ? pages[0] : undefined;
+
const hasMonitors = (workspace.usage?.monitors ?? 0) > 0;
const hasStatusPages = (workspace.usage?.pages ?? 0) > 0;
- const hastNotifications = (workspace.usage?.notifications ?? 0) > 0;
-
- if (hasMonitors && hasStatusPages && hastNotifications) return null;
+ const hasPageComponents = (workspace.usage?.pageComponents ?? 0) > 0;
+ const hasNotifications = (workspace.usage?.notifications ?? 0) > 0;
+ const hasStatusReports = (workspace.usage?.statusReports ?? 0) > 0;
const items = [
{
@@ -40,17 +43,36 @@ export function NavBannerChecklist({
checked: hasStatusPages,
href: "/status-pages/create",
},
+ {
+ title: "Add Page Components",
+ checked: hasPageComponents,
+ href: onlyPage
+ ? `/status-pages/${onlyPage.id}/components`
+ : "/status-pages",
+ },
+ {
+ title: "Create Status Report",
+ checked: hasStatusReports,
+ href: onlyPage
+ ? `/status-pages/${onlyPage.id}/status-reports`
+ : "/status-pages",
+ },
{
title: "Create Notification",
- checked: hastNotifications,
+ checked: hasNotifications,
href: "/notifications",
},
];
+ if (items.every((i) => i.checked)) return null;
+
return (
<SidebarGroup className="bg-background rounded-lg border group-data-[collapsible=icon]:hidden">
<SidebarGroupLabel className="flex items-center justify-between pr-1">
- <span>Getting Started</span>
+ <span>
+ Getting Started ({items.filter((i) => i.checked).length}/
+ {items.length})
+ </span>
<SidebarMenuAction
className="relative top-0 right-0"
onClick={handleClose}
@@ -80,6 +102,19 @@ export function NavBannerChecklist({
)}
</SidebarMenuItem>
))}
+ <SidebarMenuItem className="flex items-center gap-2 text-sm">
+ <ArrowUpRight
+ className="text-muted-foreground/50 shrink-0"
+ size={12}
+ />
+ <a
+ href="https://www.openstatus.dev/docs"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ Read the Docs
+ </a>
+ </SidebarMenuItem>
</SidebarMenu>
</SidebarGroup>
);
diff --git a/apps/dashboard/src/components/onboarding/checks-table-adapter.ts b/apps/dashboard/src/components/onboarding/checks-table-adapter.ts
index e07e9673a..b82aec826 100644
--- a/apps/dashboard/src/components/onboarding/checks-table-adapter.ts
+++ b/apps/dashboard/src/components/onboarding/checks-table-adapter.ts
@@ -1,20 +1,8 @@
-import type {
- CheckResult,
- CheckResultSuccess,
-} from "@openstatus/services/monitor";
+import type { CheckResult } from "@openstatus/services/monitor";
+import { calculateTiming } from "@openstatus/tinybird/src/schema";
import type { OnboardingChecksRow } from "./checks-table";
-function calculatePhases(timing: CheckResultSuccess["timing"]) {
- return {
- dns: timing.dnsDone - timing.dnsStart,
- connect: timing.connectDone - timing.connectStart,
- tls: timing.tlsHandshakeDone - timing.tlsHandshakeStart,
- ttfb: timing.firstByteDone - timing.firstByteStart,
- transfer: timing.transferDone - timing.transferStart,
- };
-}
-
/**
* Adapt a Go-checker preview result into the `ResponseLog` shape
* `getColumns` and `<Sheet>` expect. The synthesized row is "rich enough"
@@ -22,8 +10,7 @@ function calculatePhases(timing: CheckResultSuccess["timing"]) {
*
* - `id` is set to `region` — synthetic but stable for selection.
* - `requestStatus` derived from status + state.
- * - `timing` is the raw start/done timestamps that `<HoverCardTiming>`
- * diffs into phases.
+ * - `timing` is the phase durations `<HoverCardTiming>` renders.
* - `workspaceId` is intentionally `""` — no current row renderer
* (`columns.tsx`, `data-table-basics.tsx`, `data-table-sheet.tsx`)
* reads it. If a future renderer constructs a URL from `workspaceId`,
@@ -62,7 +49,7 @@ export function checkResultToResponseLog(
const requestStatus =
result.status >= 400 ? "error" : result.status >= 200 ? "success" : "error";
- const phases = result.timing ? calculatePhases(result.timing) : null;
+ const phases = result.timing ? calculateTiming(result.timing) : null;
return {
type: "http",
diff --git a/apps/dashboard/src/data/overview-events.client.ts b/apps/dashboard/src/data/overview-events.client.ts
new file mode 100644
index 000000000..02e8aab49
--- /dev/null
+++ b/apps/dashboard/src/data/overview-events.client.ts
@@ -0,0 +1,202 @@
+import type { RouterOutputs } from "@openstatus/api";
+import {
+ Activity,
+ type LucideIcon,
+ Megaphone,
+ PanelTop,
+ Siren,
+ Wrench,
+} from "lucide-react";
+
+type Incident = RouterOutputs["incident"]["list"][number];
+type StatusReport = RouterOutputs["statusReport"]["list"][number];
+type Maintenance = RouterOutputs["maintenance"]["list"][number];
+
+export type OverviewEvent =
+ | { type: "incident"; incident: Incident }
+ | { type: "report"; report: StatusReport }
+ | { type: "maintenance"; maintenance: Maintenance };
+
+export const eventTypeConfig = {
+ incident: { label: "Incident", icon: Siren },
+ report: { label: "Status Report", icon: Megaphone },
+ maintenance: { label: "Maintenance", icon: Wrench },
+} as const;
+
+export type OverviewEventType = keyof typeof eventTypeConfig;
+
+export const incidentStatusConfig = {
+ ongoing: { label: "Ongoing", color: "text-destructive/80" },
+ acknowledged: { label: "Acknowledged", color: "text-warning/80" },
+ resolved: { label: "Resolved", color: "text-success/80" },
+} as const;
+
+export type IncidentStatus = keyof typeof incidentStatusConfig;
+
+export const maintenanceStatusConfig = {
+ scheduled: { label: "Scheduled", color: "text-info/80" },
+ "in-progress": { label: "In Progress", color: "text-info/80" },
+ completed: { label: "Completed", color: "text-info/80" },
+} as const;
+
+export type MaintenanceStatus = keyof typeof maintenanceStatusConfig;
+
+export function getIncidentStatus(incident: {
+ acknowledgedAt: Date | null;
+ resolvedAt: Date | null;
+}): IncidentStatus {
+ if (incident.resolvedAt) return "resolved";
+ if (incident.acknowledgedAt) return "acknowledged";
+ return "ongoing";
+}
+
+export function getMaintenanceStatus(
+ maintenance: { from: Date; to: Date },
+ now = new Date(),
+): MaintenanceStatus {
+ if (now < maintenance.from) return "scheduled";
+ if (now > maintenance.to) return "completed";
+ return "in-progress";
+}
+
+function reportStartedAt(report: StatusReport): Date {
+ const dates = report.updates.map((u) => u.date.getTime());
+ if (dates.length) return new Date(Math.min(...dates));
+ return report.createdAt ?? new Date(0);
+}
+
+function reportResolvedAt(report: StatusReport): Date | null {
+ if (report.status !== "resolved") return null;
+ const dates = report.updates.map((u) => u.date.getTime());
+ // legacy resolved report without updates: fall back to updatedAt
+ if (!dates.length) return report.updatedAt ?? report.createdAt;
+ return new Date(Math.max(...dates));
+}
+
+export function getStartedAt(event: OverviewEvent): Date {
+ switch (event.type) {
+ case "incident":
+ return event.incident.startedAt;
+ case "report":
+ return reportStartedAt(event.report);
+ case "maintenance":
+ return event.maintenance.from;
+ }
+}
+
+export function getResolvedAt(event: OverviewEvent): Date | null {
+ switch (event.type) {
+ case "incident":
+ return event.incident.resolvedAt;
+ case "report":
+ return reportResolvedAt(event.report);
+ case "maintenance":
+ return event.maintenance.to;
+ }
+}
+
+function isOpen(event: OverviewEvent, now: Date): boolean {
+ switch (event.type) {
+ case "incident":
+ return !event.incident.resolvedAt;
+ case "report":
+ return event.report.status !== "resolved";
+ case "maintenance":
+ return event.maintenance.to >= now;
+ }
+}
+
+export type OverviewMetric = {
+ title: string;
+ value: number;
+ href?: string;
+ variant: "default" | "destructive" | "warning" | "info";
+ icon: LucideIcon;
+};
+
+export function buildOverviewData(
+ {
+ monitors,
+ pages,
+ incidents,
+ statusReports,
+ maintenances,
+ }: {
+ monitors: RouterOutputs["monitor"]["list"];
+ pages: RouterOutputs["page"]["list"];
+ incidents: Incident[];
+ statusReports: StatusReport[];
+ maintenances: Maintenance[];
+ },
+ now = new Date(),
+) {
+ const sevenDaysAgo = new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000);
+
+ const events: OverviewEvent[] = [
+ ...incidents.map((incident) => ({ type: "incident" as const, incident })),
+ ...statusReports.map((report) => ({ type: "report" as const, report })),
+ ...maintenances.map((maintenance) => ({
+ type: "maintenance" as const,
+ maintenance,
+ })),
+ ];
+
+ const needsAttention = events.filter(
+ (event) => event.type !== "maintenance" && isOpen(event, now),
+ );
+ // calendar, not triage — scheduled/in-progress maintenance gets its own section
+ const upcomingMaintenances = events.filter(
+ (event) => event.type === "maintenance" && isOpen(event, now),
+ );
+ const recentlyResolved = events.filter((event) => {
+ if (isOpen(event, now)) return false;
+ const resolvedAt = getResolvedAt(event);
+ return resolvedAt !== null && resolvedAt >= sevenDaysAgo;
+ });
+
+ const openIncidents = incidents.filter((i) => !i.resolvedAt);
+ const openReports = statusReports.filter((r) => r.status !== "resolved");
+ const activeMaintenances = maintenances.filter((m) => m.to >= now);
+
+ const metrics: OverviewMetric[] = [
+ {
+ title: "Monitors",
+ value: monitors.length,
+ href: "/monitors",
+ variant: "default",
+ icon: Activity,
+ },
+ {
+ title: "Status Pages",
+ value: pages.length,
+ href: "/status-pages",
+ variant: "default",
+ icon: PanelTop,
+ },
+ {
+ title: "Open Incidents",
+ value: openIncidents.length,
+ variant: openIncidents.length > 0 ? "destructive" : "default",
+ icon: eventTypeConfig.incident.icon,
+ },
+ {
+ title: "Open Reports",
+ value: openReports.length,
+ variant: openReports.length > 0 ? "warning" : "default",
+ icon: eventTypeConfig.report.icon,
+ },
+ {
+ title: "Scheduled Maintenances",
+ value: activeMaintenances.length,
+ variant: activeMaintenances.length > 0 ? "info" : "default",
+ icon: eventTypeConfig.maintenance.icon,
+ },
+ ];
+
+ return {
+ needsAttention,
+ upcomingMaintenances,
+ recentlyResolved,
+ metrics,
+ };
+}
diff --git a/packages/api/src/router/page.ts b/packages/api/src/router/page.ts
index 733b425eb..1ad64dcc6 100644
--- a/packages/api/src/router/page.ts
+++ b/packages/api/src/router/page.ts
@@ -50,17 +50,43 @@ async function addDomainToVercel(domain: string) {
if (!response.ok) {
const error = await response.json().catch(() => ({}));
+ const code = error?.error?.code;
console.error("Failed to add domain to Vercel:", { domain, error });
- throw new TRPCError({
- code: "INTERNAL_SERVER_ERROR",
- message:
- "Failed to add custom domain. Please try again. If it continues, contact support.",
- });
+ throw toDomainError(domain, code);
}
return response.json();
}
+// Vercel messages leak internal project details, so map known codes to our own copy.
+function toDomainError(domain: string, code?: string): TRPCError {
+ switch (code) {
+ case "domain_already_in_use":
+ return new TRPCError({
+ code: "CONFLICT",
+ message: `The domain '${domain}' is already in use by another status page. Remove it there first or contact support.`,
+ });
+ case "invalid_domain":
+ case "not_found":
+ return new TRPCError({
+ code: "BAD_REQUEST",
+ message: `The domain '${domain}' is invalid.`,
+ });
+ case "forbidden":
+ case "domain_taken":
+ return new TRPCError({
+ code: "FORBIDDEN",
+ message: `The domain '${domain}' belongs to another team on our hosting provider. Contact support if you own it.`,
+ });
+ default:
+ return new TRPCError({
+ code: "INTERNAL_SERVER_ERROR",
+ message:
+ "Failed to add custom domain. Please try again. If it continues, contact support.",
+ });
+ }
+}
+
async function removeDomainFromVercel(domain: string) {
const response = await fetch(
`https://api.vercel.com/v9/projects/${env.PROJECT_ID_VERCEL}/domains/${domain}?teamId=${env.TEAM_ID_VERCEL}`,
diff --git a/packages/db/src/schema/workspaces/validation.ts b/packages/db/src/schema/workspaces/validation.ts
index 5d9deb0bc..b8e514bed 100644
--- a/packages/db/src/schema/workspaces/validation.ts
+++ b/packages/db/src/schema/workspaces/validation.ts
@@ -56,6 +56,7 @@ export const selectWorkspaceSchema = createSelectSchema(workspace)
notifications: z.number().prefault(0),
pages: z.number().prefault(0),
pageComponents: z.number().prefault(0),
+ statusReports: z.number().prefault(0),
// checks: z.number().default(0),
})
.nullish(),
diff --git a/packages/db/src/schema/workspaces/workspace.ts b/packages/db/src/schema/workspaces/workspace.ts
index 5b529af20..e9269b8ea 100644
--- a/packages/db/src/schema/workspaces/workspace.ts
+++ b/packages/db/src/schema/workspaces/workspace.ts
@@ -4,6 +4,7 @@ import { integer, sqliteTable, text, unique } from "drizzle-orm/sqlite-core";
import { monitor } from "../monitors";
import { notification } from "../notifications";
import { page } from "../pages";
+import { statusReport } from "../status_reports";
import { usersToWorkspaces } from "../users";
import { workspacePlans } from "./constants";
@@ -39,5 +40,6 @@ export const workspaceRelations = relations(workspace, ({ many }) => ({
pages: many(page),
monitors: many(monitor),
notifications: many(notification),
+ statusReports: many(statusReport),
// TODO: add checks or monitorRuns
}));
diff --git a/packages/services/src/workspace/__tests__/workspace.test.ts b/packages/services/src/workspace/__tests__/workspace.test.ts
index 6efc00f55..46cc4e385 100644
--- a/packages/services/src/workspace/__tests__/workspace.test.ts
+++ b/packages/services/src/workspace/__tests__/workspace.test.ts
@@ -1,5 +1,5 @@
import { eq } from "@openstatus/db";
-import { workspace } from "@openstatus/db/src/schema";
+import { statusReport, workspace } from "@openstatus/db/src/schema";
import { expect } from "@std/expect";
import { beforeAll, describe, test } from "@std/testing/bdd";
@@ -57,6 +57,7 @@ describe("getWorkspaceWithUsage", () => {
"notifications",
"pages",
"pageComponents",
+ "statusReports",
"checks",
] as const) {
const value = result.usage[key];
@@ -68,6 +69,20 @@ describe("getWorkspaceWithUsage", () => {
expect(result.usage.checks).toBe(0);
});
});
+
+ test("counts workspace-scoped status reports", async () => {
+ await withTestTransaction(async (tx) => {
+ await tx.insert(statusReport).values({
+ workspaceId: SEEDED_WORKSPACE_TEAM_ID,
+ status: "investigating",
+ title: "svc-ws-test-status-report",
+ });
+ const result = await getWorkspaceWithUsage({
+ ctx: { ...teamCtx, db: tx },
+ });
+ expect(result.usage.statusReports).toBeGreaterThanOrEqual(1);
+ });
+ });
});
describe("listWorkspaces", () => {
diff --git a/packages/services/src/workspace/list.ts b/packages/services/src/workspace/list.ts
index 6c82a085f..ba9f45214 100644
--- a/packages/services/src/workspace/list.ts
+++ b/packages/services/src/workspace/list.ts
@@ -24,6 +24,7 @@ export type WorkspaceUsage = {
notifications: number;
pages: number;
pageComponents: number;
+ statusReports: number;
checks: number;
};
@@ -71,6 +72,7 @@ export async function getWorkspaceWithUsage(args: {
where: isNull(monitor.deletedAt),
},
notifications: true,
+ statusReports: { columns: { id: true } },
},
});
@@ -86,6 +88,7 @@ export async function getWorkspaceWithUsage(args: {
pages: result.pages?.length ?? 0,
pageComponents:
result.pages?.flatMap((page) => page.pageComponents)?.length ?? 0,
+ statusReports: result.statusReports?.length ?? 0,
// Parity with the legacy router — checks usage was previously commented
// out pending a real source and left as 0. Preserved here.
checks: 0,
diff --git a/packages/tinybird/package.json b/packages/tinybird/package.json
index c575aa6a6..2084c0f54 100644
--- a/packages/tinybird/package.json
+++ b/packages/tinybird/package.json
@@ -4,7 +4,8 @@
"license": "MIT",
"main": "src/index.ts",
"scripts": {
- "check": "deno check --sloppy-imports ."
+ "check": "deno check --sloppy-imports .",
+ "test": "deno test --parallel -A --no-check --sloppy-imports"
},
"dependencies": {
"@chronark/zod-bird": "catalog:",
@@ -15,6 +16,8 @@
"@openstatus/db": "workspace:*",
"@openstatus/tsconfig": "workspace:*",
"@openstatus/utils": "workspace:*",
+ "@std/expect": "jsr:^1.0.19",
+ "@std/testing": "jsr:^1.0.19",
"@types/node": "catalog:",
"drizzle-orm": "catalog:",
"typescript": "catalog:"
diff --git a/packages/tinybird/src/schema.test.ts b/packages/tinybird/src/schema.test.ts
new file mode 100644
index 000000000..de42ed20f
--- /dev/null
+++ b/packages/tinybird/src/schema.test.ts
@@ -0,0 +1,74 @@
+import { expect } from "@std/expect";
+import { describe, test } from "@std/testing/bdd";
+
+import { calculateTiming } from "./schema";
+
+// Absolute epoch-ms timestamps, as emitted by the checker's httptrace hooks.
+const base = 1_782_880_607_000;
+const completeTiming = {
+ dnsStart: base,
+ dnsDone: base + 5,
+ connectStart: base + 5,
+ connectDone: base + 6,
+ tlsHandshakeStart: base + 6,
+ tlsHandshakeDone: base + 16,
+ firstByteStart: base + 16,
+ firstByteDone: base + 116,
+ transferStart: base + 116,
+ transferDone: base + 120,
+};
+
+describe("calculateTiming", () => {
+ test("computes phase durations from complete timing", () => {
+ expect(calculateTiming(completeTiming)).toEqual({
+ dns: 5,
+ connect: 1,
+ tls: 10,
+ ttfb: 100,
+ transfer: 4,
+ });
+ });
+
+ test("clamps phases whose end hook never fired to 0", () => {
+ // timeout after connect: first byte never arrived
+ const timing = {
+ ...completeTiming,
+ firstByteDone: 0,
+ transferStart: 0,
+ transferDone: 0,
+ };
+
+ expect(calculateTiming(timing)).toEqual({
+ dns: 5,
+ connect: 1,
+ tls: 10,
+ ttfb: 0,
+ transfer: 0,
+ });
+ });
+
+ test("clamps phases whose start hook never fired to 0", () => {
+ const timing = { ...completeTiming, transferStart: 0 };
+
+ expect(calculateTiming(timing)?.transfer).toBe(0);
+ });
+
+ test("never returns negative durations for unmeasured phases", () => {
+ const timing = {
+ dnsStart: 0,
+ dnsDone: 0,
+ connectStart: 0,
+ connectDone: 0,
+ tlsHandshakeStart: 0,
+ tlsHandshakeDone: 0,
+ firstByteStart: base,
+ firstByteDone: 0,
+ transferStart: 0,
+ transferDone: 0,
+ };
+
+ for (const value of Object.values(calculateTiming(timing) ?? {})) {
+ expect(value).toBe(0);
+ }
+ });
+});
diff --git a/packages/tinybird/src/schema.ts b/packages/tinybird/src/schema.ts
index 81e0772e6..aae67c4e0 100644
--- a/packages/tinybird/src/schema.ts
+++ b/packages/tinybird/src/schema.ts
@@ -43,15 +43,22 @@ export function transformTiming(val: string) {
return null;
}
+// 0 = phase hook never fired (e.g. timeout before first byte); subtracting
+// absolute epoch timestamps would yield huge negative durations.
+function phaseDuration(start: number, done: number) {
+ if (start === 0 || done === 0) return 0;
+ return done - start;
+}
+
export function calculateTiming(obj: z.infer<typeof httpTimingSchema>) {
if (!obj) return null;
return {
- dns: obj.dnsDone - obj.dnsStart,
- connect: obj.connectDone - obj.connectStart,
- tls: obj.tlsHandshakeDone - obj.tlsHandshakeStart,
- ttfb: obj.firstByteDone - obj.firstByteStart,
- transfer: obj.transferDone - obj.transferStart,
+ dns: phaseDuration(obj.dnsStart, obj.dnsDone),
+ connect: phaseDuration(obj.connectStart, obj.connectDone),
+ tls: phaseDuration(obj.tlsHandshakeStart, obj.tlsHandshakeDone),
+ ttfb: phaseDuration(obj.firstByteStart, obj.firstByteDone),
+ transfer: phaseDuration(obj.transferStart, obj.transferDone),
};
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 43da4219d..fd4f9cdd8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -769,7 +769,7 @@ importers:
next-auth:
specifier: 'catalog:'
next-themes:
specifier: 'catalog:'
@@ -1216,7 +1216,7 @@ importers:
next-auth:
specifier: 'catalog:'
next-intl:
specifier: 'catalog:'
@@ -1484,7 +1484,7 @@ importers:
next-auth:
specifier: 'catalog:'
next-mdx-remote:
specifier: 'catalog:'
version: 6.0.0(@types/[email protected])([email protected])
@@ -1992,7 +1992,7 @@ importers:
version: 0.31.10
next-auth:
specifier: 'catalog:'
typescript:
specifier: 'catalog:'
version: 5.9.3
@@ -2806,6 +2806,12 @@ importers:
'@openstatus/utils':
specifier: workspace:*
version: link:../utils
+ '@std/expect':
+ specifier: jsr:^1.0.19
+ version: '@jsr/[email protected]'
+ '@std/testing':
+ specifier: jsr:^1.0.19
+ version: '@jsr/[email protected]'
'@types/node':
specifier: 'catalog:'
version: 24.12.4
@@ -18334,7 +18340,7 @@ snapshots:
dependencies:
'@auth/core': 0.41.2