Forms: lists reveal their cursor once laid out

- Select, Combobox and MultiSelect opened a long list at its top, the
  choice out of view: gpui skips a scroll asked before the list's first
  frame. Picker and Suggestions share forms::options::reveal, which Popup
  runs from a canvas inside the list
- test: a_long_list_opens_with_its_choice_in_view
- AGENTS: the scroll rule names the reveal
This commit is contained in:
ZacharyZhang-NY committed 2026-09-26 07:25:13 -04:00
1 parent 7f4bd8415c
commit 247f836073
7 files changed
+129 -28

No files matched your search

+2 -1
View File
@@ -165,6 +165,7 @@ impl RenderOnce for Combobox {
step(&rows, rows.len().saturating_sub(1), 1)
};
let (anchor, scroll) = (picker.read(cx).anchor, picker.read(cx).scroll.clone());
let reveal = Picker::reveal(&picker, open, highlighted, cx);
let pick: Pick = {
let (id, rows, state, typing, on_change) = (
self.id.clone(),
@@ -256,7 +257,7 @@ impl RenderOnce for Combobox {
pick,
dismiss: None,
scroll: Some(&scroll),
reveal: None,
reveal,
}
.render(window, cx),
)