mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
## Summary - refine mobile message metadata, search spacing, and Activity filter semantics - add channel-parity Latest navigation and stable tail following to threads - synchronize Android composer/keyboard geometry and keep Latest spacing stable across IME transitions ## Validation - `bin/just mobile-check` - `bin/just mobile-test` (1,276 tests) - Pixel 10 install/launch and channel/thread keyboard, Latest, tail, and back-navigation review - signed iPhone install/launch workflow ## Snapshots See the review snapshots below. --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Signed-off-by: Kenny Lopez <klopez4212@gmail.com> Signed-off-by: Princess Donut <b238ea756dee4d98afa5883fc7f1de61eeabe65bf700e3a5a5a80db5e42e2c2b@buzz.block.builderlab.xyz> Co-authored-by: Fast Fizz <2df81cb51f05a9d5387ef24d7b9ecb8fcdfcd1c70ffabc67061c9596e1b5b1c4@buzz.block.builderlab.xyz> Co-authored-by: Princess Donut <b238ea756dee4d98afa5883fc7f1de61eeabe65bf700e3a5a5a80db5e42e2c2b@buzz.block.builderlab.xyz>
152 lines
3.6 KiB
Dart
152 lines
3.6 KiB
Dart
import 'package:buzz/shared/theme/theme.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
void expectStyle(
|
|
TextStyle style, {
|
|
required double fontSize,
|
|
required FontWeight fontWeight,
|
|
required double lineHeight,
|
|
required double letterSpacing,
|
|
}) {
|
|
expect(style.fontFamily, 'Inter');
|
|
expect(style.fontSize, fontSize);
|
|
expect(style.fontWeight, fontWeight);
|
|
expect(style.height, closeTo(lineHeight / fontSize, 0.0001));
|
|
expect(style.letterSpacing, letterSpacing);
|
|
}
|
|
|
|
test('message typography matches the shared mobile scale', () {
|
|
expectStyle(
|
|
messageBodyTextStyle,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 20,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
messageUsernameTextStyle,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w600,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
messageTimestampTextStyle,
|
|
fontSize: 13.1,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expect(
|
|
messageTimestampTextStyle.fontSize,
|
|
lessThan(messageUsernameTextStyle.fontSize!),
|
|
);
|
|
expectStyle(
|
|
replyPreviewTextStyle,
|
|
fontSize: 13.1,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
reactionCountTextStyle,
|
|
fontSize: 13.1,
|
|
fontWeight: FontWeight.w500,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
channelTitleTextStyle,
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w700,
|
|
lineHeight: 24,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
systemMessageHeadingTextStyle,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w600,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
systemMessageBodyTextStyle,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 20,
|
|
letterSpacing: 0,
|
|
);
|
|
});
|
|
|
|
test('activity typography matches the conversation row scale', () {
|
|
expectStyle(
|
|
activityUsernameTextStyle,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w600,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
activityTimestampTextStyle,
|
|
fontSize: 13.1,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
activityContextTextStyle,
|
|
fontSize: 13.1,
|
|
fontWeight: FontWeight.w500,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
activityPreviewTextStyle,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 20,
|
|
letterSpacing: 0,
|
|
);
|
|
});
|
|
|
|
test('content list typography matches the compact list scale', () {
|
|
expectStyle(
|
|
contentListTitleTextStyle,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w600,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
contentListBodyTextStyle,
|
|
fontSize: 13.1,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
contentListTimestampTextStyle,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
filterChipTextStyle,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 15,
|
|
letterSpacing: 0,
|
|
);
|
|
});
|
|
|
|
test('message and activity avatars use their surface sizes', () {
|
|
expect(messageAvatarSize, 42);
|
|
expect(activityAvatarSize, 42);
|
|
expect(compactMessageAvatarSize, 42);
|
|
expect(messageAvatarContentGap, Grid.twelve);
|
|
});
|
|
}
|