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

RFC: Enhancing users list #850

Closed
wants to merge 6 commits into from

Conversation

kartikmaji
Copy link
Contributor

@kartikmaji kartikmaji commented May 31, 2016

  • Star User
  • Sort user according to their starred status
  • After starring user, updating user list needs a reload
  • UI improvements

@smarx
Copy link

smarx commented May 31, 2016

Automated message from Dropbox CLA bot

@krtkmj, it looks like you've already signed the Dropbox CLA. Thanks!

@kartikmaji kartikmaji force-pushed the enhancing-users-list branch from 47291c1 to 36c5432 Compare June 1, 2016 16:22
@neerajwahi
Copy link
Member

@acrefoot could you help @krtkmj with this diff?

@@ -13,6 +13,10 @@ exports.get_by_email = function get_by_email(email) {
return people_dict.get(email);
};

exports.get_star_status = function get_star_status(email) {
return page_params.starred_users.indexOf(email)>=0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This causes a test failure when page_params.starred_users is undefined.

@kartikmaji
Copy link
Contributor Author

@neerajwahi Whenever a user stars another user, I update right panel user list. But, changes in user list is reflected only after page is reloaded. I figured out it is because of stale data (where starred is still retaining the old value) applying activity.update_users doesn't reflect any change. So, updated user_info is problem here and guess this is the problem of hybrid state vs normal state.

@kartikmaji kartikmaji force-pushed the enhancing-users-list branch from 36c5432 to 3a4705b Compare June 3, 2016 19:50
@kartikmaji
Copy link
Contributor Author

@neerajwahi Any suggestion on this UI? Plus, how should it look like if someelse(not starred user) is online, should he/she be on top of the list above starred user?
screenshot from 2016-06-04 16 44 38

@kartikmaji
Copy link
Contributor Author

@neerajwahi I worked around refreshing problem of userlist that I mentioned above. One of the method that I tried is to update page_params in success callback function when user is successfully subscibed/unsubscibed and it worked. Any thoughts?

@kartikmaji kartikmaji force-pushed the enhancing-users-list branch 4 times, most recently from ddd1c9b to f8592d5 Compare June 7, 2016 21:34
@neerajwahi
Copy link
Member

@krtkmj The UI looks pretty good! I'd move the star to the right side of the user name though (so that the names continue to line up vertically)

@acrefoot Could you review @krtkmj's code for this diff?

@kartikmaji kartikmaji force-pushed the enhancing-users-list branch from f1104fe to 9d70c8d Compare June 10, 2016 18:34
@kartikmaji
Copy link
Contributor Author

@neerajwahi @acrefoot updated this PR.

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's combine this and the 0018 migration files if possible.

@acrefoot
Copy link
Contributor

Okay, I'm done reviewing this round. Thanks for your patience in looking over my many comments. The code is fairly sound--I mostly have comments on style and consistency with the rest of the codebase. The two actually buggy things are the manytomanyfield model being symmetrical and that the UI doesn't seem to update to show "Unstar user ____" when I've already starred a user.

Thanks!

@kartikmaji kartikmaji force-pushed the enhancing-users-list branch from ba614c5 to 9d3d768 Compare August 22, 2016 16:52
@kartikmaji
Copy link
Contributor Author

Updated this PR.

@brainwane
Copy link
Contributor

@umairwaheed Could I ask you to take a look at this pull request and give a (non-binding) code review, since this kind of frontend Zulip code is something I gather you're familiar with?

<li>
<a class="star_user">
<i class="icon-vector-star"></i>
{{#tr this}}{{#if starred}}{{t Unstar}}{{else}}{{t Star}}{{/if}} {{t user}} <b>__name__</b>{{/tr}}
Copy link
Member

Choose a reason for hiding this comment

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

You can write it like this as well:
{{#tr this}}{{#if starred}}Unstar{{else}}Star{{/if}} user <b>__name__</b>{{/tr}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't we need to tag keywords Star/Unstar for internationalization?

Copy link
Member

Choose a reason for hiding this comment

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

I think the point is that both {{#tr this}} and {{t Star}} are ways of tagging for i18n, and we only need one of those....

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, the block translation tag, {{#tr this }}, should suffice here.

@@ -21,7 +21,7 @@
<li>
<a class="star_user">
<i class="icon-vector-star"></i>
{{#tr this}}{{#if starred}}{{t Unstar}}{{else}}{{t Star}}{{/if}} {{t user}} <b>__name__</b>{{/tr}}
{{#tr this}}{{#if starred}}{{t "Unstar"}}{{else}}{{t "Star"}}{{/if}} {{t user}} <b>__name__</b>{{/tr}}
Copy link
Member

Choose a reason for hiding this comment

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

You can write this line like this as well:
{{#tr this}}{{#if starred}}"Unstar"{{else}}"Star"{{/if}} user <b>__name__</b>{{/tr}}

@@ -2,7 +2,7 @@
{{#each starred_users}}
{{partial "user_presence_row"}}
{{/each}}
<hr>
<hr/>
{{#each unstarred_users}}
{{partial "user_presence_row"}}
{{/each}}
Copy link
Member

Choose a reason for hiding this comment

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

This commit can be merged with 681b057

@umairwaheed
Copy link
Member

@brainwane, sure. @krtkmj, added few comments.

@kartikmaji kartikmaji force-pushed the enhancing-users-list branch from 7056324 to 8f47e15 Compare October 3, 2016 11:32
@kartikmaji
Copy link
Contributor Author

@umairwaheed Updated this PR.

@umairwaheed
Copy link
Member

Cool, the code looks good.

@zulipbot
Copy link
Member

Heads up @krtkmj, 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.

@timabbott
Copy link
Member

Closing this, since while it's a useful reference for doing this feature, there's enough merge conflicts that we'll probably want to type it in again before merging.

Thanks for all your work on this @krtkmj!

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.