Files
Inboxintel/src/InboxIntel.Application/DTOs/AnalyticsDtos.cs
T
cesnimda ca02f40841 feat: Smart Folders sidebar, category heatmap, sidebar counts API
- Replace plain activity heatmap with CategoryHeatmapWidget on dashboard
- Add collapsible Smart Folders sidebar with Favorites, Mailbox, Smart Folders sections
- Favorites: customisable pinned shortcuts (default: Inbox, Unread, Large, Old, Read Later); pin/unpin smart folders via buttons; persists to localStorage
- Mailbox section: 11 Gmail mailbox items with icons and live count badges
- Smart Folders section: 10 category folders sorted by count desc
- Live count badges via new GET /api/v1/analytics/sidebar-counts endpoint
- Backend: SidebarCountsDto, GetSidebarCountsAsync with label lookups for SENT/DRAFT/SPAM, size/age filters, EmailCategory mapping
- Sidebar collapses to icon-only; section states persist to localStorage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 19:40:54 +02:00

45 lines
1.4 KiB
C#

namespace InboxIntel.Application.DTOs;
public record InboxHealthDto(
int Score, // 0-100
string Grade, // A-F
int TotalEmails,
int UnreadEmails,
int NewsletterCount,
int SafeToUnsubscribeCount,
long EstimatedStorageBytes,
IReadOnlyList<string> Recommendations);
public record TimeSeriesPointDto(DateOnly Day, int Count);
public record HeatmapCellDto(int DayOfWeek, int Hour, int Count);
/// <summary>Email counts per category per day-of-week, for the category heatmap.</summary>
public record CategoryHeatmapCellDto(string Category, int DayOfWeek, int Count);
/// <summary>Counts for the sidebar: mailbox labels, special filters, and smart folders.</summary>
public record SidebarCountsDto(
int Inbox,
int AllMail,
int Unread,
int Starred,
int Sent,
int Drafts,
int Trash,
int Spam,
int Large,
int Old,
IReadOnlyDictionary<string, int> SmartFolders);
public record AttachmentBreakdownDto(string MimeBucket, long TotalBytes, int Count);
public record DashboardSummaryDto(
InboxHealthDto Health,
int TotalEmails,
int UnreadEmails,
IReadOnlyList<SenderStatDto> TopSenders,
IReadOnlyList<TimeSeriesPointDto> VolumeOverTime,
IReadOnlyList<HeatmapCellDto> Heatmap,
IReadOnlyList<AttachmentBreakdownDto> AttachmentBreakdown,
long StorageEstimateBytes);