Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

Show sent images as compact thumbnails above message text

justrach068da4c2d6a1
diff --git a/apps/native/components/site/ChatBubbles.tsx b/apps/native/components/site/ChatBubbles.tsx
index 9e48014e..4892322c 100644
--- a/apps/native/components/site/ChatBubbles.tsx
+++ b/apps/native/components/site/ChatBubbles.tsx
@@ -49,26 +49,29 @@ function PastedImage({ name }: { name: string }) {
const src = `/api/attach?name=${encodeURIComponent(name)}`;
if (failed) return <span className="block text-xs text-ink-3">Image no longer available</span>;
return (
- <a href={src} target="_blank" rel="noreferrer" aria-label="Open pasted image" className="block my-2">
+ <a href={src} target="_blank" rel="noreferrer" aria-label="Open pasted image" className="block min-w-0 max-w-full">
{/* Local staged pixels: no remote image optimizer or expiring object URL. */}
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={src} alt="Pasted image" loading="lazy" onError={() => setFailed(true)}
- className="block max-h-80 max-w-full rounded-lg object-contain" />
+ className="block h-32 max-w-full rounded-lg object-contain" />
</a>
);
}
export const UserBubble = memo(function UserBubble({ text }: { text: string }) {
const parts = splitImageMarkers(text);
+ const images = parts.filter((_, index) => index % 2 === 1);
+ const words = parts.filter((_, index) => index % 2 === 0).join("");
return (
<div data-user-bubble className="flex justify-end pl-10 sm:pl-24" style={{ animation: "fade-up 300ms cubic-bezier(0.23,1,0.32,1) both" }}>
- <div
- className="rounded-xl px-3.5 py-2 min-w-0 whitespace-pre-wrap break-words [overflow-wrap:anywhere] text-[13px] leading-relaxed text-ink shadow-hairline"
- style={{ background: "color-mix(in oklab, var(--accent) 12%, var(--surface))" }}
- >
- {parts.map((part, index) => index % 2 === 1
- ? <PastedImage key={`${index}-${part}`} name={markerName(part)} />
- : part)}
+ <div className="flex min-w-0 max-w-full flex-col items-end gap-2">
+ {images.length > 0 && <div aria-label="Attached images" className="flex max-w-full flex-wrap justify-end gap-2">
+ {images.map((part, index) => <PastedImage key={`${index}-${part}`} name={markerName(part)} />)}
+ </div>}
+ {words.trim() && <div
+ className="min-w-0 max-w-full whitespace-pre-wrap break-words rounded-xl px-3.5 py-2 text-[13px] leading-relaxed text-ink shadow-hairline [overflow-wrap:anywhere]"
+ style={{ background: "color-mix(in oklab, var(--accent) 12%, var(--surface))" }}
+ >{words}</div>}
</div>
</div>
);