-
Notifications
You must be signed in to change notification settings - Fork 214
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
content: Handle link previews #1049
base: main
Are you sure you want to change the base?
Conversation
abdec10
to
8fba3fe
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! Looks like this needs a rebase, so I'll do a more thorough review after that. But here are some comments from a quick skim (in particular I haven't read the parsing code or checked the UI code against web).
padding: const EdgeInsets.symmetric(horizontal: 5), | ||
child: InsetShadowBox( | ||
bottom: 8, | ||
color: messageListTheme.streamMessageBgDefault, |
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 looks like it'll be wrong for DMs, and (in future) for messages where we highlight the background because of @-mentions in the message (#647).
lib/widgets/content.dart
Outdated
child: Text(node.title!, | ||
style: TextStyle( | ||
fontSize: 1.2 * kBaseFontSize, | ||
color: const HSLColor.fromAHSL(1, 200, 1, 0.4).toColor()))), |
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 a hard-coded color; does it follow web? It needs either a variable in ContentTheme
or this comment:
// Web has the same color in light and dark mode.
(Same for any other hard-coded colors.)
Please also post screenshots in light mode; I see screenshots for dark mode already.
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.
Updated the screenshots.
lib/widgets/content.dart
Outdated
if (isSmallWidth) { | ||
return Container( | ||
decoration: const BoxDecoration(border: | ||
Border(left: BorderSide(color: Color(0xFFEDEDED), width: 3))), |
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.
Same comment about hard-coded colors; also, I think we more often use lowercase (so 0xffededed
instead of 0xFFEDEDED
); here and below.
lib/widgets/content.dart
Outdated
final messageListTheme = MessageListTheme.of(context); | ||
final isSmallWidth = MediaQuery.sizeOf(context).width <= 576; | ||
|
||
final dataContainer = Container( |
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.
Is dataContainer
the best name? I see the Container
widget being used…what's the "data" and how does that widget "contain" it?
How about building this method's return value with help from a mutable Widget result
variable? So here:
Widget result = Container(/* etc. */);
then below,
result = isSmallWidth
? Column(/* etc. */, children: [/* etc. */, result])
: Row(/* etc. */, children: [/* etc. */, result]);
then result = Container(decoration: /* etc. */, child: result);
and finally return result;
.
5b7b364
to
533fa33
Compare
533fa33
to
aeabbe6
Compare
Thanks for the initial comments @chrisbobbe! Pushed a new revision, PTAL. |
Fixes: #1016
Screenshots