From cd73dc6cfdc22be958a37a2c4708c0aadd15fc1d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 7 Oct 2026 17:17:02 +0200 Subject: [PATCH] Keep Pinyin setup prompts visible --- shell/plugins/notifications/NotificationLogic.js | 4 +++- test/shell.d/notifications-test.sh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/shell/plugins/notifications/NotificationLogic.js b/shell/plugins/notifications/NotificationLogic.js index b152dc06..e4d69a53 100644 --- a/shell/plugins/notifications/NotificationLogic.js +++ b/shell/plugins/notifications/NotificationLogic.js @@ -195,7 +195,9 @@ function snapshotOf(notification, timestamp) { image: n.image || "", glyph: glyphFromHints(n.hints), execArgv: execArgvFromHints(n.hints), - urgency: n.urgency, + // Pinyin's first-use cloud prediction question needs an explicit answer. + // Its normal urgency otherwise dismisses it before users can read it. + urgency: n.appName === "Pinyin" && n.appIcon === "fcitx-pinyin" ? 2 : n.urgency, expireTimeout: expireTimeout, timestamp: timestamp === undefined ? Date.now() : timestamp } diff --git a/test/shell.d/notifications-test.sh b/test/shell.d/notifications-test.sh index 48414ed4..52665b0a 100644 --- a/test/shell.d/notifications-test.sh +++ b/test/shell.d/notifications-test.sh @@ -271,6 +271,8 @@ const notification = { expireTimeout: 1.5 } const snapshot = notifications.snapshotOf(notification, 12345) +assertEqual(notifications.snapshotOf({ appName: 'Pinyin', appIcon: 'fcitx-pinyin', urgency: 1 }).urgency, 2, 'Pinyin prompts stay visible until dismissed') +assertEqual(notifications.snapshotOf({ appName: 'Other', appIcon: 'fcitx-pinyin', urgency: 1 }).urgency, 1, 'other notification senders retain their urgency') assertDeepEqual( { id: snapshot.id,