From ae140dbb0ae231502aaebf7f42d3a59d676aa25a Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sat, 18 Apr 2026 15:07:19 -0400 Subject: [PATCH] feat(ui): show relative timestamps on Dashboard and Downloads tables Converts the Source Health last-check column and the Downloads created-at column from locale date strings to human-relative times ("6 hours ago"). The absolute timestamp is preserved as a native browser tooltip so full precision is still one hover away; detail modals keep the absolute form. Co-Authored-By: Claude Opus 4.7 --- backend/app/api/downloads.py | 4 ++- backend/app/tasks/downloads.py | 1 + frontend/src/views/Dashboard.vue | 2 +- frontend/src/views/Downloads.vue | 47 +++++++++++++++++++++++++++----- 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/backend/app/api/downloads.py b/backend/app/api/downloads.py index ca8fe20..f42cc09 100644 --- a/backend/app/api/downloads.py +++ b/backend/app/api/downloads.py @@ -128,10 +128,12 @@ async def retry_download(download_id: int): if download.status != DownloadStatus.FAILED: return jsonify({"error": "Can only retry failed downloads"}), 400 - # Reset status to queued + # Reset status to queued and clear prior-run timestamps download.status = DownloadStatus.QUEUED download.error_type = None download.error_message = None + download.started_at = None + download.completed_at = None await session.commit() # Queue Celery task to retry the download diff --git a/backend/app/tasks/downloads.py b/backend/app/tasks/downloads.py index 3cdfa87..c3f0b2e 100644 --- a/backend/app/tasks/downloads.py +++ b/backend/app/tasks/downloads.py @@ -265,6 +265,7 @@ async def _download_source_async(source_id: int, download_id: int = None) -> dic download.status = DownloadStatus.RUNNING download.started_at = utcnow() + download.completed_at = None else: logger.warning(f"Download {download_id} not found, creating new record") download = None diff --git a/frontend/src/views/Dashboard.vue b/frontend/src/views/Dashboard.vue index ab65890..8f8d1ed 100644 --- a/frontend/src/views/Dashboard.vue +++ b/frontend/src/views/Dashboard.vue @@ -317,7 +317,7 @@ {{ source.error_count }} - {{ formatDate(source.last_check) }} + {{ source.last_check ? formatRelativeTime(source.last_check) : 'Never' }}