-
-
Notifications
You must be signed in to change notification settings - Fork 278
Visually separate pinned and unpinned streams while searching #705
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
@preetmishra This looks like a useful visual improvement 👍 |
a8fc6c1
to
22a9e26
Compare
@kaustubh-nair Thanks for the bug report. 👍 I couldn't notice it initially it as I only have a few streams pinned and the stream list would update past the pinned streams whenever I cleared the search with backspace (#700 will fix this). However, with a bunch of streams pinned, it was pretty straightforward to reproduce. I have pushed an update that will resolve the bug. |
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.
@preetmishra This looks good 👍 I'm surprised how much of a difference this makes to the search result display, but it demonstrates how we order the results, which perhaps explains why :)
As per my inline comment, I think the refactor doesn't belong in helper.py
. That's both since we're basically generating a UI element, and if we treat it as literally a subclass then it fits with the others in UI files; it also has the workaround which refers to the StreamButton
, so that points towards keeping it together with UI code too. We don't note what to have in helper.py
, but I'd prefer to limit it as much as possible, where the code could belong with the other M/V/C components.
22a9e26
to
d31e169
Compare
d31e169
to
58d8a4e
Compare
@neiljp Thanks for the review and the pointers. I have extracted the divider as a subclass now and moved it into in |
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.
@preetmishra Just a few minor points to consider 👍
This extracts StreamsViewDivider from streams_view as a class (subclass of urwid.Divider) to facilitate code reusability. Tests added and amended.
This uses StreamsViewDivider to insert a divider between the pinned and the unpinned streams. Test amended. Fixes zulip#577.
58d8a4e
to
c43f8dd
Compare
@neiljp Thanks for the review. I have incorporated all the suggestions in the latest update. |
@preetmishra Thanks for working on this! I'm merging this now 🎉 |
The first commit is a refactor that extracts
streams_view_divider()
fromstreams_view()
.The
streams_view_divider()
is used in the second commit, inupdate_streams
, for inserting a divider between search results.Fixes #577.