From d8c23210bb15873f1cfcae3907bc28ae03ab277b Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Sat, 10 Oct 2026 02:55:49 +0200 Subject: [PATCH] fix(notifications): zh-CN for the display-time settings, and review leftovers (#564) - zh-CN entries for the two new rows (label and description). - The toast test header still described the dropped drawer logging, and the noise test typed three members nothing uses any more. - clickNotification's closing brace had been re-indented by accident. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/web/public/i18n.js | 5 +++++ src/web/public/notification-manager.js | 2 +- test/notification-manager-noise.test.ts | 3 --- test/toast-display-time.test.ts | 5 ++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/web/public/i18n.js b/src/web/public/i18n.js index 93d6a04f..adfeef3e 100644 --- a/src/web/public/i18n.js +++ b/src/web/public/i18n.js @@ -595,6 +595,11 @@ 'Audio Alerts': '声音提醒', 'Push Notifications': '推送通知', 'Notification Levels': '通知级别', + 'Toast display time': '弹出提示显示时长', + 'How long the corner pop-ups stay on screen.': '角落弹出提示在屏幕上停留的时长。', + 'Browser notification display time': '浏览器通知显示时长', + 'How long a desktop notification stays up before Codeman closes it. Your OS may close it sooner.': + '桌面通知在 Codeman 关闭它之前保持显示的时长。系统可能会更早关闭它。', Critical: '严重', 'Per-Event Settings': '按事件设置', 'Permission prompts': '权限提示', diff --git a/src/web/public/notification-manager.js b/src/web/public/notification-manager.js index c8cb0595..85750d4a 100644 --- a/src/web/public/notification-manager.js +++ b/src/web/public/notification-manager.js @@ -483,7 +483,7 @@ class NotificationManager { notif.read = true; this.unreadCount = Math.max(0, this.unreadCount - 1); this.updateBadge(); - } + } // Switch to session if available if (notif.sessionId && this.app.sessions.has(notif.sessionId)) { diff --git a/test/notification-manager-noise.test.ts b/test/notification-manager-noise.test.ts index 666e36e7..ffc1a625 100644 --- a/test/notification-manager-noise.test.ts +++ b/test/notification-manager-noise.test.ts @@ -24,9 +24,6 @@ type Manager = { normalizePreferences: (preferences: Record) => NotificationPreferences; notify: (notification: Record) => void; getToastDurationMs: () => number; - unreadCount: number; - markAllRead: () => void; - clearAll: () => void; }; const openWindows: JSDOM[] = []; diff --git a/test/toast-display-time.test.ts b/test/toast-display-time.test.ts index c7d89a49..1aca6f51 100644 --- a/test/toast-display-time.test.ts +++ b/test/toast-display-time.test.ts @@ -1,7 +1,6 @@ /** - * @fileoverview showToast() display time and drawer logging: a toast with no explicit - * `duration` uses the notification preference, an explicit `duration` (0 = sticky) still wins, - * and every toast is recorded in the notification drawer. + * @fileoverview showToast() display time: a toast with no explicit `duration` uses the + * notification preference, and an explicit `duration` (0 = sticky) still wins. */ import { readFileSync } from 'node:fs'; import { resolve } from 'node:path';