authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-10-02 11:11:16-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-10-02 12:53:12-07:00
log6bc7028096a351aa0348bcbf6d76425c5a611103
tree53af2f799c55cecfeee4b4b39ca7d95baec32119
parent159858f7ba5bb557db7894c52d7f77d2ff841869
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

fix: Find on page leaves the query room beside the match count

The query field filled what the count and buttons left of the 240-pt box, which was about two letters. Finding now widens the box by 120 into the tab row's spare room, the field keeps at least 72, and the count shortens before the field gives up more. Assisted-by: claude-opus-5.5

3 files changed, 50 insertions(+), 3 deletions(-)

crates/snowbound/src/main.rs+12-1
......@@ -2886,11 +2886,22 @@ impl State {
28862886 ..Spec::default()
28872887 },
28882888 );
2889 // Finding widens the box over the tab row's spare room, for the match count beside
2890 // the query.
2891 let wide = if finding {
2892 PAGE_LIST + 120.0
2893 } else {
2894 PAGE_LIST
2895 };
2896 let width = ui::Extent {
2897 size: ui::Size::Pixels(wide),
2898 strictness: PAGE_LIST / wide,
2899 };
28892900 for folded in [false, true].into_iter().take(if finding { 1 } else { 2 }) {
28902901 self.ui.open(
28912902 folded,
28922903 Spec {
2893 size: [if folded { children() } else { px(PAGE_LIST) }, px(TAB_ROW)],
2904 size: [if folded { children() } else { width }, px(TAB_ROW)],
28942905 pad: [0.0, (TAB_ROW - ui::shell::TOOL) / 2.0],
28952906 gap: 3.0,
28962907 ..Spec::default()
crates/snowbound/src/search.rs+18-2
......@@ -1144,7 +1144,15 @@ impl State {
11441144 self.ui.leaf(
11451145 "count",
11461146 Spec {
1147 size: [fit(), px(ui::shell::TOOL)],
1147 // It shortens once the query has given up all it may.
1148 size: [
1149 ui::Extent {
1150 size: ui::Size::Text,
1151 strictness: 0.5,
1152 },
1153 px(ui::shell::TOOL),
1154 ],
1155 overflow: ui::Overflow::Ellipsis,
11481156 inset: [0.0, 3.0, 0.0, 3.0],
11491157 text: Some(&label),
11501158 fill: Some(draw::srgb(0xff, 0xe0, 0x5a)),
......@@ -1177,7 +1185,15 @@ impl State {
11771185 &mut self.search.query,
11781186 "",
11791187 Spec {
1180 size: [fill(), px(ui::shell::TOOL)],
1188 // Wider than the box ever is, so it takes all there is, yet keeps 72 for a
1189 // few words of the query.
1190 size: [
1191 ui::Extent {
1192 size: ui::Size::Pixels(1000.0),
1193 strictness: 72.0 / 1000.0,
1194 },
1195 px(ui::shell::TOOL),
1196 ],
11811197 pad: [4.0, 0.0],
11821198 role: Some(Role::SearchInput),
11831199 ..Spec::default()
crates/snowbound/tests/replay.rs+20
......@@ -369,3 +369,23 @@ fn renaming_a_section_from_its_tab_types_into_the_sidebar_at_once() {
369369 "{typed}"
370370 );
371371}
372
373/// Finding on the page leaves the query room beside the match count: a press just past
374/// where the count ends lands in the field.
375#[test]
376fn the_find_bar_keeps_room_for_the_query() {
377 let scratch = Scratch::new("find-room");
378 let notebook =
379 Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/cross-container/candidate");
380 let mut steps = vec!["modifiers command", "key f", "modifiers", "wait 200"];
381 steps.extend(["type Alpha", "wait 400", "move 600 600", "press", "release"]);
382 steps.extend(["wait 200", "move 1000 52", "press", "release", "wait 200"]);
383 steps.extend(["type zz", "wait 200", "accessibility found"]);
384 let [found] = replay(&scratch, Some(&notebook), &steps)
385 .try_into()
386 .unwrap();
387 assert!(
388 found.contains(r#"SearchInput "Find on Page" = "Alphazz" [focused]"#),
389 "{found}"
390 );
391}