9dfa06ffee
Docker image / Build (linux/amd64) (push) Has been cancelled
Docker image / Build (linux/arm64) (push) Has been cancelled
Docker image / Merge release multi-arch manifest (push) Has been cancelled
Docker image / Merge debug multi-arch manifest (push) Has been cancelled
Docker image / Build public push gateway (linux/amd64) (push) Has been cancelled
Docker image / Build public push gateway (linux/arm64) (push) Has been cancelled
Docker image / Publish public push gateway image (push) Has been cancelled
Sprig image / Build (linux/amd64) (push) Has been cancelled
Sprig image / Build (linux/arm64) (push) Has been cancelled
Sprig image / Merge multi-arch manifest (push) Has been cancelled
Harbor Buzz Orchestra / Python tests and lint (push) Has been cancelled
CI / Detect Changed Paths (push) Has been cancelled
CI / Rust Lint (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Desktop Core (push) Has been cancelled
CI / Desktop Smoke E2E (1) (push) Has been cancelled
CI / Desktop Smoke E2E (2) (push) Has been cancelled
CI / Desktop Smoke E2E (3) (push) Has been cancelled
CI / Desktop Smoke E2E (4) (push) Has been cancelled
CI / Desktop (push) Has been cancelled
CI / Desktop E2E Relay (push) Has been cancelled
CI / Desktop E2E Integration (1/2) (push) Has been cancelled
CI / Desktop E2E Integration (2/2) (push) Has been cancelled
CI / Desktop E2E Integration (push) Has been cancelled
CI / Backend Integration (relay e2e) (push) Has been cancelled
CI / Relay E2E (push) Has been cancelled
CI / Web (push) Has been cancelled
CI / Mobile (push) Has been cancelled
CI / Security (push) Has been cancelled
CI / Dead Token Reference Guard (push) Has been cancelled
CI / Server Cross-Compile (aarch64-unknown-linux-musl) (push) Has been cancelled
CI / Server Cross-Compile (x86_64-unknown-linux-musl) (push) Has been cancelled
CI / Windows Rust (x86_64-pc-windows-msvc) (push) Has been cancelled
CI / Desktop Build (macOS) (push) Has been cancelled
helm chart / lint + unittest + render matrix (push) Has been cancelled
helm chart / install on kind (gated) (push) Has been cancelled
helm chart / publish chart to GHCR (push) Has been cancelled
Mesh Lifecycle / Relay-Driven Mesh Lifecycle Smoke (push) Has been cancelled
Sprig / Build (aarch64-unknown-linux-musl) (push) Has been cancelled
Sprig / Build (x86_64-unknown-linux-musl) (push) Has been cancelled
Sprig / Publish rolling release (push) Has been cancelled
Sprig / Publish tagged release (push) Has been cancelled
Signed-off-by: cls_宁波本机 <908705107@qq.com>
187 lines
5.4 KiB
Dart
187 lines
5.4 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 _EmptySurface(
|
|
icon: LucideIcons.mailOpen,
|
|
message: context.l10n.activityNoUnread,
|
|
detail: context.l10n.activityUnreadHint,
|
|
);
|
|
}
|
|
final (icon, message) = switch (filter) {
|
|
InboxFilter.mention => (
|
|
LucideIcons.atSign,
|
|
context.l10n.activityNoMentions,
|
|
),
|
|
InboxFilter.thread => (
|
|
LucideIcons.messageSquare,
|
|
context.l10n.activityNoThreadReplies,
|
|
),
|
|
InboxFilter.needsAction => (
|
|
LucideIcons.circleAlert,
|
|
context.l10n.activityNothingNeedsAction,
|
|
),
|
|
InboxFilter.activity => (
|
|
LucideIcons.activity,
|
|
context.l10n.activityNoRecent,
|
|
),
|
|
InboxFilter.agentActivity => (
|
|
LucideIcons.bot,
|
|
context.l10n.activityNoAgentUpdates,
|
|
),
|
|
_ => (LucideIcons.bell, context.l10n.activityNoActivity),
|
|
};
|
|
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(
|
|
context.l10n.activityLoadFailed,
|
|
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: Text(context.l10n.retry),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|