Text chat: inline preview of text and code attachments #377

Open
opened 2026-11-13 00:23:36 +00:00 by charles · 0 comments
Owner

Found while building Text chat 22 (#272).

The original shows text/code attachments (shouldPreviewAttachment, e.g. build.log of the textchat scenario) with an inline preview (TextualAttachmentPreview.tsx: the first lines highlighted, expand, language picker). The preview needs the file's text, and neither fluxer-core nor fluxer-ui has a path to fetch an attachment as text (ApiRequest::FetchMedia only serves the clip and image purposes; fluxer-ui may not do I/O).

Text chat 22 draws these files as file cards (spec §15 divergence noted in file_card.rs). Fix: a MediaPurpose::Text (or similar) fetch in core with a size cap, the result kept per attachment, then the preview in widgets/message_content/ reusing rich_text::highlight.

Found while building Text chat 22 (#272). The original shows text/code attachments (`shouldPreviewAttachment`, e.g. `build.log` of the textchat scenario) with an inline preview (`TextualAttachmentPreview.tsx`: the first lines highlighted, expand, language picker). The preview needs the file's text, and neither `fluxer-core` nor `fluxer-ui` has a path to fetch an attachment as text (`ApiRequest::FetchMedia` only serves the clip and image purposes; `fluxer-ui` may not do I/O). Text chat 22 draws these files as file cards (spec §15 divergence noted in `file_card.rs`). Fix: a `MediaPurpose::Text` (or similar) fetch in core with a size cap, the result kept per attachment, then the preview in `widgets/message_content/` reusing `rich_text::highlight`.
charles added this to the Text chat milestone 2026-11-13 00:23:36 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#377
No description provided.