Keep scenario authoring visible and restore exact caller context

This commit is contained in:
2026-09-10 12:03:17 -07:00
parent 81668f94ed
commit 3978bbe23c
7 changed files with 1720 additions and 511 deletions
+7 -5
View File
@@ -228,13 +228,15 @@ pub fn view(app: &App) -> View<'_, Message> {
Page::Guide => crate::guide::view(&app.guide),
};
let process_layout = app.topology_context().is_some();
let focus_process = process_layout && app.behavior.topology.focused;
let scenario_layout = app.scenario_context().is_some();
let focus_behavior = (process_layout && app.behavior.topology.focused)
|| (scenario_layout && app.behavior.scenario.focused());
let mut body = if app.page == Page::Home {
row![container(main).width(Fill).height(Fill)].height(Fill)
} else if process_layout {
} else if process_layout || scenario_layout {
// Keep main at the same widget-tree path across Focus toggles. The
// collapsed slot has no controls, so it cannot paint over or hit the canvas.
let process_sidebar: View<'_, Message> = if focus_process {
let process_sidebar: View<'_, Message> = if focus_behavior {
Space::new().width(0).into()
} else {
sidebar.into()
@@ -242,7 +244,7 @@ pub fn view(app: &App) -> View<'_, Message> {
// Row::push would discard the zero-width slot and shift main again.
widget::Row::from_vec(vec![
container(process_sidebar)
.width(if focus_process { 0 } else { 260 })
.width(if focus_behavior { 0 } else { 260 })
.height(Fill)
.clip(true)
.into(),
@@ -253,7 +255,7 @@ pub fn view(app: &App) -> View<'_, Message> {
} else {
row![sidebar, container(main).width(Fill).height(Fill)].height(Fill)
};
if !focus_process && !matches!(app.page, Page::Home | Page::Text | Page::Guide) {
if !focus_behavior && !matches!(app.page, Page::Home | Page::Text | Page::Guide) {
body = body.push(inspector(app));
}
let footer = container(