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

fix: Rename from a section tab with the sidebar shut types into the name at once

The sidebar built its rows only once it had eased past zero width, so the rename field opened over a row that did not exist that frame, and the focus it was given fell away. Assisted-by: claude-opus-5.5

2 files changed, 21 insertions(+), 1 deletions(-)

crates/snowbound/src/sidebar.rs+2-1
......@@ -766,7 +766,8 @@ impl crate::State {
766766 &mut tree,
767767 &self.notebooks,
768768 drags,
769 width > 0.5,
769 // Opening, the rows are built at once, so a rename field there takes the focus.
770 width > 0.5 || self.sidebar && !self.full_page,
770771 self.navigation_bar_right,
771772 );
772773 let Tree {
crates/snowbound/tests/replay.rs+19
......@@ -350,3 +350,22 @@ fn a_version_copied_into_its_section_is_listed_and_found() {
350350 assert_eq!(versioned, 3, "{pages:?}");
351351 assert!(!search_results(&found).is_empty(), "{found}");
352352}
353
354/// Rename on a section tab's menu opens the shut sidebar on a field that takes what is
355/// typed over the old name at once.
356#[test]
357fn renaming_a_section_from_its_tab_types_into_the_sidebar_at_once() {
358 let scratch = Scratch::new("rename-shut-sidebar");
359 let notebook =
360 Path::new(env!("CARGO_MANIFEST_DIR")).join("../../corpus/cross-container/candidate");
361 let mut steps = vec!["move 53 53", "press right", "release right", "wait 400"];
362 steps.extend(["key Down", "key Enter", "wait 400"]);
363 steps.extend(["type Renamed", "wait 100", "accessibility typed"]);
364 let [typed] = replay(&scratch, Some(&notebook), &steps)
365 .try_into()
366 .unwrap();
367 assert!(
368 typed.contains(r#"TextInput "Name" = "Renamed" [focused]"#),
369 "{typed}"
370 );
371}