Skip to content
58 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.

Initial g1t: services, event bus, intents and attempts1import type { Route } from "./+types/tree";
Social cards for every page: og.g1t.sh2import { page } from "../../lib/meta";
Initial g1t: services, event bus, intents and attempts3import { TreeView } from "../../components/repo-view";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look4import { redirectIfBranchRenamed } from "../../lib/branch-redirect.server";
Merge checks: statuses and check runs on every commit5import { commitChecksFor } from "../../lib/commit-checks.server";
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb976import { aboutFor } from "../../lib/about.server";
7import { environmentsFor } from "../../lib/deployments.server";
Last commits read trees two dozen commits at a time, and the file list waits at most 3 s for them8import { lastCommitsFor } from "../../lib/last-commits.server";
Merge commit authors and hovercards: commits show their accounts, every name opens a card (repos 0016)9import { showOneCommit } from "../../lib/commit-people.server";
Rust repos service with shipping; pull requests kept in the model10import { repos } from "../../lib/services.server";
Initial g1t: services, event bus, intents and attempts11import { getViewer, unwrap } from "../../lib/session.server";
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9712import { projectHomepage } from "../../lib/about";
13import { useProject } from "./layout";
Initial g1t: services, event bus, intents and attempts14
Social cards for every page: og.g1t.sh15export function meta({ params, ...args }: Route.MetaArgs) {
Initial g1t: services, event bus, intents and attempts16 const path = params["*"] ? `${params["*"]} · ` : "";
Social cards for every page: og.g1t.sh17 return page(args, { title: `${path}${params.owner}/${params.repo} · g1t` });
Initial g1t: services, event bus, intents and attempts18}
19
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look20export async function loader({ params, context, request }: Route.LoaderArgs) {
Initial g1t: services, event bus, intents and attempts21 const path = { namespace: params.owner, name: params.repo };
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look22 const viewer = getViewer(context);
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9723 const [tree, branches, environments] = await Promise.all([
The code page reads like a forge: a branch menu, search and a Code button above the files24 repos.tree(path, viewer, params.ref, params["*"] ?? ""),
25 // For the branch menu; the page still shows without it.
26 repos.branches(path, viewer).catch(() => null),
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9727 // For the About sidebar's Deployments panel, shown at the root only.
28 params["*"] ? null : environmentsFor(path, viewer),
The code page reads like a forge: a branch menu, search and a Code button above the files29 ]);
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look30 // A branch that was renamed: the same folder on its new name.
31 if (!tree.ok && tree.error.code === "not_found") await redirectIfBranchRenamed(request, path, viewer, params.ref);
Branches and Tags pages, each file's last commit, and the branch menu on files32 // Each entry's last commit walks history: streamed in after the list.
Last commits read trees two dozen commits at a time, and the file list waits at most 3 s for them33 const lastCommits = lastCommitsFor(path, viewer, params.ref, params["*"] ?? "");
Merge commit authors and hovercards: commits show their accounts, every name opens a card (repos 0016)34 const found = unwrap(tree);
35 // The latest commit's author, as their account where there is one.
36 const value = { ...found, head: await showOneCommit(found.head) };
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9737 // The About beside the files, streamed in after them.
38 const about = value.head && !value.path ? aboutFor(path, viewer, value.repo.id) : null;
Merge checks: statuses and check runs on every commit39 // The latest commit's checks: streamed in beside it.
40 const checks = commitChecksFor(path, viewer, [value.head?.hash]);
41 return { tree: value, branches: branches?.ok ? branches.value : null, lastCommits, about, deployments: environments, checks };
Initial g1t: services, event bus, intents and attempts42}
43
44export default function Tree({ loaderData }: Route.ComponentProps) {
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9745 const project = useProject();
46 return (
47 <TreeView
48 tree={loaderData.tree}
49 branches={loaderData.branches}
50 lastCommits={loaderData.lastCommits}
Merge checks: statuses and check runs on every commit51 checks={loaderData.checks}
Merge branch 'main' into worktree-agent-a69aeabc4b0deeb9752 about={loaderData.about}
53 canPush={Boolean(project?.access.can.push)}
54 homepage={projectHomepage(project?.project ?? null)}
55 deployments={loaderData.deployments}
56 />
57 );
Initial g1t: services, event bus, intents and attempts58}

This file's history is long; its oldest lines are credited to the oldest commit read.