Skip to content
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

Improve invite modal to include pills and dropdown. #9992

Closed
wants to merge 2 commits into from

Conversation

shubhamdhama
Copy link
Member

Current commits can be merged if they look great, I'll be adding further work soon.

@shubhamdhama shubhamdhama force-pushed the invite-modal-work branch 2 times, most recently from 43945fa to b02eee3 Compare July 20, 2018 10:16
function update_subscription_checkboxes() {
$('#streams_to_add').html(templates.render('invite_subscription', {
streams: exports.get_invite_streams(),
}));
Copy link
Contributor

@showell showell Jul 20, 2018

Choose a reason for hiding this comment

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

nitpick: I prefer a style where you can read the code in the order it happens:

var data = {stream: exports.get_invite_streams()};
var html = template.render('invite_subscription', data);
$('#streams_to_add').html(html)

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, this is way much better, just confused as once I was asked to not prefer variable if used only once, but it makes sense here to use otherwise the line becomes long... so changing it to this

@zulipbot zulipbot added size: XL and removed size: L labels Jul 22, 2018
@shubhamdhama shubhamdhama changed the title [WIP] Improve invite modal to include pills and dropdown. Improve invite modal to include pills and dropdown. Jul 22, 2018
@shubhamdhama
Copy link
Member Author

shubhamdhama commented Jul 22, 2018

Currently, it isn't impressive look wise and we may want a replacement of "Check all and deselect all" so what they should be?
peek 2018-07-22 19-20
For default streams:
peek 2018-07-22 19-20-2

@shubhamdhama
Copy link
Member Author

#7998 can be closed now

Few other feedbacks required:

  • How should streams be sorted in typeahead, currently it's a normal sort i.e. Capital letter sorted first, then lowercase and so on, so should I sort them irrespective of case? Also do we want to keep public streams first and then private or mixed form is fine?
  • Next step would be to show "Lock" icon before private streams?
  • "Add all streams" and "reset" makes sense to be placed somewhere?

<input type="radio" name="invite_as_admin" value="true"/>{{ _('Organization administrators') }}
</label>
<div class="control-group">
<label class="control-label" for"invite_as">{{ _('User(s) join as') }}</label>
Copy link
Member Author

Choose a reason for hiding this comment

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

(for me) TODO: fix for

@timabbott
Copy link
Sponsor Member

Hmm, I thought I'd replied to your questions. I think case-insensitive alphabetical sort is fine to start. And yeah, lock icon for private streams is good.
Let me know when you have this rebased and I'll take a look at the code.

@shubhamdhama shubhamdhama force-pushed the invite-modal-work branch 2 times, most recently from b259d12 to ef342a0 Compare August 4, 2018 16:12
@shubhamdhama
Copy link
Member Author

@timabbott I've rebased the PR and I think first four commits are mergeable.

@timabbott
Copy link
Sponsor Member

Two problems with the first commit:

  • The layout for the dropdown is off -- the label should be in line with the dropdown, not like this image
  • The default value should be "Regular users", not administrators, and we should probably call it "Members" (@rishig assuming we're planning to refactor terminology to that to contrast with "Guests"). I'd call the value "member" too.

@rishig
Copy link
Member

rishig commented Aug 4, 2018

yeah, Members sounds good. I would also make it "Administrators" rather than "Organization administrators".
(Alternatively, "Organization administrators" and "Organization members".)

@timabbott
Copy link
Sponsor Member

The second commit also doesn't work for me:
image

I think the bug is this:

  • var data = {stream: exports.get_invite_streams()};

should be streams:.

I merged commits 3 and 4.

@shubhamdhama
Copy link
Member Author

Okay, I'm updating your second point.
For styling one, you suggested that Max will do the styling work... so I think I should go for styling, he can work later.

@timabbott
Copy link
Sponsor Member

Yeah, on the styling front, I think it's worth your doing the minimal positioning work if it's quick to keep things mergable (i.e. not looking broken); that way we can merge the OK-looking version and then Max can restyle it to look great. Having a window where things are broken in master is difficult to manage.

@shubhamdhama
Copy link
Member Author

Updated the first two commits. Working on improving next two.
screenshot from 2018-08-04 22-37-53

@shubhamdhama shubhamdhama force-pushed the invite-modal-work branch 2 times, most recently from e4a9322 to feb0387 Compare August 6, 2018 08:23
@shubhamdhama
Copy link
Member Author

I've updated the PR with following changes:

  • Changed the stream_pill to invite_stream_pill as first I was thinking to make stream_pills generalized but after much efforts, I think it's better to create separate pills logic.
  • Fixed some CSS issues with stream pills like placeholder text will only appear input box is empty as showing it always makes it wrapping to next line which is because of the small size of invite modal.
  • Streams are sorted irrespective of the case of letters.

For icons I was thinking to do that in separate PR as for that I think I've to do a little refactoring in input_pills.js for custom pill HTML.
So these 4 commits are ready to be reviewed.

@timabbott
Copy link
Sponsor Member

I merged the first two commits; I believe that the dropdown change unblocks what we need for the "Guest users" feature, so we can consider that feature no longer blocked on finishing this.

I'm holding off on the stream pills mostly because I want to talk with @rishig about a use case that the pills don't support well (namely, easily seeing what streams a user isn't being added to as part of deciding how to set things up). I haven't figured out how big of a problem that is, but being able to see which streams were not currently included was a feature I found myself appreciating when setting up an organization for a hackathon this weekend.

@zulipbot
Copy link
Member

zulipbot commented Aug 7, 2018

Heads up @shubhamdhama, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

@rishig
Copy link
Member

rishig commented Aug 8, 2018

hm, interesting thought. For large realms (100+ streams) it seems like not much value, but I can see the benefit for a realm with 10 streams.

I could imagine putting
Not subscribed to: #general, #help, #random
in gray at the bottom of the input box, if it's fewer than 10 streams they are being not-subscribed to, or something like that.

This currently don't affect invite modal as this code will be used
in further commits.
@shubhamdhama
Copy link
Member Author

(okay, let me know when we have reached the final consensus)
my personal feedback for this is that checkboxes were easier to use than input pills.
Maybe we can have a long dropdown which is always opened and just scroll through it to choose a stream along with text input, just like what others do here.

@zulipbot
Copy link
Member

Heads up @shubhamdhama, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

@shubhamdhama
Copy link
Member Author

shubhamdhama commented Oct 3, 2018

Closing this as two commits are merged and as a reference of pills work and also I'm going to work on the new idea suggested here https://chat.zulip.org/#narrow/stream/6-frontend/subject/Invite.20Modal/near/638686

@rishig
Copy link
Member

rishig commented Oct 9, 2018

This question is independent of whether we have pills for the streams list. I do still think some version of this is a good idea, though may have to wait for Tim and I to be able to talk about it.

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.

5 participants