# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Adding a new metric? We have docs for that!
# https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html

---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
$tags:
  - 'Firefox :: Sidebar'

sidebar:
  expand:
    type: event
    description: >
      The sidebar was expanded.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
  resize:
    type: event
    description: >
      User resized the sidebar.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      current:
        type: quantity
        description: Current width in pixels.
      previous:
        type: quantity
        description: Previous width in pixels.
      percentage:
        type: quantity
        description: Percentage of window width at time of resize (0-100).
  display_settings:
    type: string
    lifetime: application
    description: >
      Setting for sidebar display (either "always", "expand-on-hover", or "hide").
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - metrics
  position_settings:
    type: string
    lifetime: application
    description: >
      Setting for sidebar position (either "left" or "right").
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - metrics
  tabs_layout:
    type: string
    lifetime: application
    description: >
      Setting for tabs orientation (either "horizontal" or "vertical").
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - metrics
  width:
    type: quantity
    unit: pixels
    lifetime: application
    description: >
      Width of the sidebar, in pixels.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - metrics
  search:
    type: labeled_counter
    description: >
      The number of searches from the sidebar, per view (e.g.: bookmarks,
      history).
      This metric was generated to correspond to the Legacy Telemetry
      scalar sidebar.search.
    bugs:
      - https://bugzil.la/1648524
    data_reviews:
      - https://bugzil.la/1648524
    notification_emails:
      - rtestard@mozilla.com
    expires: never
    telemetry_mirror: SIDEBAR_SEARCH
  link:
    type: labeled_counter
    description: |
      The number of links opened from the sidebar, labeled by which sidebar
      panel the click originated from:
        - bookmarks: a bookmark opened from the Bookmarks sidebar panel
        - history: a history link opened from the History sidebar panel
        - synced_tabs: a synced tab opened from the Synced Tabs sidebar
    bugs:
      - https://bugzil.la/1815706
    data_reviews:
      - https://bugzil.la/1815706
    notification_emails:
      - rtestard@mozilla.com
    expires: never
    telemetry_mirror: SIDEBAR_LINK
  chatbot_icon_click:
    type: event
    description: >
      The chatbot icon was clicked.
    bugs:
      - https://bugzil.la/1923972
    data_reviews:
      - https://phabricator.services.mozilla.com/D226681
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      sidebar_open:
        type: boolean
        description: Whether the sidebar is expanded or collapsed.
  history_icon_click:
    type: event
    description: >
      The history icon was clicked.
    bugs:
      - https://bugzil.la/1923972
    data_reviews:
      - https://phabricator.services.mozilla.com/D226681
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      sidebar_open:
        type: boolean
        description: Whether the sidebar is expanded or collapsed.
  synced_tabs_icon_click:
    type: event
    description: >
      The synced tabs icon was clicked.
    bugs:
      - https://bugzil.la/1923972
    data_reviews:
      - https://phabricator.services.mozilla.com/D226681
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      sidebar_open:
        type: boolean
        description: Whether the sidebar is expanded or collapsed.
  bookmarks_icon_click:
    type: event
    description: >
      The bookmarks icon was clicked.
    bugs:
      - https://bugzil.la/1923972
    data_reviews:
      - https://phabricator.services.mozilla.com/D226681
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      sidebar_open:
        type: boolean
        description: Whether the sidebar is expanded or collapsed.
  open_tabs_icon_click:
    type: event
    description: >
      The open tabs icon was clicked.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2039574
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=2039574
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      sidebar_open:
        type: boolean
        description: Whether the sidebar is expanded or collapsed.
  addon_icon_click:
    type: event
    description: >
      An extension icon was clicked.
    bugs:
      - https://bugzil.la/1923972
    data_reviews:
      - https://phabricator.services.mozilla.com/D226681
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      sidebar_open:
        type: boolean
        description: Whether the sidebar is expanded or collapsed.
      addon_id:
        type: string
        description: The extension's ID.
  passwords_icon_click:
    type: event
    description: >
      The passwords icon was clicked.
    bugs:
      - https://bugzil.la/2008382
    data_reviews:
      - https://phabricator.services.mozilla.com/D278028
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - mtigley@mozilla.com
      - issozi@mozilla.com
      - tthorne@mozilla.com
      - passwords-dev@mozilla.org
    send_in_pings:
      - events
    extra_keys:
      sidebar_open:
        type: boolean
        description: Whether the sidebar is expanded or collapsed.
  keyboard_shortcut:
    type: event
    description: >
      Revamped sidebar toggled with keyboard shortcut.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1897411
    data_reviews:
      - https://phabricator.services.mozilla.com/D229405
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      panel:
        type: string
        description: Sidebar panel is currently open if any.
      opened:
        type: boolean
        description: Whether the sidebar is opening
history:
  sidebar_toggle:
    type: event
    description: >
      The History sidebar panel was loaded or unloaded.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      opened:
        type: boolean
        description: Whether the panel was opened.
      version:
        type: string
        description: The active version of sidebar (either "old" or "new").
synced_tabs:
  sidebar_toggle:
    type: event
    description: >
      The Synced Tabs sidebar panel was loaded or unloaded.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      opened:
        type: boolean
        description: Whether the panel was opened.
      synced_tabs_loaded:
        type: boolean
        description: Whether synced tabs are showing.
      version:
        type: string
        description: The active version of sidebar (either "old" or "new").
bookmarks:
  sidebar_toggle:
    type: event
    description: >
      The Bookmarks sidebar panel was loaded or unloaded.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      opened:
        type: boolean
        description: Whether the panel was opened.
      version:
        type: string
        description: The active version of sidebar (either "old" or "new").
extension:
  sidebar_toggle:
    type: event
    description: >
      A sidebar extension panel was loaded or unloaded.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      opened:
        type: boolean
        description: Whether the panel was opened.
      addon_id:
        type: string
        description: The extension's ID.
      addon_name:
        type: string
        description: The localized name of the extension.
      version:
        type: string
        description: The active version of sidebar (either "old" or "new").
sidebar.customize:
  panel_toggle:
    type: event
    description: >
      The Customize sidebar panel was loaded or unloaded.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      opened:
        type: boolean
        description: Whether the panel was opened.
  icon_click:
    type: event
    description: >
      User clicked on the gear icon to customize the sidebar.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
  chatbot_enabled:
    type: event
    description: >
      User clicked on the checkbox corresponding to chatbot on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1923900
    data_reviews:
      - https://phabricator.services.mozilla.com/D225304
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      checked:
        type: boolean
        description: Whether the box was checked.
  synced_tabs_enabled:
    type: event
    description: >
      User clicked on the checkbox corresponding to synced tabs on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      checked:
        type: boolean
        description: Whether the box was checked.
  history_enabled:
    type: event
    description: >
      User clicked on the checkbox corresponding to history on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      checked:
        type: boolean
        description: Whether the box was checked.
  bookmarks_enabled:
    type: event
    description: >
      User clicked on the checkbox corresponding to bookmarks on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1923900
    data_reviews:
      - https://phabricator.services.mozilla.com/D225304
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      checked:
        type: boolean
        description: Whether the box was checked.
  extensions_clicked:
    type: event
    description: >
      User clicked on the link to go to Browser Extensions on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
  sidebar_display:
    type: event
    description: >
      User selected an option of when the sidebar is shown on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      preference:
        type: string
        description: Either "always" or "hide".
  sidebar_position:
    type: event
    description: >
      User selected an option of in which side the sidebar is displayed from the sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      position:
        type: string
        description: Either "left" or "right".
  tabs_layout:
    type: event
    description: >
      User selected between horizontal or vertical tabs on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      orientation:
        type: string
        description: Either "horizontal" or "vertical".
  tabs_display:
    type: event
    description: >
      User clicked on the checkbox corresponding to hiding horizontal tabs on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      checked:
        type: boolean
        description: Whether the box was checked.
  firefox_settings_clicked:
    type: event
    description: >
      User clicked on the link to Manage Firefox Settings on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1898250
    data_reviews:
      - https://phabricator.services.mozilla.com/D220720
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
  expand_on_hover_enabled:
    type: event
    description: >
      User clicked on the checkbox corresponding to expand on hover on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1930201
    data_reviews:
      - https://phabricator.services.mozilla.com/D233098
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      checked:
        type: boolean
        description: Whether the box was checked.
contextual_manager:
  sidebar_toggle:
    type: event
    description: Client opens Contextual Manager.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1946830
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1947634
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - mtigley@mozilla.com
      - issozi@mozilla.com
      - tthorne@mozilla.com
      - passwords-dev@mozilla.org
    send_in_pings:
      - events
    extra_keys:
      opened:
        type: boolean
        description: Whether the panel was opened.
      version:
        type: string
        description: The active version of sidebar (either "old" or "new").
  passwords_enabled:
    type: event
    description: >
      User clicked on the checkbox corresponding to the "Passwords" entry on sidebar customization settings.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1956952
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1947634
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - issozi@mozilla.com
      - tthorne@mozilla.com
      - passwords-dev@mozilla.org
    send_in_pings:
      - events
    extra_keys:
      checked:
        type: boolean
        description: Whether the Passwords box was checked.
pinned_tabs:
  activations:
    type: labeled_counter
    description: >
      Records how many times a pinned tab gets activated.
    bugs:
      - https://bugzil.la/1966761
    data_reviews:
      - https://phabricator.services.mozilla.com/D253888
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - metrics
    labels:
      - sidebar
      - horizontal_bar
  count:
    type: labeled_quantity
    description: >
      Records how many pinned tabs the user currently has across all windows.
    bugs:
      - https://bugzil.la/1966761
    data_reviews:
      - https://phabricator.services.mozilla.com/D253888
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - metrics
    labels:
      - sidebar
      - horizontal_bar
  pin:
    type: event
    description: >
      Recorded when a user pins a tab.
    bugs:
      - https://bugzil.la/1966761
    data_reviews:
      - https://phabricator.services.mozilla.com/D253888
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      layout:
        type: string
        description: Either "horizontal" or "vertical".
      source:
        type: string
        description: Either "tab_menu", "drag", or "unknown".
  close:
    type: event
    description: >
      Recorded when a user closes a pinned tab.
    bugs:
      - https://bugzil.la/1966761
    data_reviews:
      - https://phabricator.services.mozilla.com/D253888
    data_sensitivity:
      - interaction
    expires: never
    notification_emails:
      - vsabino@mozilla.com
    send_in_pings:
      - events
    extra_keys:
      layout:
        type: string
        description: Either "horizontal" or "vertical".
browser.ui.interaction:
  sidebar_bookmarks:
    type: labeled_counter
    description: >
      Records the count of actions taken within the sidebar Bookmarks panel.
    bugs:
      - https://bugzil.la/2032239
    data_reviews:
      - https://phabricator.services.mozilla.com/D296255
    data_sensitivity:
      - interaction
    notification_emails:
      - jsudiaman@mozilla.com
    expires: never
    no_lint:
      - COMMON_PREFIX
    labels:
      - search
      - open_in_new_tab
      - open_in_new_container_tab
      - open_in_new_window
      - open_in_private_window
      - edit_bookmark_confirmed
      - edit_bookmark_cancelled
      - cut_bookmark
      - copy_bookmark_url
      - add_bookmark_confirmed
      - add_bookmark_cancelled
      - add_bookmark_folder_confirmed
      - add_bookmark_folder_cancelled
      - rename_bookmark_folder_confirmed
      - rename_bookmark_folder_cancelled
      - add_separator
      - open_all_bookmarks
      - sort_bookmarks_by_name

  sidebar_synced_tabs:
    type: labeled_counter
    description: >
      Records the count of actions taken within the sidebar Synced Tabs panel.
    bugs:
      - https://bugzil.la/2032239
    data_reviews:
      - https://phabricator.services.mozilla.com/D296255
    data_sensitivity:
      - interaction
    notification_emails:
      - jsudiaman@mozilla.com
    expires: never
    no_lint:
      - COMMON_PREFIX
    labels:
      - search
      - open_in_new_window
      - open_in_private_window
      - close_tab_on_connected_device
      - bookmark_tab_confirmed
      - bookmark_tab_cancelled
      - copy_link

  sidebar_history:
    type: labeled_counter
    description: >
      Records the count of actions taken within the sidebar History panel.
    bugs:
      - https://bugzil.la/2032239
    data_reviews:
      - https://phabricator.services.mozilla.com/D296255
    data_sensitivity:
      - interaction
    notification_emails:
      - jsudiaman@mozilla.com
    expires: never
    no_lint:
      - COMMON_PREFIX
    labels:
      - search
      - open_in_new_tab
      - open_in_new_container_tab
      - open_in_new_window
      - open_in_private_window
      - delete_from_history
      - clear_all_website_data_confirmed
      - clear_all_website_data_cancelled
      - clear_history_confirmed
      - clear_history_cancelled
      - bookmark_tab_confirmed
      - bookmark_tab_cancelled
      - copy_link

  sidebar_sort_history:
    type: event
    description: >
      Records when a user applies a sort to the sidebar History panel.
    bugs:
      - https://bugzil.la/2032239
    data_reviews:
      - https://phabricator.services.mozilla.com/D296255
    data_sensitivity:
      - interaction
    notification_emails:
      - jsudiaman@mozilla.com
    expires: never
    no_lint:
      - COMMON_PREFIX
    extra_keys:
      sort_type:
        type: string
        description: >
          One of "date", "site", "date_and_site", "last_visited".
