Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(email): allow mark done on the mail Calendar tab (#6316)

Peter Chinman2774b5aa6285
diff --git a/apps/web/src/features/next-soup/actions/make-mark-done-action.test.ts b/apps/web/src/features/next-soup/actions/make-mark-done-action.test.ts
index 1c03c73ad1..9f1ce59c93 100644
--- a/apps/web/src/features/next-soup/actions/make-mark-done-action.test.ts
+++ b/apps/web/src/features/next-soup/actions/make-mark-done-action.test.ts
@@ -69,7 +69,10 @@ vi.mock('@app/features/next-soup/utils', () => ({
restoreSoupFocus: vi.fn(),
}));
-import { makeMarkDoneAction } from './make-mark-done-action';
+import {
+ canExecuteMarkDoneOnView,
+ makeMarkDoneAction,
+} from './make-mark-done-action';
const currentEntity = {
type: 'email',
@@ -116,6 +119,19 @@ function createAction() {
}));
}
+describe('canExecuteMarkDoneOnView', () => {
+ it('allows mark done on every thread-listing mail tab', () => {
+ for (const tab of ['important', 'noise', 'calendar', 'shared', 'all']) {
+ expect(canExecuteMarkDoneOnView('mail', tab)).toBe(true);
+ }
+ });
+
+ it('keeps mark done off tabs whose rows are not triaged', () => {
+ expect(canExecuteMarkDoneOnView('mail', 'drafts')).toBe(false);
+ expect(canExecuteMarkDoneOnView('mail', 'sent')).toBe(false);
+ });
+});
+
describe('makeMarkDoneAction', () => {
beforeEach(() => {
mocks.controller.content.mockReturnValue({ id: 'other' });
diff --git a/apps/web/src/features/next-soup/actions/make-mark-done-action.ts b/apps/web/src/features/next-soup/actions/make-mark-done-action.ts
index e766ed3d7b..731fe7f54b 100644
--- a/apps/web/src/features/next-soup/actions/make-mark-done-action.ts
+++ b/apps/web/src/features/next-soup/actions/make-mark-done-action.ts
@@ -38,6 +38,9 @@ const VALID_MARK_DONE_LIST_VIEWS: `${ListView}-${string}`[] = [
'mail-important',
'mail-all',
'mail-noise',
+ // Calendar lists invite threads from the "all" email view, so done rows
+ // stay in place and flip to the done state exactly like mail "All".
+ 'mail-calendar',
'mail-shared',
// Completing a reminder is the whole point of the Reminders view: without
// it the only way to clear one is to delete it. Done is listed too so a