Skip to content

fix(google-chat) - fix(alibaba-chat) update unread badge - #698

Open
dansleboby wants to merge 3 commits into
ferdium:mainfrom
dansleboby:main
Open

fix(google-chat) - fix(alibaba-chat) update unread badge#698
dansleboby wants to merge 3 commits into
ferdium:mainfrom
dansleboby:main

Conversation

@dansleboby

Copy link
Copy Markdown

Pre-flight Checklist

Please ensure you've completed all of the following.

Description of Change

Add a MutationObserver to detect unread badge changes in Google Chat and recalculate the Ferdium badge immediately. DOM mutations are batched with requestAnimationFrame to avoid redundant badge updates. The existing Ferdium loop is kept as a fallback. The aggregate Shortcuts section is still ignored to prevent unread messages from being counted twice.

Add a MutationObserver to detect unread badge changes in Google Chat and recalculate the Ferdium badge immediately. DOM mutations are batched with requestAnimationFrame to avoid redundant badge updates. The existing Ferdium loop is kept as a fallback. The aggregate Shortcuts section is still ignored to prevent unread messages from being counted twice.
Update the Ferdium badge logic to select the last .option-item in the inbox panel and read its .item-unread-num value.

The unread value is now safely parsed as an integer, with empty or invalid values defaulting to 0.
@dansleboby dansleboby changed the title fix(google-chat): update unread badge on DOM changes fix(google-chat) - fix(alibaba-chat) update unread badge Jun 17, 2026

@SpecialAro SpecialAro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the fixes! The Alibaba Chat and ClickUp changes look reasonable, but I think this PR needs a small update before merging.

The Google Chat change has now been superseded by #701, which is already merged and uses a simpler unread-count implementation. Could you please rebase this PR and drop the Google Chat changes to avoid overwriting the newer fix?

Also, please bump the recipe versions for Alibaba Chat and ClickUp. Ferdium relies on recipe version bumps to distribute updated recipes to users.

With those changes, this should be in good shape.

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.

2 participants