Skip to content

Add live upload status tracking to recorder screen - #3

Merged
dschuld merged 1 commit into
mainfrom
claude/upload-status-display-lcvzbe
Aug 2, 2026
Merged

Add live upload status tracking to recorder screen#3
dschuld merged 1 commit into
mainfrom
claude/upload-status-display-lcvzbe

Conversation

@dschuld

@dschuld dschuld commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds live upload status tracking to the recorder screen, allowing users to see real-time progress of their recording uploads (queued → uploading → uploaded/failed) instead of only seeing the initial intent at save time.

Key Changes

  • New upload status model (UploadStatus.kt): Introduced UploadStage enum and UploadStatus data class to represent the lifecycle of an upload job, along with uploadStatusOf() function to map WorkManager states to UI-friendly status.

  • Upload status repository (UploadStatusRepository.kt): Created repository to observe WorkManager job state for a specific recording file, converting WorkInfo to UploadStatus and exposing it as a Flow.

  • Enhanced UploadWorker: Modified to report error messages and "kept local" status through WorkManager's output/progress data, enabling the UI to display failure reasons and retry attempts.

  • UploadScheduler refactoring: Extracted uniqueWorkName() function to centralize the naming scheme for upload jobs, making it reusable by the status repository.

  • RecorderViewModel integration: Added uploadStatus StateFlow that tracks the last saved recording's upload job, automatically switching to null when a new recording is saved.

  • UI component (UploadStatusRow): New composable that displays upload status with appropriate icons (cloud queue, upload, sync, done, off, error) and colors, including a progress indicator during active uploads. Shows contextual messages for queued, uploading, retrying, uploaded, kept local, and failed states.

  • String resources: Added new localized strings for all upload states and failure scenarios.

Notable Implementation Details

  • The status repository uses getWorkInfosForUniqueWorkFlow() to observe job state changes across process death, ensuring status persists even if the app is killed.
  • Error messages are communicated via WorkManager's output data (for finished jobs) and progress data (for retries), with fallback handling for missing data.
  • The UI gracefully handles missing configuration and Drive connectivity issues by showing appropriate status messages.
  • Attempt counting is 1-based for user-facing display, converting from WorkManager's 0-based runAttemptCount.

https://claude.ai/code/session_01AQtNehwfpS6kw5PqKyRMnj

The status line under a saved recording was derived from build config only,
so it said "Queued for upload" from the moment the recording was saved until
the app restarted — even after the upload had finished or failed.

The upload job's real state already lives in WorkManager, so observe it
instead of describing intent:

- UploadWorker reports why an attempt failed (progress data between retries,
  output data when it gives up) and flags uploads skipped for lack of
  credentials.
- UploadStatusRepository exposes that job as a Flow, mapped by the pure,
  unit-tested uploadStatusOf() onto queued / uploading / retrying (with
  attempt count) / uploaded / kept-on-device / failed.
- RecorderScreen renders it with a matching icon, a spinner while uploading,
  and the failure reason in the error color.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AQtNehwfpS6kw5PqKyRMnj
@dschuld
dschuld merged commit d8ee6d4 into main Aug 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants