mirror of
https://github.com/block/buzz.git
synced 2026-10-29 21:41:33 +00:00
## Summary Preview buzz-app's Tabler icon style in the mobile app, replacing app-drawn Lucide glyphs across channels, messages, activity, search, and settings. A shared `BuzzIcons` mapping uses the bundled Tabler 3.46.0 outline font, matching buzz-app's version, with its MIT license and source documented. Native UIKit controls retain SF Symbols. The former 300/500 navigation glyphs use Tabler's standard outline; existing selection colors and labels remain. ### Related issue No matching Tabler mobile migration issue or PR found. Related native iOS controls: #8055. ### Testing - Pre-push mobile analysis, formatting, file-size checks, and the full mobile test suite passed. - 194 focused widget tests passed, including channels, home, search, settings, and message content. - Light and dark community-settings renders inspected. - Signed iPhone Release build succeeded; installed and launched as Buzz Tabler on a physical iPhone. - Full `just ci` attempted; stopped during Rust clippy compilation because the Mac ran low on disk space. Full repository validation is not claimed. Signed-off-by: kenny lopez <klopez4212@gmail.com>
102 lines
3.5 KiB
Dart
102 lines
3.5 KiB
Dart
import 'dart:io';
|
|
import 'dart:ui' as ui;
|
|
|
|
import 'package:buzz/shared/theme/buzz_icons.dart';
|
|
import 'package:buzz/shared/theme/theme.dart';
|
|
import 'package:buzz/shared/widgets/tabler_star_icon.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/rendering.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
for (final dark in [false, true]) {
|
|
testWidgets('Tabler action artwork in ${dark ? 'dark' : 'light'}', (
|
|
tester,
|
|
) async {
|
|
await tester.runAsync(() async {
|
|
await (FontLoader(
|
|
'Inter',
|
|
)..addFont(rootBundle.load('assets/fonts/InterVariable.ttf'))).load();
|
|
await (FontLoader(
|
|
'BuzzTabler',
|
|
)..addFont(rootBundle.load('assets/fonts/TablerIcons.ttf'))).load();
|
|
});
|
|
final theme = dark ? AppTheme.dark() : AppTheme.light();
|
|
final color = theme.colorScheme.onSurface;
|
|
final key = GlobalKey();
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
theme: theme.copyWith(
|
|
listTileTheme: ListTileThemeData(
|
|
titleTextStyle: TextStyle(
|
|
fontFamily: 'Inter',
|
|
fontSize: 16,
|
|
color: color,
|
|
),
|
|
),
|
|
),
|
|
home: Center(
|
|
child: RepaintBoundary(
|
|
key: key,
|
|
child: Material(
|
|
child: SizedBox(
|
|
width: 320,
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
const ListTile(
|
|
leading: Icon(BuzzIcons.archive),
|
|
title: Text('Archive'),
|
|
),
|
|
const ListTile(
|
|
leading: Icon(BuzzIcons.archiveRestore),
|
|
title: Text('Unarchive'),
|
|
),
|
|
const ListTile(
|
|
leading: Icon(BuzzIcons.clock3),
|
|
title: Text('Running'),
|
|
),
|
|
const ListTile(
|
|
leading: Icon(BuzzIcons.clockFading),
|
|
title: Text('Temporary channel'),
|
|
),
|
|
ListTile(
|
|
leading: TablerStarIcon(color: color),
|
|
title: const Text('Star'),
|
|
),
|
|
ListTile(
|
|
leading: TablerStarIcon(
|
|
color: theme.colorScheme.primary,
|
|
filled: true,
|
|
),
|
|
title: const Text('Unstar'),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
await tester.pumpAndSettle();
|
|
expect(tester.takeException(), isNull);
|
|
final directory = Platform.environment['TABLER_SCREENSHOTS'];
|
|
if (directory != null) {
|
|
await tester.runAsync(() async {
|
|
final boundary =
|
|
key.currentContext!.findRenderObject()! as RenderRepaintBoundary;
|
|
final image = await boundary.toImage(pixelRatio: 2);
|
|
final bytes = await image.toByteData(format: ui.ImageByteFormat.png);
|
|
await Directory(directory).create(recursive: true);
|
|
await File(
|
|
'$directory/${dark ? 'dark' : 'light'}.png',
|
|
).writeAsBytes(bytes!.buffer.asUint8List());
|
|
image.dispose();
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|