Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh
573 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";
Download ZIP reads blobs eight batches at a time and deflates files together2import {
3 isRouteErrorResponse,
4 Link,
5 Links,
6 Meta,
7 Outlet,
8 Scripts,
9 ScrollRestoration,
10 type ShouldRevalidateFunctionArgs,
11 useLocation,
Usage, Billing settings and prepaid AI credit; fixes from the UX audit12 useMatches,
Download ZIP reads blobs eight batches at a time and deflates files together13 useRouteError,
14 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";
Download ZIP reads blobs eight batches at a time and deflates files together18
19import type { Route } from "./+types/root";
20import appCss from "./app.css?url";
21import 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";
Download ZIP reads blobs eight batches at a time and deflates files together26import { 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";
Download ZIP reads blobs eight batches at a time and deflates files together28import { 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";
Download ZIP reads blobs eight batches at a time and deflates files together33import { 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";
Download ZIP reads blobs eight batches at a time and deflates files together36import { 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";
Download ZIP reads blobs eight batches at a time and deflates files together44import { countsFor, readableRepos } from "./lib/access.server";
45import { shortCache } from "./lib/cache.server";
46import { 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";
Merge branch 'worktree-agent-aaf03bdceac799c89'48import { addresses } from "./lib/addresses.server";
Merge branch 'worktree-agent-a64e51c8f386f46ac'49import { 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 address50import { useNonce } from "./lib/nonce";
Merge remote-tracking branch 'origin/claude/cool-newton-7nm8r9' into claude/cool-newton-7nm8r951import { useStuckNavigationRescue } from "./lib/stuck";
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 desktop app's runner: it starts with the app for the signed-in person, sandboxed by default and running nothing where no sandbox is available yet, registers through the site, keeps itself up to date, and says everywhere what it is doing, why it is not, and how to fix it.55import { DesktopRunnerLink } from "./components/desktop-runner-link";
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)56import { 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.57import { THEME_COLOR, THEME_COOKIE, readTheme, themeAttribute, useThemeChoice } from "./lib/theme";
Download ZIP reads blobs eight batches at a time and deflates files together58
59
60export const links: Route.LinksFunction = () => [
61 { rel: "icon", href: "/favicon.ico", sizes: "32x32" },
62 { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" },
63 { 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 managers64 { rel: "icon", type: "image/png", sizes: "512x512", href: "/icon-512.png" },
65 // Home screens and password managers look for a square, opaque 180px tile;
66 // the "-precomposed" name is served too, for the ones that ask for it.
67 { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" },
68 // Installable: name, icons and colours for "Add to Home Screen" (public/site.webmanifest;
69 // manifest.webmanifest is the same file, kept for installs that already point at it).
70 { rel: "manifest", href: "/site.webmanifest" },
Download ZIP reads blobs eight batches at a time and deflates files together71 // The text and headline faces are wanted on every page, so they start
72 // loading with the stylesheet; mono waits until something uses it.
73 { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
74 { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" },
75];
76
77export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware];
78
79export async function loader({ context, params, request }: Route.LoaderArgs) {
80 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.81 const cookies = request.headers.get("cookie");
82 const chosen = readCookie(cookies, WORKSPACE_COOKIE);
83 const dock = readCookie(cookies, DOCK_COOKIE);
Merge branch 'open-signups'84 const [shell, sounds] = await Promise.all([
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)85 // An account still confirming its address sees only the pages that
86 // allows (lib/confirm-gate.ts), in the visitor's frame.
87 user && !awaitsConfirmation(user)
Usage, Billing settings and prepaid AI credit; fixes from the UX audit88 ? shellFor(user, params, chosen, context).catch((error: unknown) => {
89 // A sidebar that could not be read is no reason to lose the page,
90 // or to draw it as if they were signed out.
91 console.error("root: the sidebar could not be read", error);
92 return bareShell(user, params, chosen);
93 })
94 : visitorShell(params, context),
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.95 // Their chat sounds, with the page, so the first live event already
96 // respects them (lib/sounds.ts); the defaults when identity is slow.
97 user && !awaitsConfirmation(user) ? identity.soundSettings(user).catch(() => null) : Promise.resolve(null),
Download ZIP reads blobs eight batches at a time and deflates files together98 ]);
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.99 // 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.100 // them (read with the rest of the shell), else as this device's cookie
101 // remembers them (lib/apps.ts).
102 if (shell.workspace) shell.pins = pinsToShow(shell.pins, dock, shell.workspace.slug);
Merge branch 'worktree-agent-aaf03bdceac799c89'103 // 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 today104 return {
105 user,
106 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.107 // For a page opened with an access token: the feed socket's ticket,
108 // minted here so the feed opens without asking for one (lib/live-socket.ts).
109 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.110 // Whether they folded the sidebar away, so the page is drawn that way from the start.
111 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.112 // Their Appearance, so the page is drawn in it from the first byte (lib/theme.ts).
113 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.114 // What they hear when chat moves (components/notifications/sounds.tsx).
115 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 today116 addresses: addresses(),
117 // Visitors from where the law asks first are asked before analytics runs.
118 analyticsConsent: visitorAsksFirst(request),
119 };
Download ZIP reads blobs eight batches at a time and deflates files together120}
121
122/**
123 * The sidebar for someone not signed in: nothing of their own, only the
124 * open counts of the project being looked at. One call, and only in a
125 * project; it answers the same for a private project as a missing one.
126 */
127async function visitorShell(params: { owner?: string; repo?: string }, context: Route.LoaderArgs["context"]): Promise<ShellData> {
128 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
129 const counts = path ? await countsFor(context, params) : null;
130 return {
131 workspace: null,
132 repos: [],
133 repo: path && counts?.ok ? { ...path, member: false, issues: counts.value.issues, pulls: counts.value.pulls } : null,
134 limit: null,
135 monthUsageMicros: null,
136 };
137}
138
Usage, Billing settings and prepaid AI credit; fixes from the UX audit139/** The sidebar from what the session already says, with no service asked. */
140function bareShell(user: User, params: { owner?: string; repo?: string }, chosen: string | null): ShellData {
141 return {
142 workspace: workspaceFor(user.workspaces ?? [], chosen, params),
143 repos: [],
144 repo: null,
145 limit: null,
146 monthUsageMicros: null,
147 };
148}
149
Download ZIP reads blobs eight batches at a time and deflates files together150/**
151 * The sidebar only changes with the workspace or repository being looked
152 * at, or after something was submitted: not on every page within them.
153 */
154export function shouldRevalidate({
155 currentParams,
156 nextParams,
157 formMethod,
158 defaultShouldRevalidate,
159}: ShouldRevalidateFunctionArgs) {
160 if (formMethod && formMethod !== "GET") return defaultShouldRevalidate;
161 return currentParams.owner !== nextParams.owner || currentParams.repo !== nextParams.repo;
162}
163
164/**
Usage, Billing settings and prepaid AI credit; fixes from the UX audit165 * The sidebar: the workspace whose pages or project these are when it is
166 * one of yours, else the one you chose (lib/workspace-choice.ts); its
167 * projects; and the repository being looked at.
Download ZIP reads blobs eight batches at a time and deflates files together168 */
169async function shellFor(
170 user: User,
171 params: { owner?: string; repo?: string },
172 chosen: string | null,
173 context: Route.LoaderArgs["context"],
174): Promise<ShellData> {
175 const memberships = user.workspaces ?? [];
176 const workspace = workspaceFor(memberships, chosen, params);
177 const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null;
178 const now = new Date();
179 const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
180 // What the sidebar shows of the workspace changes rarely: kept for a few
181 // seconds per person and workspace, except just after they changed
182 // something (lib/cache.server.ts).
183 const kept = <T,>(what: string, load: () => Promise<T>) =>
184 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.185 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 sidebar186 // Every project, for the palette and the count; the sidebar lists only
187 // the person's pinned and recent ones (lib/pins.ts).
188 workspace ? workspaceProjects(workspace.slug, user) : Promise.resolve(null),
Download ZIP reads blobs eight batches at a time and deflates files together189 path ? countsFor(context, params) : Promise.resolve(null),
190 // Whether billing is on, without reading the account: that asks the
191 // card processor about the workspace's cards, too slow for every page.
192 kept("status", () => billing.status()).catch(() => null),
Usage, Billing settings and prepaid AI credit; fixes from the UX audit193 kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)).catch(() => null),
Download ZIP reads blobs eight batches at a time and deflates files together194 kept("limit", () => billing.limit(workspace!.slug, user)).catch(() => null),
195 kept("entitlements", () => billing.entitlements(workspace!.slug)).catch(() => null),
196 sharedRepos(user),
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all197 // The bell's count: one query, never kept, so marking an item shows at once.
198 inbox.counts(user.username).catch(() => null),
Navigation: the workspace's own page with tabs, pins and recent in the sidebar199 // Never kept: opening a project moves it up Recent.
200 workspace ? projects.shortcuts(workspace.slug, user).catch(() => null) : Promise.resolve(null),
Chat and workspace agents: channels, DMs and named agents you talk to201 // The rail's Chat badge: never kept, and never waited on for long.
202 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)203 // Home's Recent and the Agents sidebar, on every page: never waited on for long.
204 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.205 // The rail's pins, kept with the account so every device shows the same
206 // 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.207 // falls back to the cookie (lib/dock.server.ts).
208 workspace ? savedPins(user, workspace.slug) : Promise.resolve(null),
Download ZIP reads blobs eight batches at a time and deflates files together209 ]);
210 return {
211 workspace,
212 // 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 sidebar213 repos: listed?.ok ? listed.value.map(shortcutOf) : [],
214 pinned: (shortcuts?.pinned ?? []).map(shortcutOf),
215 recent: (shortcuts?.recent ?? []).map(shortcutOf),
Download ZIP reads blobs eight batches at a time and deflates files together216 repo:
217 path && counts?.ok
218 ? {
219 ...path,
220 // Until the repository's own page says what their role is.
221 member: hasAccessIn(user, path.namespace),
222 issues: counts.value.issues,
223 pulls: counts.value.pulls,
224 }
225 : null,
226 // Where the workspace stands against its usage limit, once billing is on.
227 limit:
228 status?.enabled && limit?.ok
229 ? {
230 exposureMicros: limit.value.exposureMicros,
231 ceilingMicros: limit.value.ceilingMicros,
232 state: limit.value.state,
233 comped: limit.value.trust === "internal",
234 }
235 : null,
236 free: Boolean(status?.free),
237 // A spend spike or a hold pauses new compute: the shell says so on every page.
238 compute:
239 workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open")
240 ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" }
241 : null,
242 shared,
Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all243 inbox: unread,
Chat and workspace agents: channels, DMs and named agents you talk to244 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)245 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.246 pins: dockPins ?? undefined,
Download ZIP reads blobs eight batches at a time and deflates files together247 // 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 audit248 // Usage at price, the one figure every page shows.
249 monthUsageMicros: usage?.ok ? (usage.value.free ? usage.value.usedMicros : (usage.value.priceMicros ?? usage.value.spentMicros)) : null,
Download ZIP reads blobs eight batches at a time and deflates files together250 };
251}
252
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)253/** Starred and recent conversations Home's sidebar lists. */
254const SHELL_CONVERSATIONS = 8;
255
256/**
257 * What is unread in chat, for the rail, and the starred and latest
258 * conversations, for Home's sidebar; null when chat is slow to answer or
259 * does not.
260 */
Chat and workspace agents: channels, DMs and named agents you talk to261async function chatUnreadFor(slug: string, user: User): Promise<ShellData["chat"]> {
262 const timeout = new Promise<null>((resolve) => setTimeout(() => resolve(null), CHAT_BADGE_WAIT_MS));
263 const read = chat
264 .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)265 .then((result) => {
266 if (!result.ok) return null;
267 const entries = result.value.entries;
268 const latest = [...entries].sort((a, b) => (b.channel.last_message_at ?? "").localeCompare(a.channel.last_message_at ?? ""));
269 return {
270 ...unreadTotals(entries),
271 starred: entries.filter((e) => e.starred).slice(0, SHELL_CONVERSATIONS),
272 recent: latest.slice(0, SHELL_CONVERSATIONS),
273 };
274 })
275 .catch(() => null);
276 return Promise.race([read, timeout]);
277}
278
279/** The workspace's agents, as the shell lists them; null when the agents service is slow or down. */
280async function agentsFor(slug: string, user: User): Promise<ShellData["agents"]> {
281 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.282 // The workspace's agents and the person's own personal ones, for "Yours",
283 // with the teams each is on, for the Agents sidebar's groups.
284 const read = Promise.all([workspaceAgents.list(slug, user, { personal: "mine" }), identity.teamAgentIndex(slug).catch(() => null)])
285 .then(([result, index]) => {
286 if (!result.ok) return null;
287 const teams = index ? teamsByAgent(index) : null;
288 return result.value
289 .filter((agent) => !agent.archived_at)
290 .map((agent) => ({
291 id: agent.id,
292 handle: agent.handle,
293 display_name: agent.display_name,
294 avatar: agent.avatar,
295 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.296 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.297 role: agent.role,
298 title: agent.title,
299 status: agent.status,
300 builtin: agent.builtin === true,
301 scope: agent.scope,
302 ...(teams ? { teams: teams[agent.id] ?? [] } : {}),
303 }));
304 })
Chat and workspace agents: channels, DMs and named agents you talk to305 .catch(() => null);
306 return Promise.race([read, timeout]);
307}
308
309/** The longest the rail's Chat badge holds up a page. */
310const CHAT_BADGE_WAIT_MS = 300;
311
Usage, Billing settings and prepaid AI credit; fixes from the UX audit312/**
313 * How long the sidebar's workspace answers are kept: as long as someone's
314 * own changes read fresh anyway (lib/perf.ts `PRIMARY_WINDOW_SECONDS`).
315 */
316const SHELL_TTL_MS = 30_000;
Download ZIP reads blobs eight batches at a time and deflates files together317
318/** Most repositories listed under Shared with you. */
319const MAX_SHARED = 20;
320
321/**
322 * Repositories shared with the user in workspaces they do not belong to,
323 * by their grants: only those, never the workspace's other repositories.
324 */
325async function sharedRepos(user: User): Promise<ShellData["shared"]> {
326 const outside = new Set(sharedWorkspaces(user));
327 if (outside.size === 0) return [];
328 const ids = (user.grants ?? []).filter((grant) => outside.has(grant.workspace)).map((grant) => grant.repo_id).slice(0, MAX_SHARED);
329 const found = await readableRepos(ids, user);
330 return found
331 .map((repo) => ({ namespace: repo.namespace, name: repo.name, isPrivate: repo.isPrivate }))
332 .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`));
333}
334
Usage, Billing settings and prepaid AI credit; fixes from the UX audit335/**
336 * The root's data as the browser last had it. When a navigation fails in a
337 * way that takes the root's data with it, the error is still drawn in the
338 * person's own frame, signed in, not the visitor's. Never kept on the
339 * server, where one module serves everyone.
340 */
341let lastRoot: Awaited<ReturnType<typeof loader>> | undefined;
342
Download ZIP reads blobs eight batches at a time and deflates files together343export 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 address344 const nonce = useNonce();
Download ZIP reads blobs eight batches at a time and deflates files together345 // Undefined when the root loader itself failed.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit346 const loaded = useRouteLoaderData<typeof loader>("root");
347 const inBrowser = typeof document !== "undefined";
348 if (loaded && inBrowser) lastRoot = loaded;
349 const root = loaded ?? (inBrowser ? lastRoot : undefined);
Download ZIP reads blobs eight batches at a time and deflates files together350 const user = root?.user;
Merge branch 'socket-tickets'351 // 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.352 if (inBrowser) {
353 setLiveViaToken(Boolean(user?.token?.website));
354 offerTicket("/-/live", root?.liveTicket);
355 }
Merge remote-tracking branch 'origin/claude/cool-newton-7nm8r9' into claude/cool-newton-7nm8r9356 const { pathname } = useLocation();
Download ZIP reads blobs eight batches at a time and deflates files together357 // Drawn around the error page too: a 404 keeps the sidebar out of a
358 // project or workspace the viewer cannot see.
359 const error = useRouteError();
360 const missing = isRouteErrorResponse(error) && error.status === 404;
361 // The billing page shows the full banner itself.
362 const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && (
363 <SpikeBanner
364 compact
365 slug={root.shell.workspace.slug}
366 entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }}
367 owner={root.shell.compute.owner}
368 />
369 );
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)370 // On the few pages an account still confirming its address can open
371 // besides /confirm-email (policies, support, signing in): the way back.
372 const verify = user && awaitsConfirmation(user) && pathname !== "/confirm-email" && (
373 <p
374 role="status"
Download ZIP reads blobs eight batches at a time and deflates files together375 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"
376 >
Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036)377 <span>Confirm your email address to start using g1t.</span>
378 <Link to="/confirm-email" className="font-medium underline underline-offset-4">
379 Enter your code
380 </Link>
381 </p>
Download ZIP reads blobs eight batches at a time and deflates files together382 );
Merge main (membership, two-factor, GitHub repo roles) into tokens383 // A workspace that requires two-factor authentication of someone who
384 // has not turned it on: they keep their place, and cannot use it yet.
385 const held = user?.held && user.held.length > 0 && pathname !== "/settings/two-factor" && <PolicyNotice held={user.held} />;
Merge branch 'worktree-agent-aca4790ea223aa235'386 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.387 // Auto, Light or Dark: as the cookie said when the page was drawn, or as just switched.
388 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.389 // Which frame the page is drawn in (lib/chrome.ts): on its own, the app's, or the public one.
390 const frame = frameOf(pathname, {
391 signedIn: user != null && !awaitsConfirmation(user),
392 workspace: (user?.workspaces ?? []).length > 0,
393 });
Download ZIP reads blobs eight batches at a time and deflates files together394 const banner =
Merge main (membership, two-factor, GitHub repo roles) into tokens395 paused || verify || held ? (
Download ZIP reads blobs eight batches at a time and deflates files together396 <>
397 {paused}
398 {verify}
Merge main (membership, two-factor, GitHub repo roles) into tokens399 {held}
Download ZIP reads blobs eight batches at a time and deflates files together400 </>
401 ) : null;
402 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.403 <html lang="en" data-theme={themeAttribute(theme)}>
Download ZIP reads blobs eight batches at a time and deflates files together404 <head>
405 <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)406 <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.407 {/* The browser bar matches the page: one colour for a chosen theme, the system's for Auto. */}
408 {theme === "auto" ? (
409 <>
410 <meta name="theme-color" media="(prefers-color-scheme: light)" content={THEME_COLOR.light} />
411 <meta name="theme-color" media="(prefers-color-scheme: dark)" content={THEME_COLOR.dark} />
412 </>
413 ) : (
414 <meta name="theme-color" content={THEME_COLOR[theme]} />
415 )}
Merge branch 'mirroring' into artifacts-mode416 <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)417 <meta name="apple-mobile-web-app-capable" content="yes" />
418 <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
Download ZIP reads blobs eight batches at a time and deflates files together419 {/* 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.420 connection paints sooner. */}
Download ZIP reads blobs eight batches at a time and deflates files together421 <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 today422 {root?.analyticsConsent && <meta name="g1t-analytics" content="consent" />}
Download ZIP reads blobs eight batches at a time and deflates files together423 <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 address424 <Links nonce={nonce} />
Download ZIP reads blobs eight batches at a time and deflates files together425 </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.426 <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 audit427 {/* The first stop for the keyboard: past the menus, to the page. */}
428 <a
429 href="#content"
430 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]"
431 >
432 Skip to content
433 </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.434 {frame === "standalone" ? (
435 <StandaloneFrame>{children}</StandaloneFrame>
436 ) : frame === "app" && user && root?.shell ? (
437 <AppShell user={user} shell={root.shell} missing={missing} banner={banner} sidebarClosed={root.sidebarClosed}>
Download ZIP reads blobs eight batches at a time and deflates files together438 {children}
439 </AppShell>
440 ) : (
441 <>
442 <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.443 <PublicHeader user={user} />
Download ZIP reads blobs eight batches at a time and deflates files together444 {banner}
Usage, Billing settings and prepaid AI credit; fixes from the UX audit445 <div id="content" tabIndex={-1} {...leaving} className={`grow outline-none ${leaving.className}`}>
Merge branch 'worktree-agent-aca4790ea223aa235'446 {children}
447 </div>
Download ZIP reads blobs eight batches at a time and deflates files together448 <SiteFooter user={user} />
449 </>
450 )}
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)451 {/* Live notifications for the signed-in: the feed socket, toasts, the tab's count (components/notifications). */}
452 {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.453 <LiveNotifications
454 workspace={root?.shell?.workspace?.slug ?? null}
455 inbox={root?.shell?.inbox?.unread ?? null}
456 sounds={root?.sounds ?? null}
457 me={{ id: user.id, username: user.username }}
458 />
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)459 )}
Merge the desktop app's runner: it starts with the app for the signed-in person, sandboxed by default and running nothing where no sandbox is available yet, registers through the site, keeps itself up to date, and says everywhere what it is doing, why it is not, and how to fix it.460 {/* Inside the desktop app: who its runner runs for, and its registration (lib/desktop-runner.ts). */}
461 {(!user || !awaitsConfirmation(user)) && (
462 <DesktopRunnerLink
463 offer={{
464 signedIn: user != null,
465 workspaces: (user?.workspaces ?? []).filter((m) => m.role === "owner").map((m) => ({ slug: m.slug, name: m.name ?? null })),
466 current: root?.shell?.workspace?.slug ?? null,
467 }}
468 />
469 )}
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 today470 <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 address471 <ScrollRestoration nonce={nonce} />
472 <Scripts nonce={nonce} />
Download ZIP reads blobs eight batches at a time and deflates files together473 </body>
474 </html>
475 );
476}
477
478export 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 today479 const userId = useRouteLoaderData<typeof loader>("root")?.user?.id ?? null;
480 // Tell analytics who is signed in, once per change; signing out forgets them.
481 const lastUserId = useRef<string | null>(null);
482 useEffect(() => {
483 identify(userId, lastUserId.current);
484 lastUserId.current = userId;
485 }, [userId]);
Merge remote-tracking branch 'origin/claude/cool-newton-7nm8r9' into claude/cool-newton-7nm8r9486 // A navigation that never arrives is loaded as a whole page (lib/stuck.ts).
487 useStuckNavigationRescue();
Download ZIP reads blobs eight batches at a time and deflates files together488 return <Outlet />;
489}
490
491export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
Usage, Billing settings and prepaid AI credit; fixes from the UX audit492 const location = useLocation();
493 const matches = useMatches();
Merge branch 'worktree-agent-a64e51c8f386f46ac'494 const href = location.pathname + location.search + location.hash;
Usage, Billing settings and prepaid AI credit; fixes from the UX audit495 // A tab left open across a deploy: load the address again as a whole
Merge branch 'worktree-agent-a64e51c8f386f46ac'496 // page, once, rather than show an error the reload fixes. A document load
497 // never reloads, so the server and the hydrating client render the same.
498 const reloadable = reloadFixes({
Usage, Billing settings and prepaid AI credit; fixes from the UX audit499 error,
500 status: isRouteErrorResponse(error) ? error.status : undefined,
Merge branch 'worktree-agent-a64e51c8f386f46ac'501 clientNavigation: clientNavigated(location.key),
Usage, Billing settings and prepaid AI credit; fixes from the UX audit502 caughtByCatchAll: matches.at(-1)?.id === "routes/not-found",
503 });
Merge branch 'worktree-agent-a64e51c8f386f46ac'504 // Already loaded again once, or the reload never started: show the page.
505 const tried = useMemo(() => reloadable && reloadedBefore(href), [reloadable, href]);
506 const [gaveUp, setGaveUp] = useState<string | null>(null);
507 const reload = reloadable && !tried && gaveUp !== href;
Usage, Billing settings and prepaid AI credit; fixes from the UX audit508 useEffect(() => {
509 if (!reload) return;
510 try {
511 sessionStorage.setItem(RELOADED_KEY, href);
512 } catch {
513 // No session storage: reload anyway; a document load never asks again.
514 }
515 window.location.assign(href);
Merge branch 'worktree-agent-a64e51c8f386f46ac'516 const timer = window.setTimeout(() => setGaveUp(href), RELOAD_GIVE_UP_MS);
517 return () => window.clearTimeout(timer);
Usage, Billing settings and prepaid AI credit; fixes from the UX audit518 }, [reload, href]);
519 if (reload) {
520 return (
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in521 <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 audit522 <title>Loading · g1t</title>
523 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 in524 </PageMain>
Usage, Billing settings and prepaid AI credit; fixes from the UX audit525 );
526 }
527
Download ZIP reads blobs eight batches at a time and deflates files together528 let title = "Something went wrong";
529 let details = "An unexpected error occurred. Try again in a moment.";
530 let stack: string | undefined;
531
532 if (isRouteErrorResponse(error)) {
533 // The same page for something private and something missing.
Usage, Billing settings and prepaid AI credit; fixes from the UX audit534 if (error.status === 404) {
535 return (
536 <>
537 <title>Not found · g1t</title>
538 <NotFound data={error.data} />
539 </>
540 );
541 }
Download ZIP reads blobs eight batches at a time and deflates files together542 if (typeof error.data === "string" && error.data) {
543 details = error.data;
544 }
Merge main into Artifacts Phase 2545 // A token asked for what needs a real sign-in (lib/website-token.ts).
546 if (isNeedsSignIn(error.data)) {
547 title = "This needs you to sign in";
548 details = error.data.message;
549 }
Download ZIP reads blobs eight batches at a time and deflates files together550 } else if (import.meta.env.DEV && error instanceof Error) {
551 details = error.message;
552 stack = error.stack;
553 }
554
555 return (
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in556 <PageMain className="mx-auto max-w-xl px-4 py-32 text-center">
Download ZIP reads blobs eight batches at a time and deflates files together557 <h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
558 <p className="mt-3 text-muted">{details}</p>
559 <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.560 <ButtonLink to="/" variant="outline">
Download ZIP reads blobs eight batches at a time and deflates files together561 Back to home
562 </ButtonLink>
563 </div>
564 {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.565 <Card asChild tone="plain" radius="lg" className="mt-8 overflow-x-auto p-4 text-left text-xs">
566 <pre>
567 <code>{stack}</code>
568 </pre>
569 </Card>
Download ZIP reads blobs eight batches at a time and deflates files together570 )}
Not found and error pages have one main landmark: their own when signed out, the shell's when signed in571 </PageMain>
Download ZIP reads blobs eight batches at a time and deflates files together572 );
573}

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