Skip to content

g1t/apps/web/app/routes/repo/issue.tsx

655 lines27,879 bytesCodeBlame
1import { env } from "cloudflare:workers";
2import { Bot, ExternalLink, GitCommitHorizontal, GitMerge, Play, Sparkles } from "lucide-react";
3import { Form, Link, redirect } from "react-router";
4
5import { type Pull, PROVIDERS, workOwner } from "@g1t/contracts";
6
7import type { Route } from "./+types/issue";
8import { excerpt, page } from "../../lib/meta";
9import { Markdown } from "../../components/markdown";
10import { AgentStepLine } from "../../components/agents";
11import {
12 Avatar,
13 CopyLine,
14 EmptyState,
15 ComputeNote,
16 ErrorText,
17 Input,
18 SubmitButton,
19 Textarea,
20 TimeAgo,
21} from "../../components/ui";
22import { CheckboxOption } from "../../components/ui/checkbox";
23import { CheckBadge } from "../../components/checks";
24import {
25 Assignee,
26 AssigneeStack,
27 ChangeSize,
28 CommentForm,
29 CommentList,
30 PeoplePicker,
31 IssueState,
32 Label,
33 PersonLink,
34 PullIcon,
35 plainText,
36} from "../../components/work";
37import { notFound } from "../../lib/not-found.server";
38import { openedBy } from "../../lib/opened-by";
39import { computeNoteFor } from "../../lib/compute.server";
40import { identity, inbox, integrations, work } from "../../lib/services.server";
41import { assertSameOrigin, getViewer, requireUser, roleIn } from "../../lib/session.server";
42import { accessTo, refusal, repoFor } from "../../lib/access.server";
43import { SubscriptionBox } from "../../components/notifications";
44import { useRefreshWhile } from "../../lib/refresh";
45
46
47export function meta({ loaderData, params, ...args }: Route.MetaArgs) {
48 const issue = loaderData?.issue;
49 const title = issue ? `${issue.title} · Issue #${issue.number} · ` : "";
50 const state = issue?.state === "open" ? "Open" : issue?.reason === "not_planned" ? "Closed as not planned" : "Closed";
51 const body = excerpt(issue?.body);
52 return page(args, {
53 title: `${title}${params.owner}/${params.repo} · g1t`,
54 description: issue
55 ? `${state} issue #${issue.number} on ${params.owner}/${params.repo}, opened by ${issue.author.username}${issue.requestedBy ? ` for ${issue.requestedBy.username}` : ""}.${body ? ` ${body}` : ""}`
56 : null,
57 // The card shows the title and the state.
58 version: issue ? [issue.title, issue.state, issue.reason] : undefined,
59 type: "article",
60 });
61}
62
63export async function loader({ params, context }: Route.LoaderArgs) {
64 const viewer = getViewer(context);
65 const path = { namespace: params.owner, name: params.repo };
66 const number = Number(params.number);
67 // At once: only the plan's note waits for the viewer's role. Putting an
68 // agent on it needs Write: Read cannot spend compute.
69 const access = accessTo(context, params);
70 const [{ can }, found, labels, agentsEnabled, members, links, computeNote, subscription] = await Promise.all([
71 access,
72 work.getIssue(path, number, viewer),
73 work.listLabels(path, viewer),
74 env.RUNNER.enabled(viewer, path),
75 // A member picks assignees from the workspace's people.
76 roleIn(viewer, params.owner) ? identity.listMembers(params.owner, viewer) : null,
77 // What it is tied to outside g1t. Shown only once the issue is known visible.
78 integrations.links(path, number).catch(() => []),
79 // Before a member assigns g1t: whether the workspace's plan lets it start.
80 access.then(({ can }) => (can.run ? computeNoteFor(params.owner, "agent") : null)),
81 // Whether the viewer hears of it, for the sidebar's Notifications.
82 viewer
83 ? repoFor(context, params).then((repo) =>
84 repo.ok ? inbox.subscription(viewer, { repoId: repo.value.id, number }).catch(() => null) : null,
85 )
86 : null,
87 ]);
88 if (!found.ok) {
89 // Issues and pull requests share numbers; this one may be a pull request.
90 const pull = await work.getPull(path, number, viewer);
91 if (pull.ok) throw redirect(`/${params.owner}/${params.repo}/pull/${number}`);
92 throw notFound("issue");
93 }
94 const { issue } = found.value;
95 return {
96 ...found.value,
97 viewer,
98 labels: labels.ok ? labels.value : [],
99 agentsEnabled,
100 computeNote,
101 links,
102 subscription,
103 members: members?.ok ? members.value.map((member) => member.username) : [],
104 // The author can close and reopen their own issue, and whoever g1t's
105 // agent filed one for, that one; Triage and up, anyone's.
106 canManage: viewer != null && (viewer.id === workOwner(issue).id || can.triage),
107 can,
108 };
109}
110
111export async function action({ request, params, context }: Route.ActionArgs) {
112 assertSameOrigin(request);
113 const user = requireUser(context, request);
114 const form = await request.formData();
115 const path = { namespace: params.owner, name: params.repo };
116 const number = Number(params.number);
117 // What each form needs; closing your own issue is checked by work.
118 const needed = form.get("action") === "run-hosted" ? "run" : form.get("action") === "assign" || form.get("action") === "labels" ? "triage" : null;
119 const refused = needed ? await refusal(context, params, needed) : null;
120 if (refused) return { error: refused, action: String(form.get("action")) };
121
122 switch (form.get("action")) {
123 case "run-hosted": {
124 const result = await env.RUNNER.run(user, path, number, {
125 instructions: String(form.get("instructions") ?? ""),
126 });
127 return result.ok ? null : { error: result.error.message, action: "run-hosted" };
128 }
129 case "open-pull": {
130 const result = await work.openPull(user, path, {
131 issue: number,
132 agent: String(form.get("agent") ?? ""),
133 runtime: "external",
134 });
135 if (!result.ok) return { error: result.error.message };
136 throw redirect(`/${params.owner}/${params.repo}/pull/${result.value.number}`);
137 }
138 case "comment": {
139 const result = await work.addComment(user, path, number, {
140 body: String(form.get("body") ?? ""),
141 });
142 return result.ok ? null : { error: result.error.message };
143 }
144 case "assign": {
145 const result = await work.updateIssue(user, path, number, {
146 assignees: [
147 ...form.getAll("assignee").map(String),
148 ...String(form.get("others") ?? "").split(/[\s,]+/),
149 ],
150 });
151 return result.ok ? null : { error: result.error.message };
152 }
153 case "labels": {
154 const result = await work.updateIssue(user, path, number, {
155 labels: [
156 ...form.getAll("label").map(String),
157 ...String(form.get("labels") ?? "").split(","),
158 ],
159 });
160 return result.ok ? null : { error: result.error.message };
161 }
162 case "reopen": {
163 const result = await work.reopenIssue(user, path, number);
164 return result.ok ? null : { error: result.error.message };
165 }
166 default: {
167 const result = await work.closeIssue(
168 user,
169 path,
170 number,
171 form.get("action") === "close-not-planned" ? "not_planned" : "completed",
172 );
173 return result.ok ? null : { error: result.error.message };
174 }
175 }
176}
177
178/** What became of a pull request, in a few words. */
179function outcome(pull: Pull): string {
180 if (pull.status === "merged") return `Merged by ${pull.mergedBy ?? "someone"}`;
181 if (pull.supersededBy != null) return `Closed · #${pull.supersededBy} was merged instead`;
182 if (pull.status === "closed") return "Closed without merging";
183 if (pull.status === "draft") return "Draft · in progress";
184 return "Ready for review";
185}
186
187function PullRow({ pull, base }: { pull: Pull; base: string }) {
188 const merged = pull.status === "merged";
189 const opener = openedBy(pull);
190 return (
191 <li>
192 <Link
193 to={`${base}/pull/${pull.number}`}
194 className={`block rounded-xl border p-4 transition-colors ${
195 merged
196 ? "border-merged/40 bg-merged/5 hover:border-merged/70"
197 : "border-line bg-surface hover:border-line-strong"
198 } ${pull.status === "closed" ? "opacity-70" : ""}`}
199 >
200 <div className="flex flex-wrap items-center gap-x-3 gap-y-1">
201 <PullIcon status={pull.status} />
202 <span className="font-medium">
203 {pull.title} <span className="font-normal text-faint">#{pull.number}</span>
204 </span>
205 {pull.status === "draft" && (
206 <span className="size-1.5 animate-pulse rounded-full bg-accent" />
207 )}
208 <span className="ml-auto flex items-center gap-3 text-xs text-faint">
209 <ChangeSize files={pull.files} />
210 <CheckBadge status={pull.checkStatus} />
211 <span className="flex items-center gap-1 font-mono">
212 <GitCommitHorizontal size={13} />
213 {pull.headCommit?.slice(0, 7) ?? "no commits"}
214 </span>
215 <TimeAgo at={pull.updatedAt} />
216 </span>
217 </div>
218 <p className="mt-1.5 flex flex-wrap items-center gap-x-2 text-xs text-muted">
219 <span className={merged ? "font-medium text-merged" : ""}>{outcome(pull)}</span>
220 <span className="text-faint">·</span>
221 <span className="flex items-center gap-1 font-mono">
222 <Bot size={12} />
223 {pull.agent}
224 </span>
225 {opener.requestedBy ? (
226 <span className="text-faint">· requested by {opener.requestedBy}</span>
227 ) : (
228 <>
229 {pull.runtime === "hosted" && <span className="text-faint">on g1t</span>}
230 <span className="text-faint">· opened by {opener.name}</span>
231 </>
232 )}
233 </p>
234 {pull.body && (
235 <p className="mt-2 line-clamp-2 text-sm text-muted">{plainText(pull.body)}</p>
236 )}
237 </Link>
238 </li>
239 );
240}
241
242export default function IssuePage({ loaderData, actionData, params }: Route.ComponentProps) {
243 const { issue, pulls, comments, viewer, labels, agentsEnabled, members, canManage, can } = loaderData;
244
245 // Follow agents at work without a manual reload.
246 const running = pulls.some(
247 (pull) =>
248 pull.status === "draft" ||
249 pull.checkStatus === "queued" ||
250 pull.checkStatus === "running",
251 );
252 // The pull request g1t's agent has in progress for this issue, if any.
253 const assigned = [...pulls]
254 .reverse()
255 .find(
256 (pull) =>
257 pull.agent === "g1t" &&
258 pull.runtime === "hosted" &&
259 (pull.status === "draft" || pull.status === "open"),
260 );
261 useRefreshWhile(Boolean(running || assigned));
262
263 // A refusal to start g1t shows by its button; every other error below the discussion.
264 const runError = actionData && "action" in actionData && actionData.action === "run-hosted";
265 const base = `/${params.owner}/${params.repo}`;
266 const open = issue.state === "open";
267 const reference = `${params.owner}/${params.repo}#${issue.number}`;
268 const resolver = pulls.find((pull) => pull.number === issue.resolvedBy);
269 // The merged pull request first, then the ones still in play, then the rest.
270 const rank = { merged: 0, open: 1, draft: 2, closed: 3 } as const;
271 const ordered = [...pulls].sort(
272 (a, b) => rank[a.status] - rank[b.status] || a.number - b.number,
273 );
274
275 return (
276 <div className="grid gap-8 lg:grid-cols-[1fr_19rem]">
277 <div className="min-w-0">
278 <h2 className="text-2xl font-semibold tracking-tight text-balance">
279 {issue.title} <span className="font-normal text-faint">#{issue.number}</span>
280 </h2>
281 <div className="mt-3 flex flex-wrap items-center gap-x-3 gap-y-2 text-sm text-muted">
282 <IssueState issue={issue} />
283 <span className="flex items-center gap-2">
284 <Avatar name={issue.author.username} size={18} />
285 <span>
286 <PersonLink name={issue.author.username} className="font-medium text-fg hover:underline" /> opened this{" "}
287 {issue.requestedBy && (
288 <>
289 for{" "}
290 <PersonLink name={issue.requestedBy.username} className="font-medium text-fg-soft hover:underline" />{" "}
291 </>
292 )}
293 <TimeAgo at={issue.createdAt} />
294 </span>
295 </span>
296 {issue.labels.map((name) => (
297 <Label key={name} name={name} />
298 ))}
299 {open && issue.agent && <Assignee agent={issue.agent} />}
300 </div>
301
302 {issue.resolvedBy != null && (
303 <Link
304 to={`${base}/pull/${issue.resolvedBy}`}
305 className="mt-5 flex items-center gap-3 rounded-xl border border-merged/40 bg-merged/5 px-4 py-3 text-sm transition-colors hover:border-merged/70"
306 >
307 <GitMerge size={18} className="shrink-0 text-merged" />
308 <span>
309 Resolved by{" "}
310 <span className="font-medium">
311 {resolver?.title ?? "pull request"} #{issue.resolvedBy}
312 </span>
313 {resolver?.mergedBy && (
314 <span className="text-muted">
315 , merged by {resolver.mergedBy}{" "}
316 {resolver.mergedAt && <TimeAgo at={resolver.mergedAt} />}
317 </span>
318 )}
319 </span>
320 </Link>
321 )}
322
323 {issue.body && (
324 <div className="mt-5 rounded-xl border border-line bg-surface p-5">
325 <Markdown source={issue.body} repo={{ namespace: params.owner, name: params.repo }} />
326 </div>
327 )}
328
329 <div className="mt-10 flex items-baseline justify-between">
330 <h3 className="font-semibold tracking-tight">Pull requests</h3>
331 <p className="text-sm text-muted">
332 {pulls.length === 0
333 ? "None yet"
334 : `${pulls.length} for this issue${
335 pulls.some((pull) => pull.status === "merged") ? "" : ", none merged"
336 }`}
337 </p>
338 </div>
339 <div className="mt-3">
340 {pulls.length === 0 ? (
341 <EmptyState title="Nobody has worked on this yet">
342 Put g1t on it, or point your own agent at{" "}
343 <code className="font-mono">{reference}</code>.
344 </EmptyState>
345 ) : (
346 <ol className="space-y-3">
347 {ordered.map((pull) => (
348 <PullRow key={pull.id} pull={pull} base={base} />
349 ))}
350 </ol>
351 )}
352 </div>
353
354 <h3 className="mt-10 font-semibold tracking-tight">Discussion</h3>
355 <div className="mt-3">
356 <div className="space-y-4">
357 <CommentList comments={comments} base={base} />
358 <CommentForm author={viewer?.username ?? null} resetKey={comments.length} />
359 {canManage && (
360 <Form method="post" className="flex flex-wrap justify-end gap-2">
361 {open ? (
362 <>
363 <SubmitButton variant="quiet" name="action" value="close-not-planned" pending="Closing…">
364 Close as not planned
365 </SubmitButton>
366 <SubmitButton variant="quiet" name="action" value="close-completed" pending="Closing…">
367 Close issue
368 </SubmitButton>
369 </>
370 ) : (
371 <SubmitButton variant="quiet" name="action" value="reopen" pending="Reopening…">
372 Reopen issue
373 </SubmitButton>
374 )}
375 </Form>
376 )}
377 </div>
378 </div>
379 <div className="mt-2">
380 {!runError && <ErrorText>{actionData?.error}</ErrorText>}
381 </div>
382 </div>
383
384 <aside className="space-y-6">
385 {loaderData.links.length > 0 && (
386 <section>
387 <h3 className="text-sm font-medium">From outside g1t</h3>
388 <ul className="mt-2 space-y-1.5 text-sm">
389 {loaderData.links.map((link) => (
390 <li key={`${link.connectionId}-${link.key}`}>
391 <a
392 href={link.url}
393 target="_blank"
394 rel="noreferrer"
395 className="group flex items-center gap-2 rounded-lg border border-line px-2.5 py-2 transition-colors hover:border-line-strong"
396 >
397 <span className="min-w-0 grow">
398 <span className="block truncate font-medium">
399 {PROVIDERS[link.provider].label} <span className="font-mono text-muted">{link.key}</span>
400 </span>
401 <span className="block text-xs text-faint">
402 {link.count > 1 ? `Seen ${link.count} times, last ` : "Linked "}
403 <TimeAgo at={link.count > 1 ? link.lastSeen : link.firstSeen} />
404 </span>
405 </span>
406 <ExternalLink size={13} className="shrink-0 text-faint group-hover:text-fg" />
407 </a>
408 </li>
409 ))}
410 </ul>
411 </section>
412 )}
413 <section>
414 <h3 className="text-sm font-medium">Assignees</h3>
415 <ul className="mt-2 space-y-1.5 text-sm">
416 {open && assigned && (
417 <li>
418 <Link
419 to={`${base}/pull/${assigned.number}`}
420 className="flex items-center gap-2 rounded-lg border border-accent/30 bg-accent/5 px-2.5 py-2 transition-colors hover:border-accent/60"
421 >
422 <Sparkles size={15} className="shrink-0 text-accent" />
423 <span className="min-w-0 grow">
424 <span className="block font-mono text-xs font-medium">g1t</span>
425 <span className="block truncate text-xs text-muted">
426 {assigned.status === "draft"
427 ? "Making the change"
428 : "Seeing it through checks and review"}{" "}
429 · #{assigned.number}
430 </span>
431 <AgentStepLine owner={params.owner} repo={params.repo} number={assigned.number} />
432 </span>
433 <span className="size-1.5 shrink-0 animate-pulse rounded-full bg-accent" />
434 </Link>
435 </li>
436 )}
437 {issue.assignees.map((name) => (
438 <li key={name} className="flex items-center gap-2 px-1">
439 <Avatar name={name} size={20} />
440 <span className="grow truncate font-mono text-xs">{name}</span>
441 </li>
442 ))}
443 {open && issue.queued && !assigned && (
444 <li className="flex items-center gap-2 rounded-lg border border-line bg-surface px-2.5 py-2">
445 <Sparkles size={15} className="shrink-0 text-faint" />
446 <span className="min-w-0 grow">
447 <span className="block font-mono text-xs font-medium">g1t</span>
448 <span className="block text-xs text-muted">
449 {issue.blockedBy.length > 0
450 ? "Queued. Starts when what this depends on has merged."
451 : "Queued. Starts as soon as there is room."}
452 </span>
453 </span>
454 </li>
455 )}
456 {!open && resolver && resolver.agent === "g1t" && (
457 <li>
458 <Link
459 to={`${base}/pull/${resolver.number}`}
460 className="flex items-center gap-2 rounded-lg border border-line bg-surface px-2.5 py-2 transition-colors hover:border-line-strong"
461 >
462 <Sparkles size={15} className="shrink-0 text-merged" />
463 <span className="min-w-0 grow">
464 <span className="block font-mono text-xs font-medium">g1t</span>
465 <span className="block truncate text-xs text-muted">
466 Resolved it with #{resolver.number}
467 </span>
468 </span>
469 </Link>
470 </li>
471 )}
472 {issue.assignees.length === 0 &&
473 !(open && (assigned || issue.queued)) &&
474 !(!open && resolver?.agent === "g1t") && (
475 <li className="px-1 text-xs text-faint">No one yet.</li>
476 )}
477 </ul>
478 {issue.blockedBy.length > 0 && (
479 <p className="mt-3 text-xs text-muted">
480 Depends on{" "}
481 {issue.blockedBy.map((number, index) => (
482 <span key={number}>
483 {index > 0 && ", "}
484 <Link
485 to={`${base}/issues/${number}`}
486 className="font-medium text-fg hover:underline"
487 >
488 #{number}
489 </Link>
490 </span>
491 ))}
492 {open ? ", which has to merge first." : "."}
493 </p>
494 )}
495
496 {open && agentsEnabled && can.run && !assigned && !issue.queued && (
497 <Form method="post" className="mt-3 space-y-2">
498 <input type="hidden" name="action" value="run-hosted" />
499 <div className="*:w-full">
500 <SubmitButton variant="accent" match={{ action: "run-hosted" }} pending="Starting a sandbox…">
501 <Sparkles size={14} />
502 Assign to g1t
503 </SubmitButton>
504 </div>
505 <details>
506 <summary className="cursor-pointer text-xs text-faint hover:text-fg">
507 Add guidance for this run
508 </summary>
509 <div className="mt-2">
510 <Textarea
511 name="instructions"
512 rows={2}
513 placeholder="On top of the issue's description"
514 />
515 </div>
516 </details>
517 <p className="text-xs text-muted">
518 It opens a pull request and sees it through checks, a review by another
519 agent and fixes. You get it back ready to merge.
520 </p>
521 <ComputeNote note={loaderData.computeNote} />
522 {runError && <ErrorText>{actionData.error}</ErrorText>}
523 </Form>
524 )}
525
526 {open && !agentsEnabled && can.run && !assigned && !issue.queued && (
527 // Where g1t's agent would be, and what makes it appear.
528 <div className="mt-3 rounded-lg border border-dashed border-line p-3 text-sm">
529 <p className="flex items-center gap-1.5 font-medium">
530 <Sparkles size={14} className="text-accent" />
531 g1t
532 </p>
533 <p className="mt-1 text-xs text-muted">
534 Connect a model provider and g1t can take this issue: it opens a pull request and sees it
535 through checks, review and fixes. Agents run on a paid workspace, or on the free trial.
536 </p>
537 <Link
538 to={`/${params.owner}/-/integrations`}
539 className="mt-2 inline-block text-xs text-accent hover:underline"
540 >
541 Connect a model
542 </Link>
543 </div>
544 )}
545
546 {viewer && can.triage && open && (
547 <div className="mt-3 space-y-2">
548 {!issue.assignees.includes(viewer.username) && (
549 <Form method="post">
550 <input type="hidden" name="action" value="assign" />
551 {issue.assignees.map((name) => (
552 <input key={name} type="hidden" name="assignee" value={name} />
553 ))}
554 <input type="hidden" name="assignee" value={viewer.username} />
555 <div className="*:w-full">
556 <SubmitButton variant="quiet" name="who" value="self" pending="Assigning…">
557 Assign yourself
558 </SubmitButton>
559 </div>
560 </Form>
561 )}
562 <details className="group">
563 <summary className="cursor-pointer text-xs text-faint hover:text-fg">
564 Assign people
565 </summary>
566 <Form method="post" className="mt-2 space-y-2" key={issue.assignees.join()}>
567 <input type="hidden" name="action" value="assign" />
568 <PeoplePicker name="assignee" members={members} chosen={issue.assignees} />
569 <SubmitButton variant="quiet" name="who" value="picked" pending="Saving…">
570 Save assignees
571 </SubmitButton>
572 </Form>
573 </details>
574 </div>
575 )}
576 </section>
577
578 {/* Another way to start the work: not once a pull request is doing it. */}
579 {open && !pulls.some((pull) => pull.status === "open" || pull.status === "draft") && (
580 <section className="rounded-xl border border-line bg-surface p-4">
581 <h3 className="text-sm font-medium">Bring your own agent</h3>
582 <p className="mt-1 text-xs text-muted">
583 With g1t connected to your agent, ask it to work on this issue.
584 </p>
585 <div className="mt-3">
586 <CopyLine text={reference} />
587 </div>
588 {viewer ? (
589 <Form method="post" className="mt-4 space-y-2 border-t border-line pt-4">
590 <input type="hidden" name="action" value="open-pull" />
591 <p className="text-xs text-muted">
592 Or open a draft pull request yourself and get a fork to push to.
593 </p>
594 <Input name="agent" placeholder="Who is working, e.g. claude-code" maxLength={60} />
595 <div className="*:w-full">
596 <SubmitButton match={{ action: "open-pull" }} pending="Opening…">
597 Open pull request
598 </SubmitButton>
599 </div>
600 <p className="text-xs text-muted">
601 Already pushed a branch?{" "}
602 <Link
603 to={`${base}/pulls/new?issue=${issue.number}`}
604 className="text-fg underline underline-offset-4"
605 >
606 Open a pull request from it
607 </Link>
608 .
609 </p>
610 </Form>
611 ) : (
612 <p className="mt-4 border-t border-line pt-4 text-sm text-muted">
613 <Link to="/login" className="text-fg underline underline-offset-4">
614 Sign in
615 </Link>{" "}
616 to open a pull request.
617 </p>
618 )}
619 </section>
620 )}
621
622 {can.triage && (
623 <details className="group">
624 <summary className="cursor-pointer list-none text-sm font-medium">
625 Labels <span className="text-xs font-normal text-faint group-open:hidden">Edit</span>
626 </summary>
627 <Form method="post" className="mt-3 space-y-3" key={issue.labels.join()}>
628 <input type="hidden" name="action" value="labels" />
629 <div className="flex flex-wrap gap-x-3 gap-y-2">
630 {labels.map((name) => (
631 <CheckboxOption
632 key={name}
633 name="label"
634 value={name}
635 defaultChecked={issue.labels.includes(name)}
636 label={<Label name={name} />}
637 className="items-center gap-1.5"
638 />
639 ))}
640 </div>
641 <Input name="labels" placeholder="New labels, comma separated" />
642 <SubmitButton variant="quiet" match={{ action: "labels" }} pending="Saving…">
643 Save labels
644 </SubmitButton>
645 </Form>
646 </details>
647 )}
648
649 {viewer && (
650 <SubscriptionBox action={`${base}/notifications`} number={issue.number} kind="issue" subscription={loaderData.subscription} />
651 )}
652 </aside>
653 </div>
654 );
655}