diff --git a/CHANGELOG.md b/CHANGELOG.md index a222f96..449c721 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## [Unreleased] + +### Changed + +- Dashboard "Recent Processing Runs" table replaced with a per-account **Mailbox Status** view: each account now shows its last-check status (OK / Error / Pending), relative last-check time, any error message, and lifetime processed/failed counters. The noisy per-run table is gone; full activity history remains available on the Logs page. +- Stats cards updated: "Emails Forwarded Today" → "Emails Processed" (all-time total from account records); "Errors" → "Accounts with Errors" (count of accounts currently showing an error). + ## v0.3.2 (2026-03-28) ### Bug Fixes diff --git a/docs/TODO.md b/docs/TODO.md index 82bca22..2a77b4e 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -4,6 +4,7 @@ Comprehensive task breakdown for repository improvements and production readines ## ✅ Recently Completed +- [x] **Dashboard redesign**: Replaced noisy "Recent Processing Runs" table with a per-account "Mailbox Status" view showing last-check status (OK/Error/Pending), relative timestamp, error messages, and lifetime counters. Stats cards updated to show all-time processed count and accounts-with-errors count. - [x] **Pull Now**: Added "Pull Now" button on Accounts page that immediately queues a `process_mail_account` Celery task via `POST /mail-accounts/{id}/pull-now`. Button shows spinner while in flight and is disabled for inactive accounts. - [x] Fixed 21 mypy type errors: `Column[T]` vs native type mismatches in `notification_service.py`, `mail_processor.py`, `auth.py`, `tasks.py`, `providers.py`, `mail_accounts.py`, and `main.py` (`lifespan` parameter rename). - [x] **Provider logos rework**: Logos now displayed as full-width banner strips at the top of each account card using `next/image fill + object-contain`. Handles all aspect ratios (1:1 square to 6:1 wordmark) without distortion. Proton Mail added. diff --git a/frontend/src/app/dashboard/page.tsx b/frontend/src/app/dashboard/page.tsx index 07b77a4..5e5f74e 100644 --- a/frontend/src/app/dashboard/page.tsx +++ b/frontend/src/app/dashboard/page.tsx @@ -3,38 +3,44 @@ import { AuthGuard } from '@/components/AuthGuard'; import { DashboardLayout } from '@/components/DashboardLayout'; import { useQuery } from '@tanstack/react-query'; -import { mailAccountsApi, processingRunsApi } from '@/lib/api'; +import { mailAccountsApi, MailAccount } from '@/lib/api'; import Link from 'next/link'; -import { - Mail, - Send, - CheckCircle, +import { + Mail, + Send, + CheckCircle, AlertCircle, - TrendingUp, - Clock + Clock, + XCircle, + AlertTriangle, + Inbox, } from 'lucide-react'; +function formatRelative(iso?: string | null): string { + if (!iso) return 'Never'; + const diff = Date.now() - new Date(iso).getTime(); + const minutes = Math.floor(diff / 60000); + if (minutes < 1) return 'Just now'; + if (minutes < 60) return `${minutes}m ago`; + const hours = Math.floor(minutes / 60); + if (hours < 24) return `${hours}h ago`; + return `${Math.floor(hours / 24)}d ago`; +} + interface StatCardProps { title: string; value: string | number; icon: React.ComponentType<{ className?: string }>; iconColor: string; - trend?: string; } -function StatCard({ title, value, icon: Icon, iconColor, trend }: StatCardProps) { +function StatCard({ title, value, icon: Icon, iconColor }: StatCardProps) { return (
{title}
{value}
- {trend && ( -{account.name}
+{account.email_address}
++ {formatRelative(lastChecked)} +
+{account.last_error_message}
+| - Account - | -- Started At - | -- Status - | -- Fetched - | -- Forwarded - | -- Errors - | -
|---|---|---|---|---|---|
| - {run.account_name || account?.name || `Account ${run.mail_account_id}`} - | -
-
-
- |
- - - {run.status} - - | -- {run.emails_fetched} - | -- {run.emails_forwarded} - | -- {run.emails_failed > 0 ? ( - {run.emails_failed} - ) : ( - 0 - )} - | -
No processing runs yet
-No mail accounts configured yet.
+ + Add your first account → + +