Skip to content

Displays unread message counts of muted streams and topics. #802

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

manojkestur
Copy link
Collaborator

This PR displays unread message count of muted streams and topics.
Names of muted streams and topics are displayed in a different color instead of 'M'.

Fixes #209

@zulipbot zulipbot added size: M [Automatic label added by zulipbot] bug Something isn't working enhancement New feature or request labels Sep 27, 2020
@manojkestur
Copy link
Collaborator Author

@neiljp Can you review this PR

Copy link
Collaborator

@neiljp neiljp left a comment

Choose a reason for hiding this comment

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

@manojkestur Hey! Thanks for taking an interest in the project!

You're addressing part of quite an old issue, so the scope of what to do is perhaps less clear than it was, making this more challenging than it might be!

Your git commit text matches our current style 👍 However, it would be useful to separate each change to the muted stream/topic text and counts (UI) into separate commits, and definitely keep that work separate from any change to the logic. That will aid in assessing which of these aspects to go forward with, and understanding more clearly what changes you're making in each case.

I've tried the PR:

  • This is how I noticed the varying unread counts values; having it in a separate commit it might be clearer what is intended there
  • Indicating the muted elements with the text styling is definitely an improvement 👍 Though, I think it might need tuning in some themes since we likely want to have the text faded slightly, but not as unreadable as it seems in eg. the light theme?
  • I'm less clear on just showing the counts of muted streams, as it looks like they are contributing towards the unread totals being in the same style. I know this was suggested in the original issue, so we should discuss that - we could style the muted counts differently, or maybe use a different character than M? I'm not personally completely convinced it's important to show a count when it's muted though.

I'm going to start a conversation at chat.zulip.org in #zulip-terminal regarding this - you're welcome to join in and comment :)

Comment on lines 170 to 171
('muted_stream', 'light gray', 'black',
None, DEF['light_gray'], DEF['black']),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please align these so they look like the surrounding layout - similarly in the other locations you added.

stream_topic = (stream_id, stream['topic'])
unread_counts['unread_topics'][stream_topic] = count
if not unread_counts['streams'].get(stream_id):
unread_counts['streams'][stream_id] = count
else:
unread_counts['streams'][stream_id] += count
if stream_id not in model.muted_streams:
if stream_id not in model.muted_streams and not topic_muted:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This and the other associated changes (in this file and elsewhere) appear to be a separate bugfix - is that correct? If so, it would be good to place these changes in a separate commit.

If this is intended as a bugfix, I'm a little concerned this correct, since the unread counts appear very different to running the current git version.

@@ -242,6 +245,8 @@
None, YELLOW, BLACK),
('edit_time', 'light blue', 'black',
None, LIGHTBLUE, BLACK),
('muted_stream', 'yellow', 'black',
Copy link
Collaborator

Choose a reason for hiding this comment

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

You're applying this to both streams and topics, and specifically only the text names, so it'd be good to use a more general name - perhaps muted_name?

@neiljp neiljp added PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback and removed bug Something isn't working labels Oct 6, 2020
@manojkestur
Copy link
Collaborator Author

@neiljp Thanks for the review. I will make the suggested changes.

@manojkestur
Copy link
Collaborator Author

I have to do 2 separate commits for dimming muted streams and displaying counts right?

@neiljp
Copy link
Collaborator

neiljp commented Oct 7, 2020

@manojkestur That would be preferable, as we can always then pick just one commit to apply easily, separate from the other. If commits are earlier in a branch then they are less likely to have dependencies upon your other commits and easier to 'cherry pick' separately.

@neiljp
Copy link
Collaborator

neiljp commented Oct 27, 2020

@manojkestur I'm not sure if you're ready for a review of this yet, but from a quick scan I can see you have a few unrelated changes in commits, and you replaced the M in one commit by an empty string only to replace that in the next commit (it'd be cleaner to leave it as 'M' and change it in the second).

Re the mute symbol, it looks a little strange here, particularly with a smaller font, though I've not found a better unicode symbol. Did you look at many? Are you available to discuss on chat.zulip.org some time?

@manojkestur
Copy link
Collaborator Author

manojkestur commented Oct 27, 2020

@neiljp I thought only dimming of muted streams and topic without M was needed. Now i will change that to M.
I saw same unicode symbols with different styling but when i pasted it, it's taking basic unicode symbol only.
Yes, i am available to discuss on chat.zulip.org.

@zulipbot zulipbot added size: L [Automatic label added by zulipbot] and removed size: M [Automatic label added by zulipbot] labels Oct 27, 2020
@zulipbot zulipbot added size: M [Automatic label added by zulipbot] and removed size: L [Automatic label added by zulipbot] labels Oct 28, 2020
@manojkestur manojkestur force-pushed the issue-209 branch 3 times, most recently from 9ed95ef to 78f9e5d Compare October 28, 2020 11:01
@zulipbot zulipbot added size: M [Automatic label added by zulipbot] size: L [Automatic label added by zulipbot] and removed size: S [Automatic label added by zulipbot] size: M [Automatic label added by zulipbot] labels Oct 28, 2020
@manojkestur
Copy link
Collaborator Author

@neiljp I have done the suggested changes.Let me know if any changes required.

@manojkestur
Copy link
Collaborator Author

collage

@zulipbot zulipbot added size: M [Automatic label added by zulipbot] and removed size: L [Automatic label added by zulipbot] labels Nov 5, 2020
@zulipbot zulipbot added size: S [Automatic label added by zulipbot] and removed size: M [Automatic label added by zulipbot] labels Nov 5, 2020
@manojkestur manojkestur force-pushed the issue-209 branch 2 times, most recently from 70bb31e to cab45e9 Compare November 5, 2020 17:16
@zulipbot zulipbot added size: M [Automatic label added by zulipbot] and removed size: S [Automatic label added by zulipbot] labels Nov 5, 2020
@manojkestur
Copy link
Collaborator Author

final display

@manojkestur
Copy link
Collaborator Author

@neiljp I have resolved the conflicts and have done the required changes.

@neiljp
Copy link
Collaborator

neiljp commented Nov 6, 2020

@manojkestur Thanks for rebasing and updating the last commit 👍

I do like the possibility of this remaining change, though as I indicated when we discussed it in the stream, I also like the idea of not being distracted by whatever the counts are in those muted streams. Having the option of being like the webapp does appear useful in any case, though I've started a discussion in #general to better understand the motivation in the webapp.

This commit does seem to render OK at first glance, but doesn't respond to muting events properly? I also don't understand at first reading why you are adjusting the helper code. The internal data should be being updated properly, but please let us know if you've found a bug in the logic there - though we should keep that different from changing how the UI is styled.

The key methods - at least for streams - are mark_muted and mark_unmuted. Can we just update those to use the update_coiunt method, perhaps with an optional parameter for the muted style, the same as we have for the text color?

@manojkestur
Copy link
Collaborator Author

manojkestur commented Nov 6, 2020

@neiljp I have checked the muted events multiple times it is working fine.
When topic is muted and stream is not muted, unread messages were not added to all messages, but when we mute the stream where muted topic resides, all messages count was reducing. To fix this bug I have done little changes in model.py and helper.py.
Unread count was not updated when stream was muted so I changed that in helper.py.
I have kept unread_count_color as parameter in update_count

@neiljp neiljp added PR needs review PR requires feedback to proceed and removed PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback labels Nov 21, 2020
Base automatically changed from master to main January 30, 2021 20:31
@zulipbot
Copy link
Member

Heads up @manojkestur, 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/main branch and resolve your pull request's merge conflicts accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request has conflicts PR needs review PR requires feedback to proceed size: M [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Left-sidebar doesn't show muted topic/stream unread count
3 participants