Skip to content

fix(extension): badge icon count from notifiable missions only - #259

Merged
guyghost merged 11 commits into
developfrom
cursor/fix-extension-badge-count-a7e8
Jul 28, 2026
Merged

fix(extension): badge icon count from notifiable missions only#259
guyghost merged 11 commits into
developfrom
cursor/fix-extension-badge-count-a7e8

Conversation

@guyghost

@guyghost guyghost commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Problem

The Chrome extension icon badge counted every unseen mission from the current scan. Notifications already applied the score / smart-alert differential, so you could see something like:

  • Chrome notification: “2 nouvelles missions pertinentes”
  • Extension icon badge: 1000

Fix

  1. notifyHighScoreMissions now always returns notifiableMissionIds (the filtered differential), including when the Chrome notification is skipped by rate-limit.
  2. The icon badge / newMissionCount use notifiableMissionIds.length instead of the raw unseen pool.
  3. Docs + unit tests updated (including a 1000-unseen / 2-notifiable regression case).

Merge with develop

Fetched latest origin/develop and merged. Conflicts resolved:

  • background/index.ts — develop’s try/catch + settingsSnapshot, badge from notifiableMissionIds
  • background unit tests — rebuilt on develop’s harness with badge assertions
  • CI / package manifests / lockfile — took develop (main↔develop divergence; not intentional PR changes)

Also integrated remote updates (main merge + AGENTS.md from #258). Pushed to origin/cursor/fix-extension-badge-count-a7e8.

Open in Web Open in Cursor 

dependabot Bot and others added 5 commits July 20, 2026 16:11
Bumps the npm-minor-and-patch group with 11 updates:

| Package | From | To |
| --- | --- | --- |
| [turbo](https://github.com/vercel/turborepo) | `2.10.4` | `2.10.5` |
| [@supabase/ssr](https://github.com/supabase/ssr) | `0.12.0` | `0.12.3` |
| [@supabase/supabase-js](https://github.com/supabase/supabase-js/tree/HEAD/packages/core/supabase-js) | `2.110.2` | `2.110.7` |
| [svelte](https://github.com/sveltejs/svelte/tree/HEAD/packages/svelte) | `5.56.4` | `5.56.6` |
| [@sveltejs/kit](https://github.com/sveltejs/kit/tree/HEAD/packages/kit) | `2.69.2` | `2.70.0` |
| [@tailwindcss/vite](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/@tailwindcss-vite) | `4.3.2` | `4.3.3` |
| [svelte-check](https://github.com/sveltejs/language-tools) | `4.7.2` | `4.7.3` |
| [tailwindcss](https://github.com/tailwindlabs/tailwindcss/tree/HEAD/packages/tailwindcss) | `4.3.2` | `4.3.3` |
| [tsx](https://github.com/privatenumber/tsx) | `4.23.0` | `4.23.1` |
| [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/typescript-eslint) | `8.63.0` | `8.64.0` |
| [svelte2tsx](https://github.com/sveltejs/language-tools) | `0.7.57` | `0.7.58` |


Updates `turbo` from 2.10.4 to 2.10.5
- [Release notes](https://github.com/vercel/turborepo/releases)
- [Changelog](https://github.com/vercel/turborepo/blob/main/RELEASE.md)
- [Commits](vercel/turborepo@v2.10.4...v2.10.5)

Updates `@supabase/ssr` from 0.12.0 to 0.12.3
- [Release notes](https://github.com/supabase/ssr/releases)
- [Changelog](https://github.com/supabase/ssr/blob/main/CHANGELOG.md)
- [Commits](supabase/ssr@v0.12.0...v0.12.3)

Updates `@supabase/supabase-js` from 2.110.2 to 2.110.7
- [Release notes](https://github.com/supabase/supabase-js/releases)
- [Changelog](https://github.com/supabase/supabase-js/blob/master/packages/core/supabase-js/CHANGELOG.md)
- [Commits](https://github.com/supabase/supabase-js/commits/v2.110.7/packages/core/supabase-js)

Updates `svelte` from 5.56.4 to 5.56.6
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/main/packages/svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/commits/svelte@5.56.6/packages/svelte)

Updates `@sveltejs/kit` from 2.69.2 to 2.70.0
- [Release notes](https://github.com/sveltejs/kit/releases)
- [Changelog](https://github.com/sveltejs/kit/blob/version-3/packages/kit/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/kit/commits/@sveltejs/kit@2.70.0/packages/kit)

Updates `@tailwindcss/vite` from 4.3.2 to 4.3.3
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.3.3/packages/@tailwindcss-vite)

Updates `svelte-check` from 4.7.2 to 4.7.3
- [Release notes](https://github.com/sveltejs/language-tools/releases)
- [Commits](https://github.com/sveltejs/language-tools/compare/svelte-check@4.7.2...svelte-check@4.7.3)

Updates `tailwindcss` from 4.3.2 to 4.3.3
- [Release notes](https://github.com/tailwindlabs/tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tailwindlabs/tailwindcss/commits/v4.3.3/packages/tailwindcss)

Updates `tsx` from 4.23.0 to 4.23.1
- [Release notes](https://github.com/privatenumber/tsx/releases)
- [Changelog](https://github.com/privatenumber/tsx/blob/master/release.config.cjs)
- [Commits](privatenumber/tsx@v4.23.0...v4.23.1)

Updates `typescript-eslint` from 8.63.0 to 8.64.0
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/typescript-eslint/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.64.0/packages/typescript-eslint)

Updates `svelte2tsx` from 0.7.57 to 0.7.58
- [Release notes](https://github.com/sveltejs/language-tools/releases)
- [Commits](https://github.com/sveltejs/language-tools/compare/svelte2tsx@0.7.57...svelte2tsx@0.7.58)

---
updated-dependencies:
- dependency-name: turbo
  dependency-version: 2.10.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: "@supabase/ssr"
  dependency-version: 0.12.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: "@supabase/supabase-js"
  dependency-version: 2.110.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: svelte
  dependency-version: 5.56.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: "@sveltejs/kit"
  dependency-version: 2.70.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@tailwindcss/vite"
  dependency-version: 4.3.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: svelte-check
  dependency-version: 4.7.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: tailwindcss
  dependency-version: 4.3.3
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: tsx
  dependency-version: 4.23.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: typescript-eslint
  dependency-version: 8.64.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: svelte2tsx
  dependency-version: 0.7.58
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6 to 7.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
#243)

Bumps [@sveltejs/vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte/tree/HEAD/packages/vite-plugin-svelte) from 5.1.1 to 7.2.0.
- [Release notes](https://github.com/sveltejs/vite-plugin-svelte/releases)
- [Changelog](https://github.com/sveltejs/vite-plugin-svelte/blob/main/packages/vite-plugin-svelte/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/vite-plugin-svelte/commits/@sveltejs/vite-plugin-svelte@7.2.0/packages/vite-plugin-svelte)

---
updated-dependencies:
- dependency-name: "@sveltejs/vite-plugin-svelte"
  dependency-version: 7.2.0
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Guy MANDINA <guyghost@gmail.com>
The extension icon badge was counting every unseen mission from the
current scan (often ~1000), while Chrome notifications correctly used
the score/smart-alert differential (~2). Drive the badge from
notifiableMissionIds so both surfaces stay aligned, including when the
notification itself is rate-limited.
@vercel
vercel Bot temporarily deployed to Preview – pulse-dashboard July 26, 2026 07:47 Inactive
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pulse Ready Ready Preview, Comment Jul 28, 2026 2:08pm
pulse-dashboard Ready Ready Preview, Comment Jul 28, 2026 2:08pm

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
@guyghost
guyghost marked this pull request as ready for review July 26, 2026 07:50
Copilot AI review requested due to automatic review settings July 26, 2026 07:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a mismatch in the extension’s UX by ensuring the Chrome action badge reflects only the notifiable “new missions” differential (the same subset used for Chrome notifications), rather than the full unseen mission pool from a scan.

Changes:

  • notifyHighScoreMissions now returns notifiableMissionIds (missions that pass notification filters) even when a notification is skipped (e.g., cooldown) or fails to create.
  • Background scan persistence now sets the badge/new-mission count from notifiableMissionIds.length, aligning badge behavior with the notification differential.
  • Updated model documentation and expanded unit tests, including a regression case with 1000 unseen missions but only 2 notifiable ones.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
apps/extension/src/lib/shell/notifications/notify-missions.ts Extends notification result to include notifiableMissionIds, and returns it even when notification isn’t shown due to rate-limit or creation failure.
apps/extension/src/background/index.ts Updates badge/new-mission-count logic to mirror the notifiable differential rather than raw unseen count; preserves seen-marking only for actually shown notifications.
apps/extension/tests/unit/notifications/notify-missions.test.ts Updates expectations and adds coverage for “cooldown active but still return notifiable ids” behavior.
apps/extension/tests/unit/background/index.test.ts Adds regression tests ensuring badge uses notifiable subset (including large unseen pool + rate-limited scenarios).
apps/extension/src/models/notification-deep-link.model.md Documents the badge’s dependency on notifiableMissionIds rather than raw unseen scan size.

@guyghost
guyghost changed the base branch from main to develop July 26, 2026 07:52
Resolve conflicts from main/develop divergence:
- Keep develop CI workflows and package manifests/lockfile
- Keep develop scan ledger try/catch + settingsSnapshot notify path
- Keep badge driven by notifiableMissionIds (this branch's fix)
- Rebase badge unit tests onto develop's background test harness
…-a7e8' into cursor/fix-extension-badge-count-a7e8
Root lint-staged prettier rewrote the committed MV3 scenario inventory
into pretty-printed JSON, breaking seal-tested-dist exact JCS equality.
Restore the canonical single-line form and ignore the file from root
Prettier so future commits cannot reformat it.
@guyghost

Copy link
Copy Markdown
Owner Author

@copilot resolve the merge conflicts in this pull request

@guyghost
guyghost merged commit 2541361 into develop Jul 28, 2026
5 of 6 checks passed
Copilot stopped work on behalf of guyghost due to an error July 28, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants