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.
| Initial g1t: services, event bus, intents and attempts | 1 | import type { Route } from "./+types/blob"; |
| Social cards for every page: og.g1t.sh | 2 | import { page } from "../../lib/meta"; |
| Initial g1t: services, event bus, intents and attempts | 3 | import { BlobView } from "../../components/repo-view"; |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 4 | import { highlightLines } from "../../lib/highlight.server"; |
| Rust repos service with shipping; pull requests kept in the model | 5 | import { repos } from "../../lib/services.server"; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 6 | import { redirectIfBranchRenamed } from "../../lib/branch-redirect.server"; |
| Initial g1t: services, event bus, intents and attempts | 7 | import { getViewer, unwrap } from "../../lib/session.server"; |
| 8 | ||
| Social cards for every page: og.g1t.sh | 9 | export function meta({ params, ...args }: Route.MetaArgs) { |
| 10 | return page(args, { title: `${params["*"]} · ${params.owner}/${params.repo} · g1t` }); | |
| Initial g1t: services, event bus, intents and attempts | 11 | } |
| 12 | ||
| Agents as a team: lifecycle, merge queue, billing and a new shell | 13 | export async function loader({ params, context, request }: Route.LoaderArgs) { |
| 14 | const viewer = getViewer(context); | |
| Initial g1t: services, event bus, intents and attempts | 15 | const path = { namespace: params.owner, name: params.repo }; |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 16 | const file = params["*"] ?? ""; |
| 17 | const wantsBlame = new URL(request.url).searchParams.has("blame"); | |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 18 | const [found, blame, list] = await Promise.all([ |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 19 | repos.blob(path, viewer, params.ref, file), |
| 20 | wantsBlame ? repos.blame(path, viewer, params.ref, file) : null, | |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 21 | // For the branch menu; the page still shows without it. |
| 22 | repos.branches(path, viewer).catch(() => null), | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 23 | ]); |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 24 | const branches = list?.ok ? list.value : null; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 25 | // A branch that was renamed: the same file on its new name. |
| 26 | if (!found.ok && found.error.code === "not_found") await redirectIfBranchRenamed(request, path, viewer, params.ref); | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 27 | const blob = unwrap(found); |
| 28 | if (blame?.ok && blob.text != null) { | |
| 29 | return { | |
| 30 | blob, | |
| 31 | html: null, | |
| 32 | blame: { blame: blame.value, lines: await highlightLines(blob.path, blob.text) }, | |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 33 | branches, |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 34 | }; |
| 35 | } | |
| API and MCP server, Rust identity service, registration, site redesign | 36 | return { |
| 37 | blob, | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 38 | html: blob.text == null ? null : await highlightLines(blob.path, blob.text), |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 39 | blame: null, |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 40 | branches, |
| API and MCP server, Rust identity service, registration, site redesign | 41 | }; |
| Initial g1t: services, event bus, intents and attempts | 42 | } |
| 43 | ||
| 44 | export default function Blob({ loaderData }: Route.ComponentProps) { | |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 45 | return <BlobView blob={loaderData.blob} html={loaderData.html} blame={loaderData.blame} branches={loaderData.branches} />; |
| Initial g1t: services, event bus, intents and attempts | 46 | } |