Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Don't navigate away from notebook when opening QB sidesheet (#74215)

Nick Fitzpatrick6666454d2b22
diff --git a/e2e/test/scenarios/question/notebook.cy.spec.js b/e2e/test/scenarios/question/notebook.cy.spec.js
index 9099f2d4f65..fe7cd9863f1 100644
--- a/e2e/test/scenarios/question/notebook.cy.spec.js
+++ b/e2e/test/scenarios/question/notebook.cy.spec.js
@@ -1,7 +1,10 @@
const { H } = cy;
import { SAMPLE_DB_ID, WRITABLE_DB_ID } from "e2e/support/cypress_data";
import { SAMPLE_DATABASE } from "e2e/support/cypress_sample_database";
-import { ADMIN_USER_ID } from "e2e/support/cypress_sample_instance_data";
+import {
+ ADMIN_USER_ID,
+ ORDERS_QUESTION_ID,
+} from "e2e/support/cypress_sample_instance_data";
const { ORDERS, ORDERS_ID, PEOPLE, PEOPLE_ID, PRODUCTS, PRODUCTS_ID } =
SAMPLE_DATABASE;
@@ -12,6 +15,34 @@ describe("scenarios > question > notebook", { tags: "@slow" }, () => {
cy.signInAsAdmin();
});
+ it("keeps the notebook editor mounted when opening the question info sidebar (UXW-224)", () => {
+ H.activateToken("pro-self-hosted");
+ H.visitQuestion(ORDERS_QUESTION_ID);
+ H.openNotebook();
+
+ // The Visualize button only renders while the notebook editor is mounted.
+ cy.location("pathname").should("include", "/notebook");
+ cy.button("Visualize").should("be.visible");
+
+ // Open the question info sidesheet — the notebook should stay mounted behind it.
+ H.questionInfoButton().click();
+ H.sidesheet().should("be.visible");
+ cy.button("Visualize").should("be.visible");
+
+ // Closing the sidesheet should leave us in notebook mode with the editor intact.
+ H.sidesheet().findByLabelText("Close").click();
+ cy.location("pathname").should("include", "/notebook");
+ cy.button("Visualize").should("be.visible");
+
+ // Open Edit settings from the actions menu — same expectation.
+ // ("Edit settings" only appears with granular caching enabled, so this
+ // step requires EE.)
+ H.openQuestionActions("Edit settings");
+ H.sidesheet().should("be.visible");
+ cy.location("pathname").should("include", "/notebook");
+ cy.button("Visualize").should("be.visible");
+ });
+
it("shouldn't offer to save the question when there were no changes (metabase#13470)", () => {
H.openOrdersTable();
// save question initially
diff --git a/frontend/src/metabase/query_builder/reducers.ts b/frontend/src/metabase/query_builder/reducers.ts
index 4d43d16d5ae..c5999658e37 100644
--- a/frontend/src/metabase/query_builder/reducers.ts
+++ b/frontend/src/metabase/query_builder/reducers.ts
@@ -310,7 +310,6 @@ export const uiControls = createReducer<QueryBuilderUIControls>(
...UI_CONTROLS_SIDEBAR_DEFAULTS,
...CLOSED_NATIVE_EDITOR_SIDEBARS,
isShowingQuestionInfoSidebar: true,
- queryBuilderMode: "view",
}),
)
.addCase(CLOSE_QUESTION_INFO, (state) => ({
@@ -321,7 +320,6 @@ export const uiControls = createReducer<QueryBuilderUIControls>(
setUIControls(state, {
...(UI_CONTROLS_SIDEBAR_DEFAULTS as Partial<QueryBuilderUIControls>),
isShowingQuestionSettingsSidebar: true,
- queryBuilderMode: "view",
} as Partial<QueryBuilderUIControls>),
)
.addCase(CLOSE_QUESTION_SETTINGS, (state) => ({