Skip to content

Instrument the command palette

Mark Florian requested to merge 417996-instrument-command-palette into master

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

  1. Open the global search modal by pressing / or clicking the search button.
  2. Inspect the shown items - they should have data-track-* attributes.
  3. 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))
  4. Optionally:
    1. Enable Snowplow in your GDK.
    2. Restart GDK
    3. 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.

Related to #417996 (closed)

Edited by Mark Florian

Merge request reports

Loading