feat: inline image display with lightbox

- Add image block type for base64 and URL images
- Parse image/image_url blocks from gateway history
- Render images inline in chat messages (rounded, dark-themed)
- Click-to-zoom lightbox with Escape to close
- Markdown images also use the lightbox component
- Detect base64 images in tool results (e.g. Read tool on image files)
- Support png, jpg, gif, webp formats
This commit is contained in:
Nicolas Varrot
2026-02-11 17:18:10 +00:00
parent 375302a27b
commit 762a5f2026
6 changed files with 158 additions and 13 deletions

View File

@@ -12,7 +12,8 @@ export type MessageBlock =
| { type: 'text'; text: string }
| { type: 'thinking'; text: string }
| { type: 'tool_use'; name: string; input: any; id?: string }
| { type: 'tool_result'; content: string; toolUseId?: string; name?: string };
| { type: 'tool_result'; content: string; toolUseId?: string; name?: string }
| { type: 'image'; mediaType: string; data?: string; url?: string };
export interface Session {
key: string;