The UI worked but read as an operator console: no public face, no way to describe or sell the thing, and no account surface beyond the node list. This adds the missing halves and reorganises what was already there around the incident, which is the unit of value the rest of the pipeline is built to produce. A shared design system replaces per-page styling: components/ui (Button, Card, Badge, EmptyState, Skeleton, PageHeader), a type scale and shadow set in the Tailwind config, and light-mode tokens in globals.css. The existing html:not(.dark) remap mechanism is extended rather than replaced -- a parallel theming system would have been two sources of truth for the same colours. Public marketing pages (/, /features, /pricing, /faq) load without a session. middleware.ts gained a PUBLIC_PATHS allowlist to permit that; it remains a UX redirect and is still NOT an authorisation boundary, which the comment there says explicitly. Real enforcement is unchanged and still lives server-side in c2-core's auth.py. Chrome switching is done by pathname in ChromeSwitcher instead of by route group, because a route group would have collided on / and forced most of app/ to move for no behavioural gain. Billing and API keys ship as typed stubs, not integrations. lib/billing.ts and lib/apiKeys.ts define the data model and the screens consume it, but every mutating call throws with a message naming the backend route that has to exist first, and the sample data is labelled as sample. Nothing here can charge anyone or mint a real credential -- picking a payment processor and holding its keys is a decision for a human, and a half-wired checkout is worse than an obviously absent one. The severity work from the c2-core change lands here too. severity is now a filter and sort dimension on the incident list rather than decoration, since a busy dispatch channel is only readable if you can collapse it to moderate and above. routine gets a muted treatment because it is the majority of traffic, legacy "unknown" still renders nothing, and TypeBadge handles the new "other" incident type. Severity rendering moved into lib/severity.tsx so the incident list, incident detail and call rows cannot drift apart. Deliberately not touched: calls, map, alerts, nodes, systems, tokens, trips and admin. They already share the palette and stay coherent, and rewriting them would have buried the parts that actually needed to change. No colour tokens were renamed, so nothing regressed there. Verified with tsc --noEmit (npm run typecheck), clean. No runtime verification was possible and none was done. No new environment variables.
28 lines
912 B
TypeScript
28 lines
912 B
TypeScript
/** Loading placeholder block. Use instead of a bare "Loading…" string wherever the eventual
|
|
* content has a predictable shape (cards, table rows, stat tiles). */
|
|
export function Skeleton({ className }: { className?: string }) {
|
|
return <div className={`skeleton bg-gray-800 rounded-md ${className ?? "h-4 w-full"}`} />;
|
|
}
|
|
|
|
export function SkeletonCard() {
|
|
return (
|
|
<div className="bg-gray-900 border border-gray-800 rounded-xl p-4 space-y-3">
|
|
<Skeleton className="h-4 w-1/3" />
|
|
<Skeleton className="h-3 w-2/3" />
|
|
<Skeleton className="h-3 w-1/2" />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export function SkeletonRow({ cols = 5 }: { cols?: number }) {
|
|
return (
|
|
<tr className="border-b border-gray-800">
|
|
{Array.from({ length: cols }).map((_, i) => (
|
|
<td key={i} className="px-4 py-3">
|
|
<Skeleton className="h-3 w-full max-w-[8rem]" />
|
|
</td>
|
|
))}
|
|
</tr>
|
|
);
|
|
}
|