pub enum ChatWidgetAction {
Send {
text: String,
},
Copy {
item_id: ChatItemId,
text: String,
},
Retry {
item_id: ChatItemId,
},
SetComposerDraft {
text: String,
},
SetComposerPermission {
value: String,
},
SetComposerModel {
model_id: Option<String>,
},
SetComposerReasoning {
reasoning_level: Option<String>,
},
SetComposerHeight {
height: f32,
},
StopTurn,
}Expand description
User intent emitted by the transcript and composer.
A general action handler runs before any specialized Send/Copy/Retry handler,
so configuring both intentionally produces two callbacks. Copy actions do not
write the clipboard themselves. SetComposerHeight expects a finite logical-
pixel value; NaN makes derived PartialEq non-reflexive despite the legacy
Eq marker on this enum.
§Examples
use ailloli_ui_core::ChatItemId;
use ailloli_ui_widgets::controls::ChatWidgetAction;
let actions = [
ChatWidgetAction::Send { text: "Hi".into() },
ChatWidgetAction::Copy { item_id: ChatItemId::new("1"), text: "Hi".into() },
ChatWidgetAction::Retry { item_id: ChatItemId::new("1") },
ChatWidgetAction::SetComposerDraft { text: "draft".into() },
ChatWidgetAction::SetComposerPermission { value: "read_only".into() },
ChatWidgetAction::SetComposerModel { model_id: None },
ChatWidgetAction::SetComposerReasoning { reasoning_level: None },
ChatWidgetAction::SetComposerHeight { height: 112.0 },
ChatWidgetAction::StopTurn,
];
assert_eq!(actions.len(), 9);Variants§
Send
Submit non-blank composer text exactly as stored, without clearing it.
Copy
Request copying one item’s current text.
Fields
item_id: ChatItemIdStable identifier of the item whose copy affordance was activated.
Retry
Request retry for an eligible item.
Fields
item_id: ChatItemIdStable identifier of the item from which retry should resume.
SetComposerDraft
Notify that the already-bound composer draft changed.
SetComposerPermission
Select a permission option value.
SetComposerModel
Select a model ID, or provider default with None.
SetComposerReasoning
Select a reasoning level, or default with None.
Fields
SetComposerHeight
Request composer height in logical pixels.
StopTurn
Request stopping the running turn.
Trait Implementations§
Source§impl Clone for ChatWidgetAction
impl Clone for ChatWidgetAction
Source§fn clone(&self) -> ChatWidgetAction
fn clone(&self) -> ChatWidgetAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChatWidgetAction
impl Debug for ChatWidgetAction
Source§impl PartialEq for ChatWidgetAction
impl PartialEq for ChatWidgetAction
impl Eq for ChatWidgetAction
impl StructuralPartialEq for ChatWidgetAction
Auto Trait Implementations§
impl Freeze for ChatWidgetAction
impl RefUnwindSafe for ChatWidgetAction
impl Send for ChatWidgetAction
impl Sync for ChatWidgetAction
impl Unpin for ChatWidgetAction
impl UnwindSafe for ChatWidgetAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.