-
Notifications
You must be signed in to change notification settings - Fork 649
Add Cargo.toml copy button to crate rows #1897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
To copy the most recent version of a crate to the clipboard, users would have to go to the crate's individual page. However, it would probably be convenient to have the same control on the search results page. To accomplish this, a new component was created to encapsulate the copy control and its notifications (success/failure). Fixes rust-lang#1587
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @carols10cents (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much!!! The copy button works great!!
I wonder if it would look better if the copy button was after the crate name and before the badge? So that the crate name could still be left-aligned and directly above the description? I'm not a designer, but wdyt? I moved the markup over in the browser; the vertical alignment of the crate name, the copy button, and the version badge is messed up but I'm not sure how best to fix it:
Also, when doing a search and there's a crate whose name matches the search exactly, the "Copied!" text overlaps the clipboard icon a bit for that result:
Could you try resolving those two things? I'm not great at CSS, but I can spend a bit more time poking at it if you need help.
Also don't worry about the percy failure right now, we're changing the UI so that's expected. I'll approve the changes once we've got them the way we want them.
Thank you!!!
Thank you for the input! Now that I see the copy button to the left of the crate name, I think I like that better. As for the location of the "Copied!" text, I know the problem and I'll correct it. |
This allows the name to stay left-aligned. Also, space the "Copied!" text in a way that better adapts to high DPI displays.
Divs inside of exact matches get a lot of padding, whereas other search results don't. Defining 0 padding for this div makes the positioning correct.
I fixed the notification positioning. It was incorrect in exact matches (like your screenshot). |
Looks great!!! Thank you so much!! @bors r+ |
📌 Commit f24e3b3 has been approved by |
…ents Add Cargo.toml copy button to crate rows To copy the most recent version of a crate to the clipboard, users would have to go to the crate's individual page. However, it would probably be convenient to have the same control on the search results page. To accomplish this, a new component was created to encapsulate the copy control and its notifications (success/failure). This new component was added to the search result page; the crate page was reworked to use it as well. For this first run at the UI, I added the same copy button to the left of the name/link for the result. I'm open to any other ideas too! Here are some screenshots to illustrate the changes: ### Crate Page   ### Results Page  Fixes #1587
☀️ Test successful - checks-travis |
To copy the most recent version of a crate to the clipboard, users would have to go to the crate's individual page. However, it would probably be convenient to have the same control on the search results page. To accomplish this, a new component was created to encapsulate the copy control and its notifications (success/failure). This new component was added to the search result page; the crate page was reworked to use it as well.
For this first run at the UI, I added the same copy button to the left of the name/link for the result. I'm open to any other ideas too!
Here are some screenshots to illustrate the changes:
Crate Page
Results Page
Fixes #1587