v4: a chat mention notification opens the chat on the mentioned message, so the newest one clears the chat badge — it linked to ?chat=open, and the chat opened on the "new" divider whenever the unread messages didn't fit. That left the list above the bottom, so the read marker never moved and the badge stayed, while the mention itself was out of sight. It now links to ?chat=<message id>: ChatProvider opens on any ?chat= (open, or a message id passed to ChatModal as focusId), and ChatModal opens centred on that message and flashes it. When the message is within a screen of the bottom, the list stays at the bottom and reads everything, as it always has. An older mention still leaves the messages after it unread. A message outside the first page of history falls back to the divider. ChatModal's flash is now its own callback, shared with jumping to a message. 675 frontend tests pass, and tsc, eslint, deno fmt and doc:lint are clean; reproduced and checked in the app with 36 unread mentions from a second account: the newest clears the badge, an older one opens on it with the badge kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
khannurien
2026-10-09 08:56:59 +00:00
parent 4ea192e0b1
commit 256857f72e
5 changed files with 73 additions and 29 deletions

View File

@@ -167,7 +167,7 @@ describe("Notifications", () => {
);
expect(mentions).toEqual([
"/@bob/dumps/d6#comment-c3",
"/notifications?chat=open",
"/notifications?chat=x",
"/@bob/playlists/faves",
]);
expect(screen.getByText("a comment")).toBeInTheDocument();