MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / handle_click

Method handle_click

crates/opencode-tui/src/components/question.rs:162–186  ·  view source on GitHub ↗
(&mut self, col: u16, row: u16)

Source from the content-addressed store, hash-verified

160 }
161
162 pub fn handle_click(&mut self, col: u16, row: u16) {
163 if !self.is_open {
164 return;
165 }
166 if let Some(area) = self.last_rendered_area.get() {
167 if row < area.y
168 || row >= area.y + area.height
169 || col < area.x
170 || col >= area.x + area.width
171 {
172 return;
173 }
174 // Options start at row area.y + 5 (border + title + blank + question + blank)
175 let options_start = area.y + 5;
176 if row >= options_start {
177 let idx = (row - options_start) as usize;
178 if let Some(q) = &self.current_question {
179 if idx < q.options.len() {
180 self.selected_index = idx;
181 self.toggle_selected();
182 }
183 }
184 }
185 }
186 }
187
188 pub fn render(&self, frame: &mut Frame, area: Rect, theme: &Theme) {
189 if !self.is_open {

Callers

nothing calls this directly

Calls 2

toggle_selectedMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected