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/tree"; |
| Social cards for every page: og.g1t.sh | 2 | import { page } from "../../lib/meta"; |
| Initial g1t: services, event bus, intents and attempts | 3 | import { TreeView } from "../../components/repo-view"; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 4 | import { redirectIfBranchRenamed } from "../../lib/branch-redirect.server"; |
| Merge checks: statuses and check runs on every commit | 5 | import { commitChecksFor } from "../../lib/commit-checks.server"; |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 6 | import { aboutFor } from "../../lib/about.server"; |
| 7 | import { 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 them | 8 | import { lastCommitsFor } from "../../lib/last-commits.server"; |
| Rust repos service with shipping; pull requests kept in the model | 9 | import { repos } from "../../lib/services.server"; |
| Initial g1t: services, event bus, intents and attempts | 10 | import { getViewer, unwrap } from "../../lib/session.server"; |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 11 | import { projectHomepage } from "../../lib/about"; |
| 12 | import { useProject } from "./layout"; | |
| Initial g1t: services, event bus, intents and attempts | 13 | |
| Social cards for every page: og.g1t.sh | 14 | export function meta({ params, ...args }: Route.MetaArgs) { |
| Initial g1t: services, event bus, intents and attempts | 15 | const path = params["*"] ? `${params["*"]} · ` : ""; |
| Social cards for every page: og.g1t.sh | 16 | return page(args, { title: `${path}${params.owner}/${params.repo} · g1t` }); |
| Initial g1t: services, event bus, intents and attempts | 17 | } |
| 18 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 19 | export async function loader({ params, context, request }: Route.LoaderArgs) { |
| Initial g1t: services, event bus, intents and attempts | 20 | const path = { namespace: params.owner, name: params.repo }; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 21 | const viewer = getViewer(context); |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 22 | const [tree, branches, environments] = await Promise.all([ |
| The code page reads like a forge: a branch menu, search and a Code button above the files | 23 | repos.tree(path, viewer, params.ref, params["*"] ?? ""), |
| 24 | // For the branch menu; the page still shows without it. | |
| 25 | repos.branches(path, viewer).catch(() => null), | |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 26 | // For the About sidebar's Deployments panel, shown at the root only. |
| 27 | params["*"] ? null : environmentsFor(path, viewer), | |
| The code page reads like a forge: a branch menu, search and a Code button above the files | 28 | ]); |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 29 | // A branch that was renamed: the same folder on its new name. |
| 30 | 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 files | 31 | // 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 them | 32 | const lastCommits = lastCommitsFor(path, viewer, params.ref, params["*"] ?? ""); |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 33 | const value = unwrap(tree); |
| 34 | // The About beside the files, streamed in after them. | |
| 35 | const about = value.head && !value.path ? aboutFor(path, viewer, value.repo.id) : null; | |
| Merge checks: statuses and check runs on every commit | 36 | // The latest commit's checks: streamed in beside it. |
| 37 | const checks = commitChecksFor(path, viewer, [value.head?.hash]); | |
| 38 | return { tree: value, branches: branches?.ok ? branches.value : null, lastCommits, about, deployments: environments, checks }; | |
| Initial g1t: services, event bus, intents and attempts | 39 | } |
| 40 | ||
| 41 | export default function Tree({ loaderData }: Route.ComponentProps) { | |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 42 | const project = useProject(); |
| 43 | return ( | |
| 44 | <TreeView | |
| 45 | tree={loaderData.tree} | |
| 46 | branches={loaderData.branches} | |
| 47 | lastCommits={loaderData.lastCommits} | |
| Merge checks: statuses and check runs on every commit | 48 | checks={loaderData.checks} |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 49 | about={loaderData.about} |
| 50 | canPush={Boolean(project?.access.can.push)} | |
| 51 | homepage={projectHomepage(project?.project ?? null)} | |
| 52 | deployments={loaderData.deployments} | |
| 53 | /> | |
| 54 | ); | |
| Initial g1t: services, event bus, intents and attempts | 55 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.