@@ -47,7 +47,7 @@ function hasImage(body: string) {
4747 // prose supplies the block-level markdown styling; the CSS vars retune its
4848 // palette to the sepia theme.
4949 const bodyClass =
50- "prose prose-sm max-w-none min-w-0 flex-1 break-words [--tw-prose-body:var(--sepia)] [--tw-prose-quotes:var(--sepia)] [--tw-prose-headings:var(--sepia)] [--tw-prose-links:var(--gold)] [--tw-prose-bold:var(--sepia)] [--tw-prose-bullets:var(--sepia)] [--tw-prose-counters:var(--sepia)] [--tw-prose-quote-borders:color-mix(in_srgb,var(--sepia)_30%,transparent)] [--tw-prose-code:var(--sepia)] [--tw-prose-pre-code:var(--sepia)] [--tw-prose-pre-bg:color-mix(in_srgb,var(--sepia)_10%,transparent)] [--tw …
50+ "prose prose-sm max-w-none break-words [--tw-prose-body:var(--sepia)] [--tw-prose-quotes:var(--sepia)] [--tw-prose-headings:var(--sepia)] [--tw-prose-links:var(--gold)] [--tw-prose-bold:var(--sepia)] [--tw-prose-bullets:var(--sepia)] [--tw-prose-counters:var(--sepia)] [--tw-prose-quote-borders:color-mix(in_srgb,var(--sepia)_30%,transparent)] [--tw-prose-code:var(--sepia)] [--tw-prose-pre-code:var(--sepia)] [--tw-prose-pre-bg:color-mix(in_srgb,var(--sepia)_10%,transparent)] [--tw-prose-hr:color …
5151
5252 function clock(ts: number) {
5353 return new Date(ts * 1000).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
@@ -321,40 +321,41 @@ export default function ChatPane({
321321 <div
322322 key={m.id}
323323 className={cn(
324- "group -mx-1.5 flex items-start gap-1.5 rounded px-1.5 py-0.5 text-sm leading-6 hover:bg-sepia/5",
324+ "group relative -mx-1.5 rounded px-1.5 py-0.5 text-sm leading-6 hover:bg-sepia/5",
325325 hit && "bg-[color-mix(in_srgb,var(--gold)_14%,transparent)]",
326326 )}
327327 >
328- <span className="shrink-0">
329- <span className="text-sepia/40">{clock(m.createdAt)}</span>{" "}
330- {!action && <span className="text-gold/90">{m.username}</span>}
331- </span>
332- {editing ? (
333- <textarea
334- autoFocus
335- rows={Math.min(editBody.split("\n").length, 8)}
336- value={editBody}
337- onChange={(e) => setEditBody(e.target.value)}
338- onKeyDown={(e) => {
339- if (e.key === "Escape") {
340- e.preventDefault();
341- setEditingId(null);
342- } else if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) {
343- e.preventDefault();
344- saveEdit(m.id);
345- }
346- }}
347- className="max-h-[200px] min-w-0 flex-1 resize-none rounded border border-input bg-transparent px-2 py-0.5 text-sm leading-6 outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 dark:bg-input/30"
348- />
328+ {action && !editing ? (
329+ <div className="break-words italic text-gold/90">
330+ <span className="mr-1 not-italic text-sepia/40">{clock(m.createdAt)}</span>
331+ * {m.username} {action}
332+ {m.editedAt ? (
333+ <span className="ml-1 not-italic text-xs text-sepia/40">(edited)</span>
334+ ) : null}
335+ </div>
349336 ) : (
350- <div className="min-w-0 flex-1">
351- {action ? (
352- <div className="break-words italic text-gold/90">
353- * {m.username} {action}
354- {m.editedAt ? (
355- <span className="ml-1 not-italic text-xs text-sepia/40">(edited)</span>
356- ) : null}
357- </div>
337+ <>
338+ <div className="text-sepia/40">
339+ {clock(m.createdAt)}
340+ {!action && <span className="text-gold/90"> {m.username}</span>}
341+ </div>
342+ {editing ? (
343+ <textarea
344+ autoFocus
345+ rows={Math.min(editBody.split("\n").length, 8)}
346+ value={editBody}
347+ onChange={(e) => setEditBody(e.target.value)}
348+ onKeyDown={(e) => {
349+ if (e.key === "Escape") {
350+ e.preventDefault();
351+ setEditingId(null);
352+ } else if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) {
353+ e.preventDefault();
354+ saveEdit(m.id);
355+ }
356+ }}
357+ className="block max-h-[200px] w-full resize-none rounded border border-input bg-transparent px-2 py-0.5 text-sm leading-6 outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/50 dark:bg-input/30"
358+ />
358359 ) : (
359360 <div className={bodyClass}>
360361 <Markdown
@@ -367,36 +368,36 @@ export default function ChatPane({
367368 ) : null}
368369 </div>
369370 )}
370- {m.reactions && Object.keys(m.reactions).length > 0 && (
371- <div className="mt-0.5 flex flex-wrap gap-1 pb-0.5">
372- {reactions.map(({ key, Icon }) => {
373- const list = m.reactions?.[key];
374- if (!list?.length) return null;
375- const active = list.includes(username);
376- return (
377- <button
378- key={key}
379- type="button"
380- title={list.join(", ")}
381- onClick={() => toggleReaction(m.id, key)}
382- className={cn(
383- "inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-xs leading-none transition-colors",
384- active
385- ? "border-gold/50 bg-gold/15 text-gold"
386- : "border-sepia/20 bg-sepia/5 text-sepia/70 hover:border-sepia/40",
387- )}
388- >
389- <Icon className="size-3" />
390- {list.length}
391- </button>
392- );
393- })}
394- </div>
395- )}
371+ </>
372+ )}
373+ {!editing && m.reactions && Object.keys(m.reactions).length > 0 && (
374+ <div className="mt-0.5 flex flex-wrap gap-1 pb-0.5">
375+ {reactions.map(({ key, Icon }) => {
376+ const list = m.reactions?.[key];
377+ if (!list?.length) return null;
378+ const active = list.includes(username);
379+ return (
380+ <button
381+ key={key}
382+ type="button"
383+ title={list.join(", ")}
384+ onClick={() => toggleReaction(m.id, key)}
385+ className={cn(
386+ "inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-xs leading-none transition-colors",
387+ active
388+ ? "border-gold/50 bg-gold/15 text-gold"
389+ : "border-sepia/20 bg-sepia/5 text-sepia/70 hover:border-sepia/40",
390+ )}
391+ >
392+ <Icon className="size-3" />
393+ {list.length}
394+ </button>
395+ );
396+ })}
396397 </div>
397398 )}
398399 {!editing && (
399- <div className="invisible flex shrink-0 items-center gap-0.5 group-hover:visible">
400+ <div className="absolute right-1.5 top-0.5 hidden items-center gap-0.5 rounded-md border border-sepia/15 bg-panel px-0.5 shadow-sm group-hover:flex">
400401 {reactions.map(({ key, label, Icon }) => (
401402 <Button
402403 key={key}