Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| A menu shaped by how g1t works, Soon pages for every promise, and sudo for sales | 1 | import { isRouteErrorResponse, Links, Meta, Outlet, useRouteLoaderData } from "react-router"; |
| Billing accounts, terms and enterprises; g1t is no longer free | 2 | |
| 3 | import type { Route } from "./+types/root"; | |
| 4 | import "./app.css"; | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 5 | import displayFont from "@g1t/theme/fonts/bricolage-grotesque-latin.woff2?url"; |
| 6 | import sansFont from "@g1t/theme/fonts/hanken-grotesk-latin.woff2?url"; | |
| A menu shaped by how g1t works, Soon pages for every promise, and sudo for sales | 7 | import { MobileBar, Sidebar } from "./components/shell"; |
| Billing accounts, terms and enterprises; g1t is no longer free | 8 | import { ButtonLink } from "./components/ui"; |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 9 | import type { NavCounts } from "./lib/nav"; |
| 10 | import { identity, statusAdmin } from "./lib/services.server"; | |
| 11 | import { settle } from "./lib/settle"; | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 12 | import { requireStaff, zoneContext } from "./lib/staff"; |
| Billing accounts, terms and enterprises; g1t is no longer free | 13 | |
| 14 | export const links: Route.LinksFunction = () => [ | |
| 15 | { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" }, | |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 16 | // The faces are served by sudo itself (@g1t/theme); these two are on every page. |
| 17 | { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, | |
| 18 | { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, | |
| Billing accounts, terms and enterprises; g1t is no longer free | 19 | ]; |
| 20 | ||
| 21 | export const meta: Route.MetaFunction = () => [ | |
| 22 | { title: "sudo · g1t" }, | |
| 23 | { name: "robots", content: "noindex, nofollow" }, | |
| 24 | ]; | |
| 25 | ||
| 26 | export async function loader({ context }: Route.LoaderArgs) { | |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 27 | const { email } = requireStaff(context); |
| 28 | // The sidebar's counts: a service that does not answer shows none. | |
| 29 | const [waitlist, incidents] = await Promise.all([settle(identity.waitlistPending()), settle(statusAdmin.openCount())]); | |
| 30 | const counts: NavCounts = { waitlist: waitlist.ok ? waitlist.value : 0, incidents: incidents.ok ? incidents.value : 0 }; | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 31 | // Every page says times in this zone (components/ui.tsx `When`). |
| 32 | const { zone, chosen } = context.get(zoneContext); | |
| 33 | return { email, counts, zone, zoneChosen: chosen }; | |
| Billing accounts, terms and enterprises; g1t is no longer free | 34 | } |
| 35 | ||
| 36 | export function Layout({ children }: { children: React.ReactNode }) { | |
| 37 | const root = useRouteLoaderData<typeof loader>("root"); | |
| 38 | return ( | |
| 39 | <html lang="en"> | |
| 40 | <head> | |
| 41 | <meta charSet="utf-8" /> | |
| 42 | <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| 43 | <meta name="theme-color" content="#0f0f11" /> | |
| 44 | <Meta /> | |
| 45 | <Links /> | |
| 46 | </head> | |
| A menu shaped by how g1t works, Soon pages for every promise, and sudo for sales | 47 | <body className="min-h-screen"> |
| status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas | 48 | <Sidebar email={root?.email} counts={root?.counts} /> |
| 49 | <MobileBar email={root?.email} counts={root?.counts} /> | |
| A menu shaped by how g1t works, Soon pages for every promise, and sudo for sales | 50 | <div className="lg:pl-60">{children}</div> |
| Billing accounts, terms and enterprises; g1t is no longer free | 51 | {/* No <Scripts />: sudo ships no JavaScript, and its policy allows none. */} |
| 52 | </body> | |
| 53 | </html> | |
| 54 | ); | |
| 55 | } | |
| 56 | ||
| 57 | export default function App() { | |
| 58 | return <Outlet />; | |
| 59 | } | |
| 60 | ||
| 61 | export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { | |
| 62 | let title = "Something went wrong"; | |
| 63 | let details = "An unexpected error occurred."; | |
| 64 | if (isRouteErrorResponse(error)) { | |
| 65 | title = error.status === 404 ? "Not found" : `Error ${error.status}`; | |
| 66 | details = typeof error.data === "string" && error.data ? error.data : error.statusText || details; | |
| 67 | } else if (error instanceof Error) { | |
| 68 | // Staff only: the real reason helps more than a polite one. | |
| 69 | details = error.message; | |
| 70 | } | |
| 71 | return ( | |
| 72 | <main className="mx-auto max-w-xl px-4 py-24 text-center"> | |
| 73 | <h1 className="text-2xl font-semibold tracking-tight">{title}</h1> | |
| 74 | <p className="mt-3 break-words text-muted">{details}</p> | |
| 75 | <div className="mt-8"> | |
| 76 | <ButtonLink to="/" variant="quiet"> | |
| A menu shaped by how g1t works, Soon pages for every promise, and sudo for sales | 77 | Back to the overview |
| Billing accounts, terms and enterprises; g1t is no longer free | 78 | </ButtonLink> |
| 79 | </div> | |
| 80 | </main> | |
| 81 | ); | |
| 82 | } |