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

Draft
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
image image image
When there's no channels Subscribe success feedback Already subscribed feedback
image image image
failed to subscribe feedback Unsubscribe success feedback failed to unsubscribe feedback
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 requested a review from rajveermalviya July 29, 2024 06:59
@Khader-1 Khader-1 marked this pull request as ready for review July 29, 2024 06:59
@Khader-1 Khader-1 force-pushed the all-streams-screen branch from a0c2bb2 to 9a12a3e Compare July 29, 2024 07:00
Copy link
Member

@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.

@Khader-1 Khader-1 force-pushed the all-streams-screen branch from 9a12a3e to 75d75c1 Compare August 7, 2024 08:24
@Khader-1
Copy link
Collaborator Author

Khader-1 commented Aug 7, 2024

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

Copy link
Member

@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.

@rajveermalviya rajveermalviya added mentor review GSoC mentor review needed. and removed buddy review GSoC buddy review needed. labels Aug 7, 2024
@rajveermalviya rajveermalviya requested a review from kenclary August 7, 2024 08:58
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 force-pushed the all-streams-screen branch from 75d75c1 to c567e9e Compare August 8, 2024 09:28
@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.

@Khader-1 Khader-1 force-pushed the all-streams-screen branch from c567e9e to d1a1c59 Compare August 12, 2024 11:24
@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.

@Khader-1 Khader-1 force-pushed the all-streams-screen branch 2 times, most recently from f816da7 to 41de1fc Compare August 22, 2024 11:14
@chrisbobbe chrisbobbe requested a review from PIG208 August 23, 2024 22:45
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.

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.

@Khader-1 Khader-1 force-pushed the all-streams-screen branch 2 times, most recently from 846174a to 368ad56 Compare August 29, 2024 09:34
@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.

@Khader-1 Khader-1 force-pushed the all-streams-screen branch 2 times, most recently from efd791d to b91bec1 Compare November 19, 2024 20:41
@Khader-1 Khader-1 requested a review from PIG208 November 19, 2024 21:05
@Khader-1
Copy link
Collaborator Author

Thanks @alya, @chrisbobbe and @PIG208! I'm finally back with another revision, PTAL.

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.

Glad to have you back @Khader-1! Thanks for the update! I have read through the commits and left some comments.

I think the last two commits can be squashed together:

  • f604530 channel_list: Implement unsubscribe from channel
  • 793e9bf channel_list: Implement subscribe to channel

And similarly, these two can be squashed together:

  • cc676ac api: Add route unsubscribeFromChannels
  • 96836fc api: Add route subscribeToChannels

@@ -367,6 +367,17 @@
"num": {"type": "int", "example": "4"}
Copy link
Member

Choose a reason for hiding this comment

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

It would be great to have a link to the discussion on the design here, so that we know this UI is based on the legacy mobile app.

@@ -262,6 +262,12 @@ class ChannelStoreImpl with ChannelStore {

case SubscriptionRemoveEvent():
for (final streamId in event.streamIds) {
final subscription = streams[streamId];
if (subscription == null || subscription is! Subscription) { // TODO(log)
continue;
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is only possible when the server behaves unexpectedly. So it might fit better in a non-nfc commit explaining how this can happen.

subscriptions: [eg.subscription(stream)],
));

check(store.streams[stream.streamId] is Subscription).isTrue();
Copy link
Member

Choose a reason for hiding this comment

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

nit: use isA<Subscription> instead and we can skip the isTrue check

crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
Copy link
Member

Choose a reason for hiding this comment

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

Let's make sure that the text wraps when there is not enough space. Wrapping this in Expanded should make it resize correctly.

Future<ZulipStream> prepareSingleStream(WidgetTester tester) async {
final stream = eg.stream();
await setupChannelListPage(tester, streams: [stream], subscriptions: []);
return stream;
Copy link
Member

Choose a reason for hiding this comment

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

nit: indentation

check(find.descendant(
of: richTextFinder,
matching: find.byIcon(ZulipIcons.hash_sign),
).evaluate()).single;
Copy link
Member

Choose a reason for hiding this comment

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

nit: use findsOne as mentioned earlier

await setupChannelListPage(tester, streams: [stream], subscriptions: []);
connection.prepare(json: SubscribeToChannelsResult(
subscribed: {eg.selfUser.email: [stream.name]},
alreadySubscribed: {}).toJson());
Copy link
Member

Choose a reason for hiding this comment

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

We could add a delay to make this more realistic.

Comment on lines +56 to +57
height: (20 / 18),
))));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
height: (20 / 18),
))));
height: (20 / 18)))));

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/zulip_localizations.dart';
Copy link
Member

Choose a reason for hiding this comment

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

We will need to regenerate the translation strings using tools/check l10n --fix, and update this import to use import '../generated/l10n/zulip_localizations.dart'; instead.

@gnprice
Copy link
Member

gnprice commented Dec 18, 2024

Thanks again @Khader-1 for all your work on this PR!

Do you think you'll have time to make a revision based on Zixuan's feedback above?

@gnprice
Copy link
Member

gnprice commented Feb 6, 2025

Marking this PR as draft for now to get it out of our review queue. @Khader-1 if in the future you're able to pick this up again and revise for the feedback above, feel free to mark again for review. Hope you're well.

@gnprice gnprice marked this pull request as draft February 6, 2025 06:54
@gnprice gnprice added this to the M6: Post-launch milestone Feb 6, 2025
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 channels, and a way to subscribe
7 participants