Skip to content

g1t/apps/web/app/routes/workspace/overview.tsx

461 lines20,707 bytesCodeBlame

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.

Navigation: the workspace's own page with tabs, pins and recent in the sidebar1import { ArrowRight, ArrowUpRight, Box, CircleDot, GitBranch, GitPullRequest, KeyRound, Lock, Pin, Plus, Rocket } from "lucide-react";
Agents as a team: lifecycle, merge queue, billing and a new shell2import { Link } from "react-router";
3
A project is an app or a library: libraries show their package and how to ship a release, not production4import type { PackageSummary, Project, ProjectDeploys, User } from "@g1t/contracts";
Projects: what a workspace builds and runs, first on every page5
Agents as a team: lifecycle, merge queue, billing and a new shell6import type { Route } from "./+types/overview";
Projects: what a workspace builds and runs, first on every page7import { host, StatusDot } from "../../components/deploy";
Agents as a team: lifecycle, merge queue, billing and a new shell8import { Avatar, ButtonLink, CopyLine, Pill, TimeAgo } from "../../components/ui";
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look9import { UsageCard } from "../../components/usage-card";
10import { PullIcon } from "../../components/work-icons";
11import { planStatus, type UsageGlance, usageGlance } from "../../lib/billing";
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent12import { openedBy } from "../../lib/opened-by";
Merge branch 'worktree-agent-aaf03bdceac799c89'13import { cloneUrl, useAddresses } from "../../lib/addresses";
A project is an app or a library: libraries show their package and how to ship a release, not production14import { libraryPackages, packageLine, packagePath } from "../../lib/project-kind";
Navigation: the workspace's own page with tabs, pins and recent in the sidebar15import { PinButton } from "../../components/pin-button";
16import { sortProjects } from "../../lib/project-list";
A project is an app or a library: libraries show their package and how to ship a release, not production17import { billing, deployments, identity, packages, projects as projectsApi, work } from "../../lib/services.server";
Agents as a team: lifecycle, merge queue, billing and a new shell18import { getViewer, roleIn } from "../../lib/session.server";
Navigation: the workspace's own page with tabs, pins and recent in the sidebar19import { workspaceProjects } from "../../lib/workspace-projects.server";
Agents as a team: lifecycle, merge queue, billing and a new shell20
Navigation: the workspace's own page with tabs, pins and recent in the sidebar21/** Projects whose open issues and pull requests are counted: the most active. */
Agents as a team: lifecycle, merge queue, billing and a new shell22const MAX_COUNTED = 30;
Navigation: the workspace's own page with tabs, pins and recent in the sidebar23/** Projects shown under Recently active, after the pins. */
24const MAX_ACTIVE = 6;
Projects: what a workspace builds and runs, first on every page25/** Projects whose pull requests are listed under "In progress". */
Agents as a team: lifecycle, merge queue, billing and a new shell26const MAX_LISTED = 8;
27const MAX_PULLS = 8;
28const MAX_FACES = 8;
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look29/** The trial as published, when the price book cannot be read. */
30const DEFAULT_TRIAL_MICROS = 5_000_000;
Agents as a team: lifecycle, merge queue, billing and a new shell31
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look32/**
33 * The month for the Usage card, for members only: what was spent, what
34 * pays first and what it went on. Fetched here, not with the sidebar, so
35 * only this page pays for it; a billing service that cannot answer leaves
36 * the card out rather than the page.
37 */
38async function usageFor(slug: string, viewer: User | null): Promise<UsageGlance | null> {
39 const now = new Date();
40 const monthStart = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
41 const [account, usage, features, entitlements, limit, book] = await Promise.all([
42 billing.account(slug, viewer).catch(() => null),
43 billing.usage(slug, viewer, monthStart).catch(() => null),
44 billing.features(slug, viewer).catch(() => null),
45 billing.entitlements(slug).catch(() => null),
46 billing.limit(slug, viewer).catch(() => null),
47 billing.prices().catch(() => null),
48 ]);
49 if (!account?.ok || !usage?.ok) return null;
50 // Without payments set up (a g1t run without billing), there is no plan to show.
51 if (!account.value.status.enabled && !usage.value.free) return null;
52 const plan = features?.ok ? (features.value.find((state) => state.plan.feature === "plan") ?? null) : null;
53 return usageGlance({
54 usage: usage.value,
55 status: planStatus(plan, entitlements),
56 entitlements,
57 limit: limit?.ok ? limit.value : null,
58 trialMicros: book?.free?.trialWorkspaceMicros ?? DEFAULT_TRIAL_MICROS,
59 });
60}
61
Agents as a team: lifecycle, merge queue, billing and a new shell62export async function loader({ params, context }: Route.LoaderArgs) {
63 const viewer = getViewer(context);
64 const slug = params.owner.toLowerCase();
65 const role = roleIn(viewer, slug);
Navigation: the workspace's own page with tabs, pins and recent in the sidebar66 const [listed, members, deploys, usage, published, shortcuts] = await Promise.all([
67 // The listing the sidebar and the Projects tab share.
68 workspaceProjects(slug, viewer),
Agents as a team: lifecycle, merge queue, billing and a new shell69 role ? identity.listMembers(slug, viewer) : null,
Projects: what a workspace builds and runs, first on every page70 role ? deployments.overview(slug, viewer) : null,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look71 role ? usageFor(slug, viewer) : null,
A project is an app or a library: libraries show their package and how to ship a release, not production72 // One listing for every card: a library's card shows its package where an app's shows production.
73 packages.list(slug, viewer).catch(() => null),
Navigation: the workspace's own page with tabs, pins and recent in the sidebar74 // The viewer's pins lead the page, as they lead the sidebar.
75 role ? projectsApi.shortcuts(slug, viewer).catch(() => null) : null,
Agents as a team: lifecycle, merge queue, billing and a new shell76 ]);
Projects: what a workspace builds and runs, first on every page77 const projects = listed.ok ? listed.value : [];
Navigation: the workspace's own page with tabs, pins and recent in the sidebar78 const pinnedIds = new Set((shortcuts?.pinned ?? []).map((project) => project.id));
79 const byId = new Map(projects.map((project) => [project.id, project]));
80 const pinned = (shortcuts?.pinned ?? []).map((pin) => byId.get(pin.id)).filter((project): project is Project => project != null);
81 // However many there are: the most active first, archived ones last.
82 const byActivity = sortProjects(
83 projects.map((project) => ({ ...project, pushedAt: project.pushedAt ?? null, activity: project.activity ?? 0, deploying: false })),
84 "active",
85 )
86 .sort((a, b) => Number(a.archived) - Number(b.archived))
87 .map((listedProject) => byId.get(listedProject.id)!);
88 const active = byActivity.filter((project) => !pinnedIds.has(project.id)).slice(0, MAX_ACTIVE);
Agents as a team: lifecycle, merge queue, billing and a new shell89
Projects: what a workspace builds and runs, first on every page90 const pathOf = (project: Project) =>
91 project.source.kind === "hosted" ? project.source.repo : { namespace: project.workspace, name: project.slug };
Navigation: the workspace's own page with tabs, pins and recent in the sidebar92 const counted = [...new Map([...pinned, ...active, ...byActivity].map((project) => [project.id, project])).values()].slice(0, Math.max(MAX_COUNTED, pinned.length + active.length));
Projects: what a workspace builds and runs, first on every page93 const counts = await Promise.all(counted.map((project) => work.counts(pathOf(project), viewer)));
Agents as a team: lifecycle, merge queue, billing and a new shell94 const open: Record<string, { issues: number; pulls: number }> = {};
Projects: what a workspace builds and runs, first on every page95 counted.forEach((project, i) => {
Agents as a team: lifecycle, merge queue, billing and a new shell96 const result = counts[i];
Projects: what a workspace builds and runs, first on every page97 if (result.ok) open[project.id] = result.value;
Agents as a team: lifecycle, merge queue, billing and a new shell98 });
99
Projects: what a workspace builds and runs, first on every page100 const busy = counted.filter((project) => (open[project.id]?.pulls ?? 0) > 0).slice(0, MAX_LISTED);
101 const lists = await Promise.all(busy.map((project) => work.listPulls(pathOf(project), viewer, "open")));
Agents as a team: lifecycle, merge queue, billing and a new shell102 const pulls = lists
Projects: what a workspace builds and runs, first on every page103 .flatMap((result, i) => (result.ok ? result.value.map((pull) => ({ pull, project: busy[i] })) : []))
Agents as a team: lifecycle, merge queue, billing and a new shell104 .sort((a, b) => b.pull.updatedAt.localeCompare(a.pull.updatedAt))
105 .slice(0, MAX_PULLS);
106
Projects: what a workspace builds and runs, first on every page107 const bySlug: Record<string, ProjectDeploys> = {};
108 for (const entry of deploys?.ok ? deploys.value : []) bySlug[entry.slug] = entry;
109
A project is an app or a library: libraries show their package and how to ship a release, not production110 const byRepo = new Map<string, PackageSummary[]>();
111 for (const pkg of published?.ok ? published.value : []) {
112 if (pkg.repo) byRepo.set(pkg.repo.id, [...(byRepo.get(pkg.repo.id) ?? []), pkg]);
113 }
114 const packageOf: Record<string, PackageSummary> = {};
Navigation: the workspace's own page with tabs, pins and recent in the sidebar115 for (const project of [...pinned, ...active]) {
A project is an app or a library: libraries show their package and how to ship a release, not production116 if (project.kind !== "library" || project.source.kind !== "hosted") continue;
117 const first = libraryPackages(byRepo.get(project.source.repoId) ?? [])[0];
118 if (first) packageOf[project.id] = first;
119 }
120
Projects: what a workspace builds and runs, first on every page121 return {
122 slug,
123 role,
Navigation: the workspace's own page with tabs, pins and recent in the sidebar124 total: projects.length,
125 pinned,
126 active,
Projects: what a workspace builds and runs, first on every page127 open,
128 deploys: bySlug,
A project is an app or a library: libraries show their package and how to ship a release, not production129 packageOf,
Projects: what a workspace builds and runs, first on every page130 pulls: pulls.map(({ pull, project }) => ({ pull, slug: project.slug, name: project.name })),
131 members: members?.ok ? members.value : null,
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look132 usage,
Projects: what a workspace builds and runs, first on every page133 };
Agents as a team: lifecycle, merge queue, billing and a new shell134}
135
136function Stat({ value, label }: { value: number; label: string }) {
137 return (
138 <div className="rounded-xl border border-line bg-surface px-4 py-3">
139 <p className="text-xl font-semibold tabular-nums tracking-tight">{value}</p>
140 <p className="text-xs text-muted">{label}</p>
141 </div>
142 );
143}
144
Projects: what a workspace builds and runs, first on every page145/** What a member sees in a workspace with no projects yet. */
Agents as a team: lifecycle, merge queue, billing and a new shell146function GetStarted({ slug }: { slug: string }) {
Merge branch 'worktree-agent-aaf03bdceac799c89'147 const addresses = useAddresses();
Agents as a team: lifecycle, merge queue, billing and a new shell148 return (
Projects: what a workspace builds and runs, first on every page149 <div className="rounded-2xl border border-line bg-surface p-8">
150 <span className="flex size-10 items-center justify-center rounded-xl bg-accent/10 text-accent ring-1 ring-accent/30">
151 <Box size={18} />
152 </span>
153 <h2 className="mt-4 text-lg font-semibold tracking-tight">Create your first project</h2>
Agents as a team: lifecycle, merge queue, billing and a new shell154 <p className="mt-1.5 max-w-xl text-sm text-muted">
Projects: what a workspace builds and runs, first on every page155 A project is what you build and run: its code, the issues that say what should change, the agents and
156 people who change it, and where it is deployed.
Agents as a team: lifecycle, merge queue, billing and a new shell157 </p>
Projects: what a workspace builds and runs, first on every page158 <div className="mt-6 flex flex-wrap gap-3">
159 <ButtonLink to={`/new?workspace=${slug}`} variant="accent">
160 <Plus size={14} />
161 New project
162 </ButtonLink>
Agents as a team: lifecycle, merge queue, billing and a new shell163 </div>
Projects: what a workspace builds and runs, first on every page164 <p className="mt-6 text-sm text-muted">Or push code you already have, and it becomes a project:</p>
Agents as a team: lifecycle, merge queue, billing and a new shell165 <div className="mt-2 max-w-xl">
Merge branch 'worktree-agent-aaf03bdceac799c89'166 <CopyLine prompt text={`git push ${cloneUrl(addresses, `${slug}/my-project`)} main`} />
Agents as a team: lifecycle, merge queue, billing and a new shell167 </div>
168 </div>
169 );
170}
171
Projects: what a workspace builds and runs, first on every page172function ProjectCard({
173 project,
174 open,
175 deploys,
A project is an app or a library: libraries show their package and how to ship a release, not production176 pkg,
Projects: what a workspace builds and runs, first on every page177 member,
Navigation: the workspace's own page with tabs, pins and recent in the sidebar178 pinned,
Projects: what a workspace builds and runs, first on every page179}: {
180 project: Project;
181 open: { issues: number; pulls: number } | undefined;
182 deploys: ProjectDeploys | undefined;
A project is an app or a library: libraries show their package and how to ship a release, not production183 /** For a library, the package it publishes. */
184 pkg: PackageSummary | undefined;
Projects: what a workspace builds and runs, first on every page185 member: boolean;
Navigation: the workspace's own page with tabs, pins and recent in the sidebar186 /** Whether the viewer pinned it; null when they cannot pin. */
187 pinned: boolean | null;
Projects: what a workspace builds and runs, first on every page188}) {
A project is an app or a library: libraries show their package and how to ship a release, not production189 const library = project.kind === "library";
Projects: what a workspace builds and runs, first on every page190 const base = `/${project.workspace}/${project.slug}`;
191 const production = deploys?.production ?? null;
192 const latest = deploys?.latest ?? null;
193 const source = project.source.kind === "hosted" ? project.source : null;
194 return (
195 <li className="group relative flex flex-col rounded-2xl border border-line bg-surface p-5 transition-colors hover:border-line-strong">
196 <div className="flex items-start gap-3">
197 <span className="flex size-9 shrink-0 items-center justify-center rounded-lg bg-raised text-muted ring-1 ring-line">
198 {project.private ? <Lock size={15} /> : <Box size={15} />}
199 </span>
200 <div className="min-w-0 grow">
201 <Link to={base} prefetch="intent" className="font-medium after:absolute after:inset-0 hover:underline">
202 {project.name}
203 </Link>
204 {production ? (
205 <a
206 href={production.url}
207 className="relative z-10 mt-0.5 flex items-center gap-1 truncate font-mono text-xs text-muted hover:text-accent"
208 >
209 {host(production.url)}
210 <ArrowUpRight size={11} className="shrink-0" />
211 </a>
A project is an app or a library: libraries show their package and how to ship a release, not production212 ) : library && pkg ? (
213 <Link
214 to={packagePath(pkg)}
215 className="relative z-10 mt-0.5 block truncate font-mono text-xs text-muted hover:text-accent"
216 >
217 {packageLine(pkg)}
218 </Link>
Projects: what a workspace builds and runs, first on every page219 ) : (
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look220 <p className="mt-0.5 truncate text-xs text-faint">
A project is an app or a library: libraries show their package and how to ship a release, not production221 {project.description ?? (library ? "Not published yet" : deploys?.enabled ? "Not deployed yet" : "Deployments are off")}
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look222 </p>
Projects: what a workspace builds and runs, first on every page223 )}
224 </div>
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look225 {(project.private || project.archived) && (
226 <span className="flex shrink-0 gap-1.5">
227 {project.private && <Pill>private</Pill>}
228 {project.archived && <Pill>archived</Pill>}
229 </span>
230 )}
Navigation: the workspace's own page with tabs, pins and recent in the sidebar231 {pinned != null && (
232 <PinButton workspace={project.workspace} slug={project.slug} name={project.name} pinned={pinned} compact className="-mt-1.5 -mr-2" />
233 )}
Projects: what a workspace builds and runs, first on every page234 </div>
235
A project is an app or a library: libraries show their package and how to ship a release, not production236 {project.description && (production || (library && pkg)) && <p className="mt-3 line-clamp-2 text-sm text-muted">{project.description}</p>}
Projects: what a workspace builds and runs, first on every page237
238 <div className="mt-auto pt-5">
239 {member && latest && (
240 <p className="mb-3 flex items-center gap-2 text-xs text-muted">
241 <StatusDot status={latest.status} />
242 <span className="truncate">
243 {latest.kind === "production" ? "Production" : `Preview of ${latest.branch}`}
244 </span>
245 <span className="ml-auto shrink-0 text-faint">
246 <TimeAgo at={latest.createdAt} />
247 </span>
248 </p>
249 )}
250 <div className="flex items-center gap-4 border-t border-line pt-3 text-xs text-muted">
251 {source && (
252 <span className="flex min-w-0 items-center gap-1.5 font-mono">
253 <GitBranch size={12} className="shrink-0 text-faint" />
254 <span className="truncate">{source.defaultBranch}</span>
255 </span>
256 )}
257 <span className="flex items-center gap-1">
258 <CircleDot size={12} className="text-faint" />
259 {open?.issues ?? 0}
260 </span>
261 <span className="flex items-center gap-1">
262 <GitPullRequest size={12} className="text-faint" />
263 {open?.pulls ?? 0}
264 </span>
265 {member && deploys?.enabled && (deploys.previews ?? 0) > 0 && (
Merge branch 'worktree-agent-ad7c6d88d93adc817'266 <span className="ml-auto flex items-center gap-1 text-success">
Projects: what a workspace builds and runs, first on every page267 <Rocket size={12} />
268 {deploys.previews} {deploys.previews === 1 ? "preview" : "previews"}
269 </span>
270 )}
271 </div>
272 </div>
273 </li>
274 );
275}
276
Agents as a team: lifecycle, merge queue, billing and a new shell277export default function WorkspaceOverview({ loaderData }: Route.ComponentProps) {
Navigation: the workspace's own page with tabs, pins and recent in the sidebar278 const { slug, role, total, pinned, active, open, deploys, pulls, members, usage } = loaderData;
279 const card = (project: Project, isPinned: boolean) => (
280 <ProjectCard
281 key={project.id}
282 project={project}
283 open={open[project.id]}
284 deploys={deploys[project.slug]}
285 pkg={loaderData.packageOf[project.id]}
286 member={role != null}
287 pinned={role ? isPinned : null}
288 />
289 );
Agents as a team: lifecycle, merge queue, billing and a new shell290 const totals = Object.values(open).reduce(
Projects: what a workspace builds and runs, first on every page291 (sum, counts) => ({ issues: sum.issues + counts.issues, pulls: sum.pulls + counts.pulls }),
Agents as a team: lifecycle, merge queue, billing and a new shell292 { issues: 0, pulls: 0 },
293 );
Projects: what a workspace builds and runs, first on every page294 const liveApps = Object.values(deploys).filter((entry) => entry.production).length;
Agents as a team: lifecycle, merge queue, billing and a new shell295 return (
296 <div className="grid gap-10 lg:grid-cols-[1fr_18rem]">
297 <div className="min-w-0 space-y-10">
Navigation: the workspace's own page with tabs, pins and recent in the sidebar298 {total === 0 && role ? (
Agents as a team: lifecycle, merge queue, billing and a new shell299 <GetStarted slug={slug} />
300 ) : (
301 <>
Projects: what a workspace builds and runs, first on every page302 <div className="grid grid-cols-2 gap-3 sm:grid-cols-4">
Navigation: the workspace's own page with tabs, pins and recent in the sidebar303 <Stat value={total} label={total === 1 ? "Project" : "Projects"} />
Projects: what a workspace builds and runs, first on every page304 <Stat value={liveApps} label="In production" />
Agents as a team: lifecycle, merge queue, billing and a new shell305 <Stat value={totals.issues} label="Open issues" />
306 <Stat value={totals.pulls} label="Pull requests in progress" />
307 </div>
308
Navigation: the workspace's own page with tabs, pins and recent in the sidebar309 {role && (
310 <section aria-labelledby="pinned">
311 <h2 id="pinned" className="text-sm font-medium text-muted">
312 Pinned
313 </h2>
314 {pinned.length > 0 ? (
315 <ul className="mt-3 grid gap-4 sm:grid-cols-2">{pinned.map((project) => card(project, true))}</ul>
316 ) : (
317 <p className="mt-3 flex items-center gap-2 rounded-xl border border-dashed border-line px-4 py-3 text-sm text-muted">
318 <Pin size={14} className="shrink-0 text-faint" />
319 Pin the projects you use most, from their page or from Projects, to keep them here and in your sidebar.
320 </p>
Projects: what a workspace builds and runs, first on every page321 )}
Navigation: the workspace's own page with tabs, pins and recent in the sidebar322 </section>
323 )}
324
325 {active.length > 0 && (
326 <section aria-labelledby="active">
327 <div className="flex items-center justify-between">
328 <h2 id="active" className="text-sm font-medium text-muted">
329 {role ? "Recently active" : "Projects"}
330 </h2>
331 {role && (
332 <Link to={`/new?workspace=${slug}`} className="inline-flex items-center gap-1 text-xs text-muted hover:text-fg">
333 <Plus size={13} />
334 New project
335 </Link>
336 )}
337 </div>
338 <ul className="mt-3 grid gap-4 sm:grid-cols-2">{active.map((project) => card(project, false))}</ul>
339 </section>
340 )}
341
342 <Link
343 to={`/${slug}/-/projects`}
344 prefetch="intent"
345 className="flex items-center justify-between rounded-xl border border-line bg-surface px-4 py-3 text-sm transition-colors hover:border-line-strong"
346 >
347 <span>
348 All projects <span className="tabular-nums text-muted">({total})</span>
349 </span>
350 <span className="flex items-center gap-1 text-xs text-muted">
351 Search, filter and sort
352 <ArrowRight size={13} />
353 </span>
354 </Link>
Projects: what a workspace builds and runs, first on every page355
Agents as a team: lifecycle, merge queue, billing and a new shell356 {pulls.length > 0 && (
357 <section>
358 <h2 className="text-sm font-medium text-muted">In progress</h2>
359 <ul className="mt-3 divide-y divide-line overflow-hidden rounded-xl border border-line bg-surface">
Projects: what a workspace builds and runs, first on every page360 {pulls.map(({ pull, slug: project, name }) => (
Agents as a team: lifecycle, merge queue, billing and a new shell361 <li key={pull.id}>
362 <Link
363 prefetch="intent"
Projects: what a workspace builds and runs, first on every page364 to={`/${slug}/${project}/pull/${pull.number}`}
Agents as a team: lifecycle, merge queue, billing and a new shell365 className="flex items-center gap-3 px-4 py-3 transition-colors hover:bg-raised"
366 >
367 <PullIcon status={pull.status} />
368 <span className="min-w-0 grow">
369 <span className="block truncate font-medium">{pull.title}</span>
Projects: what a workspace builds and runs, first on every page370 <span className="text-xs text-muted">
371 {name} <span className="font-mono">#{pull.number}</span>
g1t is one name: its agent's work, commits and comments show as @g1t, and nobody can claim g1t or g1t-agent372 {pull.issue != null && ` · for #${pull.issue}`} · {openedBy(pull).name}
Agents as a team: lifecycle, merge queue, billing and a new shell373 </span>
374 </span>
375 <span className="hidden shrink-0 text-xs text-muted sm:block">
376 {pull.status === "draft" ? "Being worked on" : "Ready for review"}
377 </span>
378 <span className="w-14 shrink-0 text-right text-xs text-faint">
379 <TimeAgo at={pull.updatedAt} />
380 </span>
381 </Link>
382 </li>
383 ))}
384 </ul>
385 </section>
386 )}
387 </>
388 )}
389 </div>
390
391 <aside className="space-y-6">
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look392 {role && usage && <UsageCard slug={slug} glance={usage} owner={role === "owner"} />}
393
Agents as a team: lifecycle, merge queue, billing and a new shell394 {members ? (
395 <section>
396 <div className="flex items-center justify-between">
Projects: what a workspace builds and runs, first on every page397 <h2 className="text-sm font-medium">Members</h2>
Agents as a team: lifecycle, merge queue, billing and a new shell398 <Link to={`/${slug}/-/people`} className="text-xs text-muted hover:text-fg">
399 {role === "owner" ? "Manage" : "See all"}
400 </Link>
401 </div>
402 <ul className="mt-3 space-y-1.5">
403 {members.slice(0, MAX_FACES).map((member) => (
404 <li key={member.username} className="flex items-center gap-2 text-sm">
405 <Avatar name={member.username} />
406 <span className="grow truncate font-mono">{member.username}</span>
407 {member.role === "owner" && <Pill>owner</Pill>}
408 </li>
409 ))}
410 </ul>
Projects: what a workspace builds and runs, first on every page411 {members.length > MAX_FACES && <p className="mt-2 text-xs text-faint">and {members.length - MAX_FACES} more</p>}
Agents as a team: lifecycle, merge queue, billing and a new shell412 </section>
413 ) : (
414 <p className="text-sm text-muted">
Projects: what a workspace builds and runs, first on every page415 Members of this workspace build its projects. Anyone can open an issue or a pull request on a public one.
Agents as a team: lifecycle, merge queue, billing and a new shell416 </p>
417 )}
418
419 {role && (
420 <section className="rounded-xl border border-line bg-surface p-5">
421 <h2 className="flex items-center gap-2 font-medium">
Projects: what a workspace builds and runs, first on every page422 <Rocket size={15} className="text-faint" />
423 Deploy on g1t.page
424 </h2>
425 <p className="mt-1.5 text-sm text-muted">
Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look426 Off until you turn them on for a project, under its Settings. Then production builds from its default
427 branch, with a live preview for every pull request. Apps cost nothing while no one visits.
Projects: what a workspace builds and runs, first on every page428 </p>
429 <Link
430 prefetch="intent"
431 to={`/${slug}/-/billing`}
432 className="mt-3 inline-flex items-center gap-1 text-sm text-accent hover:underline"
433 >
434 Billing and plans <ArrowRight size={13} />
435 </Link>
436 </section>
437 )}
438
439 {role && (
440 <section className="rounded-xl border border-line bg-surface p-5">
441 <h2 className="flex items-center gap-2 font-medium">
Agents as a team: lifecycle, merge queue, billing and a new shell442 <KeyRound size={15} className="text-faint" />
443 Automate without a service account
444 </h2>
445 <p className="mt-1.5 text-sm text-muted">
Projects: what a workspace builds and runs, first on every page446 A workspace has access tokens of its own for CI, integrations and agents. They act as the workspace,
447 not as a person.
Agents as a team: lifecycle, merge queue, billing and a new shell448 </p>
449 <Link
450 prefetch="intent"
451 to={`/${slug}/-/tokens`}
452 className="mt-3 inline-flex items-center gap-1 text-sm text-accent hover:underline"
453 >
454 Access tokens <ArrowRight size={13} />
455 </Link>
456 </section>
457 )}
458 </aside>
459 </div>
460 );
461}

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