Show a badge on the toolbar button: the unique postings captured from mail and waiting for review #2

Open
opened 2026-10-01 07:21:56 +00:00 by tiagoagueda · 0 comments
Owner

The list asks: "Make numbered badge next to the logo, with the number of unique job listings captured from emails and need review."

The skeleton sets no badge: src/background.js is empty, and it is where a badge belongs, since it has to be right with no window open. Thunderbird has action.setBadgeText for the toolbar button and messageDisplayAction.setBadgeText for the one on a message.

Where the number comes from

GET /api/v1/captures (the captures scope) lists exactly the captures waiting for review, as {items, count}. A capture that was reviewed leaves the list. Nothing in a row says which client sent it, so "captured from emails" cannot be read off the list.

What the extension should do

  • Count the postings waiting for review, once each ("unique"), by the rule postulo/postulo-chromium#5 settles for the browser extension: one per posting address. The function should be the same file, shared through shared.json.
  • Read the list on a timer and when the popup opens, and keep the last answer, as that issue describes. A timer needs the alarms permission, which test/manifest.test.mjs would have to allow.
  • Show the number on the toolbar button, "99+" above 99, and say it in words in the tooltip.
  • With Postulo unreachable, keep the last number.

Decisions

  • "From emails". (a) Only the captures this extension sent, by remembering their ids and counting the ones still in Postulo's list: what the words say, but a capture made from another Thunderbird profile is not counted. (b) Every capture waiting for review, whichever client sent it: the same number the browser extension shows. Recommended: (a), with the popup's list (#4) able to show the others.
  • Which button. Recommended: the toolbar button only. The button on a message is about that message.
  • Captures kept in Thunderbird and not yet sent, once #1 keeps any. Recommended: counted, as the browser extension proposes.

Needs from the server

Not filed on postulo/postulo. A row of GET /captures naming the token that made it would let "from emails" be exact across profiles.

Done when

  • Two captures of one posting sent from this extension and waiting in Postulo show as 1; reviewing them clears the badge within the timer's period.
  • The number survives a restart of Thunderbird.
  • test/i18n.test.mjs requires every new key in every language the extension ships, with identical placeholders: three today, more once #7 lands.

From the list of Thunderbird extension improvements of 2026-09-30.

The list asks: "Make numbered badge next to the logo, with the number of unique job listings captured from emails and need review." The skeleton sets no badge: `src/background.js` is empty, and it is where a badge belongs, since it has to be right with no window open. Thunderbird has `action.setBadgeText` for the toolbar button and `messageDisplayAction.setBadgeText` for the one on a message. ## Where the number comes from `GET /api/v1/captures` (the `captures` scope) lists exactly the captures waiting for review, as `{items, count}`. A capture that was reviewed leaves the list. Nothing in a row says which client sent it, so "captured from emails" cannot be read off the list. ## What the extension should do - Count the postings waiting for review, once each ("unique"), by the rule postulo/postulo-chromium#5 settles for the browser extension: one per posting address. The function should be the same file, shared through `shared.json`. - Read the list on a timer and when the popup opens, and keep the last answer, as that issue describes. A timer needs the `alarms` permission, which `test/manifest.test.mjs` would have to allow. - Show the number on the toolbar button, "99+" above 99, and say it in words in the tooltip. - With Postulo unreachable, keep the last number. ## Decisions - **"From emails".** (a) Only the captures this extension sent, by remembering their ids and counting the ones still in Postulo's list: what the words say, but a capture made from another Thunderbird profile is not counted. (b) Every capture waiting for review, whichever client sent it: the same number the browser extension shows. Recommended: (a), with the popup's list (#4) able to show the others. - **Which button.** Recommended: the toolbar button only. The button on a message is about that message. - **Captures kept in Thunderbird and not yet sent**, once #1 keeps any. Recommended: counted, as the browser extension proposes. ## Needs from the server Not filed on postulo/postulo. A row of `GET /captures` naming the token that made it would let "from emails" be exact across profiles. ## Done when - Two captures of one posting sent from this extension and waiting in Postulo show as 1; reviewing them clears the badge within the timer's period. - The number survives a restart of Thunderbird. - `test/i18n.test.mjs` requires every new key in every language the extension ships, with identical placeholders: three today, more once #7 lands. From the list of Thunderbird extension improvements of 2026-09-30.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo-thunderbird#2
No description provided.