-
Notifications
You must be signed in to change notification settings - Fork 276
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
base: main
Are you sure you want to change the base?
Conversation
e4fecd9
to
a0c2bb2
Compare
a0c2bb2
to
9a12a3e
Compare
There was a problem hiding this 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.
9a12a3e
to
75d75c1
Compare
Thanks @rajveermalviya! I've pushed a new revision PTAL. |
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
We use sentence case throughout the Zulip app. So, "All channels", rather than "All Channels". |
Can you please include screenshots with the subscribed/unsubscribed messages? It's difficult to review text on a video. |
75d75c1
to
c567e9e
Compare
Thanks @rajveermalviya, @kenclary and @alya for the reviews! Moving on for maintainer review now. |
c567e9e
to
d1a1c59
Compare
(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.) |
@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. |
There was a problem hiding this 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.
f816da7
to
41de1fc
Compare
There was a problem hiding this 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.
There was a problem hiding this 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.
846174a
to
368ad56
Compare
Thanks @alya, @chrisbobbe and @PIG208 for the reviews!
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.
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 |
Try using a |
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
efd791d
to
b91bec1
Compare
b91bec1
to
f604530
Compare
Thanks @alya, @chrisbobbe and @PIG208! I'm finally back with another revision, PTAL. |
There was a problem hiding this 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:
@@ -367,6 +367,17 @@ | |||
"num": {"type": "int", "example": "4"} |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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.
height: (20 / 18), | ||
)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
height: (20 / 18), | |
)))); | |
height: (20 / 18))))); |
@@ -1,4 +1,5 @@ | |||
import 'package:flutter/material.dart'; | |||
import 'package:flutter_gen/gen_l10n/zulip_localizations.dart'; |
There was a problem hiding this comment.
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.
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? |
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. |
Fixes: #188
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-07-28.at.17.56.09.mp4