Repository navigation
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
1 task done
Member
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
3 of 6 tasks
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.
Issue for this PR
Related to #43937 (that issue asks for a Desktop Electron taskbar badge; this PR adds the equivalent for the web PWA via the Badging API and does not close that issue).
Type of change
What does this PR do?
The installed web PWA (Chrome -> Install, Windows taskbar) currently shows no icon badge at all. In-app unread state only exists as a small dot on the session avatar, with no count.
This PR syncs the number of distinct sessions needing attention to the OS app icon using
navigator.setAppBadge(n)/navigator.clearAppBadge(). That covers both unseen turn/error notifications and pending manual permission/question requests, matching the session avatar dot exactly. Viewing a session (or deleting it) clears its entry through the existingmarkViewedflow, which drops the count back down automatically. Browsers without the API are skipped silently.Scope is intentionally narrow: selected server only (the same scope the avatar dots and mark-as-viewed use, so the badge can never get stuck on entries the UI cannot clear), no service worker push, so the badge only lives while the page runs. Deleting a session also clears its notification entries now, including a one-time startup reconciliation for already-stuck ones.
How did you verify your code works?
bun testinpackages/app: 726 pass, 0 failbun run buildinpackages/app: passesbun run typecheckinpackages/app: same result as cleanorigin/dev(only the pre-existingsrc/custom-elements.d.tsfailure, unrelated to this change)Screenshots / recordings
No screenshot: the badge renders in OS taskbar chrome for an installed PWA, which I can't capture in this environment. Happy to add one from a Windows installed-PWA run if a maintainer wants it.
Checklist