chat notifications reach the phone, on the same rule as the bell
the browser bell and phone push are now two subscribers to one signal. both
ask shouldNotify(); neither owns the rule.
deliberately a second subscriber rather than a branch inside notify-delivery.
the two channels share only the question "does this account want to hear about
this" — the browser needs an open tab and sends the chat's real title over a
loopback socket on the owner's own tailnet, the phone needs no tab and must
send NO title, because that hop goes through apple. one function doing both
means an `if (isPush)` at every step, and the first thing to go wrong is a
title leaking because the branch was missed in one place.
two codes, officer/core:chat.turn-ended and chat.input-needed. the route is
written out with its scheme rather than derived from the target: the hub has
no chat screen — chat is Butler, a sibling app — so these deep-link OUT over
officer-chat://, and two of the suite's twenty-one schemes already break the
officer-<app> pattern (officer-videos, officer-readaloud). deriving that works
until it silently does not.
`thread` interpolates now, so `chat:{id}` groups per conversation. a static
thread forces a choice between "three pings from one chat collapse" and "two
busy chats stay apart", and the wrong answer is that every chat is the same
chat.
dropped officer/core:agent: chat.turn-ended supersedes it and its route
pointed at officer://chat/{id}, a hub screen that does not exist.
the banner cannot name which conversation. a chat's title is content and
content does not travel; it says what happened, and tapping opens the chat,
which is where the name lives.
This commit is contained in:
@@ -38,11 +38,12 @@ export function renderNotification(n: Notification, catalogue: Catalogue): Rende
|
||||
return {
|
||||
title: interpolate(entry.title, n),
|
||||
...(body ? { body } : {}),
|
||||
thread: entry.thread ?? n.code,
|
||||
thread: interpolate(entry.thread ?? n.code, n),
|
||||
};
|
||||
}
|
||||
|
||||
/** The grouping key for a code, whether or not the catalogue knows it. */
|
||||
export function threadFor(n: Notification, catalogue: Catalogue): string {
|
||||
return catalogue.entries[n.code]?.thread ?? n.code;
|
||||
// Interpolated, so `chat:{id}` groups per conversation rather than lumping every chat together.
|
||||
return interpolate(catalogue.entries[n.code]?.thread ?? n.code, n);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user