diff --git a/src/main/ipc/teams.ts b/src/main/ipc/teams.ts index 98f7ac49..765193b5 100644 --- a/src/main/ipc/teams.ts +++ b/src/main/ipc/teams.ts @@ -375,7 +375,7 @@ function formatNotificationClockTime(date: Date): string { function buildRateLimitNotificationBody(plan: ReturnType): string { if (plan.kind === 'scheduled') { - return `Auto-resume scheduled at ${formatNotificationClockTime(plan.resetTime)}`; + return `Auto-resume scheduled at ${formatNotificationClockTime(new Date(plan.fireAtMs))}`; } return 'Manual restart needed'; } diff --git a/src/main/services/team/TeamProvisioningService.ts b/src/main/services/team/TeamProvisioningService.ts index 3c4c920f..dce403c8 100644 --- a/src/main/services/team/TeamProvisioningService.ts +++ b/src/main/services/team/TeamProvisioningService.ts @@ -24390,10 +24390,11 @@ export class TeamProvisioningService { missingNames.length > 0 ? missingNames.length : Math.max(0, launchSummary.pendingCount + launchSummary.failedCount); - const joinedCount = Math.max( - 0, - Math.min(expectedCount, launchSummary.confirmedCount || expectedCount - missingCount) - ); + const rawJoinedCount = + typeof launchSummary.confirmedCount === 'number' + ? launchSummary.confirmedCount + : expectedCount - missingCount; + const joinedCount = Math.max(0, Math.min(expectedCount, rawJoinedCount)); const missingLabel = missingNames.length > 0 ? `${missingNames.map((name) => `@${name}`).join(', ')} did not join` diff --git a/src/renderer/components/team/TeamDetailView.tsx b/src/renderer/components/team/TeamDetailView.tsx index 38b61dba..504f7a7d 100644 --- a/src/renderer/components/team/TeamDetailView.tsx +++ b/src/renderer/components/team/TeamDetailView.tsx @@ -1862,7 +1862,9 @@ export const TeamDetailView = memo(function TeamDetailView({ return; } - const section = document.querySelector(`[data-section-id="${sectionId}"]`); + const section = contentRef.current?.querySelector( + `[data-section-id="${sectionId}"]` + ); if (!section) return; section.dispatchEvent(new CustomEvent('team-section-navigate')); clearTeamSectionFocus(); diff --git a/src/renderer/store/slices/teamSlice.ts b/src/renderer/store/slices/teamSlice.ts index 306f76d0..4e69decd 100644 --- a/src/renderer/store/slices/teamSlice.ts +++ b/src/renderer/store/slices/teamSlice.ts @@ -1326,17 +1326,25 @@ function detectBlockedTaskNotifications( for (const task of newTasks) { const oldTask = oldTaskMap.get(`${task.teamName}:${task.id}`); - const oldBlockedBy = oldTask?.blockedBy?.filter(Boolean) ?? []; - const newBlockedBy = task.blockedBy?.filter(Boolean) ?? []; - const key = `${task.teamName}:${task.id}:${newBlockedBy.join(',')}`; + const oldBlockedBy = new Set(oldTask?.blockedBy?.filter(Boolean) ?? []); + const newBlockedBy = Array.from(new Set(task.blockedBy?.filter(Boolean) ?? [])); + const taskKeyPrefix = `${task.teamName}:${task.id}:`; + const key = `${taskKeyPrefix}${[...newBlockedBy].sort().join(',')}`; + const addedBlockedBy = newBlockedBy.filter((id) => !oldBlockedBy.has(id)); - if (newBlockedBy.length > 0 && oldBlockedBy.length === 0) { + for (const existingKey of Array.from(notifiedBlockedTaskKeys)) { + if (existingKey.startsWith(taskKeyPrefix) && existingKey !== key) { + notifiedBlockedTaskKeys.delete(existingKey); + } + } + + if (newBlockedBy.length > 0 && addedBlockedBy.length > 0) { if (notifiedBlockedTaskKeys.has(key)) continue; notifiedBlockedTaskKeys.add(key); fireTaskBlockedNotification(task, newBlockedBy, !notifyEnabled); } else if (newBlockedBy.length === 0) { for (const existingKey of Array.from(notifiedBlockedTaskKeys)) { - if (existingKey.startsWith(`${task.teamName}:${task.id}:`)) { + if (existingKey.startsWith(taskKeyPrefix)) { notifiedBlockedTaskKeys.delete(existingKey); } }