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 {
17221722 );
17231723 if !self.temporary {
17241724 // 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's
1726 // square after them; that room shrinks on the sidebar's easing, as they move into
1727 // its header, so the tabs ease with it.
1725 // outlines start where Back and Forward end, after the notebook button's square on
1726 // the left; that room shrinks on the sidebar's easing, as they move into its
1727 // header, so the tabs ease with it.
17281728 let room = sidebar::NAV + TAB_ROW - FRAME - self.rounding() - ui::SHADOW[0];
17291729 let room = if self.navigation_bar_right {
17301730 room - TAB_ROW
crates/snowbound/src/sidebar.rs+24-17
......@@ -196,10 +196,17 @@ fn sidebar(
196196 ..Spec::default()
197197 },
198198 );
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 };
199206 ui.leaf(
200207 "icon",
201208 Spec {
202 size: [px(ICON), px(ui::shell::TOOL)],
209 size: [px(start), px(ui::shell::TOOL)],
203210 ..Spec::default()
204211 },
205212 );
......@@ -212,15 +219,16 @@ fn sidebar(
212219 ..Spec::default()
213220 },
214221 );
215 // Room for what floats over the header's end.
216 let end = if right { RAIL } else { NAV + MARGIN };
217 ui.leaf(
218 "end",
219 Spec {
220 size: [px(end - MARGIN - 2.0 * ROW_PAD), px(1.0)],
221 ..Spec::default()
222 },
223 );
222 // Room for the notebook button floating over the header's end.
223 if right {
224 ui.leaf(
225 "end",
226 Spec {
227 size: [px(RAIL - MARGIN - 2.0 * ROW_PAD), px(1.0)],
228 ..Spec::default()
229 },
230 );
231 }
224232 ui.close();
225233 if !rows {
226234 return;
......@@ -970,10 +978,10 @@ impl crate::State {
970978 }
971979 }
972980
973 /// Back, Forward and the notebook button, floating at the body's corner over the section
974 /// tabs' row, `height` tall as it eases. While the sidebar, `width` wide as it eases, is
975 /// open on the left, the notebook button closes it from its header's icon, and Back and
976 /// Forward ride its end.
981 /// The notebook button, then Back and Forward, floating at the body's corner over the
982 /// section tabs' row, `height` tall as it eases. While the sidebar, `width` wide as it
983 /// eases, is open on the left, the notebook button closes it from its header's icon, Back
984 /// and Forward after it.
977985 pub(crate) fn sidebar_button(&mut self, height: f32, width: f32) {
978986 use crate::commands::{Choice, Id as Cmd};
979987 if self.temporary {
......@@ -987,9 +995,8 @@ impl crate::State {
987995 .map_or(0.0, |[left, _, right, _]| right - left - RAIL);
988996 (0.0, edge)
989997 } else {
990 let open = MARGIN + ROW_PAD - (RAIL - ICON) / 2.0;
991 let toggle = NAV + (open - NAV) * width / WIDTH;
992 ((width - NAV - MARGIN).max(0.0), toggle)
998 let toggle = (MARGIN + ROW_PAD - (RAIL - ICON) / 2.0) * width / WIDTH;
999 (toggle + RAIL, toggle)
9931000 };
9941001 let pad = [
9951002 (RAIL - ui::shell::TOOL) / 2.0,