Skip to content

Add yank button to the web UI #2623

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

Merged
merged 6 commits into from
Aug 24, 2020
Merged

Add yank button to the web UI #2623

merged 6 commits into from
Aug 24, 2020

Conversation

thiagoarrais
Copy link
Contributor

@thiagoarrais thiagoarrais commented Jul 10, 2020

Trying to fix #1659

This adds a yank/unyank button to the crate and versions pages.

By the way, I'm learning Ember and the crates.io codebase for this one. Please review accordingly. I'm assuming that there is a lot of things out of place. Just let me know where everything should go.

Some questions:

  1. I've based this button on the edit email button from the account page, but had to make it smaller because of lack of screen real estate. Is that ok? If so, should this live in the component's yank-button.module.css or should I create a .smaller entry in shared/buttons.module.css?

  2. Added yank-button.js just to specify an empty tag name that in turn makes Ember avoid generating an enclosing div that breaks styling. Is there a cleaner way to do that?

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sgrif (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.

@thiagoarrais thiagoarrais force-pushed the yank branch 2 times, most recently from 9178683 to 2663aa5 Compare July 10, 2020 17:37
@thiagoarrais thiagoarrais marked this pull request as draft July 20, 2020 17:07
@thiagoarrais thiagoarrais marked this pull request as ready for review July 23, 2020 18:20
@thiagoarrais thiagoarrais changed the title WIP: Adds yank button to the web UI Adds yank button to the web UI Jul 23, 2020
@thiagoarrais
Copy link
Contributor Author

Tagging @carols10cents (original issue author), @locks (original issue assignee) and @sgrif (pull request assignee) for review.

Folks, the crates.io codebase is very nice to work with. Special thanks for the folks that wrote the contributing guide. Just let me know if you need anything else.

@jtgeibel
Copy link
Member

Hey @thiagoarrais thanks for the PR! Several volunteers on the team are on vacation right now, so it may take a while to get this merged, but I've tried this out locally and have a few initial suggestions.

On the page showing all versions of a crate, we can probably get rid of the green arrow. This is a small click target (right next to the new buttons) and links to the same page as the version text on the left.

image

On the crate pages, I'm not sure about having this shown for each version:

image

I think instead of showing the button here, we could show this at the top of the version-specific pages (so crates/name/0.1.0 but not /crates/name). Maybe next to the follow/unfollow button. Then a user can go to the version page if they want to yank several versions at once, or to a specific version to modify it. I don't think it's necessary to add the buttons to the bullet point list here.

Since it no longer appears in the screen-real-estate-impaired latest
versions short list
@thiagoarrais thiagoarrais changed the title Adds yank button to the web UI Add yank button to the web UI Jul 28, 2020
@thiagoarrais
Copy link
Contributor Author

Thanks for the review, @jtgeibel!

Regarding the idea of moving the button to the page header. This is what I came up with so far:

Captura de tela de 2020-07-29 13-46-33

I really like this idea. I've chose to place the yank button next to the version number. I think this makes it clearer that this is an action specific to that version, as opposed to an overall crate action (like the follow button). But I haven't got a ton of design skills and the button now seems a little out of place. Any ideas for making this better?

By the way, I've also removed the green arrow from the owner view.

@thiagoarrais
Copy link
Contributor Author

thiagoarrais commented Jul 30, 2020

Here are some options for the positioning of the yank button. This PR uses the first option for the time being, but it still needs some work. I'm also open to other options, of course. What do you folks think?

Option A: Small button next to the version number

option-1-next-to-version

This is the current approach written into this PR. I think it makes clear(er) that the action refers to the specific version. We may assume that crate authors are already used to yanking versions (and not full-blown crates), but I think being more specific here avoids some confusion.

That said, this needs some layouting work. I can't pinpoint exactly why, but the button as is looks a little out of place to me.

Option B: Large button next to the follow button

option-3-next-to-follow

This one avoids the positioning problem, but it may be confusing for crate authors. It may look like the yank action refers to the crate itself, not the specific version. This is aggravated by the presence of the follow button, that does trigger an action referring to the crate, not the version. Which brings us to...

Option C: Large button replacing the follow button

option-2-replacing-follow

This is a variation of the previous approach. In my opinion, it may also be confusing. But at least here we have fewer buttons polluting the interface. That said though, maybe the yank button gets "invisible" because of crate owners being used to that area of the screen belonging to the follow button (both prior this PR and when viewing thirdy party crates).

@locks
Copy link
Contributor

locks commented Aug 24, 2020

@bors r=@locks

@bors
Copy link
Contributor

bors commented Aug 24, 2020

📌 Commit fca52d6 has been approved by locks

@bors
Copy link
Contributor

bors commented Aug 24, 2020

⌛ Testing commit fca52d6 with merge 6894987...

@bors
Copy link
Contributor

bors commented Aug 24, 2020

☀️ Test successful - checks-travis
Approved by: locks
Pushing 6894987 to master...

@bors bors merged commit 6894987 into rust-lang:master Aug 24, 2020
bors added a commit that referenced this pull request Sep 19, 2020
…iagoarrais

Temporarily remove yank button from crate header

Temporarily remove the yank button from the crate page until we find better placement for the button. The buttons added to the all versions page in #2623 remain.

I would like to merge this as a temporary fix to unblock deploying to production. I've opened #2794 to track adding this back.

r? `@locks`
cc `@thiagoarrais`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have a way to yank a crate from the UI
6 participants