Skip to content

add copy button & track installs#5616

Merged
ilayda-cp merged 2 commits intomainfrom
WD-34572-more-metrics
Mar 10, 2026
Merged

add copy button & track installs#5616
ilayda-cp merged 2 commits intomainfrom
WD-34572-more-metrics

Conversation

@ilayda-cp
Copy link
Copy Markdown
Contributor

@ilayda-cp ilayda-cp commented Mar 10, 2026

Done

  • add copy button to snap install command text
  • track install buttons

How to QA

  • Go to https://snapcraft-io-5616.demos.haus/vault
  • click on the " channel button" (under the snap name should be something like 1.19/stable 1.19.5)
  • Hover on a row
  • Click on the "Install >" button
    • an event should be added to batch "snap_details_channel_version_install"
  • Click on "View in Desktop Store" button
    • an event should be added to batch "snap_details_channel_view_in_desktop_store"
  • Click on the copy button that is located right side of the command
    • an event should be added to batch "snap_details_channel_copy_install_command"
  • Click on the green install button
    • an event should be added to batch "snap_details_install_button"
  • Click on "View in Desktop Store" button
    • an event should be added to batch "snap_details_view_in_desktop_store"
  • Click on the copy button that is located right side of the command
    • an event should be added to batch "snap_details_copy_install_command"

Testing

  • This PR has tests
  • No testing required (explain why):

Security

  • Security considerations for review (list them):
    • Examples:
    • Access control: users can only access their own data
    • Input: user input is validated and sanitised
    • Sensitive data: secret or private data is not exposed in any way
    • ...
  • This PR has no security considerations (explain why):

Issue / Card

Fixes https://warthogs.atlassian.net/browse/WD-34572

UX Approval

  • This PR does not require UX approval
  • This PR does require UX approval (add context):

@webteam-app
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@steverydz steverydz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Just one small change requested in the code

<div class="p-code-snippet" style="position: relative;">
<pre class="p-code-snippet__block--icon"><code id="snap-install">{{ install_snippet(
package_name, default_track, lowest_risk_available, confinement) }}</code></pre>
<button class="u-no-margin--bottom" title="Copy to clipboard" data-js="copy-install-command" data-copy-target="snap-install" data-analytics-click data-analytics-target="snap_details_copy_install_command" data-analytics-channel="{{ default_track }}/{{ lowest_risk_available }}" style="position: absolute; top: 0.5rem; right: 0.5rem; background: transparent; border: none; cursor: pointer; padding: 0.25rem;"><i class="p-icon--copy" style="opacity: 0.7;"></i></button>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put some text inside the i tags as not all screen readers read out title attributes.

<div class="p-code-snippet">
<div class="p-code-snippet" style="position: relative;">
<pre class="p-code-snippet__block--icon is-wrapped"><code id="snap-install-alt">sudo snap install {{ package_name }}${paramString}</code></pre>
<button class="u-no-margin--bottom" title="Copy to clipboard" data-js="copy-install-command" data-copy-target="snap-install-alt" data-analytics-click data-analytics-target="snap_details_channel_copy_install_command" data-analytics-channel="${channel}" style="position: absolute; top: 0.5rem; right: 0.5rem; background: transparent; border: none; cursor: pointer; padding: 0.25rem;"><i class="p-icon--copy" style="opacity: 0.7;"></i></button>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@ilayda-cp ilayda-cp merged commit c8894c6 into main Mar 10, 2026
14 checks passed
@ilayda-cp ilayda-cp deleted the WD-34572-more-metrics branch March 10, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants