Expand description
Attachment previews: the files a person adds to a prompt and the files a message carries.
One Attachment value describes a file by stable ID, name, kind, size,
optional thumbnail, and upload lifecycle. AttachmentPreview renders it
as a tile (thumbnail or kind glyph, name, metadata, state) and
AttachmentStrip lays tiles out in a wrapping row that ripples in.
The same strip serves both sides of a conversation: removable and compact
inside the composer, read-only and openable inside a message.
Applications own the bytes, the upload, and what “open” means; the
components only report AttachmentEvents keyed by attachment ID.
Structs§
- Attachment
- One file with stable identity, presentation metadata, and upload state.
- Attachment
Preview - One attachment tile.
- Attachment
Strip - A wrapping row of attachment tiles that ripple into place.
Enums§
- Attachment
Event - An interaction emitted by attachment previews.
- Attachment
Kind - The family a file belongs to; drives the fallback glyph and the kind label.
Functions§
- format_
bytes - Formats a byte count the way file managers do (
820 B,12 KB,1.4 MB).