T06b forms selection: checkbox, radio, cards, switch, select, combobox, multi select, cascader, transfer list, list box, chips, rating, sliders, knob, stepper

This commit is contained in:
ZacharyZhang-NY committed 2026-09-25 06:41:35 -04:00
1 parent ec5713c10b
commit e39d623b58
36 files changed
+5170 -198

No files matched your search

+19 -15
View File
@@ -7,7 +7,7 @@ use gpui::{
use super::{
Highlight, Input, TextInput,
suggest::{Suggestion, suggestion_list},
options::{Choice, Popup},
text::{Down, Enter, Up},
};
use crate::theme::ActiveTheme;
@@ -162,13 +162,13 @@ impl RenderOnce for MentionInput {
"mention input: open {open}, {} matches, caret {anchor:?}",
matches.len()
);
let rows: Vec<Suggestion> = matches
let rows: Vec<Choice> = matches
.iter()
.map(|name| Suggestion {
label: active.map_or(name.clone(), |(_, trigger)| {
.map(|name| {
let label = active.map_or(name.clone(), |(_, trigger)| {
SharedString::from(format!("{trigger}{name}"))
}),
note: None,
});
Choice::new(name.clone(), label)
})
.collect();
let insert = {
@@ -231,15 +231,19 @@ impl RenderOnce for MentionInput {
})
.child(Input::new(&self.state))
.when_some(anchor.filter(|_| open), |field, anchor| {
field.child(suggestion_list(
"mentions",
anchor,
&rows,
highlighted,
insert,
None,
cx,
))
field.child(
Popup {
id: "mentions".into(),
anchor,
rows: &rows,
highlighted: Some(highlighted),
checked: None,
pick: insert,
dismiss: None,
scroll: None,
}
.render(window, cx),
)
})
}
}