Messaging · GIF picker: a GIF focused past the fold scrolls into view

Each GIF holds its own focus handle, and a canvas around it, ring and
all, sets the results box's offset once per focus from its painted
bounds. layout::bring_into_view now works along either axis; the data
table's header and the video timeline pass their sideways one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-09-26 23:11:46 -04:00
1 parent 5ade2bed74
commit 6f599803ce
6 files changed
+102 -21

No files matched your search

+17
View File
@@ -180,6 +180,23 @@ fn a_gif_is_a_tab_stop_that_space_picks(cx: &mut TestAppContext) {
assert_eq!(heard(&host, cx), ["pick b"]);
}
#[gpui::test]
fn a_gif_past_the_fold_comes_into_view_when_focused(cx: &mut TestAppContext) {
let keys = [
"g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g9", "g10", "g11",
];
let (_, cx) = gifing(Gifs::Found(keys.iter().map(|key| gif(key)).collect()), cx);
tab_to(15, cx);
let (tile, results) = (
cx.debug_bounds("gif g11").expect("the last GIF draws"),
cx.debug_bounds("gif-results").expect("the results draw"),
);
assert!(
tile.top() >= results.top() && tile.bottom() <= results.bottom(),
"{tile:?} inside {results:?}"
);
}
#[gpui::test]
fn nothing_found_says_so(cx: &mut TestAppContext) {
let (_, cx) = gifing(Gifs::Found(Vec::new()), cx);