Merged
Conversation
4bcd90a to
93c5ffc
Compare
Owner
|
Is it possible to paste an image from the clipboard? :) |
Contributor
Author
93c5ffc to
a6ed89e
Compare
Kepners
pushed a commit
to Kepners/yasb
that referenced
this pull request
Feb 4, 2026
feat(ai-chat): Attachment support
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR adds support for attachments to the ai-chat widget.
Attachments can either be added via file-picker dialog or via clipboard pasting in the input field.
Supports text files (appended to the api payload as
type: text) or images (included astype: image_url, base64 encoded). Binary files (that can't be utf-8 decoded) get rejected as unsupported file type.There's two parameters to limit the max size per attachment: Text files get truncated, image files get compressed if they exceed that limit.
Supposedly OpenAIs chat completion endpoint should also allow pdf files, but in my testing I've noticed that the provider/model I use doesn't support it, so I've decided to not include untested changes.
This PR also includes a minor change to the popup / event-handling logic to properly support the file picker dialog (without the chat popup closing on me...)
Image shows one text file and two images attached to the first message sent to the model; two more files are staged for the next message. Staged attachments can be removed at this point via the deletion button next to each one.
Let me know if there's anything you don't like and want changed.
Happy new year!