pub struct PendingQuestionSet {
pub turn: TurnId,
pub call_id: ToolCallId,
pub questions: Vec<Question>,
pub active: usize,
pub selections: Vec<QuestionSelection>,
pub review_cursor: usize,
pub editing_note: bool,
pub remember: bool,
}Expand description
A batch of questions awaiting the user’s answers, plus live modal selection
state. The reducer owns this; it mirrors PendingApproval.
Fields§
§turn: TurnId§call_id: ToolCallId§questions: Vec<Question>§active: usizeActive tab. 0..questions.len() selects a question; a value equal to
questions.len() is the “Review your answers” screen.
selections: Vec<QuestionSelection>Per-question live selection state, parallel to questions.
review_cursor: usizeHighlighted row on the review screen: 0 = Submit answers, 1 = Cancel.
editing_note: boolWhen true, keystrokes edit the active question’s note (toggled with n).
remember: boolWhen true, the user opted to remember these answers across sessions
(toggled with r); the tool persists answers keyed by memory_key.
Implementations§
Source§impl PendingQuestionSet
impl PendingQuestionSet
pub fn new(turn: TurnId, call_id: ToolCallId, questions: Vec<Question>) -> Self
Sourcepub fn skips_review(&self) -> bool
pub fn skips_review(&self) -> bool
Skip the review screen only for the atomic case: a single single-select question, where picking an option is the whole answer (Claude Code resolves it immediately). Every other shape (multi-question, or any multi-select) confirms via the Submit/review screen.
Sourcepub fn row_count(&self, idx: usize) -> usize
pub fn row_count(&self, idx: usize) -> usize
Number of navigable rows for a Select/MultiSelect question at idx:
options, the Other row, and (multi-select only) the Submit row.
Sourcepub fn other_row(&self, idx: usize) -> usize
pub fn other_row(&self, idx: usize) -> usize
Row index of the “Other” free-text row for the question at idx.
Sourcepub fn submit_row(&self, idx: usize) -> Option<usize>
pub fn submit_row(&self, idx: usize) -> Option<usize>
Row index of the Submit row for a multi-select question, if any.
Sourcepub fn build_answers(&self) -> Vec<QuestionAnswer>
pub fn build_answers(&self) -> Vec<QuestionAnswer>
Build the final answers from current selections. Each answer carries the
selected option labels plus any typed “Other” text; a question left
untouched yields an empty selected (surfaced to the model as “(no
selection)”).
Trait Implementations§
Source§impl Clone for PendingQuestionSet
impl Clone for PendingQuestionSet
Source§fn clone(&self) -> PendingQuestionSet
fn clone(&self) -> PendingQuestionSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more