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"; |
| Rust repos service with shipping; pull requests kept in the model | 5 | import { repos } from "../../lib/services.server"; |
| Initial g1t: services, event bus, intents and attempts | 6 | import { getViewer, unwrap } from "../../lib/session.server"; |
| 7 | ||
| Social cards for every page: og.g1t.sh | 8 | export function meta({ params, ...args }: Route.MetaArgs) { |
| Initial g1t: services, event bus, intents and attempts | 9 | const path = params["*"] ? `${params["*"]} · ` : ""; |
| Social cards for every page: og.g1t.sh | 10 | return page(args, { title: `${path}${params.owner}/${params.repo} · g1t` }); |
| Initial g1t: services, event bus, intents and attempts | 11 | } |
| 12 | ||
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 13 | export async function loader({ params, context, request }: Route.LoaderArgs) { |
| Initial g1t: services, event bus, intents and attempts | 14 | const path = { namespace: params.owner, name: params.repo }; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 15 | const viewer = getViewer(context); |
| 16 | const tree = await repos.tree(path, viewer, params.ref, params["*"] ?? ""); | |
| 17 | // A branch that was renamed: the same folder on its new name. | |
| 18 | if (!tree.ok && tree.error.code === "not_found") await redirectIfBranchRenamed(request, path, viewer, params.ref); | |
| 19 | return unwrap(tree); | |
| Initial g1t: services, event bus, intents and attempts | 20 | } |
| 21 | ||
| 22 | export default function Tree({ loaderData }: Route.ComponentProps) { | |
| 23 | return <TreeView tree={loaderData} />; | |
| 24 | } |