g1t/apps/web/app/components/repo-settings-heading.tsx
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.
| Project settings move into the sidebar, grouped, with a heading per page | 1 | import { useLocation } from "react-router"; |
| 2 | ||
| 3 | /** Each of a project's settings pages: its name and what it is for. */ | |
| 4 | const PAGES: Record<string, { title: string; about: string }> = { | |
| 5 | "": { title: "General", about: "The project's name, where its code lives, and what it is for." }, | |
| 6 | deployments: { title: "Deployments", about: "How the project builds, where it runs, and its previews." }, | |
| 7 | domains: { title: "Domains", about: "Addresses of your own for the production deployment." }, | |
| 8 | dependencies: { title: "Dependencies", about: "What the project relies on and what relies on it." }, | |
| g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent | 9 | agents: { title: "Agents", about: "How g1t picks up work here, and what it reads first." }, |
| Project settings move into the sidebar, grouped, with a heading per page | 10 | guardrails: { title: "Guardrails", about: "What agents may reach, run and spend while they work here." }, |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 11 | repository: { title: "Repository", about: "Its name, details and default branch, who can see it, and archiving, moving or deleting it." }, |
| 12 | access: { title: "Access", about: "Who can see and change the repository, with which role, and invitations to it." }, | |
| 13 | branches: { title: "Branches and merging", about: "Protection for the default branch, what a pull request needs before it merges, and what agents do." }, | |
| Project settings move into the sidebar, grouped, with a heading per page | 14 | secrets: { title: "Secrets and variables", about: "Values workflows, builds and deployments read at run time." }, |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 15 | runners: { title: "Runners", about: "Machines of your own for this project's workflow jobs, and where its agents' work runs." }, |
| Project settings move into the sidebar, grouped, with a heading per page | 16 | webhooks: { title: "Webhooks", about: "Addresses g1t calls when something happens in the project." }, |
| 17 | }; | |
| 18 | ||
| 19 | /** | |
| 20 | * The heading of a project's settings page, named from the address. The | |
| 21 | * pages themselves are listed in the sidebar while you are in settings. | |
| 22 | */ | |
| 23 | export function RepoSettingsHeading({ base }: { base: string }) { | |
| 24 | const { pathname } = useLocation(); | |
| 25 | const section = pathname.slice(`${base}/settings`.length).replace(/^\//, "").split("/")[0] ?? ""; | |
| 26 | const page = PAGES[section] ?? PAGES[""]!; | |
| 27 | return ( | |
| 28 | <header className="mb-8 border-b border-line pb-5"> | |
| 29 | <h1 className="text-lg font-semibold tracking-tight">{page.title}</h1> | |
| 30 | <p className="mt-1 text-sm text-muted">{page.about}</p> | |
| 31 | </header> | |
| 32 | ); | |
| 33 | } |