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
16 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.

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.1import { useRouteLoaderData } from "react-router";
2
3import type { loader as rootLoader } from "../root";
4import { setDeveloperMode, useDeveloperMode } from "../lib/developer-mode";
5import { SwitchCard } from "./ui/switch";
6
7/** Developer mode for this browser (lib/developer-mode.ts), switched at once. */
8export function DeveloperModeSwitch() {
9 const on = useDeveloperMode(useRouteLoaderData<typeof rootLoader>("root")?.developer);
10 return (
11 <SwitchCard title="Developer mode" checked={on} onCheckedChange={setDeveloperMode}>
12 When a page fails, show the error itself, its stack, where it happened and the build, with a button that copies it all for a report. Signed
13 in, errors on g1t&apos;s side come through in full too. This browser remembers it.
14 </SwitchCard>
15 );
16}