Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions app/src/workspace/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3796,9 +3796,10 @@ impl Workspace {
NewWorkspaceSource::Restored {
window_snapshot, ..
} => {
if should_default_open
&& *TabSettings::as_ref(ctx).show_vertical_tab_panel_in_restored_windows
{
if !should_default_open {
// Stale "panel open" snapshot would leave a click-eating dismiss underlay (#9505).
false
} else if *TabSettings::as_ref(ctx).show_vertical_tab_panel_in_restored_windows {
true
} else {
window_snapshot.vertical_tabs_panel_open
Expand Down
35 changes: 35 additions & 0 deletions app/src/workspace/view_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2412,6 +2412,41 @@ fn test_vertical_tabs_panel_restored_open_when_show_in_restored_windows_enabled(
});
}

#[test]
fn test_vertical_tabs_panel_closed_when_disabled_even_if_persisted_open() {
// Regression for #9505: when `vertical_tabs_panel_open=true` is persisted
// and the user then disables vertical tabs, restoring the workspace must
// not honor the stale snapshot — otherwise a dismiss underlay paints over
// the window and silently swallows every click.
let _vertical_tabs_guard = FeatureFlag::VerticalTabs.override_enabled(true);
App::test((), |mut app| async move {
initialize_app(&mut app);

// Snapshot the workspace with the panel open while vertical tabs are enabled.
app.update(|ctx| {
TabSettings::handle(ctx).update(ctx, |settings, ctx| {
report_if_error!(settings.use_vertical_tabs.set_value(true, ctx));
});
});
let workspace = mock_workspace(&mut app);
let open_snapshot = workspace.update(&mut app, |workspace, ctx| {
workspace.vertical_tabs_panel_open = true;
workspace.snapshot(ctx.window_id(), false, ctx)
});

// Disable vertical tabs, then restore. The panel must stay closed.
app.update(|ctx| {
TabSettings::handle(ctx).update(ctx, |settings, ctx| {
report_if_error!(settings.use_vertical_tabs.set_value(false, ctx));
});
});
let restored = restored_workspace(&mut app, open_snapshot);
restored.read(&app, |workspace, _| {
assert!(!workspace.vertical_tabs_panel_open);
});
});
}

#[test]
fn test_vertical_tabs_panel_defaults_open_for_new_window_when_vertical_tabs_enabled() {
let _vertical_tabs_guard = FeatureFlag::VerticalTabs.override_enabled(true);
Expand Down
Loading