Skip to content

Commit d73a49c

Browse files
committed
fix(cmd-k): Rename query event to avoid TS2320 conflict with old palette
The old palette's SearchEventParameters already defines command_palette.query with a different type. Rename our event to command_palette.searched to avoid the interface merge conflict in the global EventParameters.
1 parent b9c0225 commit d73a49c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

static/app/components/commandPalette/ui/commandPalette.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export function CommandPalette(props: CommandPaletteProps) {
115115
if (state.query.length > 0 && state.query !== lastTrackedQueryRef.current) {
116116
queryTimerRef.current = setTimeout(() => {
117117
lastTrackedQueryRef.current = state.query;
118-
trackAnalytics('command_palette.query', {
118+
trackAnalytics('command_palette.searched', {
119119
organization,
120120
query: state.query,
121121
result_count: filteredActions.length,

static/app/utils/analytics/commandPaletteAnalyticsEvents.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type CommandPaletteActionSelectedEvent = {
3636
session_id: string;
3737
};
3838

39-
type CommandPaletteQueryEvent = {
39+
type CommandPaletteSearchedEvent = {
4040
/** The search query */
4141
query: string;
4242
/** Number of results returned for the query */
@@ -74,7 +74,7 @@ export type CommandPaletteEventParameters = {
7474
'command_palette.closed': CommandPaletteClosedEvent;
7575
'command_palette.no_results': CommandPaletteNoResultsEvent;
7676
'command_palette.opened': CommandPaletteOpenedEvent;
77-
'command_palette.query': CommandPaletteQueryEvent;
77+
'command_palette.searched': CommandPaletteSearchedEvent;
7878
'command_palette.session': CommandPaletteSessionEvent;
7979
};
8080

@@ -84,7 +84,7 @@ export const commandPaletteEventMap: Record<CommandPaletteEventKey, string> = {
8484
'command_palette.opened': 'Command Palette: Opened',
8585
'command_palette.closed': 'Command Palette: Closed',
8686
'command_palette.action_selected': 'Command Palette: Action Selected',
87-
'command_palette.query': 'Command Palette: Query',
87+
'command_palette.searched': 'Command Palette: Searched',
8888
'command_palette.no_results': 'Command Palette: No Results',
8989
'command_palette.session': 'Command Palette: Session',
9090
};

0 commit comments

Comments
 (0)