From 3882d18967622623243a95a463a5d69eb78a3d8f Mon Sep 17 00:00:00 2001 From: boxdot Date: Mon, 27 Jan 2025 17:10:28 +0100 Subject: [PATCH] use default line height for messages font --- .github/workflows/flutter_test.yml | 7 +++++++ app/lib/message_list/text_message_tile.dart | 13 ++++++------- app/lib/theme/styles.dart | 8 ++++++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml index b0959beb..47d355cf 100644 --- a/.github/workflows/flutter_test.yml +++ b/.github/workflows/flutter_test.yml @@ -52,3 +52,10 @@ jobs: - name: Run Flutter tests run: just test-flutter + + - name: Upload golden failures + if: failure() + uses: actions/upload-artifact@v4 + with: + name: golden-failures + path: app/test/**/failures/* diff --git a/app/lib/message_list/text_message_tile.dart b/app/lib/message_list/text_message_tile.dart index 3a8426c7..748f3d3f 100644 --- a/app/lib/message_list/text_message_tile.dart +++ b/app/lib/message_list/text_message_tile.dart @@ -58,9 +58,8 @@ class TextMessageTile extends StatelessWidget { flex: 5, child: Container( padding: EdgeInsets.only( - top: flightPosition.isFirst ? 5 : 0, - bottom: flightPosition.isLast ? 5 : 0, - ), + top: flightPosition.isFirst ? 5 : 0, + bottom: flightPosition.isLast ? 5 : 0), child: Column( crossAxisAlignment: isSender ? CrossAxisAlignment.end : CrossAxisAlignment.start, @@ -136,10 +135,10 @@ class TextMessageTile extends StatelessWidget { : AlignmentDirectional.topStart, child: Container( padding: EdgeInsets.only( - top: 4, - right: 11, - left: 11, - bottom: 6, + top: isLargeScreen(context) ? 1 : 4, + right: isLargeScreen(context) ? 10 : 11, + left: isLargeScreen(context) ? 10 : 11, + bottom: isLargeScreen(context) ? 5 : 6, ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(7), diff --git a/app/lib/theme/styles.dart b/app/lib/theme/styles.dart index b09b21a3..e61fd9a0 100644 --- a/app/lib/theme/styles.dart +++ b/app/lib/theme/styles.dart @@ -112,9 +112,13 @@ InputDecoration messageComposerInputDecoration(BuildContext context) => TextStyle messageTextStyle(BuildContext context, bool inverted) => TextStyle( color: inverted ? Colors.white : Colors.black, fontFamily: fontFamily, - fontVariations: variationMedium, + fontVariations: + isLargeScreen(context) ? variationRegular : variationMedium, letterSpacing: -0.05, - fontSize: 15, + fontSize: isLargeScreen(context) ? 14 : 15, + // NOTE: When specifying line height, the text is rendered inconsistently on + // Linux and macOS (and therefore also on Android and iOS). For now, we use the default one. + // height: isLargeScreen(context) ? 1.5 : 1.3, ); final textInputBorder = OutlineInputBorder(