mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
## Summary - align message typography, avatars, metadata, and spacing across mobile surfaces - improve message follow behavior, touch feedback, and Activity popover motion - refine Search motion, gutters, and explicit recent-search history ## Snapshots ### Home  ### Activity  ### Search  ## Testing - `just mobile-check` - `just mobile-test` (749 passed, 1 skipped) --------- Signed-off-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: kenny lopez <klopez4212@gmail.com> Signed-off-by: npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f <ab176f059d100602ea25073d9a69ee9817f7b691c76a897180d48498d959faa2@buzz.block.builderlab.xyz> Signed-off-by: Wes <wesbillman@users.noreply.github.com> Signed-off-by: npub15w828kxsxu2684ynste0uah2jwkgatd99flt7ds4523hzm8ju6cshdr8hh <a38ea3d8d03715a3d49382f2fe76ea93ac8eada52a7ebf3615a2a3716cf2e6b1@buzz.block.builderlab.xyz> Co-authored-by: npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w <52a228d6edf316ec6812ac3c9fc0d696ab59fc7954d77e7be31eedcddf91335b@buzz.block.builderlab.xyz> Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Co-authored-by: npub14vtk7pvazqrq9639qu7e560wnqtl0d53ca4gjuvq6jzf3k2el23qqlwa7f <ab176f059d100602ea25073d9a69ee9817f7b691c76a897180d48498d959faa2@buzz.block.builderlab.xyz> Co-authored-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz> Co-authored-by: npub15w828kxsxu2684ynste0uah2jwkgatd99flt7ds4523hzm8ju6cshdr8hh <a38ea3d8d03715a3d49382f2fe76ea93ac8eada52a7ebf3615a2a3716cf2e6b1@buzz.block.builderlab.xyz>
142 lines
3.4 KiB
Dart
142 lines
3.4 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: 15,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expect(messageTimestampTextStyle, messageMetadataTextStyle);
|
|
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: 15,
|
|
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,
|
|
);
|
|
});
|
|
|
|
test('message and activity avatars use their surface sizes', () {
|
|
expect(messageAvatarSize, 42);
|
|
expect(activityAvatarSize, 42);
|
|
expect(compactMessageAvatarSize, 42);
|
|
expect(messageAvatarContentGap, Grid.twelve);
|
|
});
|
|
}
|