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

Add button to view @ mentions. #433

Closed
wants to merge 5 commits into from

Conversation

sumanthvrao
Copy link
Member

@sumanthvrao sumanthvrao commented Jul 16, 2019

This PR adds support to view @ mentioned messages. Any feedback regarding this is welcomed.

Solves #425

@zulipbot zulipbot added the size: L [Automatic label added by zulipbot] label Jul 16, 2019
@amanagr
Copy link
Member

amanagr commented Jul 16, 2019

One thing I noticed is that if there are two message of the same narrow (say #zt>some topic), and if I narrow using one of them via S/z from the @mention narrow to some topic and come back to @mention narrow and select the other msg of the same narrow (some topic) and press z, it's focus is still set on the previous message. This might come as a separate PR btw.

@sumanthvrao
Copy link
Member Author

@amanagr Not sure why, But I'm not able to reproduce this. How are you coming back to the @mention narrow? (By selecting it from the left sidebar?).

My steps:

  • Went to @mention narrow and clicked on #checkin>sumanth which has multiple mentioned messages. I clicked on the top and used z, which zoomed into Checkin stream
  • I again went to @mention narrow choosing from side bar and did the same on the other message. Which took me to the correct focus.

Am I doing anything wrong?

@amanagr
Copy link
Member

amanagr commented Jul 19, 2019

I am also unable to reproduce it now :|

@zulipbot zulipbot added size: XL [Automatic label added by zulipbot] and removed size: L [Automatic label added by zulipbot] labels Jul 20, 2019
@sumanthvrao
Copy link
Member Author

@neiljp FYI. Updated this with tests. Its now ready for a review.

@sumanthvrao sumanthvrao changed the title [WIP] Add button to view @ mentions. Add button to view @ mentions. Jul 20, 2019
@sumanthvrao
Copy link
Member Author

@neiljp Resolved conflicts and rebased this. Do you have time to give it a review?

@sumanthvrao sumanthvrao force-pushed the zt-add-mentions-buttons branch 6 times, most recently from 785f430 to f6e5301 Compare March 2, 2020 02:44
@sumanthvrao
Copy link
Member Author

This PR has be split up as :

  • The first 3 commits adds the necessary support functions involving the new 'mentioned messages' narrow; These involve - create narrow, get id's in narrow and show all messages in the narrow. Tests have been added in the respective commits as well.
  • The next 3 commits are UI related. They help register the new hotkey (#) , connect it via keypress and change the search bar text as well.
  • The 7th and 8th commit - create the UI button for the 'mentioned messages' and connect it via the UI.
  • The last commit classifies the unread messages so that the UI button can be marked with them.

I have separated the commits which involve the scenario when a mentioned message is received after ZT has started. I have kept these in a separate branch and will work on these shortly.

@neiljp @amanagr

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.

@sumanthvrao Thanks for looking at this again - it may just be 3 fewer commits, or the reworking you did, but this feels good 🎉
I think if the first 6 commits (by git, not per github!) can be polished then these will allow a good initial partial merge, allowing the narrowing to work with # (maybe with that squash mentioned). Then the button code and dynamic updates can be integrated separately.

Hopefully the comments are clear, but as always let me know here and/or on czo.

zulipterminal/core.py Outdated Show resolved Hide resolved
tests/ui/test_ui_tools.py Outdated Show resolved Hide resolved
zulipterminal/ui_tools/boxes.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
zulipterminal/config/keys.py Outdated Show resolved Hide resolved
zulipterminal/ui.py Outdated Show resolved Hide resolved
zulipterminal/ui_tools/buttons.py Show resolved Hide resolved
zulipterminal/ui_tools/views.py Show resolved Hide resolved
@sumanthvrao
Copy link
Member Author

@neiljp Thanks for the review. I have updated the PR with the changes requested.

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.

@sumanthvrao Other than the possible extra comment note and Narrow to in the README/help_text, I'd like to merge the first 5 commits ASAP. You have a different git name for one of those commits though - if you want to maintain the original name, we can do that before merging those 5 too.

I've left a small note re the button spacing; there may be a few other issues, but I've run out of time to look further right now.

zulipterminal/core.py Outdated Show resolved Hide resolved
zulipterminal/ui_tools/buttons.py Outdated Show resolved Hide resolved
@sumanthvrao
Copy link
Member Author

sumanthvrao commented Mar 5, 2020

@neiljp What do you want the README/help text to say. I think Messages in which you're mentioned seems good.

The new commit message was because I squashed 2 commits from the previous version. I have updated the commit heading to be the first one of the squashed commits.

I didn't exactly get what changes you wanted wrt button spacing.

Besides this, if there are no more changes, let's get it merged ASAP :)

@sumanthvrao sumanthvrao force-pushed the zt-add-mentions-buttons branch 4 times, most recently from 5a52631 to 993cf2a Compare March 7, 2020 04:22
@neiljp
Copy link
Collaborator

neiljp commented Mar 7, 2020

@sumanthvrao The first 5 are merged; now onto more UI :) 🎉

I think the other work is updating while ZT is running, and possibly the all-mentions aspect?

@sumanthvrao
Copy link
Member Author

Thanks @neiljp !

@zulipbot zulipbot added size: M [Automatic label added by zulipbot] and removed size: XL [Automatic label added by zulipbot] labels Mar 7, 2020
If user is in 'mentioned' view and a new mentioned
message arrives, we need to append it to current view.

Tests added.
On startup, we classify any unreads which belong to mentioned stream
so that we can mark the MentionedButton with the correct mentioned
count.

Tests added.
@zulipbot zulipbot added size: L [Automatic label added by zulipbot] and removed size: M [Automatic label added by zulipbot] labels Mar 8, 2020
@neiljp neiljp added the PR needs review PR requires feedback to proceed label Mar 9, 2020
Copy link
Member

@kaustubh-nair kaustubh-nair left a comment

Choose a reason for hiding this comment

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

LGTM!
I've tested this locally and everything works great for me.
Also, the commits look concise and well organized. 👍

@sumanthvrao
Copy link
Member Author

Thanks for the review @kaustubh-nair! Glad to see there are no errors. :)

@neiljp
Copy link
Collaborator

neiljp commented Apr 9, 2020

@sumanthvrao I just merged the rest of these commits manually, after slightly adjusting the last one to fit with the recent changes to set_count - working well so far, thanks! 🎉

Some commits are quite small, but we put in a lot of related effort before this - though some extra tests may be warranted?

@preetmishra
Copy link
Member

@sumanthvrao Awesome work! This looks great. 👍

@sumanthvrao
Copy link
Member Author

@neiljp Thanks for taking time to review this and I'm glag to finally get it merged.

Thanks @preetmishra :)

@sumanthvrao sumanthvrao deleted the zt-add-mentions-buttons branch April 10, 2020 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR needs review PR requires feedback to proceed size: L [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants