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.
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 1 | import { isCodeownersPath } from "@g1t/contracts"; |
| 2 | ||
| Initial g1t: services, event bus, intents and attempts | 3 | import type { Route } from "./+types/blob"; |
| Social cards for every page: og.g1t.sh | 4 | import { page } from "../../lib/meta"; |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 5 | import { CodeownersFileErrors } from "../../components/codeowners"; |
| Initial g1t: services, event bus, intents and attempts | 6 | import { BlobView } from "../../components/repo-view"; |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 7 | import { highlightLines } from "../../lib/highlight.server"; |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 8 | import { repos, work } from "../../lib/services.server"; |
| Merge commit authors and hovercards: commits show their accounts, every name opens a card (repos 0016) | 9 | import { showCommits } from "../../lib/commit-people.server"; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 10 | import { redirectIfBranchRenamed } from "../../lib/branch-redirect.server"; |
| Initial g1t: services, event bus, intents and attempts | 11 | import { getViewer, unwrap } from "../../lib/session.server"; |
| 12 | ||
| Social cards for every page: og.g1t.sh | 13 | export function meta({ params, ...args }: Route.MetaArgs) { |
| 14 | return page(args, { title: `${params["*"]} · ${params.owner}/${params.repo} · g1t` }); | |
| Initial g1t: services, event bus, intents and attempts | 15 | } |
| 16 | ||
| Agents as a team: lifecycle, merge queue, billing and a new shell | 17 | export async function loader({ params, context, request }: Route.LoaderArgs) { |
| 18 | const viewer = getViewer(context); | |
| Initial g1t: services, event bus, intents and attempts | 19 | const path = { namespace: params.owner, name: params.repo }; |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 20 | const file = params["*"] ?? ""; |
| 21 | const wantsBlame = new URL(request.url).searchParams.has("blame"); | |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 22 | const [found, blame, list, checked] = await Promise.all([ |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 23 | repos.blob(path, viewer, params.ref, file), |
| 24 | wantsBlame ? repos.blame(path, viewer, params.ref, file) : null, | |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 25 | // For the branch menu; the page still shows without it. |
| 26 | repos.branches(path, viewer).catch(() => null), | |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 27 | // A CODEOWNERS file is checked as it is shown; the file shows without it. |
| 28 | isCodeownersPath(file) ? work.codeownersErrors(path, viewer, params.ref).catch(() => null) : null, | |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 29 | ]); |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 30 | const codeowners = checked?.ok ? checked.value : null; |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 31 | const branches = list?.ok ? list.value : null; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 32 | // A branch that was renamed: the same file on its new name. |
| 33 | 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 | 34 | const blob = unwrap(found); |
| 35 | if (blame?.ok && blob.text != null) { | |
| 36 | return { | |
| 37 | blob, | |
| 38 | html: null, | |
| Merge commit authors and hovercards: commits show their accounts, every name opens a card (repos 0016) | 39 | blame: { |
| 40 | // Every commit's people at once. | |
| 41 | blame: { ...blame.value, commits: await showCommits(blame.value.commits) }, | |
| 42 | lines: await highlightLines(blob.path, blob.text), | |
| 43 | }, | |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 44 | branches, |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 45 | codeowners, |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 46 | }; |
| 47 | } | |
| API and MCP server, Rust identity service, registration, site redesign | 48 | return { |
| 49 | blob, | |
| Fast pages, required checks on the branch, self-hosted runners, honest incidents | 50 | html: blob.text == null ? null : await highlightLines(blob.path, blob.text), |
| Agents as a team: lifecycle, merge queue, billing and a new shell | 51 | blame: null, |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 52 | branches, |
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 53 | codeowners, |
| API and MCP server, Rust identity service, registration, site redesign | 54 | }; |
| Initial g1t: services, event bus, intents and attempts | 55 | } |
| 56 | ||
| Teams and CODEOWNERS, labels and milestones, dependency updates, the security suite, and a clearer top bar | 57 | export default function Blob({ loaderData, params }: Route.ComponentProps) { |
| 58 | const { codeowners, blob } = loaderData; | |
| 59 | // Its errors' lines are marked, when they are this file's. | |
| 60 | const own = codeowners != null && codeowners.path === blob.path; | |
| 61 | return ( | |
| 62 | <BlobView | |
| 63 | blob={blob} | |
| 64 | html={loaderData.html} | |
| 65 | blame={loaderData.blame} | |
| 66 | branches={loaderData.branches} | |
| 67 | notice={ | |
| 68 | codeowners && ( | |
| 69 | <CodeownersFileErrors report={codeowners} path={blob.path} base={`/${params.owner}/${params.repo}`} /> | |
| 70 | ) | |
| 71 | } | |
| 72 | marked={own ? codeowners.errors.map((error) => error.line).filter((line) => line > 0) : undefined} | |
| 73 | /> | |
| 74 | ); | |
| Initial g1t: services, event bus, intents and attempts | 75 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.