Solve workspace popover anchor from runtime sidebar width
DISCLOSURE_TOP_PX, DISCLOSURE_LEFT_PX, and DISCLOSURE_WIDTH_PX were three hardcoded numbers that drifted the moment anyone touched the sidebar header layout: SHELL_INSET, header padding, picker row geometry, or the workspace tile size. Replace them with WorkspaceDisclosureAnchor::solve(sidebar_width) — a pure function whose algebra is the geometric inverse of render_sidebar_header, expressed over named layout constants (HEADER_PT, PICKER_BUTTON_SIZE, etc.) the renderer already applies. Picker resize now flows: snapshot → sidebar_width → solve → anchor → render_workspace_disclosure. Three regression tests lock the default (66, 98, 180), invariance of left/top under resize, and zero-width clamp. cargo test ely_app --bin ely_app: 101 passed.
This commit is contained in:
@@ -25,7 +25,8 @@ pub(crate) use plugin_detail_view::render_plugin_detail_view;
|
||||
pub(crate) use settings_layout::render_settings_shell;
|
||||
pub(crate) use sidebar::{panel_bg, panel_shadow};
|
||||
pub(crate) use sidebar_header::{
|
||||
render_sidebar_header, render_workspace_disclosure, render_workspace_disclosure_backdrop,
|
||||
WorkspaceDisclosureAnchor, render_sidebar_header, render_workspace_disclosure,
|
||||
render_workspace_disclosure_backdrop,
|
||||
};
|
||||
pub(crate) use split_pane::{
|
||||
pane_host_label, pane_url_is_secure, render_compact_split_canvas,
|
||||
|
||||
Reference in New Issue
Block a user