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

left_sidebar: Add option to hide summary unread counters. #29257

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

akarsh-jain-790
Copy link
Collaborator

@akarsh-jain-790 akarsh-jain-790 commented Mar 10, 2024

Adds a user-configurable option to hide unread counters in the left sidebar. Users now have the flexibility to choose whether they want these counters displayed or hidden, reducing distraction for those who find them disruptive.

Fixes: #28759

Screenshots and screen captures:

Show/Hide Unread Counter Option:

Added a "Show unread counter" / "Hide unread counter" option as the second item in the home view menu.

Screenshot 2024-02-22 at 12 03 43 PM

Screenshot 2024-03-16 at 9 59 56 PM Screenshot 2024-03-16 at 10 15 42 PM

Preferences Setting:

Added a "Show unread message totals on home view and streams" checkbox under SETTINGS / PREFERENCES > Advanced, just below the "Show unread counts for" setting.

Screenshot 2024-03-14 at 12 23 22 AM

When "Show Unread Counter" is selected for "No streams":

more Screenshots Unread counters will not be visible in the left sidebar for streams. Screenshot 2024-02-22 at 12 03 43 PM

When "Hide Unread Counter" is selected:

The counter will be displayed as a dot on both the home view and the STREAMS line.
The actual number will be revealed on hover.

Screenshot 2024-02-22 at 12 03 43 PM

Adjusted the logic to ensure consistency in displaying summary counters in the default left sidebar view and in "more topics"/"more conversations" views.
When "Show unread message totals on home view and streams" is enable:
More Conversations View:

Screenshot 2024-02-22 at 12 03 43 PM

More Topics View:

Screenshot 2024-02-22 at 12 03 43 PM

When "Show unread message totals on home view and streams" is not enable:
More Conversations View:

Screenshot 2024-02-22 at 12 03 43 PM

More Topics View:

Screenshot 2024-02-22 at 12 03 43 PM
Self-review checklist
  • Self-reviewed the changes for clarity and maintainability
    (variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

  • Explains differences from previous plans (e.g., issue description).
  • Highlights technical choices and bugs encountered.
  • Calls out remaining decisions and concerns.
  • Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

  • Each commit is a coherent idea.
  • Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

  • Visual appearance of the changes.
  • Responsiveness and internationalization.
  • Strings and tooltips.
  • End-to-end functionality of buttons, interactions and flows.
  • Corner cases, error conditions, and easily imagined bugs.

@zulipbot zulipbot added size: XL area: left sidebar (features) New left sidebar functionality area: left sidebar (popovers) Left sidebar popovers and tooltips priority: high labels Mar 10, 2024
@akarsh-jain-790 akarsh-jain-790 marked this pull request as draft March 10, 2024 18:20
@akarsh-jain-790 akarsh-jain-790 force-pushed the issue-28759 branch 5 times, most recently from 6c51305 to 520a6c7 Compare March 12, 2024 18:39
@akarsh-jain-790 akarsh-jain-790 marked this pull request as ready for review March 12, 2024 19:05
@alya
Copy link
Contributor

alya commented Mar 13, 2024

@akarsh-jain-790 Has this PR been updated with the latest #design suggestions? If so, please update the screenshots in the PR description, and post a summary comment here about the PR's status.

@akarsh-jain-790
Copy link
Collaborator Author

@alya Yeah, I have update the PR description and is now ready for the initial review.

@timabbott timabbott added the maintainer review PR is ready for review by Zulip maintainers. label Mar 14, 2024
@alya
Copy link
Contributor

alya commented Mar 14, 2024

Things go wrong when views are collapsed:

Screenshot 2024-03-14 at 12 08 14 AM
Screenshot 2024-03-14 at 12 08 03 AM

Please try to test your changes more thoroughly; https://zulip.readthedocs.io/en/latest/contributing/code-reviewing.html#manual-testing has some tips.

@akarsh-jain-790 akarsh-jain-790 force-pushed the issue-28759 branch 3 times, most recently from f41b23d to c9bf798 Compare March 16, 2024 20:03
@akarsh-jain-790
Copy link
Collaborator Author

@alya I have updated the PR and description, can you please re-review.

api_docs/changelog.md Outdated Show resolved Hide resolved
api_docs/changelog.md Outdated Show resolved Hide resolved
const {instance} = event.data;
const data = {};
const home_view_unread_msg_count = user_settings.web_left_sidebar_unreads_count_summary;
data.web_left_sidebar_unreads_count_summary = JSON.stringify(!home_view_unread_msg_count);
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

This is a weird way to construct data; and worse than the similar blocks just above; can you follow those better conventions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for your review. I appreciate your feedback. Regarding the construction of data I took reference from a similar block below:

$popper.one("click", "#toggle_display_starred_msg_count", () => {
                const data = {};
                const starred_msg_counts = user_settings.starred_message_counts;
                data.starred_message_counts = JSON.stringify(!starred_msg_counts);

                channel.patch({
                    url: "/json/settings",
                    data,
                });
                instance.hide();
            });

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Hmm, maybe the right plan is to refactor those as well; the ones above this seem more sensible.

web/src/sidebar_ui.ts Outdated Show resolved Hide resolved
display: none;
}
}
}
}
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

This CSS refactoring is quite hard to understand; can you use some preparatory commits with proper commit messages to explain it?

@akarsh-jain-790
Copy link
Collaborator Author

@timabbott Thanks for the detailed feedback! I've addressed your comments and made the necessary updates to the PR. Let me know if you have any further suggestions.

@akarsh-jain-790 akarsh-jain-790 force-pushed the issue-28759 branch 2 times, most recently from 7fa7f61 to 6e1ff2e Compare April 10, 2024 08:41
@alya
Copy link
Contributor

alya commented Apr 10, 2024

@timabbott Marking for integration review, since you seem to be reviewing this one? Please feel free to re-delegate.

@alya alya added integration review Added by maintainers when a PR may be ready for integration. and removed maintainer review PR is ready for review by Zulip maintainers. labels Apr 10, 2024
This commit adds a user-configurable option to hide unread
counters in the left sidebar. Users now have the flexibility to choose
whether they want these counters displayed or hidden, reducing
distraction for those who find them disruptive.

Fixes: zulip#28759
Moved the CSS rules from .input-append related to hiding and
showing unread counts into a common container style.
In this commit, the .hide-unread-count-summary class is introduced
to  manage the visibility of unread counts within the
selected-home-view section of the left-sidebar-navigation-list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: left sidebar (features) New left sidebar functionality area: left sidebar (popovers) Left sidebar popovers and tooltips integration review Added by maintainers when a PR may be ready for integration. priority: high size: XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to hide summary unread counters in left sidebar
4 participants