Instrument the command palette
What does this MR do and why?
Instrument the command palette
This adds Snowplow tracking to several parts of the command palette.
The general idea is to have a correspondence with existing entries in
the new navigation sidebar/context switcher, where possible. The only
difference should be the action, which is click_command_palette_item
instead of click_menu_item
.
Addresses #417996 (closed).
Event data
Items
Items in the global search modal should have click_command_palette_item
as the data-track-action
attribute.
The data-track-label
attribute is detailed below.
Item type | Label in Snowplow structured event |
---|---|
Page | The id of the page item (same as in navigation sidebar) |
Project | projects |
User | users |
Group | groups |
File | file |
Search in group | scoped_in_group |
Search in all GitLab | scoped_in_all |
Activating the command palette
When the user enters a leading scoping character (> for commands/pages, @ for users, : for projects/ / for files (when on a project page)), an event is logged with the action activate_command_palette
, and the label
corresponding to type (command
, user
, project
and path
respectively).
Screenshots or screen recordings
n/a
How to set up and validate locally
- Open the global search modal by pressing / or clicking the search button.
- Inspect the shown items - they should have
data-track-*
attributes. - Type in a search term, with and without a leading scoping character (> for commands/pages, @ for users, : for projects/ / for files (when on a project page))
- Optionally:
- Enable Snowplow in your GDK.
- Restart GDK
- Click a link in the global search modal, an event to some
/tp2
endpoint should have been fired.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #417996 (closed)