Fix CodeRabbit review feedback

This commit is contained in:
2026-05-23 22:22:22 -07:00
parent afe1731514
commit dc9d7b77bb
13 changed files with 198 additions and 36 deletions
+1 -1
View File
@@ -219,7 +219,7 @@ test('confirmDayGroupDelete uses singular for one session', async () => {
try {
assert.equal(await confirmDayGroupDelete('Yesterday', 1), true);
assert.deepEqual(calls, ['Delete all 1 session from Yesterday and all associated data?']);
assert.deepEqual(calls, ['Delete this session from Yesterday and all associated data?']);
} finally {
globalThis.confirm = originalConfirm;
}
+6 -1
View File
@@ -44,8 +44,13 @@ export function confirmSessionDelete(): Promise<boolean> {
}
export function confirmDayGroupDelete(dayLabel: string, count: number): Promise<boolean> {
if (count === 1) {
return confirmWithStatsNativeDialogLayer(
`Delete this session from ${dayLabel} and all associated data?`,
);
}
return confirmWithStatsNativeDialogLayer(
`Delete all ${count} session${count === 1 ? '' : 's'} from ${dayLabel} and all associated data?`,
`Delete all ${count} sessions from ${dayLabel} and all associated data?`,
);
}