mirror of
https://github.com/block/buzz.git
synced 2026-11-05 08:51:10 +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>
178 lines
5.2 KiB
Dart
178 lines
5.2 KiB
Dart
part of '../activity_page.dart';
|
|
|
|
class _LoadingSkeleton extends StatelessWidget {
|
|
final ScrollController scrollController;
|
|
|
|
const _LoadingSkeleton({required this.scrollController});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListView.separated(
|
|
controller: scrollController,
|
|
padding: _activityScrollPadding(
|
|
context,
|
|
horizontal: Grid.gutter,
|
|
top: Grid.gutter,
|
|
bottom: Grid.gutter,
|
|
),
|
|
itemCount: 8,
|
|
separatorBuilder: (_, _) => const SizedBox(height: Grid.xs),
|
|
itemBuilder: (context, _) => Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
width: 36,
|
|
height: 36,
|
|
decoration: BoxDecoration(
|
|
shape: BoxShape.circle,
|
|
color: context.colors.outlineVariant.withValues(alpha: 0.4),
|
|
),
|
|
),
|
|
const SizedBox(width: Grid.twelve),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Container(
|
|
width: 140,
|
|
height: 12,
|
|
decoration: BoxDecoration(
|
|
color: context.colors.outlineVariant.withValues(alpha: 0.4),
|
|
borderRadius: BorderRadius.circular(4),
|
|
),
|
|
),
|
|
const SizedBox(height: Grid.xxs),
|
|
Container(
|
|
width: double.infinity,
|
|
height: 10,
|
|
decoration: BoxDecoration(
|
|
color: context.colors.outlineVariant.withValues(alpha: 0.3),
|
|
borderRadius: BorderRadius.circular(4),
|
|
),
|
|
),
|
|
const SizedBox(height: Grid.half),
|
|
Container(
|
|
width: 220,
|
|
height: 10,
|
|
decoration: BoxDecoration(
|
|
color: context.colors.outlineVariant.withValues(alpha: 0.2),
|
|
borderRadius: BorderRadius.circular(4),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _EmptySurface extends StatelessWidget {
|
|
final IconData icon;
|
|
final String message;
|
|
final String? detail;
|
|
|
|
const _EmptySurface({required this.icon, required this.message, this.detail});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: Grid.gutter),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Icon(icon, size: Grid.lg, color: context.colors.onSurfaceVariant),
|
|
const SizedBox(height: Grid.xxs),
|
|
Text(
|
|
message,
|
|
style: context.textTheme.bodyMedium?.copyWith(
|
|
color: context.colors.onSurfaceVariant,
|
|
),
|
|
),
|
|
if (detail != null) ...[
|
|
const SizedBox(height: Grid.half),
|
|
Text(
|
|
detail!,
|
|
style: context.textTheme.bodySmall?.copyWith(
|
|
color: context.colors.onSurfaceVariant,
|
|
),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _EmptyFilterState extends StatelessWidget {
|
|
final InboxFilter filter;
|
|
final bool unreadOnly;
|
|
|
|
const _EmptyFilterState({required this.filter, required this.unreadOnly});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (unreadOnly) {
|
|
return const _EmptySurface(
|
|
icon: BuzzIcons.mailOpen,
|
|
message: 'No unread messages',
|
|
detail: 'Turn off the unread filter to see read messages.',
|
|
);
|
|
}
|
|
final (icon, message) = switch (filter) {
|
|
InboxFilter.mention => (BuzzIcons.atSign, 'No mentions yet'),
|
|
InboxFilter.thread => (BuzzIcons.messageSquare, 'No thread replies yet'),
|
|
InboxFilter.needsAction => (
|
|
BuzzIcons.circleAlert,
|
|
'Nothing needs your action',
|
|
),
|
|
InboxFilter.activity => (
|
|
BuzzIcons.activity,
|
|
'No recent channel activity',
|
|
),
|
|
InboxFilter.agentActivity => (BuzzIcons.bot, 'No agent updates'),
|
|
_ => (BuzzIcons.bell, 'No activity yet'),
|
|
};
|
|
return _EmptySurface(icon: icon, message: message);
|
|
}
|
|
}
|
|
|
|
class _ErrorView extends StatelessWidget {
|
|
final Future<void> Function() onRetry;
|
|
|
|
const _ErrorView({required this.onRetry});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Icon(
|
|
BuzzIcons.triangleAlert,
|
|
size: Grid.lg,
|
|
color: context.colors.error,
|
|
),
|
|
const SizedBox(height: Grid.xxs),
|
|
Text(
|
|
'Failed to load activity',
|
|
style: context.textTheme.bodyMedium?.copyWith(
|
|
color: context.colors.onSurfaceVariant,
|
|
),
|
|
),
|
|
const SizedBox(height: Grid.xs),
|
|
FilledButton.icon(
|
|
onPressed: () => unawaited(onRetry()),
|
|
icon: const Icon(BuzzIcons.refreshCcw, size: 16),
|
|
label: const Text('Retry'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|