()
| 25 | |
| 26 | impl McpDialog { |
| 27 | pub fn new() -> Self { |
| 28 | let mut state = ListState::default(); |
| 29 | state.select(Some(0)); |
| 30 | Self { |
| 31 | items: Vec::new(), |
| 32 | state, |
| 33 | open: false, |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | pub fn set_items(&mut self, mut items: Vec<McpItem>) { |
| 38 | items.sort_by(|a, b| a.name.cmp(&b.name)); |