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' | 1 | import { useEffect, useMemo, useRef, useState } from "react"; |
| The plan says what g1t is for without measuring it against other products | 2 | import { |
| 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 audit | 12 | useMatches, |
| The plan says what g1t is for without measuring it against other products | 13 | useRouteError, |
| 14 | useRouteLoaderData, | |
| 15 | } from "react-router"; | |
| 16 | ||
| Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036) | 17 | import { type User, awaitsConfirmation, hasAccessIn, sharedWorkspaces } from "@g1t/contracts"; |
| The plan says what g1t is for without measuring it against other products | 18 | |
| 19 | import type { Route } from "./+types/root"; | |
| 20 | import appCss from "./app.css?url"; | |
| 21 | import displayFont from "@g1t/theme/fonts/bricolage-grotesque-latin.woff2?url"; | |
| 22 | import 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. | 23 | import { ButtonLink } from "./components/ui"; |
| Merge branch 'worktree-agent-aca4790ea223aa235' | 24 | import { AppShell, Progress, type ShellData, useLeaving } from "./components/shell"; |
| The plan says what g1t is for without measuring it against other products | 25 | import { 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. | 26 | import { PublicHeader } from "./components/public-header"; |
| The plan says what g1t is for without measuring it against other products | 27 | import { SpikeBanner } from "./components/spike-banner"; |
| Merge main (membership, two-factor, GitHub repo roles) into tokens | 28 | import { 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 today | 29 | import { identify } from "./lib/analytics.client"; |
| 30 | import { visitorAsksFirst } from "./lib/analytics-consent"; | |
| 31 | import { AnalyticsConsent } from "./components/analytics-consent"; | |
| The plan says what g1t is for without measuring it against other products | 32 | import { readCookie } from "./lib/mission"; |
| 33 | import { 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 in | 34 | import { PageMain } from "./components/landmark"; |
| The plan says what g1t is for without measuring it against other products | 35 | import { 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. | 36 | import { 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. | 37 | import { DOCK_COOKIE, SIDEBAR_COOKIE, pinsToShow, sidebarClosed } from "./lib/apps"; |
| 38 | import { 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. | 39 | import { StandaloneFrame } from "./components/standalone"; |
| The site no longer has g1t's own agents. g1t is where the coding agents you already use do their work, so the Agents mode is gone from the rail, with every page under /<workspace>/-/agents: personas, faces, skills, abilities, routines, computers, sessions and agent spend. Customize (skills, connectors, plugins, marketplaces), the context hub, model providers, the AI Gateway page, the Spend page and pill, Ask g1t, and the repository's Agents, Plans and agent settings pages go too, and their addresses now answer 404. | 40 | import { billing, chat, identity, inbox, projects } from "./lib/services.server"; |
| Chat and workspace agents: channels, DMs and named agents you talk to | 41 | import { unreadTotals } from "./lib/chat"; |
| The plan says what g1t is for without measuring it against other products | 42 | import { countsFor, readableRepos } from "./lib/access.server"; |
| 43 | import { shortCache } from "./lib/cache.server"; | |
| 44 | import { getViewer, viewerMiddleware } from "./lib/session.server"; | |
| Navigation: the workspace's own page with tabs, pins and recent in the sidebar | 45 | import { shortcutOf, workspaceProjects } from "./lib/workspace-projects.server"; |
| Merge branch 'worktree-agent-aaf03bdceac799c89' | 46 | import { addresses } from "./lib/addresses.server"; |
| Merge branch 'worktree-agent-a64e51c8f386f46ac' | 47 | import { 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 address | 48 | import { useNonce } from "./lib/nonce"; |
| Merge remote-tracking branch 'origin/claude/cool-newton-7nm8r9' into claude/cool-newton-7nm8r9 | 49 | import { useStuckNavigationRescue } from "./lib/stuck"; |
| Merge main into Artifacts Phase 2 | 50 | import { 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. | 51 | import { offerTicket, setLiveViaToken } from "./lib/live-socket"; |
| 52 | import { socketTicketFor } from "./lib/socket-ticket.server"; | |
| Merge branch 'main' into rm-agents | 53 | import { DesktopApp } from "./components/desktop-app"; |
| 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. | 54 | import { 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) | 55 | import { 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. | 56 | import { THEME_COLOR, THEME_COOKIE, readTheme, themeAttribute, useThemeChoice } from "./lib/theme"; |
| Developer mode: a page that fails can say why. Under Settings, Account, a Developer mode switch (kept per browser in a g1t_dev cookie, like Appearance) makes the error page show the error itself, its message and stack, the address, the time, whether it came from a page the server drew or a navigation in the browser, the routes it was drawn from, the site's build (its stylesheet's hashed name), the browser and the desktop app's version, with Copy details to paste it all into a report; with it off, the page says where to turn it on. A signed-in request with developer mode on is answered by React Router in its development mode (workers/app.ts, a second handler made the first time it is wanted), so an error on the server comes through in full instead of "Unexpected Server Error"; that mode differs from production only in that and in hooks only Vite's dev server sets, and only ever covers the person's own requests. Checked in a production build: a failing repository page shows "counts failed with status 503" and its stack with developer mode on, and the usual page with it off. The workspaces guide covers it under Developer mode. | 57 | import { DEVELOPER_COOKIE, readDeveloperMode, useDeveloperMode } from "./lib/developer-mode"; |
| 58 | import { DebugDetails } from "./components/debug-details"; | |
| The plan says what g1t is for without measuring it against other products | 59 | |
| 60 | ||
| 61 | export const links: Route.LinksFunction = () => [ | |
| 62 | { rel: "icon", href: "/favicon.ico", sizes: "32x32" }, | |
| 63 | { rel: "icon", type: "image/svg+xml", href: "/favicon.svg" }, | |
| 64 | { 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 managers | 65 | { rel: "icon", type: "image/png", sizes: "512x512", href: "/icon-512.png" }, |
| 66 | // Home screens and password managers look for a square, opaque 180px tile; | |
| 67 | // the "-precomposed" name is served too, for the ones that ask for it. | |
| 68 | { rel: "apple-touch-icon", sizes: "180x180", href: "/apple-touch-icon.png" }, | |
| 69 | // Installable: name, icons and colours for "Add to Home Screen" (public/site.webmanifest; | |
| 70 | // manifest.webmanifest is the same file, kept for installs that already point at it). | |
| 71 | { rel: "manifest", href: "/site.webmanifest" }, | |
| The plan says what g1t is for without measuring it against other products | 72 | // The text and headline faces are wanted on every page, so they start |
| 73 | // loading with the stylesheet; mono waits until something uses it. | |
| 74 | { rel: "preload", href: sansFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, | |
| 75 | { rel: "preload", href: displayFont, as: "font", type: "font/woff2", crossOrigin: "anonymous" }, | |
| 76 | ]; | |
| 77 | ||
| 78 | export const middleware: Route.MiddlewareFunction[] = [viewerMiddleware]; | |
| 79 | ||
| 80 | export async function loader({ context, params, request }: Route.LoaderArgs) { | |
| 81 | 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. | 82 | const cookies = request.headers.get("cookie"); |
| 83 | const chosen = readCookie(cookies, WORKSPACE_COOKIE); | |
| 84 | const dock = readCookie(cookies, DOCK_COOKIE); | |
| Merge main into rm-agents: mirroring removal, open signups, free-tier limits, the g1t CLI and runner fixes, with the agent removal kept. The CLI's table of operations is regenerated from the API without the agent, customize and AI credit operations; no CLI command used them. | 85 | const [shell, 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 audit | 89 | ? 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), | |
| 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. | 96 | // Their chat sounds, with the page, so the first live event already |
| 97 | // respects them (lib/sounds.ts); the defaults when identity is slow. | |
| 98 | user && !awaitsConfirmation(user) ? identity.soundSettings(user).catch(() => null) : Promise.resolve(null), | |
| The plan says what g1t is for without measuring it against other products | 99 | ]); |
| 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. | 100 | // 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. | 101 | // them (read with the rest of the shell), else as this device's cookie |
| 102 | // remembers them (lib/apps.ts). | |
| 103 | if (shell.workspace) shell.pins = pinsToShow(shell.pins, dock, shell.workspace.slug); | |
| Merge branch 'worktree-agent-aaf03bdceac799c89' | 104 | // 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 today | 105 | return { |
| 106 | user, | |
| 107 | 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. | 108 | // For a page opened with an access token: the feed socket's ticket, |
| 109 | // minted here so the feed opens without asking for one (lib/live-socket.ts). | |
| 110 | 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. | 111 | // Whether they folded the sidebar away, so the page is drawn that way from the start. |
| 112 | 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. | 113 | // Their Appearance, so the page is drawn in it from the first byte (lib/theme.ts). |
| 114 | theme: readTheme(readCookie(cookies, THEME_COOKIE)), | |
| Developer mode: a page that fails can say why. Under Settings, Account, a Developer mode switch (kept per browser in a g1t_dev cookie, like Appearance) makes the error page show the error itself, its message and stack, the address, the time, whether it came from a page the server drew or a navigation in the browser, the routes it was drawn from, the site's build (its stylesheet's hashed name), the browser and the desktop app's version, with Copy details to paste it all into a report; with it off, the page says where to turn it on. A signed-in request with developer mode on is answered by React Router in its development mode (workers/app.ts, a second handler made the first time it is wanted), so an error on the server comes through in full instead of "Unexpected Server Error"; that mode differs from production only in that and in hooks only Vite's dev server sets, and only ever covers the person's own requests. Checked in a production build: a failing repository page shows "counts failed with status 503" and its stack with developer mode on, and the usual page with it off. The workspaces guide covers it under Developer mode. | 115 | // Whether a page that fails says why, in full (lib/developer-mode.ts). |
| 116 | developer: readDeveloperMode(readCookie(cookies, DEVELOPER_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. | 117 | // What they hear when chat moves (components/notifications/sounds.tsx). |
| 118 | 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 today | 119 | addresses: addresses(), |
| 120 | // Visitors from where the law asks first are asked before analytics runs. | |
| 121 | analyticsConsent: visitorAsksFirst(request), | |
| 122 | }; | |
| The plan says what g1t is for without measuring it against other products | 123 | } |
| 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 | */ | |
| 130 | async function visitorShell(params: { owner?: string; repo?: string }, context: Route.LoaderArgs["context"]): Promise<ShellData> { | |
| 131 | const path = params.owner && params.repo ? { namespace: params.owner, name: params.repo } : null; | |
| 132 | const counts = path ? await countsFor(context, params) : null; | |
| 133 | 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 | }; | |
| 140 | } | |
| 141 | ||
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 142 | /** The sidebar from what the session already says, with no service asked. */ |
| 143 | function 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 | ||
| The plan says what g1t is for without measuring it against other products | 153 | /** |
| 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 | */ | |
| 157 | export 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 audit | 168 | * 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. | |
| The plan says what g1t is for without measuring it against other products | 171 | */ |
| 172 | async function shellFor( | |
| 173 | user: User, | |
| 174 | params: { owner?: string; repo?: string }, | |
| 175 | chosen: string | null, | |
| 176 | context: Route.LoaderArgs["context"], | |
| 177 | ): Promise<ShellData> { | |
| 178 | const memberships = user.workspaces ?? []; | |
| 179 | const workspace = workspaceFor(memberships, chosen, params); | |
| 180 | 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(); | |
| 183 | // 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 site no longer has g1t's own agents. g1t is where the coding agents you already use do their work, so the Agents mode is gone from the rail, with every page under /<workspace>/-/agents: personas, faces, skills, abilities, routines, computers, sessions and agent spend. Customize (skills, connectors, plugins, marketplaces), the context hub, model providers, the AI Gateway page, the Spend page and pill, Ask g1t, and the repository's Agents, Plans and agent settings pages go too, and their addresses now answer 404. | 188 | const [listed, counts, status, usage, limit, entitlements, shared, unread, shortcuts, chatUnread, dockPins] = await Promise.all([ |
| Navigation: the workspace's own page with tabs, pins and recent in the sidebar | 189 | // 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), | |
| The plan says what g1t is for without measuring it against other products | 192 | path ? countsFor(context, params) : Promise.resolve(null), |
| 193 | // 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 audit | 196 | kept(`usage:${monthStart}`, () => billing.usage(workspace!.slug, user, monthStart)).catch(() => null), |
| The plan says what g1t is for without measuring it against other products | 197 | 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 all | 200 | // 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 sidebar | 202 | // 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 to | 204 | // The rail's Chat badge: never kept, and never waited on for long. |
| 205 | workspace ? chatUnreadFor(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. | 206 | // The rail's pins, kept with the account so every device shows the same |
| 207 | // 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. | 208 | // falls back to the cookie (lib/dock.server.ts). |
| 209 | workspace ? savedPins(user, workspace.slug) : Promise.resolve(null), | |
| The plan says what g1t is for without measuring it against other products | 210 | ]); |
| 211 | return { | |
| 212 | workspace, | |
| 213 | // 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 sidebar | 214 | repos: listed?.ok ? listed.value.map(shortcutOf) : [], |
| 215 | pinned: (shortcuts?.pinned ?? []).map(shortcutOf), | |
| 216 | recent: (shortcuts?.recent ?? []).map(shortcutOf), | |
| The plan says what g1t is for without measuring it against other products | 217 | repo: |
| 218 | path && counts?.ok | |
| 219 | ? { | |
| 220 | ...path, | |
| 221 | // Until the repository's own page says what their role is. | |
| 222 | member: hasAccessIn(user, path.namespace), | |
| 223 | issues: counts.value.issues, | |
| 224 | pulls: counts.value.pulls, | |
| 225 | } | |
| 226 | : null, | |
| 227 | // Where the workspace stands against its usage limit, once billing is on. | |
| 228 | limit: | |
| 229 | status?.enabled && limit?.ok | |
| 230 | ? { | |
| 231 | exposureMicros: limit.value.exposureMicros, | |
| 232 | ceilingMicros: limit.value.ceilingMicros, | |
| 233 | state: limit.value.state, | |
| 234 | comped: limit.value.trust === "internal", | |
| 235 | } | |
| 236 | : null, | |
| 237 | free: Boolean(status?.free), | |
| 238 | // A spend spike or a hold pauses new compute: the shell says so on every page. | |
| 239 | compute: | |
| 240 | workspace && entitlements && (entitlements.paused || entitlements.spike?.status === "open") | |
| 241 | ? { paused: entitlements.paused, spike: entitlements.spike ?? null, owner: workspace.role === "owner" } | |
| 242 | : null, | |
| 243 | shared, | |
| Inbox: a bell in the top bar opens it beside the page, and /inbox holds it all | 244 | inbox: unread, |
| Chat and workspace agents: channels, DMs and named agents you talk to | 245 | chat: chatUnread, |
| 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, |
| The plan says what g1t is for without measuring it against other products | 247 | // 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 audit | 248 | // 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, | |
| The plan says what g1t is for without measuring it against other products | 250 | }; |
| 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. */ |
| 254 | const 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 to | 261 | async 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 | }; | |
| 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. | 274 | }) |
| Chat and workspace agents: channels, DMs and named agents you talk to | 275 | .catch(() => null); |
| 276 | return Promise.race([read, timeout]); | |
| 277 | } | |
| 278 | ||
| 279 | /** The longest the rail's Chat badge holds up a page. */ | |
| 280 | const CHAT_BADGE_WAIT_MS = 300; | |
| 281 | ||
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 282 | /** |
| 283 | * How long the sidebar's workspace answers are kept: as long as someone's | |
| 284 | * own changes read fresh anyway (lib/perf.ts `PRIMARY_WINDOW_SECONDS`). | |
| 285 | */ | |
| 286 | const SHELL_TTL_MS = 30_000; | |
| The plan says what g1t is for without measuring it against other products | 287 | |
| 288 | /** Most repositories listed under Shared with you. */ | |
| 289 | const MAX_SHARED = 20; | |
| 290 | ||
| 291 | /** | |
| 292 | * Repositories shared with the user in workspaces they do not belong to, | |
| 293 | * by their grants: only those, never the workspace's other repositories. | |
| 294 | */ | |
| 295 | async function sharedRepos(user: User): Promise<ShellData["shared"]> { | |
| 296 | const outside = new Set(sharedWorkspaces(user)); | |
| 297 | if (outside.size === 0) return []; | |
| 298 | const ids = (user.grants ?? []).filter((grant) => outside.has(grant.workspace)).map((grant) => grant.repo_id).slice(0, MAX_SHARED); | |
| 299 | const found = await readableRepos(ids, user); | |
| 300 | return found | |
| 301 | .map((repo) => ({ namespace: repo.namespace, name: repo.name, isPrivate: repo.isPrivate })) | |
| 302 | .sort((a, b) => `${a.namespace}/${a.name}`.localeCompare(`${b.namespace}/${b.name}`)); | |
| 303 | } | |
| 304 | ||
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 305 | /** |
| 306 | * The root's data as the browser last had it. When a navigation fails in a | |
| 307 | * way that takes the root's data with it, the error is still drawn in the | |
| 308 | * person's own frame, signed in, not the visitor's. Never kept on the | |
| 309 | * server, where one module serves everyone. | |
| 310 | */ | |
| 311 | let lastRoot: Awaited<ReturnType<typeof loader>> | undefined; | |
| 312 | ||
| The plan says what g1t is for without measuring it against other products | 313 | export 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 address | 314 | const nonce = useNonce(); |
| The plan says what g1t is for without measuring it against other products | 315 | // Undefined when the root loader itself failed. |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 316 | const loaded = useRouteLoaderData<typeof loader>("root"); |
| 317 | const inBrowser = typeof document !== "undefined"; | |
| 318 | if (loaded && inBrowser) lastRoot = loaded; | |
| 319 | const root = loaded ?? (inBrowser ? lastRoot : undefined); | |
| The plan says what g1t is for without measuring it against other products | 320 | const user = root?.user; |
| Merge branch 'socket-tickets' | 321 | // 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. | 322 | if (inBrowser) { |
| 323 | setLiveViaToken(Boolean(user?.token?.website)); | |
| 324 | offerTicket("/-/live", root?.liveTicket); | |
| 325 | } | |
| Merge remote-tracking branch 'origin/claude/cool-newton-7nm8r9' into claude/cool-newton-7nm8r9 | 326 | const { pathname } = useLocation(); |
| The plan says what g1t is for without measuring it against other products | 327 | // Drawn around the error page too: a 404 keeps the sidebar out of a |
| 328 | // project or workspace the viewer cannot see. | |
| 329 | const error = useRouteError(); | |
| 330 | const missing = isRouteErrorResponse(error) && error.status === 404; | |
| 331 | // The billing page shows the full banner itself. | |
| 332 | const paused = root?.shell?.compute && root.shell.workspace && !pathname.endsWith("/-/billing") && ( | |
| 333 | <SpikeBanner | |
| 334 | compact | |
| 335 | slug={root.shell.workspace.slug} | |
| 336 | entitlements={{ paused: root.shell.compute.paused, spike: root.shell.compute.spike }} | |
| 337 | owner={root.shell.compute.owner} | |
| 338 | /> | |
| 339 | ); | |
| Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036) | 340 | // On the few pages an account still confirming its address can open |
| 341 | // besides /confirm-email (policies, support, signing in): the way back. | |
| 342 | const verify = user && awaitsConfirmation(user) && pathname !== "/confirm-email" && ( | |
| 343 | <p | |
| 344 | role="status" | |
| The plan says what g1t is for without measuring it against other products | 345 | 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" |
| 346 | > | |
| Merge email confirmation gate: a code and a link, nothing until confirmed (identity 0036) | 347 | <span>Confirm your email address to start using g1t.</span> |
| 348 | <Link to="/confirm-email" className="font-medium underline underline-offset-4"> | |
| 349 | Enter your code | |
| 350 | </Link> | |
| 351 | </p> | |
| The plan says what g1t is for without measuring it against other products | 352 | ); |
| Merge main (membership, two-factor, GitHub repo roles) into tokens | 353 | // A workspace that requires two-factor authentication of someone who |
| 354 | // has not turned it on: they keep their place, and cannot use it yet. | |
| 355 | const held = user?.held && user.held.length > 0 && pathname !== "/settings/two-factor" && <PolicyNotice held={user.held} />; | |
| Merge branch 'worktree-agent-aca4790ea223aa235' | 356 | 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. | 357 | // Auto, Light or Dark: as the cookie said when the page was drawn, or as just switched. |
| 358 | 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. | 359 | // Which frame the page is drawn in (lib/chrome.ts): on its own, the app's, or the public one. |
| 360 | const frame = frameOf(pathname, { | |
| 361 | signedIn: user != null && !awaitsConfirmation(user), | |
| 362 | workspace: (user?.workspaces ?? []).length > 0, | |
| 363 | }); | |
| The plan says what g1t is for without measuring it against other products | 364 | const banner = |
| Merge main (membership, two-factor, GitHub repo roles) into tokens | 365 | paused || verify || held ? ( |
| The plan says what g1t is for without measuring it against other products | 366 | <> |
| 367 | {paused} | |
| 368 | {verify} | |
| Merge main (membership, two-factor, GitHub repo roles) into tokens | 369 | {held} |
| The plan says what g1t is for without measuring it against other products | 370 | </> |
| 371 | ) : null; | |
| 372 | 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. | 373 | <html lang="en" data-theme={themeAttribute(theme)}> |
| The plan says what g1t is for without measuring it against other products | 374 | <head> |
| 375 | <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) | 376 | <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. | 377 | {/* The browser bar matches the page: one colour for a chosen theme, the system's for Auto. */} |
| 378 | {theme === "auto" ? ( | |
| 379 | <> | |
| 380 | <meta name="theme-color" media="(prefers-color-scheme: light)" content={THEME_COLOR.light} /> | |
| 381 | <meta name="theme-color" media="(prefers-color-scheme: dark)" content={THEME_COLOR.dark} /> | |
| 382 | </> | |
| 383 | ) : ( | |
| 384 | <meta name="theme-color" content={THEME_COLOR[theme]} /> | |
| 385 | )} | |
| Merge branch 'mirroring' into artifacts-mode | 386 | <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) | 387 | <meta name="apple-mobile-web-app-capable" content="yes" /> |
| 388 | <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> | |
| The plan says what g1t is for without measuring it against other products | 389 | {/* 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. | 390 | connection paints sooner. */} |
| The plan says what g1t is for without measuring it against other products | 391 | <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 today | 392 | {root?.analyticsConsent && <meta name="g1t-analytics" content="consent" />} |
| The plan says what g1t is for without measuring it against other products | 393 | <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 address | 394 | <Links nonce={nonce} /> |
| The plan says what g1t is for without measuring it against other products | 395 | </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. | 396 | <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 audit | 397 | {/* The first stop for the keyboard: past the menus, to the page. */} |
| 398 | <a | |
| 399 | href="#content" | |
| 400 | 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]" | |
| 401 | > | |
| 402 | Skip to content | |
| 403 | </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. | 404 | {frame === "standalone" ? ( |
| 405 | <StandaloneFrame>{children}</StandaloneFrame> | |
| 406 | ) : frame === "app" && user && root?.shell ? ( | |
| 407 | <AppShell user={user} shell={root.shell} missing={missing} banner={banner} sidebarClosed={root.sidebarClosed}> | |
| The plan says what g1t is for without measuring it against other products | 408 | {children} |
| 409 | </AppShell> | |
| 410 | ) : ( | |
| 411 | <> | |
| 412 | <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. | 413 | <PublicHeader user={user} /> |
| The plan says what g1t is for without measuring it against other products | 414 | {banner} |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 415 | <div id="content" tabIndex={-1} {...leaving} className={`grow outline-none ${leaving.className}`}> |
| Merge branch 'worktree-agent-aca4790ea223aa235' | 416 | {children} |
| 417 | </div> | |
| The plan says what g1t is for without measuring it against other products | 418 | <SiteFooter user={user} /> |
| 419 | </> | |
| 420 | )} | |
| 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) | 421 | {/* Live notifications for the signed-in: the feed socket, toasts, the tab's count (components/notifications). */} |
| 422 | {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. | 423 | <LiveNotifications |
| 424 | workspace={root?.shell?.workspace?.slug ?? null} | |
| 425 | inbox={root?.shell?.inbox?.unread ?? null} | |
| 426 | sounds={root?.sounds ?? null} | |
| 427 | me={{ id: user.id, username: user.username }} | |
| 428 | /> | |
| 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) | 429 | )} |
| 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. | 430 | {/* Inside the desktop app: who its runner runs for, and its registration (lib/desktop-runner.ts). */} |
| 431 | {(!user || !awaitsConfirmation(user)) && ( | |
| 432 | <DesktopRunnerLink | |
| 433 | offer={{ | |
| 434 | signedIn: user != null, | |
| 435 | workspaces: (user?.workspaces ?? []).filter((m) => m.role === "owner").map((m) => ({ slug: m.slug, name: m.name ?? null })), | |
| 436 | current: root?.shell?.workspace?.slug ?? null, | |
| 437 | }} | |
| 438 | /> | |
| 439 | )} | |
| Merge branch 'main' into rm-agents | 440 | {/* Inside the desktop app: its settings dialog, and the runner's menu under the title bar's dot. */} |
| 441 | <DesktopApp /> | |
| 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 today | 442 | <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 address | 443 | <ScrollRestoration nonce={nonce} /> |
| 444 | <Scripts nonce={nonce} /> | |
| The plan says what g1t is for without measuring it against other products | 445 | </body> |
| 446 | </html> | |
| 447 | ); | |
| 448 | } | |
| 449 | ||
| 450 | export 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 today | 451 | const userId = useRouteLoaderData<typeof loader>("root")?.user?.id ?? null; |
| 452 | // Tell analytics who is signed in, once per change; signing out forgets them. | |
| 453 | const lastUserId = useRef<string | null>(null); | |
| 454 | useEffect(() => { | |
| 455 | identify(userId, lastUserId.current); | |
| 456 | lastUserId.current = userId; | |
| 457 | }, [userId]); | |
| Merge remote-tracking branch 'origin/claude/cool-newton-7nm8r9' into claude/cool-newton-7nm8r9 | 458 | // A navigation that never arrives is loaded as a whole page (lib/stuck.ts). |
| 459 | useStuckNavigationRescue(); | |
| The plan says what g1t is for without measuring it against other products | 460 | return <Outlet />; |
| 461 | } | |
| 462 | ||
| 463 | export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { | |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 464 | const location = useLocation(); |
| 465 | const matches = useMatches(); | |
| Merge branch 'worktree-agent-a64e51c8f386f46ac' | 466 | const href = location.pathname + location.search + location.hash; |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 467 | // A tab left open across a deploy: load the address again as a whole |
| Merge branch 'worktree-agent-a64e51c8f386f46ac' | 468 | // page, once, rather than show an error the reload fixes. A document load |
| 469 | // never reloads, so the server and the hydrating client render the same. | |
| 470 | const reloadable = reloadFixes({ | |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 471 | error, |
| 472 | status: isRouteErrorResponse(error) ? error.status : undefined, | |
| Merge branch 'worktree-agent-a64e51c8f386f46ac' | 473 | clientNavigation: clientNavigated(location.key), |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 474 | caughtByCatchAll: matches.at(-1)?.id === "routes/not-found", |
| 475 | }); | |
| Merge branch 'worktree-agent-a64e51c8f386f46ac' | 476 | // Already loaded again once, or the reload never started: show the page. |
| 477 | const tried = useMemo(() => reloadable && reloadedBefore(href), [reloadable, href]); | |
| Developer mode: a page that fails can say why. Under Settings, Account, a Developer mode switch (kept per browser in a g1t_dev cookie, like Appearance) makes the error page show the error itself, its message and stack, the address, the time, whether it came from a page the server drew or a navigation in the browser, the routes it was drawn from, the site's build (its stylesheet's hashed name), the browser and the desktop app's version, with Copy details to paste it all into a report; with it off, the page says where to turn it on. A signed-in request with developer mode on is answered by React Router in its development mode (workers/app.ts, a second handler made the first time it is wanted), so an error on the server comes through in full instead of "Unexpected Server Error"; that mode differs from production only in that and in hooks only Vite's dev server sets, and only ever covers the person's own requests. Checked in a production build: a failing repository page shows "counts failed with status 503" and its stack with developer mode on, and the usual page with it off. The workspaces guide covers it under Developer mode. | 478 | // The error in full, for reporting it (lib/developer-mode.ts). |
| 479 | const developer = useDeveloperMode(useRouteLoaderData<typeof loader>("root")?.developer) || import.meta.env.DEV; | |
| Merge branch 'worktree-agent-a64e51c8f386f46ac' | 480 | const [gaveUp, setGaveUp] = useState<string | null>(null); |
| 481 | const reload = reloadable && !tried && gaveUp !== href; | |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 482 | useEffect(() => { |
| 483 | if (!reload) return; | |
| 484 | try { | |
| 485 | sessionStorage.setItem(RELOADED_KEY, href); | |
| 486 | } catch { | |
| 487 | // No session storage: reload anyway; a document load never asks again. | |
| 488 | } | |
| 489 | window.location.assign(href); | |
| Merge branch 'worktree-agent-a64e51c8f386f46ac' | 490 | const timer = window.setTimeout(() => setGaveUp(href), RELOAD_GIVE_UP_MS); |
| 491 | return () => window.clearTimeout(timer); | |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 492 | }, [reload, href]); |
| 493 | if (reload) { | |
| 494 | return ( | |
| Not found and error pages have one main landmark: their own when signed out, the shell's when signed in | 495 | <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 audit | 496 | <title>Loading · g1t</title> |
| 497 | 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 in | 498 | </PageMain> |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 499 | ); |
| 500 | } | |
| 501 | ||
| The plan says what g1t is for without measuring it against other products | 502 | let title = "Something went wrong"; |
| 503 | let details = "An unexpected error occurred. Try again in a moment."; | |
| 504 | ||
| 505 | if (isRouteErrorResponse(error)) { | |
| 506 | // The same page for something private and something missing. | |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 507 | if (error.status === 404) { |
| 508 | return ( | |
| 509 | <> | |
| 510 | <title>Not found · g1t</title> | |
| 511 | <NotFound data={error.data} /> | |
| 512 | </> | |
| 513 | ); | |
| 514 | } | |
| The plan says what g1t is for without measuring it against other products | 515 | if (typeof error.data === "string" && error.data) { |
| 516 | details = error.data; | |
| 517 | } | |
| Merge main into Artifacts Phase 2 | 518 | // A token asked for what needs a real sign-in (lib/website-token.ts). |
| 519 | if (isNeedsSignIn(error.data)) { | |
| 520 | title = "This needs you to sign in"; | |
| 521 | details = error.data.message; | |
| 522 | } | |
| The plan says what g1t is for without measuring it against other products | 523 | } |
| 524 | ||
| 525 | return ( | |
| Developer mode: a page that fails can say why. Under Settings, Account, a Developer mode switch (kept per browser in a g1t_dev cookie, like Appearance) makes the error page show the error itself, its message and stack, the address, the time, whether it came from a page the server drew or a navigation in the browser, the routes it was drawn from, the site's build (its stylesheet's hashed name), the browser and the desktop app's version, with Copy details to paste it all into a report; with it off, the page says where to turn it on. A signed-in request with developer mode on is answered by React Router in its development mode (workers/app.ts, a second handler made the first time it is wanted), so an error on the server comes through in full instead of "Unexpected Server Error"; that mode differs from production only in that and in hooks only Vite's dev server sets, and only ever covers the person's own requests. Checked in a production build: a failing repository page shows "counts failed with status 503" and its stack with developer mode on, and the usual page with it off. The workspaces guide covers it under Developer mode. | 526 | <PageMain className={`mx-auto px-4 text-center ${developer ? "max-w-3xl py-16" : "max-w-xl py-32"}`}> |
| The plan says what g1t is for without measuring it against other products | 527 | <h1 className="text-2xl font-semibold tracking-tight">{title}</h1> |
| 528 | <p className="mt-3 text-muted">{details}</p> | |
| 529 | <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. | 530 | <ButtonLink to="/" variant="outline"> |
| The plan says what g1t is for without measuring it against other products | 531 | Back to home |
| 532 | </ButtonLink> | |
| 533 | </div> | |
| Developer mode: a page that fails can say why. Under Settings, Account, a Developer mode switch (kept per browser in a g1t_dev cookie, like Appearance) makes the error page show the error itself, its message and stack, the address, the time, whether it came from a page the server drew or a navigation in the browser, the routes it was drawn from, the site's build (its stylesheet's hashed name), the browser and the desktop app's version, with Copy details to paste it all into a report; with it off, the page says where to turn it on. A signed-in request with developer mode on is answered by React Router in its development mode (workers/app.ts, a second handler made the first time it is wanted), so an error on the server comes through in full instead of "Unexpected Server Error"; that mode differs from production only in that and in hooks only Vite's dev server sets, and only ever covers the person's own requests. Checked in a production build: a failing repository page shows "counts failed with status 503" and its stack with developer mode on, and the usual page with it off. The workspaces guide covers it under Developer mode. | 534 | {developer ? ( |
| 535 | <DebugDetails error={error} /> | |
| 536 | ) : ( | |
| 537 | <p className="mt-6 text-xs text-faint"> | |
| 538 | Turn on developer mode in{" "} | |
| 539 | <Link to="/settings/account#developer" className="underline underline-offset-4 hover:text-fg"> | |
| 540 | Settings | |
| 541 | </Link>{" "} | |
| 542 | to see what went wrong. | |
| 543 | </p> | |
| The plan says what g1t is for without measuring it against other products | 544 | )} |
| Not found and error pages have one main landmark: their own when signed out, the shell's when signed in | 545 | </PageMain> |
| The plan says what g1t is for without measuring it against other products | 546 | ); |
| 547 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.