feat(desktop): coalesce burst feed notifications into one toast - #6768
Open
mfethe1 wants to merge 1 commit into
Open
feat(desktop): coalesce burst feed notifications into one toast#6768mfethe1 wants to merge 1 commit into
mfethe1 wants to merge 1 commit into
Conversation
The feed notification hook delivered one OS notification and one sound per eligible item, so a burst of ten items produced ten toasts. Buffer eligible items for a bounded 2s window and flush once: two or more items collapse into a single count-only summary, while a lone item keeps its existing single-item format so the common case is unchanged. The summary is derived from counts and the relay's existing needs_action partition only - no item content, channel name, or pubkey reaches the toast. Scoped to the feed producer; the WebSocket producer is deliberately untouched. Signed-off-by: Michael Feth <michael@jira-flow.com>
mfethe1
force-pushed
the
upstream/HW-011
branch
from
August 25, 2026 08:50
822e12d to
9811a7c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A burst of feed items produced one OS notification and one sound per item, so ten items meant ten toasts.
This buffers eligible feed items for a bounded 2s window and flushes once:
The summary is derived only from counts and the relay's existing
needs_actionpartition — no item content, channel name, or pubkey reaches the toast.Scope: the feed producer only. The WebSocket producer is deliberately untouched, so an item arriving via WS during an open window can still raise its own toast. That is a known, deliberate limitation of this slice rather than an oversight — keeping it narrow avoids colliding with #5806, which owns
hooks.tsandapp/useAppShellDesktopNotifications.ts.3 files, +252/-1. New logic is a pure module (
lib/coalesce.ts) with 6 unit tests.Checks
pnpm typecheck— cleanpnpm check:px-text,check:pubkey-truncation— cleanpnpm check:file-sizesis red onmaintoday forChannelPane.tsx/ChannelScreen.tsx; this PR touches neither and adds no lines to either.Not verified (stated explicitly)
Overlap
#5806 also touches
use-feed-desktop-notifications.ts(open, last updated 2026-08-22). It does not addlib/coalesce.ts. No open PR implements notification coalescing/digest policy — the other notification PRs are delivery-layer (sound, toast delivery, permission, click routing). Happy to rebase if #5806 lands first.