feat(app): block selecting already-uploaded photos at picker tap (double-tap to force)

方案 A(选图点选拦截):multiImagePickerProvider 经 wechat_assets_picker
10.1.3 官方钩子 AssetPickerConfig.selectPredicate 挂 PickerDuplicateGate——
点选「已上传到目标相册」的照片当场拦下(SnackBar 提示),再次点击同一张
强制选择(escape hatch)。

- MultiImagePicker typedef 增参 accountId/albumId(拦截判定范围=当前
  目标相册;相册详情/连拍页两处调用点传入);
- 判定口径同 checkDuplicatesUnified:本机 TaskStore(同账号+相册+
  completed,filename+bytes)∪ 服务器单项预检(bytes;本机命中短路
  服务器,点选延迟考量);任一半场异常按该半场无命中,fileSize 失败等
  整体异常直接放行——enqueue 弹窗 + init 409 兜底不变;
- per-asset 判定缓存(二次点击瞬回)+ 二次点击放行集;取消选择恒放行
  且不预热放行集;
- AssetEntity 事实适配(PickerAssetFact 测试接缝):fileSize 为
  photo_manager 3.12 的 Future<int> 平台通道 getter(entity.dart:778),
  惰性求值;title 为 String?(Android 恒有值;iOS 需 needTitle——null
  时本机半场跳过,服务器按 bytes 仍可判);
- l10n pickerDuplicateBlocked(zh/en);测试替身签名同步
  (album_detail/capture_page 页测 + integration_test app_boot),
  页测补 (accountId, albumId) 接线断言;gate 五态用例入 enqueue_test。

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-29 10:10:49 +08:00
parent 2261b8aebc
commit 7e5c550fb3
13 changed files with 563 additions and 17 deletions
+1
View File
@@ -349,6 +349,7 @@
}
},
"uploadPickNone": "No photos selected",
"pickerDuplicateBlocked": "Already uploaded to this album — tap again to select anyway",
"albumManagePhotos": "Manage photos",
"albumTakeFirstPhoto": "Take the first photo",
"albumUploadDisabledHint": "Uploads are off for this album. New photos cannot be added right now",
@@ -1688,6 +1688,12 @@ abstract class AppLocalizations {
/// **'未选择照片'**
String get uploadPickNone;
/// No description provided for @pickerDuplicateBlocked.
///
/// In zh, this message translates to:
/// **'这张已上传到该相册——再点一次可强制选择'**
String get pickerDuplicateBlocked;
/// No description provided for @albumManagePhotos.
///
/// In zh, this message translates to:
@@ -856,6 +856,10 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get uploadPickNone => 'No photos selected';
@override
String get pickerDuplicateBlocked =>
'Already uploaded to this album — tap again to select anyway';
@override
String get albumManagePhotos => 'Manage photos';
@@ -828,6 +828,9 @@ class AppLocalizationsZh extends AppLocalizations {
@override
String get uploadPickNone => '未选择照片';
@override
String get pickerDuplicateBlocked => '这张已上传到该相册——再点一次可强制选择';
@override
String get albumManagePhotos => '管理照片';
+1
View File
@@ -349,6 +349,7 @@
}
},
"uploadPickNone": "未选择照片",
"pickerDuplicateBlocked": "这张已上传到该相册——再点一次可强制选择",
"albumManagePhotos": "管理照片",
"albumTakeFirstPhoto": "拍摄第一张照片",
"albumUploadDisabledHint": "相册已关闭上传,暂不能新增照片",