@@ -126,6 +126,31 @@ const readerGridStyle = computed(() => ({
126126 " --reader-list-width" : ` ${listColumnWidth .value }px ` ,
127127}));
128128const syncJobs = computed (() => syncJobsQuery .data .value ?.jobs ?? []);
129+ const displayedSyncJobs = computed (() => {
130+ const seenAutomaticSuccesses = new Set <string >();
131+
132+ return syncJobs .value .filter ((job ) => {
133+ if (job .state === " pending" || job .state === " running" || job .state === " failed" ) {
134+ return true ;
135+ }
136+
137+ if (job .origin === " appUser" ) {
138+ return true ;
139+ }
140+
141+ if (job .state !== " succeeded" ) {
142+ return false ;
143+ }
144+
145+ const key = ` ${job .accountId }:${syncJobScopeKey (job .scope )} ` ;
146+ if (seenAutomaticSuccesses .has (key )) {
147+ return false ;
148+ }
149+
150+ seenAutomaticSuccesses .add (key );
151+ return true ;
152+ });
153+ });
129154const activeSyncJobs = computed (() =>
130155 syncJobs .value .filter ((job ) => job .state === " pending" || job .state === " running" ),
131156);
@@ -546,6 +571,14 @@ function syncJobScopeLabel(job: SyncJobRecord): string {
546571 return ` Custom ${job .scope .days }d ` ;
547572}
548573
574+ function syncJobScopeKey(scope : SyncJobRecord [" scope" ]): string {
575+ if (scope .type === " regular" ) {
576+ return " regular" ;
577+ }
578+
579+ return ` ${scope .type }:${scope .days } ` ;
580+ }
581+
549582function syncJobOriginLabel(job : SyncJobRecord ): string {
550583 return job .origin === " automatic" ? " ⟳" : " 👤" ;
551584}
@@ -880,15 +913,17 @@ async function selectAccountDefault(account: MailAccountMailboxTree) {
880913 class =" absolute right-10 top-9 z-20 flex max-h-[32rem] w-96 flex-col rounded-md border border-stone-300 bg-white p-2 shadow-lg"
881914 >
882915 <div class =" flex shrink-0 items-center justify-between gap-2 px-2 pb-2" >
883- <p class =" text-xs font-semibold uppercase text-slate-500" >Sync jobs</p >
884- <p class =" text-[11px] text-slate-400" >{{ syncJobs.length }} total</p >
916+ <p class =" text-xs font-semibold uppercase text-slate-500" >Sync activity</p >
917+ <p class =" text-[11px] text-slate-400" >
918+ {{ displayedSyncJobs.length }} shown
919+ </p >
885920 </div >
886- <div v-if =" syncJobs .length === 0" class =" px-2 py-3 text-sm text-slate-500" >
921+ <div v-if =" displayedSyncJobs .length === 0" class =" px-2 py-3 text-sm text-slate-500" >
887922 No recent jobs.
888923 </div >
889924 <div v-else class =" min-h-0 flex-1 space-y-1 overflow-y-auto pr-1" >
890925 <div
891- v-for =" job in syncJobs "
926+ v-for =" job in displayedSyncJobs "
892927 :key =" job.id"
893928 class =" rounded border border-stone-200 px-2 py-1.5 text-xs"
894929 >
0 commit comments