Skip to content
564 linesCodeBlameRaw

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.

Merge branch 'worktree-agent-a64e51c8f386f46ac'1import { useEffect, useMemo, useRef, useState } from "react";
Secrets and variables kept from before stay with workflows2import {
3 isRouteErrorResponse,
4 Link,
5 Links,
6 Meta,
7 Outlet,
8 Scripts,
9 ScrollRestoration,
10 type ShouldRevalidateFunctionArgs,
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put11 useLocation,
Usage, Billing settings and prepaid AI credit; fixes from the UX audit12 useMatches,
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas13 useRouteError,
Secrets and variables kept from before stay with workflows14 useRouteLoaderData,
15} from "react-router";
16
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)17import { type User, awaitsConfirmation, hasAccessIn, sharedWorkspaces } from "@g1t/contracts";
Secrets and variables kept from before stay with workflows18
19import type { Route } from "./+types/root";
Load the stylesheet first; plain legal contact details20import appCss from "./app.css?url";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look21import displayFont from "@g1t/theme/fonts/bricolage-grotesque-latin.woff2?url";
22import sansFont from "@g1t/theme/fonts/hanken-grotesk-latin.woff2?url";
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.23import { ButtonLink } from "./components/ui";
The site is built from its shared components: one Button with its variants and sizes, one Badge, Card for every panel, Alert for notices, Kbd for keys, Table for the security tables, and Avatar, Command, Progress, ScrollArea, ToggleGroup, Collapsible and Accordion in the kit; raw buttons, hand-drawn cards and pills and per-file button class lists are gone, outline buttons stand the same height as filled ones, and the phone's Ask g1t loses its tile. Every page was compared pixel by pixel before and after.24import { Card } from "./components/ui/card";
Merge branch 'worktree-agent-aca4790ea223aa235'25import { AppShell, Progress, type ShellData, useLeaving } from "./components/shell";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look26import { SiteFooter } from "./components/footer";
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.27import { PublicHeader } from "./components/public-header";
Fast pages, required checks on the branch, self-hosted runners, honest incidents28import { SpikeBanner } from "./components/spike-banner";
Merge main (membership, two-factor, GitHub repo roles) into tokens29import { PolicyNotice } from "./components/policy-notice";
Merge site-audit: SEO routes, analytics with consent first in Europe, security page, founder and X account, docs header; the tour opens on the pull request and leads with Code, on the real shell, with Agents and Docs working today30import { identify } from "./lib/analytics.client";
31import { visitorAsksFirst } from "./lib/analytics-consent";
32import { AnalyticsConsent } from "./components/analytics-consent";
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put33import { readCookie } from "./lib/mission";
34import { WORKSPACE_COOKIE, workspaceFor } from "./lib/workspace-choice";
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in35import { PageMain } from "./components/landmark";
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put36import { NotFound } from "./components/not-found";
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.37import { frameOf } from "./lib/chrome";
The apps you pin to your dock are kept with your account, per workspace and in your order, so the dock is the same on every device: identity keeps them in dock_pins and answers dock_pins and set_dock_pins, the dock reads them with the rest of the page, pins kept only on this device carry over with your first change, this device's copy still draws the dock when identity can't be reached, a pin that can't be saved says so, and they go when you or the workspace do; the workspaces guide says how.38import { DOCK_COOKIE, SIDEBAR_COOKIE, pinsToShow, sidebarClosed } from "./lib/apps";
39import { savedPins } from "./lib/dock.server";
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.40import { StandaloneFrame } from "./components/standalone";
An agent is on teams the way a person is: through team membership, with no team or department of its own. Add it to teams when you create it, from its profile or from the team's page; the Agents sidebar groups agents by the teams they're on, with those on none last; what an agent is told about its teammates, team budgets, skills reach, Spend's By team and the People pages all read memberships. Agents with an old team name matching a team are moved onto it once; the rest are left off a team. Templates name a role only. The agents, teams and people guides say how.41import { billing, chat, identity, inbox, projects, workspaceAgents } from "./lib/services.server";
42import { teamsByAgent } from "./lib/people";
Chat and workspace agents: channels, DMs and named agents you talk to43import { unreadTotals } from "./lib/chat";
Fast pages, required checks on the branch, self-hosted runners, honest incidents44import { countsFor, readableRepos } from "./lib/access.server";
45import { shortCache } from "./lib/cache.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look46import { getViewer, viewerMiddleware } from "./lib/session.server";
Navigation: the workspace's own page with tabs, pins and recent in the sidebar47import { shortcutOf, workspaceProjects } from "./lib/workspace-projects.server";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look48import { registrationMode } from "./lib/registration.server";
Merge branch 'worktree-agent-aaf03bdceac799c89'49import { addresses } from "./lib/addresses.server";
Merge branch 'worktree-agent-a64e51c8f386f46ac'50import { RELOADED_KEY, RELOAD_GIVE_UP_MS, clientNavigated, reloadFixes, reloadedBefore } from "./lib/stale-build";
Merge g1tusercontent.com: registry answers run nothing in a browser, the site's pages run only their own scripts, repository files and avatars on their own origin, raw files rate limited per address51import { useNonce } from "./lib/nonce";
Merge main into Artifacts Phase 252import { isNeedsSignIn } from "./lib/website-token";
A doc opens at once: the page carries the document's saved state, so the editor mounts without waiting for its live room, which connects in the background and sends only what changed, with a quiet dot that turns green when it's synced; edits made before then are kept and sent once. The editor's code is preloaded from the page and fetched early when you hover a doc, the app's shared code ships in a few chunks instead of a hundred small ones, socket tickets come with the page instead of a round trip, and the artifacts service answers a page, a sidebar and a room in parallel lookups instead of a dozen in a row, reporting its database round trips in Server-Timing. The artifacts guide says how a doc opens, and CONTRIBUTING's Speed section has the numbers.53import { offerTicket, setLiveViaToken } from "./lib/live-socket";
54import { socketTicketFor } from "./lib/socket-ticket.server";
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)55import { LiveNotifications } from "./components/notifications/live-notifications";
You choose how g1t looks: Auto follows your system, Light and Dark stay put, set from the account menu, the phone's You and help sheet, Settings → Account or the command palette; the page is drawn in your choice from the first byte, every colour has a light value that reads at 4.5:1 or better, code and diffs are highlighted for both, diagrams and the document editor follow along, the product tour and the g1t mark's avatar stay dark, and Dark is what you see until you choose; the workspaces guide says how.56import { THEME_COLOR, THEME_COOKIE, readTheme, themeAttribute, useThemeChoice } from "./lib/theme";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look57
Secrets and variables kept from before stay with workflows58
59export const links: Route.LinksFunction = () => [
The fleet: g1t's new mark60 { rel: "icon", href: "/favicon.ico", sizes: "32x32" },
Secrets and variables kept from before stay with workflows61 { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
The fleet: g1t's new mark62 { rel: "icon", type: "image/png", sizes: "192x192", href: "/icon-192.png" },
One kind of access token; presence and status; usernames keep their case; the tour is a miniature of the real app; icons for password managers63 { rel: "icon", type: "image/png", sizes: "512x512", href: "/icon-512.png" },
64 // Home screens and password managers look for a square, opaque 180px tile;
65 // the "-precomposed" name is served too, for the ones that ask for it.
66 { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" },
67 // Installable: name, icons and colours for "Add to Home Screen" (public/site.webmanifest;
68 // manifest.webmanifest is the same file, kept for installs that already point at it).
69 { rel: "manifest", href: "/site.webmanifest" },
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look70 // The text and headline faces are wanted on every page, so they start
71 // loading with the stylesheet; mono waits until something uses it.
72 { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
73 { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
Secrets and variables kept from before stay with workflows74];
75
76export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware];
77
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put78export async function loader({ context, params, request }: Route.LoaderArgs) {
Secrets and variables kept from before stay with workflows79 const user = getViewer(context);
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.80 const cookies = request.headers.get("cookie");
81 const chosen = readCookie(cookies, WORKSPACE_COOKIE);
82 const dock = readCookie(cookies, DOCK_COOKIE);
Merge two kinds of invite, kept apart: an invite to g1t (Settings, invite-only only, no workspace unless asked) and an invitation to a workspace (its People page)83 // Whether sign-up takes an invite: the sign-up page says so, and
84 // Settings → Invites offers invites to g1t only then. Cached per isolate.
Chat has sounds. A short warm cue plays for a message in a conversation you have open but aren't looking at, a direct message, a mention of you and an agent finishing something for you, with a soft tick for sending that is off until you turn it on; never for your own messages, a muted conversation, a conversation you are looking at in a window that has the front, or while you have paused notifications, and never twice for one message or more than once in a second and a half. The cues are made by the browser itself in two sets, Soft and Bright, so nothing is downloaded; the Sounds and notifications section of your notification settings turns them on and off, picks the set and the volume, plays each one, and offers desktop notifications for when the window is behind; Do not disturb is the one pause everyone sees, set from the chat sidebar's bell, the settings, or your avatar menu, now with a two-hour choice, and the top bar's bell shows a dot while it's on. Your choices are kept with your account. The sound layer sits behind one small interface so the desktop app can play them natively later. The chat and notifications guides say the rules.85 const [shell, mode, sounds] = await Promise.all([
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)86 // An account still confirming its address sees only the pages that
87 // allows (lib/confirm-gate.ts), in the visitor's frame.
88 user && !awaitsConfirmation(user)
Usage, Billing settings and prepaid AI credit; fixes from the UX audit89 ? shellFor(user, params, chosen, context).catch((error: unknown) => {
90 // A sidebar that could not be read is no reason to lose the page,
91 // or to draw it as if they were signed out.
92 console.error("root: the sidebar could not be read", error);
93 return bareShell(user, params, chosen);
94 })
95 : visitorShell(params, context),
Merge two kinds of invite, kept apart: an invite to g1t (Settings, invite-only only, no workspace unless asked) and an invitation to a workspace (its People page)96 registrationMode(),
Chat has sounds. A short warm cue plays for a message in a conversation you have open but aren't looking at, a direct message, a mention of you and an agent finishing something for you, with a soft tick for sending that is off until you turn it on; never for your own messages, a muted conversation, a conversation you are looking at in a window that has the front, or while you have paused notifications, and never twice for one message or more than once in a second and a half. The cues are made by the browser itself in two sets, Soft and Bright, so nothing is downloaded; the Sounds and notifications section of your notification settings turns them on and off, picks the set and the volume, plays each one, and offers desktop notifications for when the window is behind; Do not disturb is the one pause everyone sees, set from the chat sidebar's bell, the settings, or your avatar menu, now with a two-hour choice, and the top bar's bell shows a dot while it's on. Your choices are kept with your account. The sound layer sits behind one small interface so the desktop app can play them natively later. The chat and notifications guides say the rules.97 // Their chat sounds, with the page, so the first live event already
98 // respects them (lib/sounds.ts); the defaults when identity is slow.
99 user && !awaitsConfirmation(user) ? identity.soundSettings(user).catch(() => null) : Promise.resolve(null),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look100 ]);
The left-hand navigation takes less room and reads at a glance. The dock becomes a rail: a 56-pixel column of icons with the g1t mark on top, the current app marked by a filled square, hover hints naming each with its shortcut, the apps you pinned in a scrolling band, and Apps, People, Workspace and your account at the foot. Each mode's sidebar sits flush against it, 240 pixels wide, opening on Search or jump to and listing its groups under small labels in 36-pixel rows; Ctrl B hides it and the page grows into the room. Every mode's list is built on the shadcn Sidebar now in the kit, so Workspace, Code, People, Notifications, account settings, Chat, Artifacts and Agents all share one frame; the phone keeps its bottom bar and drawer. The workspaces guide describes the rail, the sidebar and the page.101 // The apps this person pinned to their rail here: as their account keeps
The apps you pin to your dock are kept with your account, per workspace and in your order, so the dock is the same on every device: identity keeps them in dock_pins and answers dock_pins and set_dock_pins, the dock reads them with the rest of the page, pins kept only on this device carry over with your first change, this device's copy still draws the dock when identity can't be reached, a pin that can't be saved says so, and they go when you or the workspace do; the workspaces guide says how.102 // them (read with the rest of the shell), else as this device's cookie
103 // remembers them (lib/apps.ts).
104 if (shell.workspace) shell.pins = pinsToShow(shell.pins, dock, shell.workspace.slug);
Merge branch 'worktree-agent-aaf03bdceac799c89'105 // Where this g1t lives, for clone lines, agent setup and link previews.
Merge site-audit: SEO routes, analytics with consent first in Europe, security page, founder and X account, docs header; the tour opens on the pull request and leads with Code, on the real shell, with Agents and Docs working today106 return {
107 user,
108 shell,
A doc opens at once: the page carries the document's saved state, so the editor mounts without waiting for its live room, which connects in the background and sends only what changed, with a quiet dot that turns green when it's synced; edits made before then are kept and sent once. The editor's code is preloaded from the page and fetched early when you hover a doc, the app's shared code ships in a few chunks instead of a hundred small ones, socket tickets come with the page instead of a round trip, and the artifacts service answers a page, a sidebar and a room in parallel lookups instead of a dozen in a row, reporting its database round trips in Server-Timing. The artifacts guide says how a doc opens, and CONTRIBUTING's Speed section has the numbers.109 // For a page opened with an access token: the feed socket's ticket,
110 // minted here so the feed opens without asking for one (lib/live-socket.ts).
111 liveTicket: user?.token?.website ? await socketTicketFor(context, request, "/-/live") : null,
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.112 // Whether they folded the sidebar away, so the page is drawn that way from the start.
113 sidebarClosed: sidebarClosed(readCookie(cookies, SIDEBAR_COOKIE)),
You choose how g1t looks: Auto follows your system, Light and Dark stay put, set from the account menu, the phone's You and help sheet, Settings → Account or the command palette; the page is drawn in your choice from the first byte, every colour has a light value that reads at 4.5:1 or better, code and diffs are highlighted for both, diagrams and the document editor follow along, the product tour and the g1t mark's avatar stay dark, and Dark is what you see until you choose; the workspaces guide says how.114 // Their Appearance, so the page is drawn in it from the first byte (lib/theme.ts).
115 theme: readTheme(readCookie(cookies, THEME_COOKIE)),
Chat has sounds. A short warm cue plays for a message in a conversation you have open but aren't looking at, a direct message, a mention of you and an agent finishing something for you, with a soft tick for sending that is off until you turn it on; never for your own messages, a muted conversation, a conversation you are looking at in a window that has the front, or while you have paused notifications, and never twice for one message or more than once in a second and a half. The cues are made by the browser itself in two sets, Soft and Bright, so nothing is downloaded; the Sounds and notifications section of your notification settings turns them on and off, picks the set and the volume, plays each one, and offers desktop notifications for when the window is behind; Do not disturb is the one pause everyone sees, set from the chat sidebar's bell, the settings, or your avatar menu, now with a two-hour choice, and the top bar's bell shows a dot while it's on. Your choices are kept with your account. The sound layer sits behind one small interface so the desktop app can play them natively later. The chat and notifications guides say the rules.116 // What they hear when chat moves (components/notifications/sounds.tsx).
117 sounds,
Merge site-audit: SEO routes, analytics with consent first in Europe, security page, founder and X account, docs header; the tour opens on the pull request and leads with Code, on the real shell, with Agents and Docs working today118 inviteOnly: mode !== "open",
119 addresses: addresses(),
120 // Visitors from where the law asks first are asked before analytics runs.
121 analyticsConsent: visitorAsksFirst(request),
122 };
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put123}
124
125/**
126 * The sidebar for someone not signed in: nothing of their own, only the
127 * open counts of the project being looked at. One call, and only in a
128 * project; it answers the same for a private project as a missing one.
129 */
Fast pages, required checks on the branch, self-hosted runners, honest incidents130async function visitorShell(params: { owner?: string; repo?: string }, context: Route.LoaderArgs["context"]): Promise<ShellData> {
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put131 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
Fast pages, required checks on the branch, self-hosted runners, honest incidents132 const counts = path ? await countsFor(context, params) : null;
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put133 return {
134 workspace: null,
135 repos: [],
136 repo: path && counts?.ok ? { ...path, member: false, issues: counts.value.issues, pulls: counts.value.pulls } : null,
137 limit: null,
138 monthUsageMicros: null,
139 };
Secrets and variables kept from before stay with workflows140}
141
Usage, Billing settings and prepaid AI credit; fixes from the UX audit142/** The sidebar from what the session already says, with no service asked. */
143function bareShell(user: User, params: { owner?: string; repo?: string }, chosen: string | null): ShellData {
144 return {
145 workspace: workspaceFor(user.workspaces ?? [], chosen, params),
146 repos: [],
147 repo: null,
148 limit: null,
149 monthUsageMicros: null,
150 };
151}
152
Secrets and variables kept from before stay with workflows153/**
154 * The sidebar only changes with the workspace or repository being looked
155 * at, or after something was submitted: not on every page within them.
156 */
157export function shouldRevalidate({
158 currentParams,
159 nextParams,
160 formMethod,
161 defaultShouldRevalidate,
162}: ShouldRevalidateFunctionArgs) {
163 if (formMethod && formMethod !== "GET") return defaultShouldRevalidate;
164 return currentParams.owner !== nextParams.owner || currentParams.repo !== nextParams.repo;
165}
166
167/**
Usage, Billing settings and prepaid AI credit; fixes from the UX audit168 * The sidebar: the workspace whose pages or project these are when it is
169 * one of yours, else the one you chose (lib/workspace-choice.ts); its
170 * projects; and the repository being looked at.
Secrets and variables kept from before stay with workflows171 */
172async function shellFor(
173 user: User,
174 params: { owner?: string; repo?: string },
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put175 chosen: string | null,
Fast pages, required checks on the branch, self-hosted runners, honest incidents176 context: Route.LoaderArgs["context"],
Secrets and variables kept from before stay with workflows177): Promise<ShellData> {
178 const memberships = user.workspaces ?? [];
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put179 const workspace = workspaceFor(memberships, chosen, params);
Secrets and variables kept from before stay with workflows180 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
181 const now = new Date();
182 const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
Fast pages, required checks on the branch, self-hosted runners, honest incidents183 // What the sidebar shows of the workspace changes rarely: kept for a few
184 // seconds per person and workspace, except just after they changed
185 // something (lib/cache.server.ts).
186 const kept = <T,>(what: string, load: () => Promise<T>) =>
187 workspace ? shortCache(`shell:${what}:${user.id}:${workspace.slug}`, SHELL_TTL_MS, load) : Promise.resolve(null);
The apps you pin to your dock are kept with your account, per workspace and in your order, so the dock is the same on every device: identity keeps them in dock_pins and answers dock_pins and set_dock_pins, the dock reads them with the rest of the page, pins kept only on this device carry over with your first change, this device's copy still draws the dock when identity can't be reached, a pin that can't be saved says so, and they go when you or the workspace do; the workspaces guide says how.188 const [listed, counts, status, usage, limit, entitlements, shared, unread, shortcuts, chatUnread, teamAgents, dockPins] = await Promise.all([
Navigation: the workspace's own page with tabs, pins and recent in the sidebar189 // Every project, for the palette and the count; the sidebar lists only
190 // the person's pinned and recent ones (lib/pins.ts).
191 workspace ? workspaceProjects(workspace.slug, user) : Promise.resolve(null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents192 path ? countsFor(context, params) : Promise.resolve(null),
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor193 // Whether billing is on, without reading the account: that asks the
194 // card processor about the workspace's cards, too slow for every page.
195 kept("status", () => billing.status()).catch(() => null),
Usage, Billing settings and prepaid AI credit; fixes from the UX audit196 kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)).catch(() => null),
Fast pages, required checks on the branch, self-hosted runners, honest incidents197 kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null),
198 kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null),
199 sharedRepos(user),
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all200 // The bell's count: one query, never kept, so marking an item shows at once.
201 inbox.counts(user.username).catch(() => null),
Navigation: the workspace's own page with tabs, pins and recent in the sidebar202 // Never kept: opening a project moves it up Recent.
203 workspace ? projects.shortcuts(workspace.slug, user).catch(() => null) : Promise.resolve(null),
Chat and workspace agents: channels, DMs and named agents you talk to204 // The rail's Chat badge: never kept, and never waited on for long.
205 workspace ? chatUnreadFor(workspace.slug, user) : Promise.resolve(null),
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)206 // Home's Recent and the Agents sidebar, on every page: never waited on for long.
207 workspace ? agentsFor(workspace.slug, user) : Promise.resolve(null),
The left-hand navigation takes less room and reads at a glance. The dock becomes a rail: a 56-pixel column of icons with the g1t mark on top, the current app marked by a filled square, hover hints naming each with its shortcut, the apps you pinned in a scrolling band, and Apps, People, Workspace and your account at the foot. Each mode's sidebar sits flush against it, 240 pixels wide, opening on Search or jump to and listing its groups under small labels in 36-pixel rows; Ctrl B hides it and the page grows into the room. Every mode's list is built on the shadcn Sidebar now in the kit, so Workspace, Code, People, Notifications, account settings, Chat, Artifacts and Agents all share one frame; the phone keeps its bottom bar and drawer. The workspaces guide describes the rail, the sidebar and the page.208 // The rail's pins, kept with the account so every device shows the same
209 // rail; never kept here, so a pin shows the moment it is made. Null
The apps you pin to your dock are kept with your account, per workspace and in your order, so the dock is the same on every device: identity keeps them in dock_pins and answers dock_pins and set_dock_pins, the dock reads them with the rest of the page, pins kept only on this device carry over with your first change, this device's copy still draws the dock when identity can't be reached, a pin that can't be saved says so, and they go when you or the workspace do; the workspaces guide says how.210 // falls back to the cookie (lib/dock.server.ts).
211 workspace ? savedPins(user, workspace.slug) : Promise.resolve(null),
Secrets and variables kept from before stay with workflows212 ]);
213 return {
214 workspace,
Projects: what a workspace builds and runs, first on every page215 // Projects are what the sidebar lists: what the workspace builds and runs.
Navigation: the workspace's own page with tabs, pins and recent in the sidebar216 repos: listed?.ok ? listed.value.map(shortcutOf) : [],
217 pinned: (shortcuts?.pinned ?? []).map(shortcutOf),
218 recent: (shortcuts?.recent ?? []).map(shortcutOf),
Secrets and variables kept from before stay with workflows219 repo:
220 path && counts?.ok
221 ? {
222 ...path,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look223 // Until the repository's own page says what their role is.
224 member: hasAccessIn(user, path.namespace),
Secrets and variables kept from before stay with workflows225 issues: counts.value.issues,
226 pulls: counts.value.pulls,
227 }
228 : null,
Billing accounts, terms and enterprises; g1t is no longer free229 // Where the workspace stands against its usage limit, once billing is on.
230 limit:
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor231 status?.enabled && limit?.ok
Billing accounts, terms and enterprises; g1t is no longer free232 ? {
233 exposureMicros: limit.value.exposureMicros,
234 ceilingMicros: limit.value.ceilingMicros,
235 state: limit.value.state,
236 comped: limit.value.trust === "internal",
237 }
238 : null,
The sidebar asks billing whether it is on, not for the account, so no page waits on the card processor239 free: Boolean(status?.free),
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look240 // A spend spike or a hold pauses new compute: the shell says so on every page.
241 compute:
242 workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open")
243 ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" }
244 : null,
245 shared,
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all246 inbox: unread,
Chat and workspace agents: channels, DMs and named agents you talk to247 chat: chatUnread,
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)248 agents: teamAgents,
The apps you pin to your dock are kept with your account, per workspace and in your order, so the dock is the same on every device: identity keeps them in dock_pins and answers dock_pins and set_dock_pins, the dock reads them with the rest of the page, pins kept only on this device carry over with your first change, this device's copy still draws the dock when identity can't be reached, a pin that can't be saved says so, and they go when you or the workspace do; the workspaces guide says how.249 pins: dockPins ?? undefined,
Secrets and variables kept from before stay with workflows250 // While g1t is free every charge is zero, so usage is shown at cost.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit251 // Usage at price, the one figure every page shows.
252 monthUsageMicros: usage?.ok ? (usage.value.free ? usage.value.usedMicros : (usage.value.priceMicros ?? usage.value.spentMicros)) : null,
Secrets and variables kept from before stay with workflows253 };
254}
255
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)256/** Starred and recent conversations Home's sidebar lists. */
257const SHELL_CONVERSATIONS = 8;
258
259/**
260 * What is unread in chat, for the rail, and the starred and latest
261 * conversations, for Home's sidebar; null when chat is slow to answer or
262 * does not.
263 */
Chat and workspace agents: channels, DMs and named agents you talk to264async function chatUnreadFor(slug: string, user: User): Promise<ShellData["chat"]> {
265 const timeout = new Promise<null>((resolve) => setTimeout(() => resolve(null), CHAT_BADGE_WAIT_MS));
266 const read = chat
267 .sidebar(slug, user)
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)268 .then((result) => {
269 if (!result.ok) return null;
270 const entries = result.value.entries;
271 const latest = [...entries].sort((a, b) => (b.channel.last_message_at ?? "").localeCompare(a.channel.last_message_at ?? ""));
272 return {
273 ...unreadTotals(entries),
274 starred: entries.filter((e) => e.starred).slice(0, SHELL_CONVERSATIONS),
275 recent: latest.slice(0, SHELL_CONVERSATIONS),
276 };
277 })
278 .catch(() => null);
279 return Promise.race([read, timeout]);
280}
281
282/** The workspace's agents, as the shell lists them; null when the agents service is slow or down. */
283async function agentsFor(slug: string, user: User): Promise<ShellData["agents"]> {
284 const timeout = new Promise<null>((resolve) => setTimeout(() => resolve(null), CHAT_BADGE_WAIT_MS));
An agent is on teams the way a person is: through team membership, with no team or department of its own. Add it to teams when you create it, from its profile or from the team's page; the Agents sidebar groups agents by the teams they're on, with those on none last; what an agent is told about its teammates, team budgets, skills reach, Spend's By team and the People pages all read memberships. Agents with an old team name matching a team are moved onto it once; the rest are left off a team. Templates name a role only. The agents, teams and people guides say how.285 // The workspace's agents and the person's own personal ones, for "Yours",
286 // with the teams each is on, for the Agents sidebar's groups.
287 const read = Promise.all([workspaceAgents.list(slug, user, { personal: "mine" }), identity.teamAgentIndex(slug).catch(() => null)])
288 .then(([result, index]) => {
289 if (!result.ok) return null;
290 const teams = index ? teamsByAgent(index) : null;
291 return result.value
292 .filter((agent) => !agent.archived_at)
293 .map((agent) => ({
294 id: agent.id,
295 handle: agent.handle,
296 display_name: agent.display_name,
297 avatar: agent.avatar,
298 avatar_seed: agent.avatar_seed,
Agents have faces, and are never mistaken for people. Every agent wears a little bot face drawn from a look it owns, shape, colour, eyes, mouth, antenna, accessory and pattern, chosen in its builder and on its Profile tab with a live preview, Shuffle and a way back to the face its seed gives it; the face blinks on its own time, breathes, narrows its eyes while the agent works, shuts them asleep and bounces when it finishes, all of it still for anyone who asked for less motion. Wherever an agent shows, in chat, in a list, on a mention, on a review or a commit, its avatar carries an agent marker, and the people reading it are told so. In Chat, direct messages are two lists: People, and Agents, which also holds the agents you haven't talked to yet; a conversation with both a person and an agent in it is marked in the list, named in the conversation's header, spelled out by the composer and explained once the first time it opens. Agents keep their look in the agents service, which every service passes along. The chat and agents guides say so, and CONTRIBUTING makes the shared avatar the only way to draw an agent.299 look: agent.look ?? null,
An agent is on teams the way a person is: through team membership, with no team or department of its own. Add it to teams when you create it, from its profile or from the team's page; the Agents sidebar groups agents by the teams they're on, with those on none last; what an agent is told about its teammates, team budgets, skills reach, Spend's By team and the People pages all read memberships. Agents with an old team name matching a team are moved onto it once; the rest are left off a team. Templates name a role only. The agents, teams and people guides say how.300 role: agent.role,
301 title: agent.title,
302 status: agent.status,
303 builtin: agent.builtin === true,
304 scope: agent.scope,
305 ...(teams ? { teams: teams[agent.id] ?? [] } : {}),
306 }));
307 })
Chat and workspace agents: channels, DMs and named agents you talk to308 .catch(() => null);
309 return Promise.race([read, timeout]);
310}
311
312/** The longest the rail's Chat badge holds up a page. */
313const CHAT_BADGE_WAIT_MS = 300;
314
Usage, Billing settings and prepaid AI credit; fixes from the UX audit315/**
316 * How long the sidebar's workspace answers are kept: as long as someone's
317 * own changes read fresh anyway (lib/perf.ts `PRIMARY_WINDOW_SECONDS`).
318 */
319const SHELL_TTL_MS = 30_000;
Fast pages, required checks on the branch, self-hosted runners, honest incidents320
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look321/** Most repositories listed under Shared with you. */
322const MAX_SHARED = 20;
323
324/**
325 * Repositories shared with the user in workspaces they do not belong to,
326 * by their grants: only those, never the workspace's other repositories.
327 */
328async function sharedRepos(user: User): Promise<ShellData["shared"]> {
329 const outside = new Set(sharedWorkspaces(user));
330 if (outside.size === 0) return [];
331 const ids = (user.grants ?? []).filter((grant) => outside.has(grant.workspace)).map((grant) => grant.repo_id).slice(0, MAX_SHARED);
Fast pages, required checks on the branch, self-hosted runners, honest incidents332 const found = await readableRepos(ids, user);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look333 return found
Fast pages, required checks on the branch, self-hosted runners, honest incidents334 .map((repo) => ({ namespace: repo.namespace, name: repo.name, isPrivate: repo.isPrivate }))
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look335 .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`));
336}
337
Usage, Billing settings and prepaid AI credit; fixes from the UX audit338/**
339 * The root's data as the browser last had it. When a navigation fails in a
340 * way that takes the root's data with it, the error is still drawn in the
341 * person's own frame, signed in, not the visitor's. Never kept on the
342 * server, where one module serves everyone.
343 */
344let lastRoot: Awaited<ReturnType<typeof loader>> | undefined;
345
Secrets and variables kept from before stay with workflows346export function Layout({ children }: { children: React.ReactNode }) {
Merge g1tusercontent.com: registry answers run nothing in a browser, the site's pages run only their own scripts, repository files and avatars on their own origin, raw files rate limited per address347 const nonce = useNonce();
Secrets and variables kept from before stay with workflows348 // Undefined when the root loader itself failed.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit349 const loaded = useRouteLoaderData<typeof loader>("root");
350 const inBrowser = typeof document !== "undefined";
351 if (loaded && inBrowser) lastRoot = loaded;
352 const root = loaded ?? (inBrowser ? lastRoot : undefined);
Secrets and variables kept from before stay with workflows353 const user = root?.user;
Merge branch 'socket-tickets'354 // A page opened with an access token signs its live sockets in with tickets (lib/live-socket.ts).
A doc opens at once: the page carries the document's saved state, so the editor mounts without waiting for its live room, which connects in the background and sends only what changed, with a quiet dot that turns green when it's synced; edits made before then are kept and sent once. The editor's code is preloaded from the page and fetched early when you hover a doc, the app's shared code ships in a few chunks instead of a hundred small ones, socket tickets come with the page instead of a round trip, and the artifacts service answers a page, a sidebar and a room in parallel lookups instead of a dozen in a row, reporting its database round trips in Server-Timing. The artifacts guide says how a doc opens, and CONTRIBUTING's Speed section has the numbers.355 if (inBrowser) {
356 setLiveViaToken(Boolean(user?.token?.website));
357 offerTicket("/-/live", root?.liveTicket);
358 }
Merge branch 'worktree-agent-a985c01f43538af01'359 const { pathname, search } = useLocation();
status.g1t.sh with incident management, invites that land you in the workspace, settings as pages, usage without quotas360 // Drawn around the error page too: a 404 keeps the sidebar out of a
361 // project or workspace the viewer cannot see.
362 const error = useRouteError();
363 const missing = isRouteErrorResponse(error) && error.status === 404;
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look364 // The billing page shows the full banner itself.
365 const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && (
Fast pages, required checks on the branch, self-hosted runners, honest incidents366 <SpikeBanner
367 compact
368 slug={root.shell.workspace.slug}
369 entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }}
370 owner={root.shell.compute.owner}
371 />
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look372 );
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)373 // On the few pages an account still confirming its address can open
374 // besides /confirm-email (policies, support, signing in): the way back.
375 const verify = user && awaitsConfirmation(user) && pathname !== "/confirm-email" && (
376 <p
377 role="status"
Secrets and variables kept from before stay with workflows378 className="flex flex-wrap items-center justify-center gap-x-3 gap-y-1 border-b border-warn/30 bg-warn/10 px-4 py-2 text-sm"
379 >
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)380 <span>Confirm your email address to start using g1t.</span>
381 <Link to="/confirm-email" className="font-medium underline underline-offset-4">
382 Enter your code
383 </Link>
384 </p>
Secrets and variables kept from before stay with workflows385 );
Merge main (membership, two-factor, GitHub repo roles) into tokens386 // A workspace that requires two-factor authentication of someone who
387 // has not turned it on: they keep their place, and cannot use it yet.
388 const held = user?.held && user.held.length > 0 && pathname !== "/settings/two-factor" && <PolicyNotice held={user.held} />;
Merge branch 'worktree-agent-aca4790ea223aa235'389 const leaving = useLeaving();
You choose how g1t looks: Auto follows your system, Light and Dark stay put, set from the account menu, the phone's You and help sheet, Settings → Account or the command palette; the page is drawn in your choice from the first byte, every colour has a light value that reads at 4.5:1 or better, code and diffs are highlighted for both, diagrams and the document editor follow along, the product tour and the g1t mark's avatar stay dark, and Dark is what you see until you choose; the workspaces guide says how.390 // Auto, Light or Dark: as the cookie said when the page was drawn, or as just switched.
391 const theme = useThemeChoice(root?.theme);
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.392 // Which frame the page is drawn in (lib/chrome.ts): on its own, the app's, or the public one.
393 const frame = frameOf(pathname, {
394 signedIn: user != null && !awaitsConfirmation(user),
395 workspace: (user?.workspaces ?? []).length > 0,
396 });
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look397 const banner =
Merge main (membership, two-factor, GitHub repo roles) into tokens398 paused || verify || held ? (
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look399 <>
400 {paused}
401 {verify}
Merge main (membership, two-factor, GitHub repo roles) into tokens402 {held}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look403 </>
404 ) : null;
Secrets and variables kept from before stay with workflows405 return (
You choose how g1t looks: Auto follows your system, Light and Dark stay put, set from the account menu, the phone's You and help sheet, Settings → Account or the command palette; the page is drawn in your choice from the first byte, every colour has a light value that reads at 4.5:1 or better, code and diffs are highlighted for both, diagrams and the document editor follow along, the product tour and the g1t mark's avatar stay dark, and Dark is what you see until you choose; the workspaces guide says how.406 <html lang="en" data-theme={themeAttribute(theme)}>
Secrets and variables kept from before stay with workflows407 <head>
408 <meta charSet="utf-8" />
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)409 <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
You choose how g1t looks: Auto follows your system, Light and Dark stay put, set from the account menu, the phone's You and help sheet, Settings → Account or the command palette; the page is drawn in your choice from the first byte, every colour has a light value that reads at 4.5:1 or better, code and diffs are highlighted for both, diagrams and the document editor follow along, the product tour and the g1t mark's avatar stay dark, and Dark is what you see until you choose; the workspaces guide says how.410 {/* The browser bar matches the page: one colour for a chosen theme, the system's for Auto. */}
411 {theme === "auto" ? (
412 <>
413 <meta name="theme-color" media="(prefers-color-scheme: light)" content={THEME_COLOR.light} />
414 <meta name="theme-color" media="(prefers-color-scheme: dark)" content={THEME_COLOR.dark} />
415 </>
416 ) : (
417 <meta name="theme-color" content={THEME_COLOR[theme]} />
418 )}
Merge branch 'mirroring' into artifacts-mode419 <meta name="mobile-web-app-capable" content="yes" />
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)420 <meta name="apple-mobile-web-app-capable" content="yes" />
421 <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
Put the stylesheet at the top of the head, before React Router's preloads422 {/* The stylesheet before everything React Router preloads, so a slow
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.423 connection paints sooner. */}
Give the stylesheet a precedence so React places it before preloads424 <link rel="stylesheet" href={appCss} precedence="default" />
Merge site-audit: SEO routes, analytics with consent first in Europe, security page, founder and X account, docs header; the tour opens on the pull request and leads with Code, on the real shell, with Agents and Docs working today425 {root?.analyticsConsent && <meta name="g1t-analytics" content="consent" />}
Secrets and variables kept from before stay with workflows426 <Meta />
Merge g1tusercontent.com: registry answers run nothing in a browser, the site's pages run only their own scripts, repository files and avatars on their own origin, raw files rate limited per address427 <Links nonce={nonce} />
Secrets and variables kept from before stay with workflows428 </head>
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.429 <body className="flex min-h-screen flex-col" data-frame={frame === "app" && user && root?.shell ? "app" : frame}>
Usage, Billing settings and prepaid AI credit; fixes from the UX audit430 {/* The first stop for the keyboard: past the menus, to the page. */}
431 <a
432 href="#content"
433 className="sr-only rounded-md bg-fg px-3 py-2 text-sm font-medium text-bg focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-[70]"
434 >
435 Skip to content
436 </a>
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.437 {frame === "standalone" ? (
438 <StandaloneFrame>{children}</StandaloneFrame>
439 ) : frame === "app" && user && root?.shell ? (
440 <AppShell user={user} shell={root.shell} missing={missing} banner={banner} sidebarClosed={root.sidebarClosed}>
Secrets and variables kept from before stay with workflows441 {children}
442 </AppShell>
443 ) : (
444 <>
445 <Progress />
g1t is described as the product it is in alpha, and its shell takes the new shape: the README, the docs home and docs/PLAN.md label every feature Live, Preview or Coming; a floating dock with the g1t mark, Today, Chat, Notifications, Agents, Code, Artifacts, your pinned apps and the Apps launcher, with People, Workspace and the account menu (now holding help) at its foot; the workspace's logo and switcher heading a flat sidebar that folds away with Ctrl B, or leading the header's breadcrumbs where there is none; the page in a rounded panel with a full-width header; Today as the front page, with first-time acceptance of agents' pull requests, what needs you and what's at stake, spend today and one item to start with, every number from a service; Notifications in place of the Inbox at /notifications; a bottom bar and More sheet on phones; and sign-in, sign-up, two-factor, reset, invites and choosing a workspace on standalone pages with no app around them.446 <PublicHeader user={user} />
Secrets and variables kept from before stay with workflows447 {banner}
Usage, Billing settings and prepaid AI credit; fixes from the UX audit448 <div id="content" tabIndex={-1} {...leaving} className={`grow outline-none ${leaving.className}`}>
Merge branch 'worktree-agent-aca4790ea223aa235'449 {children}
450 </div>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look451 <SiteFooter user={user} />
Secrets and variables kept from before stay with workflows452 </>
453 )}
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)454 {/* Live notifications for the signed-in: the feed socket, toasts, the tab's count (components/notifications). */}
455 {user && !awaitsConfirmation(user) && (
Chat has sounds. A short warm cue plays for a message in a conversation you have open but aren't looking at, a direct message, a mention of you and an agent finishing something for you, with a soft tick for sending that is off until you turn it on; never for your own messages, a muted conversation, a conversation you are looking at in a window that has the front, or while you have paused notifications, and never twice for one message or more than once in a second and a half. The cues are made by the browser itself in two sets, Soft and Bright, so nothing is downloaded; the Sounds and notifications section of your notification settings turns them on and off, picks the set and the volume, plays each one, and offers desktop notifications for when the window is behind; Do not disturb is the one pause everyone sees, set from the chat sidebar's bell, the settings, or your avatar menu, now with a two-hour choice, and the top bar's bell shows a dot while it's on. Your choices are kept with your account. The sound layer sits behind one small interface so the desktop app can play them natively later. The chat and notifications guides say the rules.456 <LiveNotifications
457 workspace={root?.shell?.workspace?.slug ?? null}
458 inbox={root?.shell?.inbox?.unread ?? null}
459 sounds={root?.sounds ?? null}
460 me={{ id: user.id, username: user.username }}
461 />
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)462 )}
Merge site-audit: SEO routes, analytics with consent first in Europe, security page, founder and X account, docs header; the tour opens on the pull request and leads with Code, on the real shell, with Agents and Docs working today463 <AnalyticsConsent />
Merge g1tusercontent.com: registry answers run nothing in a browser, the site's pages run only their own scripts, repository files and avatars on their own origin, raw files rate limited per address464 <ScrollRestoration nonce={nonce} />
465 <Scripts nonce={nonce} />
Secrets and variables kept from before stay with workflows466 </body>
467 </html>
468 );
469}
470
471export default function App() {
Merge site-audit: SEO routes, analytics with consent first in Europe, security page, founder and X account, docs header; the tour opens on the pull request and leads with Code, on the real shell, with Agents and Docs working today472 const userId = useRouteLoaderData<typeof loader>("root")?.user?.id ?? null;
473 // Tell analytics who is signed in, once per change; signing out forgets them.
474 const lastUserId = useRef<string | null>(null);
475 useEffect(() => {
476 identify(userId, lastUserId.current);
477 lastUserId.current = userId;
478 }, [userId]);
Secrets and variables kept from before stay with workflows479 return <Outlet />;
480}
481
482export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
Usage, Billing settings and prepaid AI credit; fixes from the UX audit483 const location = useLocation();
484 const matches = useMatches();
Merge branch 'worktree-agent-a64e51c8f386f46ac'485 const href = location.pathname + location.search + location.hash;
Usage, Billing settings and prepaid AI credit; fixes from the UX audit486 // A tab left open across a deploy: load the address again as a whole
Merge branch 'worktree-agent-a64e51c8f386f46ac'487 // page, once, rather than show an error the reload fixes. A document load
488 // never reloads, so the server and the hydrating client render the same.
489 const reloadable = reloadFixes({
Usage, Billing settings and prepaid AI credit; fixes from the UX audit490 error,
491 status: isRouteErrorResponse(error) ? error.status : undefined,
Merge branch 'worktree-agent-a64e51c8f386f46ac'492 clientNavigation: clientNavigated(location.key),
Usage, Billing settings and prepaid AI credit; fixes from the UX audit493 caughtByCatchAll: matches.at(-1)?.id === "routes/not-found",
494 });
Merge branch 'worktree-agent-a64e51c8f386f46ac'495 // Already loaded again once, or the reload never started: show the page.
496 const tried = useMemo(() => reloadable && reloadedBefore(href), [reloadable, href]);
497 const [gaveUp, setGaveUp] = useState<string | null>(null);
498 const reload = reloadable && !tried && gaveUp !== href;
Usage, Billing settings and prepaid AI credit; fixes from the UX audit499 useEffect(() => {
500 if (!reload) return;
501 try {
502 sessionStorage.setItem(RELOADED_KEY, href);
503 } catch {
504 // No session storage: reload anyway; a document load never asks again.
505 }
506 window.location.assign(href);
Merge branch 'worktree-agent-a64e51c8f386f46ac'507 const timer = window.setTimeout(() => setGaveUp(href), RELOAD_GIVE_UP_MS);
508 return () => window.clearTimeout(timer);
Usage, Billing settings and prepaid AI credit; fixes from the UX audit509 }, [reload, href]);
510 if (reload) {
511 return (
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in512 <PageMain className="mx-auto max-w-xl px-4 py-32 text-center text-sm text-muted" aria-busy="true">
Usage, Billing settings and prepaid AI credit; fixes from the UX audit513 <title>Loading · g1t</title>
514 Loading the latest version of g1t…
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in515 </PageMain>
Usage, Billing settings and prepaid AI credit; fixes from the UX audit516 );
517 }
518
Secrets and variables kept from before stay with workflows519 let title = "Something went wrong";
520 let details = "An unexpected error occurred. Try again in a moment.";
521 let stack: string | undefined;
522
523 if (isRouteErrorResponse(error)) {
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put524 // The same page for something private and something missing.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit525 if (error.status === 404) {
526 return (
527 <>
528 <title>Not found · g1t</title>
529 <NotFound data={error.data} />
530 </>
531 );
532 }
Team plan, an open-source pool, monthly trials and honest metering; the sidebar for everyone; a workspace that stays put533 if (typeof error.data === "string" && error.data) {
Secrets and variables kept from before stay with workflows534 details = error.data;
535 }
Merge main into Artifacts Phase 2536 // A token asked for what needs a real sign-in (lib/website-token.ts).
537 if (isNeedsSignIn(error.data)) {
538 title = "This needs you to sign in";
539 details = error.data.message;
540 }
Secrets and variables kept from before stay with workflows541 } else if (import.meta.env.DEV && error instanceof Error) {
542 details = error.message;
543 stack = error.stack;
544 }
545
546 return (
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in547 <PageMain className="mx-auto max-w-xl px-4 py-32 text-center">
Secrets and variables kept from before stay with workflows548 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
549 <p className="mt-3 text-muted">{details}</p>
550 <div className="mt-8">
The site is built from its shared components: one Button with its variants and sizes, one Badge, Card for every panel, Alert for notices, Kbd for keys, Table for the security tables, and Avatar, Command, Progress, ScrollArea, ToggleGroup, Collapsible and Accordion in the kit; raw buttons, hand-drawn cards and pills and per-file button class lists are gone, outline buttons stand the same height as filled ones, and the phone's Ask g1t loses its tile. Every page was compared pixel by pixel before and after.551 <ButtonLink to="/" variant="outline">
Secrets and variables kept from before stay with workflows552 Back to home
553 </ButtonLink>
554 </div>
555 {stack && (
The site is built from its shared components: one Button with its variants and sizes, one Badge, Card for every panel, Alert for notices, Kbd for keys, Table for the security tables, and Avatar, Command, Progress, ScrollArea, ToggleGroup, Collapsible and Accordion in the kit; raw buttons, hand-drawn cards and pills and per-file button class lists are gone, outline buttons stand the same height as filled ones, and the phone's Ask g1t loses its tile. Every page was compared pixel by pixel before and after.556 <Card asChild tone="plain" radius="lg" className="mt-8 overflow-x-auto p-4 text-left text-xs">
557 <pre>
558 <code>{stack}</code>
559 </pre>
560 </Card>
Secrets and variables kept from before stay with workflows561 )}
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in562 </PageMain>
Secrets and variables kept from before stay with workflows563 );
564}

This file's history is long; its oldest lines are credited to the oldest commit read.