Handle image paste from empty paste events#9049
Conversation
joshka-oai
left a comment
There was a problem hiding this comment.
Add more context as doc comments around why we're making choices around this code. There's a lot of nuance that's not immediately obvious / discoverable here, and it would be good to capture these rather than having to dig for it in commit / PR history.
Do we have more details on which terminals act this way? Can we link it to any issues? What testing was done on this?
| self.add_to_history(history_cell::new_error_event(format!( | ||
| "Failed to paste image: {err}", | ||
| ))); |
There was a problem hiding this comment.
Can we make this message not be a dead end - i.e. tell the user what they can do next to succeed with their intended action. Something like: "Try saving the image on your clipboard somewhere and then copying the path in here" (let codex wordsmith some better suggestions on this).
There was a problem hiding this comment.
Summary
- Added contextual doc comments explaining empty-paste image handling and its best-effort behavior in the chat widget paste flow. codex-rs/tui/src/chatwidget.rsL1645-L1933
- Updated the clipboard image paste failure message to guide users toward saving the image and pasting the file path when clipboard paste fails. codex-rs/tui/src/chatwidget.rsL1662-L1666
Testing
- ✅
just fmt - ✅
just fix -p codex-tui - ✅
cargo test -p codex-tui
Handle image paste on empty paste events.