codetether-agent 4.7.0-a-002.4

A2A-native AI coding agent for the CodeTether ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Attach pasted image data URLs.

use crate::tui::app::state::App;

/// Attach a pasted image data URL when the text is one.
pub(crate) fn try_attach_data_url(app: &mut App, text: &str) -> bool {
    let Some(image) = crate::image_clipboard::attachment_from_data_url(text) else {
        return false;
    };
    app.state.pending_images.push(image);
    let count = app.state.pending_images.len();
    app.state.status = if count == 1 {
        "Attached pasted image. Press Enter to send, or add text first.".to_string()
    } else {
        format!("Attached {count} pasted images. Press Enter to send, or add text first.")
    };
    true
}