Chrome: turning the File tab off closes a Backstage that is already open

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-19 12:23:08 -04:00
co-authored by Claude Opus 5.5
parent 9b8fde71ee
commit 92c0d1e936
2 changed files with 15 additions and 0 deletions
+4
View File
@@ -1129,6 +1129,10 @@ impl SheetApp {
// The language the widgets translate with this frame (see `i18n::current`).
i18n::set_current(&ctx, self.ui.language);
let t = theme::Tokens::get(&ctx);
// A host can turn the File tab off while Backstage is already open: close it.
if !self.chrome.file_tab {
self.backstage = None;
}
if self.backstage.is_none() {
self.ribbon_keys(&ctx);
}
+11
View File
@@ -52,3 +52,14 @@ fn without_the_file_tab_the_backstage_view_never_opens() {
assert!(h.state().backstage.is_none(), "so is every page, Print and Save As included");
assert!(h.query_by_label("AutoSave").is_some(), "the title bar can stay on its own");
}
#[test]
fn turning_the_file_tab_off_closes_an_open_backstage() {
let mut h = harness(Chrome::default());
h.state_mut().open_backstage(Page::Home);
h.run_steps(3);
assert!(h.state().backstage.is_some(), "Backstage opens with the File tab on");
h.state_mut().chrome.file_tab = false;
h.run_steps(3);
assert!(h.state().backstage.is_none(), "and closes when the host turns the File tab off");
}