feat: quick actions on email rows (read/unread, star, trash)
- EmailRow shared component with hover action buttons: mark read/unread, star/unstar, trash
- Optimistic UI — local state patches immediately on click; row fades and becomes non-interactive during the API call
- Trashed rows disappear from the current folder view via onRemove callback
- Backend: EmailController single-email endpoints (POST /email/{id}/read|unread|star|unstar|trash|untrash)
- Star/Unstar added to CleanupActionType enum and CleanupService (maps to STARRED Gmail label via BatchModifyAsync)
- UserId scope enforced in ResolveTargetsAsync — a user can only act on their own emails
- action buttons use stopPropagation so clicking them does not open Gmail
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,14 @@ public class CleanupService : ICleanupService
|
||||
await _gmail.BatchModifyAsync(userId, gmailIds, new[] { "UNREAD" }, Array.Empty<string>(), ct);
|
||||
emails.ForEach(e => e.IsUnread = true);
|
||||
break;
|
||||
case CleanupActionType.Star:
|
||||
await _gmail.BatchModifyAsync(userId, gmailIds, new[] { "STARRED" }, Array.Empty<string>(), ct);
|
||||
emails.ForEach(e => e.IsStarred = true);
|
||||
break;
|
||||
case CleanupActionType.Unstar:
|
||||
await _gmail.BatchModifyAsync(userId, gmailIds, Array.Empty<string>(), new[] { "STARRED" }, ct);
|
||||
emails.ForEach(e => e.IsStarred = false);
|
||||
break;
|
||||
case CleanupActionType.AddLabel:
|
||||
await _gmail.BatchModifyAsync(userId, gmailIds, new[] { request.LabelId! }, Array.Empty<string>(), ct);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user