Skip to content

Commit 77bb2a4

Browse files
hetunandutrishaanand
authored andcommitted
chore: Have a failsafe for split screen if we turn off the feature flag (#31832)
## Description Adds a failsafe for Split screen feature when flag is turned off ## Automation /ok-to-test tags="@tag.IDE" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!IMPORTANT] > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/8294997501> > Commit: `434c36e595e46c378b58fa14bd1c9d04a3bfd119` > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8294997501&attempt=2" target="_blank">Click here!</a> > All cypress tests have passed 🎉🎉🎉 <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced an `Editor View Mode` option to enhance user interface customization based on feature availability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 782c7b0 commit 77bb2a4

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

app/client/src/selectors/ideSelectors.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import { createSelector } from "reselect";
22
import { selectFeatureFlags } from "@appsmith/selectors/featureFlagsSelectors";
33
import type { AppState } from "@appsmith/reducers";
44
import { getPageActions } from "@appsmith/selectors/entitiesSelector";
5-
import { EditorEntityTab } from "@appsmith/entities/IDE/constants";
5+
import {
6+
EditorEntityTab,
7+
EditorViewMode,
8+
} from "@appsmith/entities/IDE/constants";
69

710
export const getIsSideBySideEnabled = createSelector(
811
selectFeatureFlags,
@@ -11,7 +14,16 @@ export const getIsSideBySideEnabled = createSelector(
1114
flags.rollout_side_by_side_enabled,
1215
);
1316

14-
export const getIDEViewMode = (state: AppState) => state.ui.ide.view;
17+
export const getIDEViewMode = createSelector(
18+
getIsSideBySideEnabled,
19+
(state) => state.ui.ide.view,
20+
(featureFlag, ideViewMode) => {
21+
if (featureFlag) {
22+
return ideViewMode;
23+
}
24+
return EditorViewMode.FullScreen;
25+
},
26+
);
1527

1628
export const getPagesActiveStatus = (state: AppState) =>
1729
state.ui.ide.pagesActive;

0 commit comments

Comments
 (0)