-
Notifications
You must be signed in to change notification settings - Fork 341
Show channel/topic at top of channel/topic action sheet #1877
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
Show channel/topic at top of channel/topic action sheet #1877
Conversation
7f6a80d
to
96b3eba
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 @chrisbobbe! LGTM, and tests great. Moving over to Greg's review.
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! Small code comments below.
I feel like we might want to include the channel name/icon when showing the topic, too. Consider the case of the combined feed or another interleaved view.
Which reminds me: this should get UX review from Alya (if it hasn't already in a chat thread).
lib/widgets/action_sheet.dart
Outdated
]; | ||
|
||
_showActionSheet(pageContext, buttonSections: buttonSections); | ||
Widget header; |
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: add final
lib/widgets/action_sheet.dart
Outdated
header = BottomSheetHeader( | ||
buildTitle: (baseStyle) => Text( | ||
style: baseStyle.copyWith(fontStyle: FontStyle.italic), | ||
store.realmEmptyTopicDisplayName)); |
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.
action_sheet: Show topic in topic action sheet
Fixes #1533.
This excludes the channel description for now; that'll be more
complicated to implement, involving #488.
That last bit belongs in the commit message for the channel action sheet, right?
Let's also track that follow-up somewhere — either explicitly in #488, or as its own small issue.
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.
Sure: #1896
Hmm, we don't show the channel name in topic menus in the web app, but you can seem more context around the menu there. Including the name of the channel makes sense to me for mobile. |
Looks good to me otherwise! |
96b3eba
to
09bfe18
Compare
Thanks for the reviews! Revision pushed @alya, this time including the channel name in the topic action sheet too. I've also subtly adjusted the size and alignment of the channel icon; PTAL at that. Greg commented that the line height looks too small when the topic wraps onto a second line. I kind of agree, but it looks just right to me in the common case where it doesn't wrap; in that case I think it might look awkward to add extra space above or below the line. |
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! The new InlineIconGeometryData and iconWidgetData are interesting.
In the screenshots, the hash icon looks a bit low to me.
lib/widgets/text.dart
Outdated
ZulipIcons.hash_sign: InlineIconGeometryData._( | ||
sizeFactor: 0.8, | ||
alphabeticBaselineFactor: 1 / 8, | ||
paddingFactor: 1 / 5), |
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.
Interesting!
Are there other places we should be using these values? The recipient headers, and message-list app bars, come to mind.
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 agree! I think we can use it basically anywhere we have a channel name with its icon.
channelTopicLabelSpan
in its current form isn't ready to be used in recipient headers, but maybe with adjustments. The channel name and topic need to have separate gesture handling, the chevron-right icon needs to be a different color than the text, and ideally we'd do something smart when there's a really long channel name but we still want to show the topic (or at least part of it, if it's long too).
lib/widgets/text.dart
Outdated
/// How much padding should separate the icon from surrounding text, | ||
/// as a fraction of the text's font size. | ||
final double paddingFactor; |
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.
Horizontal padding, right? Seems good to make explicit.
required this.alphabeticBaselineFactor, | ||
required this.paddingFactor, |
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 looks like the baseline factor ends up getting interpreted compounded with the size factor, but the padding factor doesn't.
Is there a motivation for that difference? Seems like it'd be easy to get confused about. It might be cleanest to specify both of them the same way (either both relative to the surrounding font size, or both relative to the icon size).
lib/widgets/text.dart
Outdated
paddingFactor: 0), | ||
}; | ||
|
||
static InlineIconGeometryData defaultGeometry = InlineIconGeometryData._( |
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: make private?
lib/widgets/text.dart
Outdated
if (channelIcon != null) ...[ | ||
iconWidgetSpan( |
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: can skip the ...[
, since there's exactly one item inside
Side point: #design > unknown channel symbol |
Yeah, I agree that it looks to tight for 2-line topics, and fine without line-wrapping. Can we just increase the spacing when it wraps? It might be OK to add a bit of space below for 1-line topics if we have to. |
09bfe18
to
c18d1c4
Compare
Thanks for the revision! The code all looks good to me; I'll hold off a bit on merging to give @alya an opportunity to look at the screenshots. Perhaps file a follow-up issue for taking advantage of the new icon-geometry data, per #1877 (comment) ? |
Sure: #1906 |
Looks great to me, thanks! |
This excludes the channel description for now; that's zulip#1896. Fixes-partly: zulip#1533
It turns out we can do this without wasting space with extra margin above or below the title, using TextHeightBehavior.
c18d1c4
to
3d3b1c1
Compare
Fixes #1533.
Outdated screenshots; working on new ones…