authorgravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-10-02 21:10:55-07:00
committergravatar for git@paperclover.netclover caruso <git@paperclover.net> 2026-10-03 07:05:30-07:00
log2bfd2c325dbad48b099155c8aee21fcd5b3a5ee5
tree23fcff547110e9073cae04ddd411d54344dd504a
parentc5f2777d27e890082216a8d8eb1dacee4d4a104f
signature Signed by SSH key SHA256:52mNGHRsVFBDED9IAX5pe+LRWUefqTbxEReunq21QvU

fix: the notebook button leads the tab row, Back and Forward after it

Shut, the tab row starts with the notebook button, then Back and Forward; open, the button closes the sidebar from the column's left and Back and Forward follow it, ahead of "My Notebooks", so neither moves past the other as the sidebar eases. Assisted-by: claude-opus-5.5

2 files changed, 27 insertions(+), 20 deletions(-)

crates/snowbound/src/main.rs+3-3
...@@ -1722,9 +1722,9 @@ impl State {...@@ -1722,9 +1722,9 @@ impl State {
1722 );1722 );
1723 if !self.temporary {1723 if !self.temporary {
1724 // Past the row's padding, the frame's corner and the first tab's shadow, the tabs'1724 // Past the row's padding, the frame's corner and the first tab's shadow, the tabs'
1725 // outlines start where Back and Forward end, and on the left the notebook button's1725 // outlines start where Back and Forward end, after the notebook button's square on
1726 // square after them; that room shrinks on the sidebar's easing, as they move into1726 // the left; that room shrinks on the sidebar's easing, as they move into its
1727 // its header, so the tabs ease with it.1727 // header, so the tabs ease with it.
1728 let room = sidebar::NAV + TAB_ROW - FRAME - self.rounding() - ui::SHADOW[0];1728 let room = sidebar::NAV + TAB_ROW - FRAME - self.rounding() - ui::SHADOW[0];
1729 let room = if self.navigation_bar_right {1729 let room = if self.navigation_bar_right {
1730 room - TAB_ROW1730 room - TAB_ROW
crates/snowbound/src/sidebar.rs+24-17
...@@ -196,10 +196,17 @@ fn sidebar(...@@ -196,10 +196,17 @@ fn sidebar(
196 ..Spec::default()196 ..Spec::default()
197 },197 },
198 );198 );
199 // Room for what floats over the header's start: the notebook button's icon, and on the
200 // left Back and Forward after it.
201 let start = if right {
202 ICON
203 } else {
204 (ICON + RAIL) / 2.0 + NAV - ROW_PAD
205 };
199 ui.leaf(206 ui.leaf(
200 "icon",207 "icon",
201 Spec {208 Spec {
202 size: [px(ICON), px(ui::shell::TOOL)],209 size: [px(start), px(ui::shell::TOOL)],
203 ..Spec::default()210 ..Spec::default()
204 },211 },
205 );212 );
...@@ -212,15 +219,16 @@ fn sidebar(...@@ -212,15 +219,16 @@ fn sidebar(
212 ..Spec::default()219 ..Spec::default()
213 },220 },
214 );221 );
215 // Room for what floats over the header's end.222 // Room for the notebook button floating over the header's end.
216 let end = if right { RAIL } else { NAV + MARGIN };223 if right {
217 ui.leaf(224 ui.leaf(
218 "end",225 "end",
219 Spec {226 Spec {
220 size: [px(end - MARGIN - 2.0 * ROW_PAD), px(1.0)],227 size: [px(RAIL - MARGIN - 2.0 * ROW_PAD), px(1.0)],
221 ..Spec::default()228 ..Spec::default()
222 },229 },
223 );230 );
231 }
224 ui.close();232 ui.close();
225 if !rows {233 if !rows {
226 return;234 return;
...@@ -970,10 +978,10 @@ impl crate::State {...@@ -970,10 +978,10 @@ impl crate::State {
970 }978 }
971 }979 }
972980
973 /// Back, Forward and the notebook button, floating at the body's corner over the section981 /// The notebook button, then Back and Forward, floating at the body's corner over the
974 /// tabs' row, `height` tall as it eases. While the sidebar, `width` wide as it eases, is982 /// section tabs' row, `height` tall as it eases. While the sidebar, `width` wide as it
975 /// open on the left, the notebook button closes it from its header's icon, and Back and983 /// eases, is open on the left, the notebook button closes it from its header's icon, Back
976 /// Forward ride its end.984 /// and Forward after it.
977 pub(crate) fn sidebar_button(&mut self, height: f32, width: f32) {985 pub(crate) fn sidebar_button(&mut self, height: f32, width: f32) {
978 use crate::commands::{Choice, Id as Cmd};986 use crate::commands::{Choice, Id as Cmd};
979 if self.temporary {987 if self.temporary {
...@@ -987,9 +995,8 @@ impl crate::State {...@@ -987,9 +995,8 @@ impl crate::State {
987 .map_or(0.0, |[left, _, right, _]| right - left - RAIL);995 .map_or(0.0, |[left, _, right, _]| right - left - RAIL);
988 (0.0, edge)996 (0.0, edge)
989 } else {997 } else {
990 let open = MARGIN + ROW_PAD - (RAIL - ICON) / 2.0;998 let toggle = (MARGIN + ROW_PAD - (RAIL - ICON) / 2.0) * width / WIDTH;
991 let toggle = NAV + (open - NAV) * width / WIDTH;999 (toggle + RAIL, toggle)
992 ((width - NAV - MARGIN).max(0.0), toggle)
993 };1000 };
994 let pad = [1001 let pad = [
995 (RAIL - ui::shell::TOOL) / 2.0,1002 (RAIL - ui::shell::TOOL) / 2.0,