-
Notifications
You must be signed in to change notification settings - Fork 309
subscription_list: Show muted streams as faded in streams list #711
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
subscription_list: Show muted streams as faded in streams list #711
Conversation
f25e276
to
f2b71c2
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 @Khader-1. LGTM! Just a few small comments below.
f2b71c2
to
72b7dae
Compare
Thanks @sm-sayedi! I've pushed a 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.
lib/widgets/subscription_list.dart
Outdated
], | ||
const SizedBox(width: 16), | ||
]))); | ||
child: Opacity( |
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.
Instead of Opacity
wrapping the whole Row
, let's make it wrap only the icon and the stream name. This will be helpful when there is a dot marker added through #714. See 714 comment.
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.
Good catch, Thanks!
72b7dae
to
0620510
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 review @sm-sayedi! A new revision is pushed PTAL.
lib/widgets/subscription_list.dart
Outdated
], | ||
const SizedBox(width: 16), | ||
]))); | ||
child: Opacity( |
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.
Good catch, Thanks!
0620510
to
cf07bf8
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.
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 good to me.
I think we should show muted channels below unmuted ones, as we do in the left sidebar in the web app, unless we specifically have reason to do otherwise. (I know that's not how it works in the RN app.) |
Could you please update the screenshots in the PR description to include more muted streams, including ones both with and without unread messages? |
cf07bf8
to
97e1bbb
Compare
226c137
to
1e66fdf
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 review @chrisbobbe! I believe this ready now.
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! And thanks for posting updated screenshots. I notice that the unread marker isn't faded, like it is in Vlad's draft design in the issue: #424 (comment)
Let's make it so the unread marker is also faded.
1e66fdf
to
24d9bc1
Compare
I see you've pushed some changes; please comment here when this is ready for another review. |
This is now ready; I had to update the Flutter SDK, which unfortunately took quite some time. |
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 @Khader-1! Small comments below, and I'll go ahead and mark for Greg's review.
lib/widgets/subscription_list.dart
Outdated
UnreadCountBadge(count: unreadCount, backgroundColor: swatch, bold: true), | ||
Opacity( | ||
opacity: subscription.isMuted ? 0.55 : 1, | ||
child: UnreadCountBadge( | ||
count: unreadCount, | ||
backgroundColor: swatch, | ||
bold: true)), |
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.
Can we simplify by putting a single Opacity
higher in the tree, instead of two different Opacity
s?
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 could be done as such and it was actually but we had to change it as it will eventually be changed when working on #714; Check Sayed's comment
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 @Khader-1, and thanks @sm-sayedi and @chrisbobbe for the previous reviews! Comments below.
lib/widgets/subscription_list.dart
Outdated
Opacity( | ||
opacity: subscription.isMuted ? 0.55 : 1, |
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.
Can this have just one Opacity around the whole thing? Or is there something I'm missing that isn't getting the Opacity applied?
If so, then that may also enable going back to a single Row instead of a pair of them nested.
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 could be done as such and it was actually but we had to change it as it will eventually be changed when working on #714; Check #711 (comment)
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.
I see.
In that case let's split the Opacity up further, so that it applies separately to the icon and name. That will save the extra layer of Expanded and Row, which I think makes this code a bit easier to read and understand.
UserTopicItem( | ||
streamId: stream1.streamId, | ||
topicName: 'a', | ||
lastUpdated: 1234567890, | ||
visibilityPolicy: UserTopicVisibilityPolicy.unmuted, |
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.
This can be made a bit more compact (and with less noise from boring parts like lastUpdated
) with an appropriate helper.
There's one already in model/stream_test.dart
. So that can be moved to example_data.dart
in a prep commit.
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.
bump — you added that useful prep commit but then didn't actually use the new shared helper here 🙂
24d9bc1
to
6bf222f
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! This is close to merge now. Small comments below.
test/example_data.dart
Outdated
int _nextStreamId() => (_lastStreamId += 1 + Random().nextInt(10)); | ||
int _lastStreamId = 100; | ||
|
||
const staticStreamId = 123; |
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.
const staticStreamId = 123; | |
const defaultStreamId = 123; |
I think this name will make it a bit clearer how this stream ID relates to the rest of the data.
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.
Or I guess that name doesn't capture it either — the meaning is actually a little complicated, in that this is the default for eg.streamMessage
but not for eg.stream
(which defaults to the random sequence).
Let's make it:
const staticStreamId = 123; | |
const defaultStreamMessageStreamId = 123; |
and also put the definition right above streamMessage
.
That name is kind of wordy, but that may actually be a good thing here — the way this works is a bit surprising and we should probably reorganize so that tests aren't referring to a shared constant stream ID like this.
The streamMessage
doc should also mention that there's this default.
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.
bump on these two aspects:
and also put the definition right above
streamMessage
.
The
streamMessage
doc should also mention that there's this default.
eg.subscription(stream2, isMuted: false) | ||
], |
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:
eg.subscription(stream2, isMuted: false) | |
], | |
eg.subscription(stream2, isMuted: false), | |
], |
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.
bump 🙂
UserTopicItem( | ||
streamId: stream1.streamId, | ||
topicName: 'a', | ||
lastUpdated: 1234567890, | ||
visibilityPolicy: UserTopicVisibilityPolicy.unmuted, |
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.
bump — you added that useful prep commit but then didn't actually use the new shared helper here 🙂
lib/widgets/subscription_list.dart
Outdated
Opacity( | ||
opacity: subscription.isMuted ? 0.55 : 1, |
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.
I see.
In that case let's split the Opacity up further, so that it applies separately to the icon and name. That will save the extra layer of Expanded and Row, which I think makes this code a bit easier to read and understand.
6bf222f
to
32e3bf6
Compare
Thanks Greg! Sorry about the lack of focus.. I believe This is ready now. |
eg.subscription(stream2, isMuted: false) | ||
], |
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.
bump 🙂
lib/widgets/subscription_list.dart
Outdated
iconDataForStream(subscription)), | ||
), | ||
), |
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: follow the existing style for formatting these close-parens
iconDataForStream(subscription)), | |
), | |
), | |
iconDataForStream(subscription)))), |
lib/widgets/subscription_list.dart
Outdated
subscription.name), | ||
))), |
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: similarly here
test/example_data.dart
Outdated
int _nextStreamId() => (_lastStreamId += 1 + Random().nextInt(10)); | ||
int _lastStreamId = 100; | ||
|
||
const staticStreamId = 123; |
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.
bump on these two aspects:
and also put the definition right above
streamMessage
.
The
streamMessage
doc should also mention that there's this default.
Thanks @Khader-1 for the revision! Just a couple of small things still open, and a few nits new in this revision; details above. |
32e3bf6
to
19b53b0
Compare
Thanks @gnprice for the review! I've made a new revision PTAL. |
This allows `eg.stream` to be used in contexts where it's important that the stream IDs don't collide or even that they're increasing, without the test having to explicitly give specific stream IDs when no other fact about them is relevant. Some tests are dependent on the stream IDs being static. Those are updated to use `eg.defaultStreamMessageStreamId` explicitly.
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 @Khader-1 for all your work on this! Looks good — merging.
I fixed the one nit below, and also tweaked the eg.streamMessage
doc slightly:
-/// If the message stream `stream` is not given, an example stream with
-/// `defaultStreamMessageStreamId` will be used.
+/// The message will be in `stream` if given. Otherwise,
+/// an example stream with ID `defaultStreamMessageStreamId` will be used.
19b53b0
to
b0b8a50
Compare
Fixes: #424