mirror of
https://github.com/block/buzz.git
synced 2026-11-28 04:01:45 +00:00
## Summary - Organize mobile Messages into configurable flat sections. See All keeps the list and its search position when opening a conversation, and supports side-by-side browsing on an unfolded Duo. - Use the same 16-point Messages gutter in booklet and open Duo layouts. The regular iPhone uses 20 points. Align navigation actions and use native inline titles on See All. - Update mobile typography and spacing across chat rows, message bubbles, drafts, and the composer. Render code proportionally to the 17-point message body. ## Device review Compare the leading edges of the section headings and channel icons in Messages on the open Duo and in booklet mode. Open See All and check that its rows follow the same column. --------- Signed-off-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
124 lines
3.0 KiB
Dart
124 lines
3.0 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: 17,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 23,
|
|
letterSpacing: -0.45,
|
|
);
|
|
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(
|
|
reactionCountTextStyle,
|
|
fontSize: 13.1,
|
|
fontWeight: FontWeight.w500,
|
|
lineHeight: 17,
|
|
letterSpacing: 0,
|
|
);
|
|
expectStyle(
|
|
channelTitleTextStyle,
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w500,
|
|
lineHeight: 26,
|
|
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: 16,
|
|
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(
|
|
filterChipTextStyle,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.w400,
|
|
lineHeight: 15,
|
|
letterSpacing: 0,
|
|
);
|
|
});
|
|
|
|
test('message and activity avatars use their surface sizes', () {
|
|
expect(messageAvatarSize, 36);
|
|
expect(activityAvatarSize, 42);
|
|
expect(compactMessageAvatarSize, 42);
|
|
expect(messageAvatarContentGap, Grid.twelve);
|
|
});
|
|
}
|