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 Not subscribe tab in channels settings. #30021

Merged
merged 6 commits into from
Jun 4, 2024

Conversation

sujalshah-bit
Copy link
Collaborator

@sujalshah-bit sujalshah-bit commented May 8, 2024

PR summary:

  • Add a Not Subscribed tab to the channels settings that will contain all the channels the user is not subscribed to.
  • Display the text No Channels to show. View all channels. when no channels is available to show.
  • Changes the redirect links for Browse channel and Browse 1 more channels to the Not subscribed tab.
  • Hide the Not subscribed tab if the user is a guest user.
  • Add a tooltip for for the disabled tabs for guests. ( Originally posted by @alya in stream_settings: Add not-subscribed tab to stream settings. #26049 (comment) )

Fixes: #21869

Continuing the works of: #26049


not-subscribed.mp4

tooltip
image
Empty view
image

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
Copy link
Member

zulipbot commented May 8, 2024

Hello @zulip/server-streams members, this pull request was labeled with the "area: stream settings" label, so you may want to check it out!

@sujalshah-bit sujalshah-bit changed the title Not subscribe tab Add Not subscribe tab in channels settings May 8, 2024
@sujalshah-bit sujalshah-bit changed the title Add Not subscribe tab in channels settings Add Not subscribe tab in channels settings May 8, 2024
@sujalshah-bit sujalshah-bit changed the title Add Not subscribe tab in channels settings Add Not subscribe tab in **channels settings**. May 8, 2024
@sujalshah-bit sujalshah-bit changed the title Add Not subscribe tab in **channels settings**. Add Not subscribe tab in channels settings. May 8, 2024
@alya
Copy link
Contributor

alya commented May 8, 2024

Thanks! The tooltip should refer to "channels", not "streams" now.

@sujalshah-bit
Copy link
Collaborator Author

@alya made the changes :)

@timabbott
Copy link
Sponsor Member

@sahil839 can you review this one?

Copy link
Collaborator

@sahil839 sahil839 left a comment

Choose a reason for hiding this comment

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

Posted few comments.

Also, the "Fixes .." line in commit message should be in the last commit which completes all the points mentioned in the issue. In the previous commit, you can write "Fixes part of ..".

web/src/stream_edit.js Outdated Show resolved Hide resolved
web/src/stream_settings_ui.js Show resolved Hide resolved
web/src/stream_ui_updates.js Outdated Show resolved Hide resolved
web/src/stream_settings_ui.js Outdated Show resolved Hide resolved
web/src/hash_util.ts Show resolved Hide resolved
web/src/stream_settings_ui.js Show resolved Hide resolved
web/src/stream_ui_updates.js Show resolved Hide resolved
@sujalshah-bit
Copy link
Collaborator Author

@sahil839 made the changes according to your feedbacks kindly review :)

Copy link
Collaborator

@sahil839 sahil839 left a comment

Choose a reason for hiding this comment

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

Posted one comment. Also, please update the commit message to include "Fixes .." line.

web/templates/subscribe_to_more_streams.hbs Outdated Show resolved Hide resolved
web/src/stream_ui_updates.js Show resolved Hide resolved
@sujalshah-bit
Copy link
Collaborator Author

@sahil839 made the changes. kindly review :)

@sahil839
Copy link
Collaborator

sahil839 commented May 23, 2024

Looks good to me. @timabbott ready for your review. There are a couple of things - here and here, that I am not sure and need feeback.

This commit changes the variable and function name from
"subscribed_only" to "show_subscribed" and
"set_subscribed_only" to "set_show_subscribed"
so that in the next commit, when the "not subscribed" tab is added,
we can use a similar variable named "show_unsubscribed" and function
named "set_show_unsubscribed".
This commit adds a new tab to the stream settings overlay called
"Not subscribed" which lists all the streams the user is not
subscribed to. This tab is disabled if the user is a guest.

Introduced a new variable called "show_not_subscribed" to replicate
a similar model to how the subscribed tab is working. Currently,
there are only two tabs: "subscribed" and "all streams" so we can
use an if-else condition.

Refactored the 'update_stream_row_in_settings_tab' function inside
stream_ui_updates.js to include the case of a 'Not-subscribed' tab,
so that the tab is immediately updated in any add/remove subscription
event.

Fixed and added the node tests for these changes.
In the "not-subscribed" tab, when there are no channels to show, we
display a text message saying "No channels to show. View all channels"
along with a link that redirects the user to the "All channels" tab
(All channels(#channels/all)).

Updated the update_empty_left_panel_message function in
stream_settings_ui.js to modify and determine which banner to display
when no channels are available to show, modified that function to also
display the banner of the "not-subscribed" tab using a new classname
called 'not_subscribed_streams_tab_empty_text'.
This commit changes the redirect links for "Browse channels" and
"Browse 1 more stream" to the Not subscribed(#streams/notsubscribed)
tab.
Render tooltips for both the tabs if the user is guest user.

Fixes zulip#21869.
@sahil839 sahil839 added the integration review Added by maintainers when a PR may be ready for integration. label Jun 1, 2024
@sahil839
Copy link
Collaborator

sahil839 commented Jun 1, 2024

I forgot to add the "integration review" label before, sorry for that. Added it now.

@alya
Copy link
Contributor

alya commented Jun 3, 2024

Works for me in manual testing!

case "Not subscribed":
toggler.goto("subscribed");
break;
case "All channels":
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I'm skeptical of this logic keying off what looks like a translated string; I think this code might not work for non-English user languages.

We should be able to use a data attribute for these conditionals, rather than reading text from the DOM.

This isn't a new issue in this PR, though; can you just fix that in a quick follow-up PR @sujalshah-bit?

@timabbott timabbott merged commit d793cc0 into zulip:main Jun 4, 2024
7 checks passed
@timabbott
Copy link
Sponsor Member

Merged, thanks for all the work on this @sujalshah-bit and @sahil839!

@sujalshah-bit can you pick up #30021 (comment) as your next priority? It'd be great to fix that while this is fresh, since it seems not very deep.

@sujalshah-bit sujalshah-bit deleted the not-subscribe-tab branch June 23, 2024 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: channel settings feedback wanted integration review Added by maintainers when a PR may be ready for integration. new feature A proposed new feature for the product size: XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an "Unsubscribed" streams tab
5 participants