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