Change Permalink button into dropdown item
What does this MR do and why?
Add a new permalink_dropdown_item.vue component that copies permalink to clipboard with a successful toast. Show new component to blob overflow menu when blob_overflow_menu
flag is on. In the spirt of iteration
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- See design and expected behaviour in #452305 (closed)
- See #452305 (comment 2334139884) for technical context
- As outlined in the issue, this also fixes the following two issues:
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Flag off | Flag on |
---|---|
Screen Recording 2025-02-19 at 9.56.48 AM.mov | Screen Recording 2025-02-19 at 9.46.57 AM.mov |
How to set up and validate locally
- Enable
blob_overflow_menu
and enableblob_repository_vue_header_app
feature flag
Feature.enable(:blob_overflow_menu)
Feature.enable(:blob_repository_vue_header_app)
- Go to a directory
- Go to a file
- The copied link (when flag is on) and the url in the search bar (when flag is off) should match
- This should work when viewing a file with:
- A branch
- A commit (Select Code > Commits > Select a commit > View file)
- A tag
- In all situations, the last selected line number should be append to the end of the link
- Press
y
should work the same as clicking the dropdown item - Blame button remains in the header and should not be impacted by this change
Related to #452305 (closed)
Thank Yous
Huge shout out to @markrian for saving me from the dropdown item <> copy to clipboard <> shortcut mess