Keep Pinyin setup prompts visible

This commit is contained in:
David Heinemeier Hansson committed 2026-10-07 17:17:02 +02:00
1 parent fcda55944a
commit cd73dc6cfd
2 files changed
+5 -1

No files matched your search

@@ -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
}
+2
View File
@@ -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,