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/code"; |
| 2 | import { TreeView } from "../../components/repo-view"; | |
| Search across all of g1t, Explore, and a command palette | 3 | import { page } from "../../lib/meta"; |
| Merge checks: statuses and check runs on every commit | 4 | import { commitChecksFor } from "../../lib/commit-checks.server"; |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 5 | import { aboutFor } from "../../lib/about.server"; |
| 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 branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 10 | import { projectHomepage } from "../../lib/about"; |
| 11 | import { useProject } from "./layout"; | |
| Initial g1t: services, event bus, intents and attempts | 12 | |
| Search across all of g1t, Explore, and a command palette | 13 | export function meta({ params, ...args }: Route.MetaArgs) { |
| 14 | return page(args, { title: `Code · ${params.owner}/${params.repo} · g1t` }); | |
| 15 | } | |
| 16 | ||
| Initial g1t: services, event bus, intents and attempts | 17 | export async function loader({ params, context }: Route.LoaderArgs) { |
| 18 | const path = { namespace: params.owner, name: params.repo }; | |
| The code page reads like a forge: a branch menu, search and a Code button above the files | 19 | const viewer = getViewer(context); |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 20 | 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 | 21 | repos.tree(path, viewer, null, ""), |
| 22 | // For the branch menu; the page still shows without it. | |
| 23 | repos.branches(path, viewer).catch(() => null), | |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 24 | // For the About sidebar's Deployments panel; null without any. |
| 25 | environmentsFor(path, viewer), | |
| The code page reads like a forge: a branch menu, search and a Code button above the files | 26 | ]); |
| Branches and Tags pages, each file's last commit, and the branch menu on files | 27 | // 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 | 28 | const lastCommits = lastCommitsFor(path, viewer, null, ""); |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 29 | const value = unwrap(tree); |
| 30 | // The About beside the files, streamed in after them. | |
| 31 | const about = value.head ? aboutFor(path, viewer, value.repo.id) : null; | |
| Merge checks: statuses and check runs on every commit | 32 | // The latest commit's checks: streamed in beside it. |
| 33 | const checks = commitChecksFor(path, viewer, [value.head?.hash]); | |
| 34 | return { tree: value, branches: branches?.ok ? branches.value : null, lastCommits, about, deployments: environments, checks }; | |
| Search across all of g1t, Explore, and a command palette | 35 | } |
| 36 | ||
| Initial g1t: services, event bus, intents and attempts | 37 | export default function Code({ loaderData }: Route.ComponentProps) { |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 38 | const project = useProject(); |
| 39 | return ( | |
| 40 | <TreeView | |
| 41 | tree={loaderData.tree} | |
| 42 | branches={loaderData.branches} | |
| 43 | lastCommits={loaderData.lastCommits} | |
| Merge checks: statuses and check runs on every commit | 44 | checks={loaderData.checks} |
| Merge branch 'main' into worktree-agent-a69aeabc4b0deeb97 | 45 | about={loaderData.about} |
| 46 | canPush={Boolean(project?.access.can.push)} | |
| 47 | homepage={projectHomepage(project?.project ?? null)} | |
| 48 | deployments={loaderData.deployments} | |
| 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.