feat(app): 服务端历史行首缩略图 + 上传中心空态引导至服务端历史
- UploadSessionPhoto 解析可选 preview;历史行首有 thumb 渲染 PhotoThumbnail (SizedBox 定寸——Row 内裸 AspectRatio 无界约束),缺省回退中性占位 - 上传中心整体空态加「仅本机存储」说明 + 「查看服务端历史」tonal 按钮 (与右上 History 同路由);「需关注」空态保持专属文案不加引导 - l10n 增 queueEmptyDeviceHint / queueViewServerHistory Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -427,14 +427,24 @@ class _TaskListView extends ConsumerWidget {
|
||||
),
|
||||
data: (tasks) {
|
||||
if (tasks.isEmpty) {
|
||||
// 页面 15:异常视图空态专用文案(区别于整体队列空态)。
|
||||
// 页面 15:异常视图空态专用文案(区别于整体队列空态);整体空态
|
||||
// 附「本机口径说明 + 服务端历史」引导(卸载重装后本机库为空)。
|
||||
final needsAttentionEmpty =
|
||||
stateFilter == QueueStateFilter.needsAttention;
|
||||
return EmptyState(
|
||||
icon: stateFilter == QueueStateFilter.needsAttention
|
||||
icon: needsAttentionEmpty
|
||||
? Icons.task_alt_outlined
|
||||
: Icons.cloud_upload_outlined,
|
||||
title: stateFilter == QueueStateFilter.needsAttention
|
||||
title: needsAttentionEmpty
|
||||
? l10n.uploadsNoNeedsAttention
|
||||
: l10n.queueEmpty,
|
||||
subtitle: needsAttentionEmpty ? null : l10n.queueEmptyDeviceHint,
|
||||
actionLabel: needsAttentionEmpty
|
||||
? null
|
||||
: l10n.queueViewServerHistory,
|
||||
onAction: needsAttentionEmpty
|
||||
? null
|
||||
: () => Navigator.of(context).pushNamed('/server-history'),
|
||||
);
|
||||
}
|
||||
return ListView.builder(
|
||||
|
||||
@@ -30,6 +30,7 @@ import '../features/uploads/models.dart';
|
||||
import '../features/uploads/queue_controller.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../ui/components/empty_state.dart';
|
||||
import '../ui/components/photo_thumbnail.dart';
|
||||
import '../ui/components/error_state.dart';
|
||||
import '../ui/components/state_badge.dart';
|
||||
import '../ui/tokens.dart';
|
||||
@@ -381,20 +382,32 @@ class _ServerHistoryPageState extends ConsumerState<ServerHistoryPage> {
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
// 契约无图片 URL——中性占位(不伪造缩略图)。
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(kRadiusBadge),
|
||||
// 行首 48×48:有 preview(变体齐备且未隐藏/删除,服务端现签)→
|
||||
// 真实缩略图;缺省 → 中性占位图标(不伪造缩略图)。SizedBox 定
|
||||
// 尺寸——Row 内直接放 AspectRatio 是无界约束。
|
||||
if (record.photo.preview?.thumb.url case final String thumbUrl)
|
||||
SizedBox(
|
||||
width: 48,
|
||||
height: 48,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(kRadiusBadge),
|
||||
child: PhotoThumbnail(url: thumbUrl, aspectRatio: 1),
|
||||
),
|
||||
)
|
||||
else
|
||||
Container(
|
||||
width: 48,
|
||||
height: 48,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surfaceContainerHighest,
|
||||
borderRadius: BorderRadius.circular(kRadiusBadge),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.cloud_done_outlined,
|
||||
size: 24,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.cloud_done_outlined,
|
||||
size: 24,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: kSpace12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
|
||||
Reference in New Issue
Block a user