mirror of
https://github.com/block/buzz.git
synced 2026-12-01 05:32:24 +00:00
## Summary
- Refine the mobile composer with compact and expanded states, shared
footer fades, haptics, reliable keyboard dismissal, and full-width
camera and photo surfaces.
- Standardize popovers, filters, and section menus with consistent type,
strokes, radii, spacing, icons, and destructive styling.
- Align message presentation with desktop through consistent system
rows, typing and loading feedback, emoji placement, and predictable
photo viewing.
## Validation
- `just mobile-check`
- `just mobile-test` — 1,037 passed, 1 skipped
- Tested on Pixel 10 and a connected iPhone
## Snapshots
<table>
<tr>
<td align="center">Compact composer</td>
<td align="center">Attachment menu</td>
<td align="center">Recent photos</td>
</tr>
<tr>
<td><img
src="https://raw.githubusercontent.com/block/buzz/9732022cb13bb39ce797c4faaa714fe4c924955f/pr-3918--01-compact-composer.png"
width="260" /></td>
<td><img
src="https://raw.githubusercontent.com/block/buzz/9732022cb13bb39ce797c4faaa714fe4c924955f/pr-3918--02-attachment-menu.png"
width="260" /></td>
<td><img
src="https://raw.githubusercontent.com/block/buzz/9732022cb13bb39ce797c4faaa714fe4c924955f/pr-3918--03-photo-surface.png"
width="260" /></td>
</tr>
</table>
---------
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 {
|
|
const _LoadingSkeleton();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListView.separated(
|
|
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: LucideIcons.mailOpen,
|
|
message: 'No unread messages',
|
|
detail: 'Turn off the unread filter to see read messages.',
|
|
);
|
|
}
|
|
final (icon, message) = switch (filter) {
|
|
InboxFilter.mention => (LucideIcons.atSign, 'No mentions yet'),
|
|
InboxFilter.thread => (
|
|
LucideIcons.messageSquare,
|
|
'No thread replies yet',
|
|
),
|
|
InboxFilter.needsAction => (
|
|
LucideIcons.circleAlert,
|
|
'Nothing needs your action',
|
|
),
|
|
InboxFilter.activity => (
|
|
LucideIcons.activity,
|
|
'No recent channel activity',
|
|
),
|
|
InboxFilter.agentActivity => (LucideIcons.bot, 'No agent updates'),
|
|
_ => (LucideIcons.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(
|
|
LucideIcons.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(LucideIcons.refreshCcw, size: 16),
|
|
label: const Text('Retry'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|