Auto-reveal hidden sidebar on cursor reach
Cursor-reach reveal now fulfils the "Slide in on cursor reach" description on the design's Hidden-on-hover layout card. - BrowserCore::active_space_sidebar_width() returns the current sidebar tier without cloning a full BrowserSnapshot, so the mouse_move hot path stays cheap. - on_window_mouse_move on the shell root hits-tests the cursor x against REVEAL_THRESHOLD_PX (24 px from the left edge). Outside the reveal/collapse zones it returns immediately, so 99 % of mouse moves never even read the snapshot. - When in HIDDEN mode and the cursor crosses the reveal threshold, expand_hidden_sidebar fires (its early-return on already-expanded state prevents notify spam). When the cursor passes COLLAPSE_THRESHOLD_PX (shell inset + default sidebar width + 24 px buffer), collapse_hidden_sidebar fires. - Click-to-expand on the rail and click-on-backdrop-to-collapse remain as predictable fallbacks.
This commit is contained in:
@@ -465,6 +465,11 @@ impl BrowserCore {
|
||||
.ok_or_else(|| CoreError::SpaceNotFound { id: self.active_space_id.clone() })
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn active_space_sidebar_width(&self) -> Option<u16> {
|
||||
self.active_space().ok().map(|space| space.sidebar_width_px())
|
||||
}
|
||||
|
||||
fn favorites(&self) -> Vec<BrowserTab> {
|
||||
self.tabs.iter().filter(|tab| tab.flags().favorite).cloned().collect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user