Skip to content

Commit 863895f

Browse files
committed
feat(compass-aggregations): remove focus mode feature flag, always show COMPASS-6474 (#4152)
1 parent 3ce7b94 commit 863895f

File tree

3 files changed

+10
-35
lines changed

3 files changed

+10
-35
lines changed

packages/compass-aggregations/src/components/stage-toolbar/index.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import ToggleStage from './toggle-stage';
1616
import StageCollapser from './stage-collapser';
1717
import StageOperatorSelect from './stage-operator-select';
1818
import { hasSyntaxError } from '../../utils/stage';
19-
import { usePreference } from 'compass-preferences-model';
2019
import { enableFocusMode } from '../../modules/focus-mode';
2120
import OptionMenu from './option-menu';
2221

@@ -110,7 +109,6 @@ export function StageToolbar({
110109
editorRef,
111110
}: StageToolbarProps) {
112111
const darkMode = useDarkMode();
113-
const showFocusMode = usePreference('showFocusMode', React);
114112

115113
return (
116114
<div
@@ -135,16 +133,14 @@ export function StageToolbar({
135133
{isDisabled ? DISABLED_TEXT : isCollapsed ? COLLAPSED_TEXT : null}
136134
</div>
137135
<div className={rightStyles}>
138-
{showFocusMode && (
139-
<IconButton
140-
onClick={onOpenFocusMode}
141-
aria-label="Open stage in focus mode"
142-
data-testid="focus-mode-button"
143-
data-guide-cue-ref="focus-mode-button"
144-
>
145-
<Icon glyph="FullScreenEnter" size="small"></Icon>
146-
</IconButton>
147-
)}
136+
<IconButton
137+
onClick={onOpenFocusMode}
138+
aria-label="Open stage in focus mode"
139+
data-testid="focus-mode-button"
140+
data-guide-cue-ref="focus-mode-button"
141+
>
142+
<Icon glyph="FullScreenEnter" size="small"></Icon>
143+
</IconButton>
148144
<OptionMenu index={index} />
149145
</div>
150146
</div>

packages/compass-aggregations/src/components/stage.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
GuideCue,
1212
} from '@mongodb-js/compass-components';
1313
import { type AceEditor } from '@mongodb-js/compass-editor';
14-
import { usePreference } from 'compass-preferences-model';
1514

1615
import { useSortable } from '@dnd-kit/sortable';
1716
import { CSS as cssDndKit } from '@dnd-kit/utilities';
@@ -154,15 +153,12 @@ const useFocusModeGuideCue = (stageIndex: number) => {
154153
const [setGuideCueIntersectingRef, isIntersecting] = useInView({
155154
threshold: 0.5,
156155
});
157-
const showFocusMode = usePreference('showFocusMode', React);
158156

159157
useEffect(() => {
160158
if (!hasSeenFocusModeGuideCue()) {
161-
setIsGuideCueVisible(
162-
Boolean(stageIndex === 0 && showFocusMode && isIntersecting)
163-
);
159+
setIsGuideCueVisible(Boolean(stageIndex === 0 && isIntersecting));
164160
}
165-
}, [setIsGuideCueVisible, showFocusMode, stageIndex, isIntersecting]);
161+
}, [setIsGuideCueVisible, stageIndex, isIntersecting]);
166162

167163
const setGuideCueVisited = () => {
168164
setIsGuideCueVisible(false);

packages/compass-preferences-model/src/preferences.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export type FeatureFlags = {
1717
showDevFeatureFlags?: boolean;
1818
lgDarkmode?: boolean;
1919
debugUseCsfleSchemaMap?: boolean;
20-
showFocusMode?: boolean;
2120
useNewExportBackend?: boolean;
2221
};
2322

@@ -255,22 +254,6 @@ const featureFlagsProps: Required<{
255254
},
256255
},
257256

258-
/**
259-
* Feature flag for the focus mode in aggregation pipeline builder.
260-
*/
261-
showFocusMode: {
262-
type: 'boolean',
263-
required: false,
264-
default: true,
265-
ui: true,
266-
cli: true,
267-
global: true,
268-
description: {
269-
short: 'Focus Mode in Stage Editor',
270-
long: 'Use focus mode to compose aggregation pipeline stage.',
271-
},
272-
},
273-
274257
/**
275258
* Feature flag for enabling the use of the new backend api for
276259
* exporting documents. Epic: COMPASS-5576

0 commit comments

Comments
 (0)