Skip to content

Commit cbd3f81

Browse files
committed
cleaned up traces of insights from query bar
1 parent 7f96465 commit cbd3f81

File tree

3 files changed

+0
-41
lines changed

3 files changed

+0
-41
lines changed

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

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -78,30 +78,6 @@ const editorWithErrorStyles = css({
7878
},
7979
});
8080

81-
const queryBarEditorOptionInsightsStyles = css({
82-
alignSelf: 'flex-start',
83-
// To align the icon in the middle of the first line of the editor input
84-
// (<input height> - <insight badge height>) / 2
85-
paddingTop: 3,
86-
paddingBottom: 3,
87-
paddingLeft: 3,
88-
paddingRight: 3,
89-
90-
// We make container the size of the collapsed insight to avoid additional
91-
// shrinking of the editor content when hoveing over the icon. In this case
92-
// it's okay for the content to be hidden by the expanded badge as user is
93-
// interacting with the badge
94-
width: spacing[4],
95-
height: spacing[4],
96-
overflow: 'visible',
97-
display: 'flex',
98-
justifyContent: 'flex-end',
99-
});
100-
101-
const insightsBadgeStyles = css({
102-
flex: 'none',
103-
});
104-
10581
type OptionEditorProps = {
10682
optionName: QueryOptionOfTypeDocument;
10783
namespace: string;
@@ -119,7 +95,6 @@ type OptionEditorProps = {
11995
serverVersion?: string;
12096
value?: string;
12197
['data-testid']?: string;
122-
insights?: Signal | Signal[];
12398
disabled?: boolean;
12499
recentQueries: AutoCompleteRecentQuery[];
125100
favoriteQueries: AutoCompleteFavoriteQuery[];
@@ -139,13 +114,11 @@ export const OptionEditor: React.FunctionComponent<OptionEditorProps> = ({
139114
serverVersion = '3.6.0',
140115
value = '',
141116
['data-testid']: dataTestId,
142-
insights,
143117
disabled = false,
144118
recentQueries,
145119
favoriteQueries,
146120
onApplyQuery,
147121
}) => {
148-
const showInsights = usePreference('showInsights');
149122
const editorContainerRef = useRef<HTMLDivElement>(null);
150123
const editorRef = useRef<EditorRef>(null);
151124
const isQueryHistoryAutocompleteEnabled = usePreference(
@@ -299,14 +272,6 @@ export const OptionEditor: React.FunctionComponent<OptionEditorProps> = ({
299272
onPaste={onPaste}
300273
onBlur={onBlur}
301274
/>
302-
{showInsights && insights && (
303-
<div className={queryBarEditorOptionInsightsStyles}>
304-
<SignalPopover
305-
className={insightsBadgeStyles}
306-
signals={insights}
307-
></SignalPopover>
308-
</div>
309-
)}
310275
</div>
311276
);
312277
};

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ type QueryBarProps = {
124124
expanded: boolean;
125125
placeholders?: Record<QueryProperty, string>;
126126
onExplain?: () => void;
127-
insights?: Signal | Signal[];
128127
isAIInputVisible?: boolean;
129128
isAIFetching?: boolean;
130129
onShowAIInputClick: () => void;
@@ -153,7 +152,6 @@ export const QueryBar: React.FunctionComponent<QueryBarProps> = ({
153152
expanded: isQueryOptionsExpanded,
154153
placeholders,
155154
onExplain,
156-
insights,
157155
isAIInputVisible = false,
158156
isAIFetching = false,
159157
onShowAIInputClick,
@@ -229,7 +227,6 @@ export const QueryBar: React.FunctionComponent<QueryBarProps> = ({
229227
id={filterQueryOptionId}
230228
onApply={onApply}
231229
placeholder={filterPlaceholder}
232-
insights={insights}
233230
disabled={isAIFetching}
234231
/>
235232
{showAIEntryButton && (

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ type QueryOptionProps = {
9090
onChange: (name: QueryBarProperty, value: string) => void;
9191
placeholder?: string | HTMLElement;
9292
onApply?(): void;
93-
insights?: Signal | Signal[];
9493
disabled?: boolean;
9594
};
9695

@@ -122,7 +121,6 @@ const QueryOption: React.FunctionComponent<QueryOptionProps> = ({
122121
name,
123122
value,
124123
onApply,
125-
insights,
126124
disabled = false,
127125
}) => {
128126
const track = useTelemetry();
@@ -199,7 +197,6 @@ const QueryOption: React.FunctionComponent<QueryOptionProps> = ({
199197
value={value}
200198
data-testid={`query-bar-option-${name}-input`}
201199
onApply={onApply}
202-
insights={insights}
203200
disabled={disabled}
204201
/>
205202
) : (

0 commit comments

Comments
 (0)