Skip to content

reactions: (Actually) make text-emoji chip's height consistent with others #442

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

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions lib/widgets/emoji_reaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class ReactionChip extends StatelessWidget {
child: Padding(
// 1px of this padding accounts for the border, which Flutter
// just paints without changing size.
padding: const EdgeInsetsDirectional.fromSTEB(4, 2, 5, 2),
padding: const EdgeInsetsDirectional.fromSTEB(4, 3, 5, 3),
child: LayoutBuilder(
builder: (context, constraints) {
final maxRowWidth = constraints.maxWidth;
Expand All @@ -162,11 +162,9 @@ class ReactionChip extends StatelessWidget {
// ones (probably a good thing).
SizedBox(height: _squareEmojiScalerClamped(context).scale(_squareEmojiSize)),
Flexible( // [Flexible] to let text emojis expand if they can
child: Padding(padding: const EdgeInsets.symmetric(horizontal: 3, vertical: 1),
child: Padding(padding: const EdgeInsets.symmetric(horizontal: 3),
child: emoji)),
// Added vertical: 1 to give some space when the label is
// taller than the emoji (e.g. because it needs multiple lines)
Comment on lines -167 to -168
Copy link
Member

Choose a reason for hiding this comment

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

As Greg suggested:
  https://github.com/zulip/zulip-flutter/pull/442/commits/ec4a21fdccdb21774ca656082fa921161d6b1ae0#r1442492101

Link is broken — GitHub links like …/pull/NNN/commits/HHH/… are unstable, because GitHub breaks them if the commit is no longer in the latest revision of the PR. Instead link to discussions on the "Conversation" tab of the PR, like #442 (comment) .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah indeed. I knew that, but missed it in this case; thanks for the catch. 🙂

Padding(padding: const EdgeInsets.symmetric(horizontal: 3, vertical: 1),
Padding(padding: const EdgeInsets.symmetric(horizontal: 3),
child: Container(
constraints: BoxConstraints(maxWidth: maxLabelWidth),
child: Text(
Expand All @@ -178,8 +176,7 @@ class ReactionChip extends StatelessWidget {
color: labelColor,
).merge(weightVariableTextStyle(context,
wght: selfVoted ? 600 : null)),
label),
)),
label))),
]);
})))));
}
Expand Down