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

Pin stream (formerly "star stream") #819

Closed
wants to merge 14 commits into from

Conversation

kartikmaji
Copy link
Contributor

@kartikmaji kartikmaji commented May 23, 2016

Star favourite or important streams.
Starred streams will be sorted at the top of Left side stream list.

@neerajwahi

@smarx
Copy link

smarx commented May 23, 2016

Automated message from Dropbox CLA bot

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

@timabbott
Copy link
Member

Looks like this is failing tests? Regardless @neerajwahi @acrefoot can one of you take a look?

@neerajwahi
Copy link
Member

@krtkmj taking a look at this, in the meantime please fix the failing tests.

@kartikmaji kartikmaji force-pushed the star-stream branch 2 times, most recently from 587e7cb to e64761d Compare May 25, 2016 21:09
@kartikmaji
Copy link
Contributor Author

@neerajwahi all tests passing now.

@neerajwahi
Copy link
Member

neerajwahi commented Jun 2, 2016

@krtkmj There are some bugs here. For instance, try starring stream Verona in your dev VM and notice that the threads under Verona are always visible despite switching away to another stream.

I also noticed an intermittent issue where the threads underneath a starred stream get doubled up (look at Verona below):

screenshot 2016-06-01 22 48 40

@kartikmaji
Copy link
Contributor Author

@neerajwahi I guess the purpose of starring stream is that it remains open irrespective of narrowed to any other stream. I also mentioned that in commit message.

And, I am looking for doubled topic list.

@neerajwahi
Copy link
Member

@timabbott The current behavior of this diff is to keep the stream uncollapsed (and the list of threads showing) when a stream is starred regardless of whether that stream is selected. There's discussion around it here: #292

What are your thoughts on this behavior? I personally think it's confusing and makes the starred stream section too cluttered. I initially thought it was a bug until @krtkmj pointed out that it was by design.

@timabbott
Copy link
Member

I think the intent of the current feature is just to sort the pinned streams at the top of the list of streams, and not to keep them always expanded; I agree that we should not combine this feature with the idea in #292. I think #292 probably makes sense to be an independent setting if we were to add that feature, since some users may want one and the not the other behavior..

@kartikmaji
Copy link
Contributor Author

@timabbott @neerajwahi shall we have another button which will be responsible for keeping the stream open? This won't take much time and can add this feature in this pr itself.

@timabbott
Copy link
Member

No, I'd prefer to have that be feature idea be a separate PR and discussion -- let's get this working completely correctly as described, so we can merge it.

As a general rule, it's usually easier to merge multiple features one at a time.

@kartikmaji
Copy link
Contributor Author

@neerajwahi updated the pull request. Please review.

@neerajwahi
Copy link
Member

@krtkmj I think we should remove the settings icon next to the 'Starred' section. It doesn't do what I expect -- control only starred streams -- and the functionality is currently duplicated across both sections.

@timabbott Do you think that starring a stream should remove it from the 'Streams' section, or duplicate it into both sections (acting as more of a shortcut)?

@timabbott
Copy link
Member

Hmm, interesting question. I could see good reason to do it either way. I'd probably start with having it remove it from the "Streams" section, since I think that may be more intuitive, and we can always change that based on feedback.

@timabbott
Copy link
Member

timabbott commented Jun 8, 2016

(Also, I think that will be easier to implement, because with the alternative, we'd have to deal with only doing the topics list expansion in one of the two copies if the user narrows to the stream).

@@ -153,14 +184,15 @@ exports.set_in_home_view = function (stream, in_home) {
}
};

function build_stream_sidebar_row(name) {
function build_stream_sidebar_row (name) {
Copy link
Member

Choose a reason for hiding this comment

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

You added an inadvertent space here. It's a good habit to go through and review the diff yourself before pushing. I usually just run git diff in the console and look through it before I create a PR

@neerajwahi
Copy link
Member

@krtkmj Added some inline comments

@kartikmaji
Copy link
Contributor Author

kartikmaji commented Jun 8, 2016

@timabbott I agree with @neerajwahi but removing settings icon next to "STREAM" may seem like we don't have a settings page for normal streams. Or we can have something like this
screenshot from 2016-06-08 17 42 57

@timabbott
Copy link
Member

timabbott commented Jun 8, 2016

@krtkmj I'm not sure what you mean by "removing settings icon next to stream" but the design in that screenshot is what I had mind for showing the streams themselves.

[edit] Oh, maybe what you're asking is where to put the settings gear? Good question! I would probably just put it next to STARRED and not include ALL STREAMS.

@kartikmaji
Copy link
Contributor Author

@timabbott I guess settings gear just in front of starred stream might be confusing as @neerajwahi commented earlier.
My suggestion is to (referring screenshot posted above) change ALL STREAMS to SUBSCRIBED STREAMS and let settings gear in that same line because clicking that simply opens up "Manage Streams" page. What do you think?

@timabbott
Copy link
Member

That seems reasonable to me.

@timabbott
Copy link
Member

After thinking about this more, I have a a new proposals for how to do the display:

  • We retain the existing "STREAMS" heading, sort the starred teams to the top, and don't add any other new headings.
  • We use a horizontal line to delimit the pinned streams from the rest of the streams.
  • We rename the feature from "Star stream" to "pin stream to stop" (would called the variable on the Subscription object ".pinned").

What do you think @krtkmj and @neerajwahi? I think this would be a clean way to implement this feature without cluttering the UI.

@kartikmaji
Copy link
Contributor Author

I think this will make more sense along with cleaner UI.
But, why change the feature name? Because, "pin stream to stop" may sound like stopping incoming messages.

@kartikmaji
Copy link
Contributor Author

@timabbott This is how it looks now. Pretty decent now. Any suggestion?
cc @neerajwahi
screenshot from 2016-06-12 03 02 25

@timabbott
Copy link
Member

That looks pretty reasonable to me at a high level; I think we could potentially make it nicer by changing the styling (e.g. maybe there's too 2x much space above/below the horizontal line?).

// If no stream filter box is there,
// return all streams.
return streams;
}
Copy link
Member

Choose a reason for hiding this comment

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

Is this change needed? Seems like it is kinda its own change related to the stream filter box functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In file frontend_tests.node_tests.stream_list.js, function test_sort_pin_to_top_streams does not add .stream-list-filter to body. Hence, search_box.expectOne() in line number 31 fails.
So, I added this code if no filter box is detected then return streams without filtering.
Or I can just append .stream-list-filter in body and remove this part of code. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

If this is just for the Node tests, yeah, I'd just create this in the Node test code...

Copy link
Member

Choose a reason for hiding this comment

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

@krtkmj looks like you haven't addressed this in your latest update?

Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is now resolved.

@timabbott
Copy link
Member

Cool, I posted a few comments. Once those are resolved, I think this should be ready to merge from a code perspective. It would be great to clean up the history for this. What I'd love to see is individual commits for the changes whose purpose as part of the "pin streams" feature isn't clear (most of those I posted a question about in my comments above, e.g. some of the CSS and test framework changes), and then rest of the changes squashed together as a single large commit that adds this feature.

Does that make sense @krtkmj?

@kartikmaji
Copy link
Contributor Author

@timabbott updated this PR. Have some doubts that I posted in inline comments.

@neerajwahi
Copy link
Member

@krtkmj Added some inline comments

@timabbott
Copy link
Member

@krtkmj can you fix your git author name to be "Kartik Maji", not your username?

@timabbott
Copy link
Member

I merged the subscriber list sorting as a32167d.

{{else}}
{{t Pin to top }}
{{/if}}
stream <b>{{stream.name}}</b>
Copy link
Member

@timabbott timabbott Jun 30, 2016

Choose a reason for hiding this comment

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

word stream here should also be tagged for translations.

@timabbott
Copy link
Member

Noticed a few other display bugs while trying to merge this; since I need to head home I'm posting my working branch.
https://github.com/timabbott/zulip/commits/starred
Will plan to finish cleaning this up and merge it soon.

@timabbott
Copy link
Member

OK, that ended up being all I needed to do (and in fact, the CSS piece was no longer needed), so I merged this. Huge thanks @krtkmj and @laurenzlong for building this!!!

@timabbott timabbott closed this Jul 1, 2016
@laurenzlong
Copy link

Awesome!! Thanks for all your support Tim!

On Thu, Jun 30, 2016, 10:28 PM Tim Abbott notifications@github.com wrote:

Closed #819 #819.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#819 (comment), or mute the
thread
https://github.com/notifications/unsubscribe/ADzlFJhywnyf4cPUHgHoMV72FPRycxyaks5qRKWYgaJpZM4IkzLt
.

Lauren

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.

5 participants