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

Skip muted topics and streams on n key #1245

Merged
merged 5 commits into from
Aug 16, 2022

Conversation

neiljp
Copy link
Collaborator

@neiljp neiljp commented Aug 15, 2022

What does this PR do?

This is an adjusted version of the rebuild of #442 in #1239, so if merged will supersede both of those.

The motivation for this was upon considering the test adjustments which were absent in the draft updated PR (#1239), it seemed much more natural to migrate the appropriate function into the model itself. The main logic is therefore the same as #442, but the surrounding code is quite different, including tests.

I'm strongly considering merging this promptly, but I'd welcome a read-through, and testing by anyone who looked at #T1239.

This was discussed in #zulip-terminal > Skip muted topics and streams on 'n' #T442 #T1239
(may update topic name given this PR)

Tested?

  • Manually
  • Existing tests (adapted, if necessary)
  • New tests added (for any new behavior)
  • Passed linting & tests (each commit)

Notes & Questions

This explicitly adds what I believe is the current behavior of ordering by stream id and then topic name. As indicated in #1239, there is likely a lot of scope for improvement beyond that, assuming we want to mimic web app use of this feature.

@neiljp neiljp added bug Something isn't working area: UI General user interface update labels Aug 15, 2022
@neiljp neiljp added this to the Next Release milestone Aug 15, 2022
@zulipbot zulipbot added the size: XL [Automatic label added by zulipbot] label Aug 15, 2022
While functional in the MiddleColumnView, it only relies upon state stored
there and only accessed by itself, as well as model data, so this migrates it
into the model along with that state. This will make it easier to test the core
functionality independently of the UI when we adjust the feature to depend upon
other existing model state such as muted streams and topics.

Also ensure the current behavior is maintained for now by explicitly sorting
the unread topics keys, which previous relied upon the initial and subsequent
data being ordered.

Tests migrated, simplified and set to use valid stream+topic data.
Logic originally developed by Aman Agrawal (amanagr) in zulip#442.

Updated to take into account:
- already-added (slightly different) is_muted[stream|topic] methods
- migration of get_next_unread_topic into model (simplifying tests)

Also ensure the current behavior is maintained for now by explicitly sorting
the unread counts, which previous relied upon the initial and subsequent data
being ordered.

Tests added.

Co-authored by: Aman Agrawal <f2016561@pilani.bits-pilani.ac.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: UI General user interface update bug Something isn't working size: XL [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants