feat(mobile): upload queue ui and continuous capture page

Task 9 (P3 plan): queue tab replaces the stub, continuous capture page
enqueues per shot, album detail gains an upload FAB, and the upload
engine lifecycle is now bound to the login session.

- Engine scope: session account drives UploadEngine start/stop; wired
  from app boot, login success, logout, and 401 eviction. Tasks stay in
  the store across logout (accountId hard isolation).
- Queue tab: album x state x time filter bar, task rows with thumbnail,
  state chip, localized error copy, attempt count, per-row progress via
  a broadcast progress hub, state-dependent actions (re-pick retry,
  retryNow, cancel, delete), batch retry bar, 200ms-debounced live
  refresh from drift table updates.
- Capture page: camera preview via injected CaptureSource, one enqueue
  per shutter press, persistent album/category/badges overlay with a
  switch-only-affects-new-shots hint, gallery multi-pick, exit confirm
  while uploads are pending, permission-denied and init-failure views.
- POST_NOTIFICATIONS runtime permission via a small MethodChannel
  (photolive/permissions) + PermissionPlugin.kt: single runtime
  permission need, avoids permission_handler dependency; requested once
  on first enqueue, silent degradation when denied or unavailable.
- Album detail FAB: capture-and-upload / pick-from-gallery sheet.
- l10n: ~50 new keys in zh/en arbs; tests: +45 (filter matrix, engine
  scope lifecycle, permission gate, queue tab, capture page, FAB entry);
  existing page tests updated to inject session/task-store fakes.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-19 04:47:31 +08:00
parent 42e1c2e34b
commit 955f9b13c1
30 changed files with 4206 additions and 51 deletions
@@ -370,4 +370,171 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get thisDevice => 'This device';
@override
String get queueAlbumFilterAll => 'All albums';
@override
String get queueStateAll => 'All';
@override
String get queueStatePreparing => 'Preparing';
@override
String get queueStateQueued => 'Queued';
@override
String get queueStateUploading => 'Uploading';
@override
String get queueStateWaitingNetwork => 'Waiting for network';
@override
String get queueStateFailed => 'Failed';
@override
String get queueStateCompleted => 'Done';
@override
String get queueTimeAll => 'Any time';
@override
String get queueTimeToday => 'Today';
@override
String get queueTimeLast7Days => 'Last 7 days';
@override
String get queueTimeLast30Days => 'Last 30 days';
@override
String get queueEmpty => 'No upload tasks';
@override
String get queueRetryAllFailed => 'Retry all failed';
@override
String queueAttemptCount(int count) {
return '$count attempt(s)';
}
@override
String get taskStatePreparing => 'Preparing';
@override
String get taskStatePreparationFailed => 'Preparation failed';
@override
String get taskStateQueued => 'Queued';
@override
String get taskStateUploading => 'Uploading';
@override
String get taskStateUploadedConfirming => 'Confirming';
@override
String get taskStateCompleted => 'Completed';
@override
String get taskStateWaitingNetwork => 'Waiting for network';
@override
String get taskStateRetryableFailed => 'Upload failed';
@override
String get taskStateCancelled => 'Cancelled';
@override
String get errorPrepSourceUnreadable =>
'Could not read the selected photo. Please reselect';
@override
String get errorPrepUnsupportedType =>
'Only JPG, PNG and HEIC images are supported';
@override
String get errorPrepTooLarge => 'Photo exceeds the 50MB limit';
@override
String get errorPrepCopyFailed => 'Failed to copy the photo. Please retry';
@override
String get errorUploadSourceMissing =>
'Source file is missing. Please reselect';
@override
String get errorAlbumUploadDisabled => 'Album uploads are disabled';
@override
String get errorUploadSessionConflict =>
'Upload session conflict. Please retry';
@override
String get errorUploadVerifyFailed =>
'Upload verification failed. Will retry';
@override
String get captureTitle => 'Continuous capture';
@override
String get captureCategoryDefault => 'Default category';
@override
String get captureSwitchHint =>
'Switching only affects photos captured afterwards';
@override
String capturePendingBadge(int count) {
return 'Pending $count';
}
@override
String captureFailedBadge(int count) {
return 'Failed $count';
}
@override
String get capturePickFromGallery => 'Pick from gallery';
@override
String get captureShutter => 'Capture';
@override
String get captureExitTitle => 'Leave shooting?';
@override
String captureExitBody(int count) {
return '$count photo(s) are still uploading. Tasks will continue in the background after you leave.';
}
@override
String get captureKeepShooting => 'Keep shooting';
@override
String get captureExitConfirm => 'Leave';
@override
String get cameraPermissionDenied =>
'Camera unavailable. Allow camera access in system settings';
@override
String get cameraInitFailed => 'Camera failed to initialize';
@override
String get uploadActionCapture => 'Capture and upload';
@override
String get uploadActionPick => 'Pick from gallery';
@override
String get uploadAction => 'Upload';
@override
String uploadEnqueuedCount(int count) {
return 'Added $count photo(s) to the upload queue';
}
@override
String get uploadPickNone => 'No photos selected';
}