Skip to content

Commit 1dcfda3

Browse files
authored
Merge branch 'main' into refactor-renderer-init
2 parents 27ab8c9 + 40f3b05 commit 1dcfda3

File tree

9 files changed

+51
-70
lines changed

9 files changed

+51
-70
lines changed

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **Mongodb Compass**.
2-
This document was automatically generated on Mon May 12 2025.
2+
This document was automatically generated on Thu May 15 2025.
33

44
## List of dependencies
55

docs/tracking-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
> the tracking plan for the specific Compass version you can use the following
77
> URL: `https://github.com/mongodb-js/compass/blob/<compass version>/docs/tracking-plan.md`
88
9-
Generated on Mon, May 12, 2025
9+
Generated on Thu, May 15, 2025
1010

1111
## Table of Contents
1212

packages/compass-aggregations/src/components/pipeline-toolbar/pipeline-ai.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export const PipelineAI: React.FunctionComponent<PipelineAIProps> = ({
118118
onResetIsAggregationGeneratedFromQuery={
119119
onResetIsAggregationGeneratedFromQuery
120120
}
121-
placeholder="Tell Compass what aggregation to build (e.g. how many movies were made each year)"
121+
placeholder="Tell us what aggregation to build (e.g. count movies made each year) or paste one in another language (SQL, Java, etc.)"
122122
onSubmitFeedback={enableTelemetry ? onSubmitFeedback : undefined}
123123
/>
124124
);

packages/compass-connections/src/utils/end-of-life-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let latestEndOfLifeServerVersion: Promise<string> | null = null;
1616
export async function getLatestEndOfLifeServerVersion(): Promise<string> {
1717
if (!HADRON_AUTO_UPDATE_ENDPOINT) {
1818
log.debug(
19-
mongoLogId(1_001_000_352),
19+
mongoLogId(1_001_000_356),
2020
'getLatestEndOfLifeServerVersion',
2121
'HADRON_AUTO_UPDATE_ENDPOINT is not set'
2222
);

packages/compass-generative-ai/src/components/generative-ai-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ function GenerativeAIInput({
326326
errorMessage,
327327
errorCode,
328328
isFetching,
329-
placeholder = 'Tell Compass what documents to find (e.g. which movies were released in 2000)',
329+
placeholder = 'Tell us what to find (e.g. movies from 2000) or paste a query in another language (SQL, Java, etc.)',
330330
show,
331331
onCancelRequest,
332332
onClose,

packages/compass-indexes/src/components/indexes-toolbar/indexes-toolbar.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ const toolbarButtonsContainer = css({
3737
alignItems: 'center',
3838
});
3939

40+
const indexesToolbarContainerStyles = css({
41+
padding: spacing[400],
42+
paddingBottom: 0,
43+
});
44+
4045
const alignSelfEndStyles = css({
4146
marginLeft: 'auto',
4247
});
@@ -98,7 +103,10 @@ export const IndexesToolbar: React.FunctionComponent<IndexesToolbarProps> = ({
98103
);
99104

100105
return (
101-
<div data-testid="indexes-toolbar-container">
106+
<div
107+
className={indexesToolbarContainerStyles}
108+
data-testid="indexes-toolbar-container"
109+
>
102110
{!isReadonlyView && (
103111
<div data-testid="indexes-toolbar">
104112
<div className={toolbarButtonsContainer}>

packages/compass-indexes/src/components/indexes/indexes.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ import CreateIndexModal from '../create-index-modal/create-index-modal';
3535
const IDEAL_NUMBER_OF_MAX_INDEXES = 10;
3636

3737
const containerStyles = css({
38-
paddingTop: spacing[400],
39-
paddingLeft: spacing[400],
40-
paddingRight: spacing[400],
41-
// No padding bottom so that the table can scroll visibly to the bottom
42-
paddingBottom: 0,
4338
gap: spacing[400],
4439
display: 'flex',
4540
flexDirection: 'column',
@@ -106,7 +101,9 @@ function isRefreshingStatus(status: FetchStatus) {
106101
}
107102

108103
const indexesContainersStyles = css({
109-
paddingTop: spacing[400],
104+
padding: spacing[400],
105+
// No padding bottom so that the table can scroll visibly to the bottom.
106+
paddingBottom: 0,
110107
display: 'grid',
111108
gridTemplateColumns: '100%',
112109
gap: spacing[200],

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export type FeatureFlags = {
1919
showInsights: boolean;
2020
enableExportSchema: boolean;
2121
enableRenameCollectionModal: boolean;
22-
enableQueryHistoryAutocomplete: boolean;
2322
enableProxySupport: boolean;
2423
enableRollingIndexes: boolean;
2524
showDisabledConnections: boolean;
@@ -70,17 +69,6 @@ export const featureFlags: Required<{
7069
},
7170
},
7271

73-
/**
74-
* Feature flag for adding query history items to the query bar autocompletion. COMPASS-8096
75-
*/
76-
enableQueryHistoryAutocomplete: {
77-
stage: 'released',
78-
description: {
79-
short:
80-
'Enables showing query history items in the query bar autocomplete.',
81-
},
82-
},
83-
8472
/**
8573
* Feature flag for explicit proxy configuration support.
8674
*/

packages/compass-query-bar/src/components/option-editor.tsx

Lines changed: 34 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import type {
1515
} from '@mongodb-js/compass-editor';
1616
import {
1717
CodemirrorInlineEditor as InlineEditor,
18-
createQueryAutocompleter,
1918
createQueryWithHistoryAutocompleter,
2019
} from '@mongodb-js/compass-editor';
2120
import { connect } from '../stores/context';
@@ -119,9 +118,6 @@ export const OptionEditor: React.FunctionComponent<OptionEditorProps> = ({
119118
}) => {
120119
const editorContainerRef = useRef<HTMLDivElement>(null);
121120
const editorRef = useRef<EditorRef>(null);
122-
const isQueryHistoryAutocompleteEnabled = usePreference(
123-
'enableQueryHistoryAutocomplete'
124-
);
125121

126122
const focusRingProps = useFocusRing({
127123
outer: true,
@@ -158,52 +154,45 @@ export const OptionEditor: React.FunctionComponent<OptionEditorProps> = ({
158154
}, [optionName, recentQueries, favoriteQueries]);
159155

160156
const completer = useMemo(() => {
161-
return isQueryHistoryAutocompleteEnabled
162-
? createQueryWithHistoryAutocompleter({
163-
queryProperty: optionName,
164-
savedQueries,
165-
options: {
166-
fields: schemaFields,
167-
serverVersion,
168-
},
169-
onApply: (query: SavedQuery['queryProperties']) => {
170-
// When we are applying a query from `filter` field, we want to apply the whole query,
171-
// otherwise we want to preserve the other fields that are already in the current query.
172-
const fieldsToPreserve =
173-
optionName === 'filter'
174-
? []
175-
: QUERY_PROPERTIES.filter((x) => x !== optionName);
176-
onApplyQuery(query, fieldsToPreserve);
177-
if (!query[optionName]) {
178-
return;
179-
}
180-
const formFields = mapQueryToFormFields(
181-
{ maxTimeMS: maxTimeMSPreference },
182-
{
183-
...DEFAULT_FIELD_VALUES,
184-
...query,
185-
}
186-
);
187-
const optionFormField =
188-
formFields[optionName as keyof QueryFormFields];
189-
if (optionFormField?.string) {
190-
// When we did apply something we want to move the cursor to the end of the input.
191-
editorRef.current?.cursorDocEnd();
192-
}
193-
},
194-
theme: darkMode ? 'dark' : 'light',
195-
})
196-
: createQueryAutocompleter({
197-
fields: schemaFields,
198-
serverVersion,
199-
});
157+
return createQueryWithHistoryAutocompleter({
158+
queryProperty: optionName,
159+
savedQueries,
160+
options: {
161+
fields: schemaFields,
162+
serverVersion,
163+
},
164+
onApply: (query: SavedQuery['queryProperties']) => {
165+
// When we are applying a query from `filter` field, we want to apply the whole query,
166+
// otherwise we want to preserve the other fields that are already in the current query.
167+
const fieldsToPreserve =
168+
optionName === 'filter'
169+
? []
170+
: QUERY_PROPERTIES.filter((x) => x !== optionName);
171+
onApplyQuery(query, fieldsToPreserve);
172+
if (!query[optionName]) {
173+
return;
174+
}
175+
const formFields = mapQueryToFormFields(
176+
{ maxTimeMS: maxTimeMSPreference },
177+
{
178+
...DEFAULT_FIELD_VALUES,
179+
...query,
180+
}
181+
);
182+
const optionFormField = formFields[optionName as keyof QueryFormFields];
183+
if (optionFormField?.string) {
184+
// When we did apply something we want to move the cursor to the end of the input.
185+
editorRef.current?.cursorDocEnd();
186+
}
187+
},
188+
theme: darkMode ? 'dark' : 'light',
189+
});
200190
}, [
201191
maxTimeMSPreference,
202192
savedQueries,
203193
schemaFields,
204194
serverVersion,
205195
onApplyQuery,
206-
isQueryHistoryAutocompleteEnabled,
207196
darkMode,
208197
optionName,
209198
]);
@@ -216,8 +205,7 @@ export const OptionEditor: React.FunctionComponent<OptionEditorProps> = ({
216205
editorRef.current?.editorContents === '{}'
217206
) {
218207
editorRef.current?.applySnippet('\\{${}}');
219-
if (isQueryHistoryAutocompleteEnabled && editorRef.current?.editor)
220-
editorRef.current?.startCompletion();
208+
if (editorRef.current?.editor) editorRef.current?.startCompletion();
221209
}
222210
});
223211
}

0 commit comments

Comments
 (0)