Skip to content

Conversation

nornagon-openai
Copy link
Collaborator

we were checking every typed character to see if it was an image. this involved going to disk, which was slow.

this was a bad interaction between image paste support and burst-paste detection.

@@ -223,7 +224,7 @@ impl ChatComposer {
let placeholder = format!("[Pasted Content {char_count} chars]");
self.textarea.insert_element(&placeholder);
self.pending_pastes.push((placeholder, pasted));
} else if self.handle_paste_image_path(pasted.clone()) {
} else if char_count > 1 && self.handle_paste_image_path(pasted.clone()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably make this tighter too -- at minimum every image file would have .png .jpg so >4 characters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ehh, technically that's not required of an image file; they could have any or no extension. bit of an edge case, and especially unlikely for pasted paths as i think almost always the pasted path will be an absolute path, but this is the simplest thing we can do that's almost-always correct. (technically i suppose someone could paste a single-character path that's an image...)

@nornagon-openai nornagon-openai merged commit b32c79e into main Sep 2, 2025
16 checks passed
@nornagon-openai nornagon-openai deleted the nornagon/lag branch September 2, 2025 17:35
@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants