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

channel_list: All channels screen #832

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

Conversation

Khader-1
Copy link
Collaborator

@Khader-1 Khader-1 commented Jul 23, 2024

Fixes: #188

Link to all channels Link when there is no other channels All channels screen When there's no channels
image image image image
Subscribe success feedback Already subscribed feedback failed to subscribe feedback failed to subscribe feedback due to exception
image image image image
Unsubscribe success feedback failed to unsubscribe feedback failed to unsubscribe due to exception
image image image
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-07-28.at.17.56.09.mp4

@Khader-1 Khader-1 force-pushed the all-streams-screen branch 4 times, most recently from e4fecd9 to a0c2bb2 Compare July 29, 2024 06:06
@Khader-1 Khader-1 changed the title [WIP] All streams screen channel_list: All channels screen Jul 29, 2024
@Khader-1 Khader-1 added the buddy review GSoC buddy review needed. label Jul 29, 2024
@Khader-1 Khader-1 marked this pull request as ready for review July 29, 2024 06:59
Copy link
Collaborator

@rajveermalviya rajveermalviya left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @Khader-1!

Overall looks great, just some comments.

test/widgets/subscription_list_test.dart Outdated Show resolved Hide resolved
lib/widgets/channel_list.dart Outdated Show resolved Hide resolved
lib/widgets/subscription_list.dart Outdated Show resolved Hide resolved
test/widgets/subscription_list_test.dart Show resolved Hide resolved
lib/widgets/channel_list.dart Outdated Show resolved Hide resolved
lib/widgets/channel_list.dart Show resolved Hide resolved
@Khader-1
Copy link
Collaborator Author

Khader-1 commented Aug 7, 2024

Thanks @rajveermalviya! I've pushed a new revision PTAL.

Copy link
Collaborator

@rajveermalviya rajveermalviya left a comment

Choose a reason for hiding this comment

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

Thanks for the revision!
This looks good to me, moving on to the mentor review from @kenclary.

assets/l10n/app_en.arb Outdated Show resolved Hide resolved
@rajveermalviya rajveermalviya added mentor review GSoC mentor review needed. and removed buddy review GSoC buddy review needed. labels Aug 7, 2024
Copy link
Collaborator

@kenclary kenclary left a comment

Choose a reason for hiding this comment

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

lgtm

@alya
Copy link
Collaborator

alya commented Aug 7, 2024

Let's keep the empty view message consistent with the web app, unless there's a specific reason to do otherwise. So, it would be:

There are no channels you can view in this organization.

Screenshot 2024-08-07 at 14 23 51@2x

@alya
Copy link
Collaborator

alya commented Aug 7, 2024

We use sentence case throughout the Zulip app. So, "All channels", rather than "All Channels".

@alya
Copy link
Collaborator

alya commented Aug 7, 2024

Can you please include screenshots with the subscribed/unsubscribed messages? It's difficult to review text on a video.

@Khader-1 Khader-1 added maintainer review PR ready for review by Zulip maintainers and removed mentor review GSoC mentor review needed. labels Aug 8, 2024
@Khader-1
Copy link
Collaborator Author

Khader-1 commented Aug 8, 2024

Thanks @rajveermalviya, @kenclary and @alya for the reviews! Moving on for maintainer review now.
I've pushed a new revision and updated appended screenshots, PTAL @alya.

@gnprice
Copy link
Member

gnprice commented Aug 12, 2024

-    channel_list: Setup subscribeToChannels api binding
+    api: Add route subscribeToChannels

(Thanks for making this update! I definitely appreciate when someone takes a comment from one PR and proactively applies it to other open PRs where it'd be relevant.)

@chrisbobbe
Copy link
Collaborator

@alya some of the snackbar messages have exclamation marks in them; do we want to keep those? Not sure what our pattern is for ending punctuation. Maybe they should even all have a period.

Copy link
Collaborator

@chrisbobbe chrisbobbe left a comment

Choose a reason for hiding this comment

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

Thanks! Comments below.

Also, since we now have a dark theme (since #867 🎉), please update this to provide a dark-theme variant, and post screenshots of that. Since there isn't something we can really follow in the Figma or the web app, I expect each color will need one of these TODOs:

// TODO(design-dark) need proper dark-theme color (this is ad hoc)

(if you've chosen the dark-theme color yourself)

or

// TODO(design) check if this is the right variable

(if you've used a Figma design variable)

For examples, see c6abaf9.

assets/l10n/app_en.arb Outdated Show resolved Hide resolved
lib/widgets/channel_list.dart Show resolved Hide resolved
lib/widgets/channel_list.dart Show resolved Hide resolved
lib/widgets/channel_list.dart Outdated Show resolved Hide resolved
lib/widgets/channel_list.dart Show resolved Hide resolved
test/widgets/channel_list_test.dart Outdated Show resolved Hide resolved
test/widgets/channel_list_test.dart Outdated Show resolved Hide resolved
test/widgets/channel_list_test.dart Outdated Show resolved Hide resolved
lib/widgets/channel_list.dart Outdated Show resolved Hide resolved
lib/widgets/channel_list.dart Show resolved Hide resolved
@@ -363,6 +363,13 @@
"num": {"type": "int", "example": "4"}
}
},
"browseMoreNChannels": "Browse {num, plural, =0{all channels} =1{1 more channel} other{{num} more channels}}",
"@browseMoreNChannels": {
"description": "Label showing the number of other channels that user can subscribe to",
Copy link
Member

Choose a reason for hiding this comment

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

When first reading this, I couldn't understand the =0{all channels} variant within the context of this description, until I look at where this text appears in the app. I would expect something like =0{no other channels} by looking at this description alone.

I think we should mention that this is the label for the button that shows all channels.

Copy link
Member

Choose a reason for hiding this comment

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

Because now we have a separate rule, the =0 variant can be dropped.

lib/widgets/channel_list.dart Outdated Show resolved Hide resolved
lib/widgets/channel_list.dart Outdated Show resolved Hide resolved
lib/widgets/channel_list.dart Outdated Show resolved Hide resolved
lib/widgets/subscription_list.dart Outdated Show resolved Hide resolved
test/widgets/channel_list_test.dart Outdated Show resolved Hide resolved
test/widgets/subscription_list_test.dart Show resolved Hide resolved
test/widgets/subscription_list_test.dart Outdated Show resolved Hide resolved
test/widgets/subscription_list_test.dart Outdated Show resolved Hide resolved
test/widgets/channel_list_test.dart Outdated Show resolved Hide resolved
lib/api/route/channel.dart Outdated Show resolved Hide resolved
lib/api/route/channel.dart Outdated Show resolved Hide resolved
Copy link
Member

@PIG208 PIG208 left a comment

Choose a reason for hiding this comment

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

Read the commits up to d16b58f, and left some comments.

lib/model/channel.dart Outdated Show resolved Hide resolved
@alya
Copy link
Collaborator

alya commented Aug 22, 2024

For the confirmation notices:

  1. We have a pattern of always putting either a privacy icon (this is best if it's not too tricky), or at least a #, before the name of a channel.
  2. Where did the strings for these notices come from? I would probably tweak some of them, but would like to keep them consistent if there's a source for them. At a minimum, we should consistently put punctuation at the end -- the unsuccessful ones are missing a ..

@alya
Copy link
Collaborator

alya commented Aug 22, 2024

For the exception ones, it seems like we're showing too much to the user. If it's not going to cause us difficulties investigating, I'd leave off the everything in the parentheses.

Copy link
Collaborator

@chrisbobbe chrisbobbe left a comment

Choose a reason for hiding this comment

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

Thanks for the revision! Some small nits from me, then I think @PIG208 will want to check this new revision against his review. Also see Alya's open comments at #832 (comment) and right after.

Widget build(BuildContext context) {
final designVariables = DesignVariables.of(context);
return Material(
color: designVariables.background,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
color: designVariables.background,
// TODO(design) check if this is the right variable
color: designVariables.background,

final notShownStreams = store.streams.length - store.subscriptions.length;
final zulipLocalizations = ZulipLocalizations.of(context);
final label = notShownStreams != 0
? zulipLocalizations.browseMoreNChannels(notShownStreams)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
? zulipLocalizations.browseMoreNChannels(notShownStreams)
? zulipLocalizations.browseNMoreChannels(notShownStreams)

(sounds more natural, given that the string could be e.g. "Browse 6 more channels".)

Comment on lines 105 to 106
const SizedBox(width: 8),
_ChannelItemSubscriptionToggle(stream: stream, channelItemContext: context),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const SizedBox(width: 8),
_ChannelItemSubscriptionToggle(stream: stream, channelItemContext: context),
const SizedBox(width: 8),
_ChannelItemSubscriptionToggle(stream: stream, channelItemContext: context),

}

void checkItemCount(int expectedCount) {
check(find.byType(ChannelItem).evaluate().length).equals(expectedCount);
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
check(find.byType(ChannelItem).evaluate().length).equals(expectedCount);
check(find.byType(ChannelItem).evaluate()).length.equals(expectedCount);

Copy link
Member

@PIG208 PIG208 left a comment

Choose a reason for hiding this comment

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

Thanks for the revision! Just took a quick look again. Reopened two previous comments and left another small one.

This creates the page that contains all channels list, still we need
to implement subscribe/unsubscribe logic which will be introduced in
the upcoming commits.

Fixes parts of zulip#188
@Khader-1
Copy link
Collaborator Author

Thanks @alya, @chrisbobbe and @PIG208 for the reviews!

We have a pattern of always putting either a privacy icon (this is best if it's not too tricky), or at least a #, before the name of a channel.

I tried to use privacy icon but I could not find a direct way to inline the icon within the message text with proper wrapping. I'd love to hear any suggestion from Chris or Zixuan on how to do that.

Where did the strings for these notices come from?

I wrote them down. I tried to get the same as strings as mobile but I believe mobile shows a snackbar only if it fails to subscribe.

@alya
Copy link
Collaborator

alya commented Aug 29, 2024

I wrote them down. I tried to get the same as strings as mobile but I believe mobile shows a snackbar only if it fails to subscribe.

Ok, please start a discussion in #mobile regarding what these strings should be. You can post a list of situations where messages are shown and your suggested strings (with . added, since we definitely want that).

@chrisbobbe
Copy link
Collaborator

I tried to use privacy icon but I could not find a direct way to inline the icon within the message text with proper wrapping. I'd love to hear any suggestion from Chris or Zixuan on how to do that.

Try using a Text.rich instead of a Text, and put the privacy icon in a WidgetSpan. We have a few uses of WidgetSpan in message content: user mentions, image emojis, and global times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer review PR ready for review by Zulip maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Offer a list of all streams, and a way to subscribe
7 participants