@bridgebrew/sessions 0.0.0-stage → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +43 -2
- package/answers.ts +167 -0
- package/browser/branch-actions.tsx +166 -0
- package/browser/changes.tsx +415 -0
- package/browser/children.tsx +650 -0
- package/browser/conversation.tsx +2381 -0
- package/browser/decision-questions.tsx +191 -0
- package/browser/elapsed.tsx +44 -0
- package/browser/gallery.tsx +218 -0
- package/browser/index.tsx +3434 -0
- package/browser/media-origins.tsx +38 -0
- package/browser/mobile.tsx +663 -0
- package/browser/open-link.tsx +30 -0
- package/browser/pull-request.tsx +116 -0
- package/browser/questions.tsx +156 -0
- package/browser/session-scheduled.tsx +203 -0
- package/browser/subagent-view.tsx +136 -0
- package/browser/subagents.tsx +339 -0
- package/browser/tabs.tsx +228 -0
- package/browser/tsconfig.json +15 -0
- package/browser/views/view.tsx +1064 -0
- package/browser/views.tsx +166 -0
- package/contract.ts +287 -0
- package/delegations.ts +1975 -0
- package/diff.ts +88 -0
- package/docs/en/images.mdx +51 -0
- package/docs/en/index.mdx +22 -0
- package/docs/en/meta.json +4 -0
- package/docs/en/organize-sessions.mdx +53 -0
- package/docs/en/start-a-session.mdx +63 -0
- package/docs/meta.json +4 -0
- package/git.ts +223 -0
- package/listing.ts +382 -0
- package/package.json +1023 -4
- package/peers.ts +677 -0
- package/pull-request-watch.ts +282 -0
- package/pull-requests.ts +606 -0
- package/server.ts +5915 -0
- package/text.ts +19 -0
- package/tsconfig.json +3 -0
- package/viewer-activity.ts +57 -0
- package/views/examples.ts +153 -0
- package/views/library.ts +1116 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
// The open session's details panel, under the header: its tags (up to five, the workspace's offered as suggestions)
|
|
2
|
+
// and what it changed in its git repository (`POST /sessions/changes`): its uncommitted files, checked to commit (all
|
|
3
|
+
// at first), the other sessions sharing some of them (a commit then asks to confirm, and takes their changes too), a
|
|
4
|
+
// message and Commit (`POST /sessions/commit`, with the session's trailer), its uncommitted diff file by file, and its
|
|
5
|
+
// commits; the files it claimed (`peers.ts`). A tool call's change counts open it on that file (`focus`): the diff
|
|
6
|
+
// opens, scrolled to the file, marked; a file with no uncommitted change says so.
|
|
7
|
+
// Read again when the session's files, commits or last turn change. Outside a repository, it says so.
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { Badge, Button, Checkbox, Icon, Input, TagInput, cn } from '@bridge/ui';
|
|
10
|
+
|
|
11
|
+
/** The fields of a session the panel reads. */
|
|
12
|
+
export interface Details {
|
|
13
|
+
id: string;
|
|
14
|
+
tags?: string[];
|
|
15
|
+
claims?: { path: string; note?: string }[];
|
|
16
|
+
files?: string[];
|
|
17
|
+
commits?: { sha: string; at: string; message: string; files: string[] }[];
|
|
18
|
+
lastTurn?: { endedAt: string };
|
|
19
|
+
running?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface Changes {
|
|
22
|
+
repository: string;
|
|
23
|
+
files: { path: string; pending: boolean }[];
|
|
24
|
+
commits: { sha: string; at: string; message: string; files: string[] }[];
|
|
25
|
+
shared: { id: string; node: string; title: string; running: boolean; files: string[] }[];
|
|
26
|
+
diff: string;
|
|
27
|
+
}
|
|
28
|
+
/** A POST to the sessions API (`path` after `/sessions`): its JSON answer, or a rejection with the refusal's `code`. */
|
|
29
|
+
export type Post = (path: string, body: object) => Promise<any>;
|
|
30
|
+
|
|
31
|
+
const TAGS_MAX = 5;
|
|
32
|
+
|
|
33
|
+
/** A path as git prints it: a name with a quote, a control or a non-ASCII character comes quoted, C-escaped, its
|
|
34
|
+
* bytes in octal (`"b/caf\\303\\251.ts"`). */
|
|
35
|
+
const unquote = (name: string | undefined) => {
|
|
36
|
+
if (!name?.startsWith('"') || !name.endsWith('"')) return name;
|
|
37
|
+
const escapes: Record<string, number> = { a: 7, b: 8, t: 9, n: 10, v: 11, f: 12, r: 13 };
|
|
38
|
+
const bytes: number[] = [];
|
|
39
|
+
const body = name.slice(1, -1);
|
|
40
|
+
for (let at = 0; at < body.length; at++) {
|
|
41
|
+
const char = body[at]!;
|
|
42
|
+
if (char !== '\\') bytes.push(...new TextEncoder().encode(char));
|
|
43
|
+
else if (/[0-7]{3}/.test(body.slice(at + 1, at + 4))) {
|
|
44
|
+
bytes.push(parseInt(body.slice(at + 1, at + 4), 8));
|
|
45
|
+
at += 3;
|
|
46
|
+
} else {
|
|
47
|
+
const next = body[++at] ?? '';
|
|
48
|
+
bytes.push(escapes[next] ?? next.charCodeAt(0));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return new TextDecoder().decode(new Uint8Array(bytes));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** A `git diff` cut per file: its path (the new one, the old one for a deletion), its lines from its first hunk, and
|
|
55
|
+
* its added and removed line counts. */
|
|
56
|
+
export const diffFiles = (diff: string) =>
|
|
57
|
+
diff
|
|
58
|
+
.split(/^(?=diff --git )/m)
|
|
59
|
+
.filter((chunk) => chunk.startsWith('diff --git '))
|
|
60
|
+
.map((chunk) => {
|
|
61
|
+
const lines = chunk.replace(/\n$/, '').split('\n');
|
|
62
|
+
const side = (prefix: string) => {
|
|
63
|
+
const name = unquote(lines.find((line) => line.startsWith(prefix))?.slice(prefix.length));
|
|
64
|
+
return name && name !== '/dev/null' ? name.replace(/^[ab]\//, '') : undefined;
|
|
65
|
+
};
|
|
66
|
+
const hunk = lines.findIndex((line) => line.startsWith('@@'));
|
|
67
|
+
const body = hunk < 0 ? lines.slice(1) : lines.slice(hunk);
|
|
68
|
+
return {
|
|
69
|
+
path: side('+++ ') ?? side('--- ') ?? /^diff --git a\/(.*) b\//.exec(lines[0]!)?.[1] ?? '',
|
|
70
|
+
lines: body,
|
|
71
|
+
added: body.filter((line) => line[0] === '+').length,
|
|
72
|
+
removed: body.filter((line) => line[0] === '-').length,
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
/** The file of `files` (relative to `repository`) that `wanted` names, as an agent named it (absolute, or relative to
|
|
77
|
+
* the session's folder): the same path first, else one ending the other (`src/app.ts` before `app.ts`). */
|
|
78
|
+
const fileNamed = <T extends { path: string }>(files: T[], wanted: string, repository: string) =>
|
|
79
|
+
files.find(
|
|
80
|
+
({ path }) => wanted === path || wanted === `${repository.replace(/\/$/, '')}/${path}`,
|
|
81
|
+
) ??
|
|
82
|
+
files.find(({ path }) => wanted.endsWith(`/${path}`)) ??
|
|
83
|
+
files.find(({ path }) => path.endsWith(`/${wanted}`));
|
|
84
|
+
|
|
85
|
+
export function SessionDetails({
|
|
86
|
+
session,
|
|
87
|
+
known,
|
|
88
|
+
focus,
|
|
89
|
+
post,
|
|
90
|
+
onChanged,
|
|
91
|
+
onOpen,
|
|
92
|
+
}: {
|
|
93
|
+
session: Details;
|
|
94
|
+
known: string[];
|
|
95
|
+
/** The file to show (a tool call's change counts asked for it), again at each new `at`. */
|
|
96
|
+
focus?: { path: string; at: number } | undefined;
|
|
97
|
+
post: Post;
|
|
98
|
+
onChanged: () => void;
|
|
99
|
+
onOpen: (id: string) => void;
|
|
100
|
+
}) {
|
|
101
|
+
const [changes, setChanges] = React.useState<Changes | null>();
|
|
102
|
+
const [outside, setOutside] = React.useState(false);
|
|
103
|
+
const [error, setError] = React.useState('');
|
|
104
|
+
const [picked, setPicked] = React.useState<Set<string>>(new Set());
|
|
105
|
+
const [message, setMessage] = React.useState('');
|
|
106
|
+
const [committing, setCommitting] = React.useState(false);
|
|
107
|
+
/** Other sessions share the picked files: Commit asks again before it takes their changes. */
|
|
108
|
+
const [confirming, setConfirming] = React.useState(false);
|
|
109
|
+
const listId = React.useId();
|
|
110
|
+
const [diffOpen, setDiffOpen] = React.useState(false);
|
|
111
|
+
const files = React.useMemo(() => diffFiles(changes?.diff ?? ''), [changes?.diff]);
|
|
112
|
+
const focused = focus && changes ? fileNamed(files, focus.path, changes.repository) : undefined;
|
|
113
|
+
const fileRefs = React.useRef(new Map<string, HTMLElement>());
|
|
114
|
+
// Asked for a file: the diff opens on it.
|
|
115
|
+
React.useEffect(() => {
|
|
116
|
+
if (focused) setDiffOpen(true);
|
|
117
|
+
}, [focus?.at, focused?.path]);
|
|
118
|
+
React.useEffect(() => {
|
|
119
|
+
if (focused && diffOpen)
|
|
120
|
+
fileRefs.current.get(focused.path)?.scrollIntoView?.({ block: 'start' });
|
|
121
|
+
}, [focus?.at, focused?.path, diffOpen]);
|
|
122
|
+
const key = JSON.stringify([
|
|
123
|
+
session.id,
|
|
124
|
+
session.files,
|
|
125
|
+
session.commits?.length,
|
|
126
|
+
session.lastTurn?.endedAt,
|
|
127
|
+
]);
|
|
128
|
+
React.useEffect(() => {
|
|
129
|
+
let live = true;
|
|
130
|
+
setError('');
|
|
131
|
+
post('/changes', { id: session.id }).then(
|
|
132
|
+
(found: Changes) => {
|
|
133
|
+
if (!live) return;
|
|
134
|
+
setOutside(false);
|
|
135
|
+
setChanges(found);
|
|
136
|
+
setPicked(new Set(found.files.filter((each) => each.pending).map((each) => each.path)));
|
|
137
|
+
setConfirming(false);
|
|
138
|
+
},
|
|
139
|
+
(cause: unknown) => {
|
|
140
|
+
if (!live) return;
|
|
141
|
+
const code =
|
|
142
|
+
typeof cause === 'object' && cause !== null && 'code' in cause ? cause.code : undefined;
|
|
143
|
+
if (code === 'not_a_repository') setOutside(true);
|
|
144
|
+
else setError(cause instanceof Error ? cause.message : String(cause));
|
|
145
|
+
setChanges(null);
|
|
146
|
+
},
|
|
147
|
+
);
|
|
148
|
+
return () => {
|
|
149
|
+
live = false;
|
|
150
|
+
};
|
|
151
|
+
}, [key]);
|
|
152
|
+
|
|
153
|
+
const tag = (tags: string[]) => {
|
|
154
|
+
setError('');
|
|
155
|
+
post('/tags', { id: session.id, tags: tags.slice(0, TAGS_MAX) }).then(onChanged, (cause) =>
|
|
156
|
+
setError(cause instanceof Error ? cause.message : String(cause)),
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
const pending = changes?.files.filter((each) => each.pending) ?? [];
|
|
160
|
+
const shared =
|
|
161
|
+
changes?.shared.filter((each) => each.files.some((file) => picked.has(file))) ?? [];
|
|
162
|
+
const commit = async (event: React.FormEvent) => {
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
if (shared.length && !confirming) {
|
|
165
|
+
setConfirming(true);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
setCommitting(true);
|
|
169
|
+
setError('');
|
|
170
|
+
try {
|
|
171
|
+
await post('/commit', {
|
|
172
|
+
id: session.id,
|
|
173
|
+
message: message.trim(),
|
|
174
|
+
files: [...picked],
|
|
175
|
+
...(confirming && { force: true }),
|
|
176
|
+
});
|
|
177
|
+
setMessage('');
|
|
178
|
+
onChanged();
|
|
179
|
+
} catch (cause) {
|
|
180
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
181
|
+
} finally {
|
|
182
|
+
setCommitting(false);
|
|
183
|
+
setConfirming(false);
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
return (
|
|
188
|
+
<div
|
|
189
|
+
aria-label="Session details"
|
|
190
|
+
className="flex max-h-[45vh] shrink-0 flex-col gap-3 overflow-y-auto border-b border-border bg-surface px-4 py-3 text-sm"
|
|
191
|
+
>
|
|
192
|
+
<div className="flex items-center gap-2">
|
|
193
|
+
<Icon name="tag" size={14} className="shrink-0 text-muted" />
|
|
194
|
+
<TagInput
|
|
195
|
+
aria-label="Tags"
|
|
196
|
+
list={listId}
|
|
197
|
+
placeholder={(session.tags?.length ?? 0) < TAGS_MAX ? 'Add a tag…' : ''}
|
|
198
|
+
value={session.tags ?? []}
|
|
199
|
+
onChange={tag}
|
|
200
|
+
className="min-w-0 flex-1"
|
|
201
|
+
/>
|
|
202
|
+
<datalist id={listId}>
|
|
203
|
+
{known
|
|
204
|
+
.filter((each) => !session.tags?.includes(each))
|
|
205
|
+
.map((each) => (
|
|
206
|
+
<option key={each} value={each} />
|
|
207
|
+
))}
|
|
208
|
+
</datalist>
|
|
209
|
+
</div>
|
|
210
|
+
{!!session.claims?.length && (
|
|
211
|
+
<p className="text-xs text-secondary">
|
|
212
|
+
<span className="font-medium text-foreground">Claimed</span> (other sessions see it before
|
|
213
|
+
they edit):{' '}
|
|
214
|
+
<span className="font-mono">
|
|
215
|
+
{session.claims.map(({ path, note }) => (note ? `${path} (${note})` : path)).join(', ')}
|
|
216
|
+
</span>
|
|
217
|
+
</p>
|
|
218
|
+
)}
|
|
219
|
+
{focus && changes && !focused && (
|
|
220
|
+
<p role="status" className="text-xs text-muted">
|
|
221
|
+
{/* A session's files are read at each turn's end: a running turn's are not there yet. */}
|
|
222
|
+
{session.running ? 'The changes to ' : 'No uncommitted change to '}
|
|
223
|
+
<span className="font-mono">
|
|
224
|
+
{focus.path.split(`${changes.repository.replace(/\/$/, '')}/`).join('')}
|
|
225
|
+
</span>
|
|
226
|
+
{session.running ? ' show here once the turn ends.' : ': committed or undone since.'}
|
|
227
|
+
</p>
|
|
228
|
+
)}
|
|
229
|
+
{outside && (
|
|
230
|
+
<p className="text-xs text-muted">
|
|
231
|
+
This session works outside any git repository: no changes to commit.
|
|
232
|
+
</p>
|
|
233
|
+
)}
|
|
234
|
+
{changes && (
|
|
235
|
+
<>
|
|
236
|
+
{pending.length === 0 ? (
|
|
237
|
+
<p className="text-xs text-muted">
|
|
238
|
+
{changes.files.length
|
|
239
|
+
? 'Everything this session changed is committed.'
|
|
240
|
+
: 'No changes from this session yet.'}
|
|
241
|
+
</p>
|
|
242
|
+
) : (
|
|
243
|
+
<form
|
|
244
|
+
aria-label="Commit"
|
|
245
|
+
onSubmit={(event) => {
|
|
246
|
+
void commit(event);
|
|
247
|
+
}}
|
|
248
|
+
className="flex flex-col gap-2"
|
|
249
|
+
>
|
|
250
|
+
<ul aria-label="Uncommitted files" className="m-0 flex list-none flex-col gap-1 p-0">
|
|
251
|
+
{pending.map(({ path }) => {
|
|
252
|
+
const others = changes.shared.filter((each) => each.files.includes(path));
|
|
253
|
+
return (
|
|
254
|
+
<li key={path} className="flex items-center gap-2">
|
|
255
|
+
<Checkbox
|
|
256
|
+
aria-label={`Commit ${path}`}
|
|
257
|
+
checked={picked.has(path)}
|
|
258
|
+
onCheckedChange={(checked: boolean) =>
|
|
259
|
+
setPicked((was) => {
|
|
260
|
+
const next = new Set(was);
|
|
261
|
+
if (checked) next.add(path);
|
|
262
|
+
else next.delete(path);
|
|
263
|
+
return next;
|
|
264
|
+
})
|
|
265
|
+
}
|
|
266
|
+
/>
|
|
267
|
+
<span className="min-w-0 truncate font-mono text-xs">{path}</span>
|
|
268
|
+
{others.length > 0 && (
|
|
269
|
+
<span
|
|
270
|
+
className="flex shrink-0 items-center gap-1 text-xs text-warning"
|
|
271
|
+
title={`Also changed by ${others.map((each) => each.title).join(', ')}`}
|
|
272
|
+
>
|
|
273
|
+
<Icon name="triangle-alert" size={12} />
|
|
274
|
+
shared
|
|
275
|
+
</span>
|
|
276
|
+
)}
|
|
277
|
+
</li>
|
|
278
|
+
);
|
|
279
|
+
})}
|
|
280
|
+
</ul>
|
|
281
|
+
{changes.shared.length > 0 && (
|
|
282
|
+
<div
|
|
283
|
+
role="note"
|
|
284
|
+
className="rounded-md border border-border px-3 py-2 text-xs text-secondary"
|
|
285
|
+
>
|
|
286
|
+
Other sessions changed some of these files and have not committed them:
|
|
287
|
+
<ul className="m-0 mt-1 flex list-none flex-col gap-0.5 p-0">
|
|
288
|
+
{changes.shared.map((each) => (
|
|
289
|
+
<li key={each.id}>
|
|
290
|
+
<button
|
|
291
|
+
type="button"
|
|
292
|
+
className="cursor-pointer border-0 bg-transparent p-0 text-xs font-medium text-foreground underline-offset-2 hover:underline"
|
|
293
|
+
onClick={() => onOpen(each.id)}
|
|
294
|
+
>
|
|
295
|
+
{each.title}
|
|
296
|
+
</button>
|
|
297
|
+
{each.running && ' (running)'}:{' '}
|
|
298
|
+
<span className="font-mono">{each.files.join(', ')}</span>
|
|
299
|
+
</li>
|
|
300
|
+
))}
|
|
301
|
+
</ul>
|
|
302
|
+
</div>
|
|
303
|
+
)}
|
|
304
|
+
<div className="flex items-center gap-2">
|
|
305
|
+
<Input
|
|
306
|
+
size="sm"
|
|
307
|
+
aria-label="Commit message"
|
|
308
|
+
placeholder="Commit message"
|
|
309
|
+
value={message}
|
|
310
|
+
onChange={(event) => {
|
|
311
|
+
setMessage(event.currentTarget.value);
|
|
312
|
+
setConfirming(false);
|
|
313
|
+
}}
|
|
314
|
+
className="min-w-0 flex-1"
|
|
315
|
+
/>
|
|
316
|
+
<Button
|
|
317
|
+
type="submit"
|
|
318
|
+
size="sm"
|
|
319
|
+
variant={confirming ? 'outline' : 'primary'}
|
|
320
|
+
disabled={committing || session.running || !picked.size || !message.trim()}
|
|
321
|
+
>
|
|
322
|
+
<Icon name="git-branch" size={14} />
|
|
323
|
+
{confirming ? 'Commit their changes too' : `Commit ${picked.size}`}
|
|
324
|
+
</Button>
|
|
325
|
+
</div>
|
|
326
|
+
{confirming && (
|
|
327
|
+
<p role="status" className="text-xs text-warning">
|
|
328
|
+
The shared files hold the other sessions' changes too: they go in this commit.
|
|
329
|
+
Click again to confirm.
|
|
330
|
+
</p>
|
|
331
|
+
)}
|
|
332
|
+
{session.running && <p className="text-xs text-muted">Commit once the turn ends.</p>}
|
|
333
|
+
{changes.diff && (
|
|
334
|
+
<details
|
|
335
|
+
open={diffOpen}
|
|
336
|
+
onToggle={(event) => setDiffOpen(event.currentTarget.open)}
|
|
337
|
+
>
|
|
338
|
+
<summary className="cursor-pointer text-xs text-muted">Diff</summary>
|
|
339
|
+
<div className="mt-1 flex flex-col gap-2">
|
|
340
|
+
{files.map((file) => (
|
|
341
|
+
<section
|
|
342
|
+
key={file.path}
|
|
343
|
+
ref={(element) => {
|
|
344
|
+
if (element) fileRefs.current.set(file.path, element);
|
|
345
|
+
else fileRefs.current.delete(file.path);
|
|
346
|
+
}}
|
|
347
|
+
aria-label={file.path}
|
|
348
|
+
data-diff-file={file.path}
|
|
349
|
+
data-focused={file === focused || undefined}
|
|
350
|
+
className={cn(
|
|
351
|
+
'scroll-mt-2 overflow-hidden rounded-md border border-border-subtle bg-background',
|
|
352
|
+
file === focused && 'border-accent ring-1 ring-accent',
|
|
353
|
+
)}
|
|
354
|
+
>
|
|
355
|
+
<div className="flex h-7 items-center gap-2 border-b border-border-subtle bg-surface px-2.5 text-xs">
|
|
356
|
+
<span className="min-w-0 truncate font-mono text-secondary">
|
|
357
|
+
{file.path}
|
|
358
|
+
</span>
|
|
359
|
+
<span className="shrink-0 font-mono">
|
|
360
|
+
{file.added > 0 && <span className="text-success">+{file.added}</span>}
|
|
361
|
+
{file.added > 0 && file.removed > 0 && ' '}
|
|
362
|
+
{file.removed > 0 && (
|
|
363
|
+
<span className="text-destructive">−{file.removed}</span>
|
|
364
|
+
)}
|
|
365
|
+
</span>
|
|
366
|
+
</div>
|
|
367
|
+
<pre className="max-h-72 overflow-auto py-1 font-mono text-[11px] leading-4">
|
|
368
|
+
{file.lines.map((line, at) => (
|
|
369
|
+
<div
|
|
370
|
+
key={at}
|
|
371
|
+
className={cn(
|
|
372
|
+
'px-2.5',
|
|
373
|
+
line[0] === '+'
|
|
374
|
+
? 'bg-success-subtle text-success'
|
|
375
|
+
: line[0] === '-'
|
|
376
|
+
? 'bg-destructive-subtle text-destructive'
|
|
377
|
+
: line.startsWith('@@')
|
|
378
|
+
? 'text-accent'
|
|
379
|
+
: 'text-muted',
|
|
380
|
+
)}
|
|
381
|
+
>
|
|
382
|
+
{line || ' '}
|
|
383
|
+
</div>
|
|
384
|
+
))}
|
|
385
|
+
</pre>
|
|
386
|
+
</section>
|
|
387
|
+
))}
|
|
388
|
+
</div>
|
|
389
|
+
</details>
|
|
390
|
+
)}
|
|
391
|
+
</form>
|
|
392
|
+
)}
|
|
393
|
+
{changes.commits.length > 0 && (
|
|
394
|
+
<ul aria-label="Commits" className="m-0 flex list-none flex-col gap-1 p-0">
|
|
395
|
+
{[...changes.commits].reverse().map((each) => (
|
|
396
|
+
<li key={each.sha} className="flex items-center gap-2 text-xs text-secondary">
|
|
397
|
+
<Badge className="shrink-0 font-mono">{each.sha.slice(0, 7)}</Badge>
|
|
398
|
+
<span className="min-w-0 truncate">{each.message.split('\n')[0]}</span>
|
|
399
|
+
<span className="shrink-0 text-muted">
|
|
400
|
+
{each.files.length} file{each.files.length === 1 ? '' : 's'}
|
|
401
|
+
</span>
|
|
402
|
+
</li>
|
|
403
|
+
))}
|
|
404
|
+
</ul>
|
|
405
|
+
)}
|
|
406
|
+
</>
|
|
407
|
+
)}
|
|
408
|
+
{error && (
|
|
409
|
+
<p role="alert" className="text-xs text-destructive">
|
|
410
|
+
{error}
|
|
411
|
+
</p>
|
|
412
|
+
)}
|
|
413
|
+
</div>
|
|
414
|
+
);
|
|
415
|
+
}
|