Project · a focused card scrolls into view
The board scrolled sideways without a handle, so a card that took focus past the fold stayed out of sight, ring and all, and Option-Right could send it into a column nobody saw. The board now tracks its scroll, and a card that takes focus sets the offset through layout::bring_into_view from its row's painted box, ring included, once per focus and again when it lands in another column. The stepping rules gain tests for left and right keeping a card's place and for the end of a shorter column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
62382f7e68
commit
fc0c3e564d
4 files changed
+82
-6
No files matched your search
@@ -54,5 +54,20 @@ mod tests {
|
||||
assert_eq!(stepped(&lens, 2, 1, "left"), Some((1, 0)));
|
||||
assert_eq!(stepped(&lens, 2, 1, "right"), None);
|
||||
assert_eq!(stepped(&lens, 1, 0, "home"), None);
|
||||
assert_eq!(
|
||||
stepped(&[3, 2], 0, 1, "right"),
|
||||
Some((1, 1)),
|
||||
"the same place"
|
||||
);
|
||||
assert_eq!(
|
||||
stepped(&[3, 2], 1, 1, "left"),
|
||||
Some((0, 1)),
|
||||
"the same place"
|
||||
);
|
||||
assert_eq!(
|
||||
stepped(&[3, 2], 0, 2, "right"),
|
||||
Some((1, 2)),
|
||||
"the end of a shorter column"
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user