Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

173 linesCodeBlameRaw
1import { ArrowRight, Check, Sparkles } from "lucide-react";
2import { Link, data, redirect } from "react-router";
3
4import type { Route } from "./+types/soon";
5import { page } from "../../lib/meta";
6import { ROADMAP, type RoadmapItem, roadmapIn, roadmapItem } from "../../lib/roadmap";
7import { Badge } from "../../components/ui/badge";
8import { Card } from "../../components/ui/card";
9
10export function meta({ params, ...args }: Route.MetaArgs) {
11 const item = roadmapItem(params.feature);
12 return page(args, {
13 title: `${item?.title ?? "Soon"} · ${params.owner}/${params.repo} · g1t`,
14 description: item ? `Soon on g1t: ${item.summary}` : null,
15 version: item ? [item.title, item.summary] : undefined,
16 });
17}
18
19/** Soon pages that have since been built, and where each is now. */
20const BUILT: Record<string, string> = { releases: "releases", logs: "observability/logs", errors: "observability/errors" };
21
22export function loader({ params }: Route.LoaderArgs) {
23 const built = BUILT[params.feature];
24 if (built) throw redirect(`/${params.owner}/${params.repo}/${built}`);
25 const item = roadmapItem(params.feature);
26 if (!item) throw data(null, { status: 404 });
27 return { item };
28}
29
30/**
31 * A page a project will have: what it is for, what it will do, and what
32 * to use until then. Reached from the project menu's Soon items.
33 */
34export default function Soon({ loaderData, params }: Route.ComponentProps) {
35 return <SoonView item={loaderData.item} base={`/${params.owner}/${params.repo}`} />;
36}
37
38/**
39 * A Soon page, for a project's (under `base`, `/<owner>/<project>`) or the
40 * workspace's (`/<owner>/-`).
41 */
42/**
43 * What is coming, and what to use until then. In a project, "until then"
44 * is a page of that project. Across a workspace it lives in each project,
45 * so `inProjects` lists them, or offers to make the first one.
46 */
47export function SoonView({
48 item,
49 base,
50 inProjects,
51 newProject,
52}: {
53 item: RoadmapItem;
54 base: string;
55 inProjects?: { name: string; to: string }[];
56 newProject?: string;
57}) {
58 const siblings = roadmapIn(item.section).filter((other) => other.key !== item.key);
59 const inWorkspace = item.section === "Workspace";
60 return (
61 <div className="mx-auto max-w-3xl">
62 {/* A project's tabs already say where this is; the workspace's need saying. */}
63 {inWorkspace && (
64 <p className="mb-4 flex items-center gap-2 text-sm text-muted">
65 <span>Across projects</span>
66 <span className="text-line-strong">/</span>
67 <span className="text-fg">{item.title}</span>
68 </p>
69 )}
70 <div className="flex flex-wrap items-center gap-3">
71 <h1 className="text-3xl font-semibold tracking-tight">{item.title}</h1>
72 <Badge tone="accent" size="md" className="gap-1.5 px-2.5 font-medium">
73 <Sparkles size={12} />
74 Soon
75 </Badge>
76 </div>
77 <p className="mt-3 text-lg text-muted">{item.summary}</p>
78
79 <Card asChild className="mt-8 p-6">
80 <section>
81 <p className="leading-relaxed">{item.why}</p>
82 <h2 className="mt-6 text-sm font-medium text-muted">What it will do</h2>
83 <ul className="mt-3 space-y-2.5">
84 {item.plans.map((plan) => (
85 <li key={plan} className="flex gap-3 text-sm">
86 <Check size={16} className="mt-0.5 shrink-0 text-accent" />
87 <span>{plan}</span>
88 </li>
89 ))}
90 </ul>
91 </section>
92 </Card>
93
94 {item.today && inProjects && (
95 <Card asChild tone="plain" className="mt-4 px-5 py-4">
96 <section>
97 <span className="block text-xs text-faint">Until then: {item.today.label.toLowerCase()} in each project</span>
98 {inProjects.length > 0 ? (
99 <ul className="mt-2 divide-y divide-line">
100 {inProjects.map((project) => (
101 <li key={project.to}>
102 <Link
103 to={`${project.to}/${item.today!.path}`}
104 className="group flex items-center justify-between gap-4 py-2.5 text-sm"
105 >
106 <span className="font-medium">
107 {item.today!.label} in {project.name}
108 </span>
109 <ArrowRight size={16} className="text-faint transition-transform group-hover:translate-x-0.5 group-hover:text-fg" />
110 </Link>
111 </li>
112 ))}
113 </ul>
114 ) : (
115 <Link
116 to={newProject ?? "/new"}
117 className="group mt-2 flex items-center justify-between gap-4 text-sm"
118 >
119 <span>
120 <span className="font-medium">Create a project</span>
121 <span className="text-muted"> to plan {item.today.label.toLowerCase()} in it.</span>
122 </span>
123 <ArrowRight size={16} className="text-faint transition-transform group-hover:translate-x-0.5 group-hover:text-fg" />
124 </Link>
125 )}
126 </section>
127 </Card>
128 )}
129
130 {item.today && !inProjects && (
131 <Link
132 to={`${base}/${item.today.path}`}
133 className="group mt-4 flex items-center justify-between gap-4 rounded-xl border border-line px-5 py-4 transition-colors hover:border-line-strong hover:bg-surface"
134 >
135 <span>
136 <span className="block text-xs text-faint">Until then</span>
137 <span className="mt-0.5 block text-sm font-medium">{item.today.label}</span>
138 </span>
139 <ArrowRight size={16} className="text-faint transition-transform group-hover:translate-x-0.5 group-hover:text-fg" />
140 </Link>
141 )}
142
143 {siblings.length > 0 && (
144 <section className="mt-10">
145 <h2 className="text-sm font-medium text-muted">
146 Also coming {inWorkspace ? "across projects" : `to ${item.section}`}
147 </h2>
148 <ul className="mt-3 grid gap-3 sm:grid-cols-2">
149 {siblings.map((other) => (
150 <li key={other.key}>
151 <Link
152 to={`${base}/soon/${other.key}`}
153 className="block h-full rounded-xl border border-line p-4 transition-colors hover:border-line-strong hover:bg-surface"
154 >
155 <span className="text-sm font-medium">{other.title}</span>
156 <span className="mt-1 block text-sm text-muted">{other.summary}</span>
157 </Link>
158 </li>
159 ))}
160 </ul>
161 </section>
162 )}
163
164 <p className="mt-10 text-xs text-faint">
165 {ROADMAP.length} things are on the way to every project. Want this one sooner, or something else?{" "}
166 <a href="https://g1t.sh/flagon-io/g1t/issues/new" className="text-muted hover:text-fg">
167 Tell us
168 </a>
169 .
170 </p>
171 </div>
172 );
173}