Improved notification badge behavior by refining how the unseen message count is tracked and displayed on the app icon.
Closes #239
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
## Bug Fixes
* Improved notification badge behavior by refining how the unseen message count is tracked and displayed on the app icon.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 91f8df6a-643d-486d-97c9-c0ef6742f439
📥 Commits
Reviewing files that changed from the base of the PR and between c1f5b6c8c1 and df5495a8bd.
📒 Files selected for processing (1)
js/desktop/src/hooks/use-dock-badge.ts
💤 Files with no reviewable changes (1)
js/desktop/src/hooks/use-dock-badge.ts
📝 Walkthrough
Walkthrough
The useDockBadge hook updates the macOS dock badge count from Firestore-derived unseenCount via useEffect. The cleanup function that previously reset the badge to 0 on unmount or dependency changes has been removed.
Changes
Dock Badge Effect Behavior
Layer / File(s)
Summary
Dock badge effect cleanup removal js/desktop/src/hooks/use-dock-badge.ts
The useEffect hook that updates platform.app.setDockBadge(unseenCount) no longer includes a cleanup handler to reset the badge to 0 when the component unmounts or dependencies change.
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
🐰A badge that persists when the effect takes leave, No reset in sight, quite bold to believe, One line removed, a cleanup passed by, The dock badge stands tall beneath the sky!
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
✅ Passed
The title directly addresses the main change: fixing an invalid dock badge count by removing a problematic cleanup function in the useDockBadge hook.
Docstring Coverage
✅ Passed
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check
✅ Passed
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
✅ Passed
Check skipped because no linked issues were found for this pull request.
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches📝 Generate docstrings
Create stacked PR
Commit on current branch
🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch 239-web-app-showing-inaccurate-badge-count
Comment @coderabbitai help to get the list of available commands and usage tips.
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->
[](https://app.coderabbit.ai/change-stack/flowy-live/llink/pull/250?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)
<!-- review_stack_entry_end -->
No actionable comments were generated in the recent review. 🎉
<details>
<summary>ℹ️ Recent review info</summary>
<details>
<summary>⚙️ Run configuration</summary>
**Configuration used**: defaults
**Review profile**: CHILL
**Plan**: Pro Plus
**Run ID**: `91f8df6a-643d-486d-97c9-c0ef6742f439`
</details>
<details>
<summary>📥 Commits</summary>
Reviewing files that changed from the base of the PR and between c1f5b6c8c1b5536279e839d35352be90d5bc8e28 and df5495a8bd6ef966cd9e3bed90c39bcd77c203b7.
</details>
<details>
<summary>📒 Files selected for processing (1)</summary>
* `js/desktop/src/hooks/use-dock-badge.ts`
</details>
<details>
<summary>💤 Files with no reviewable changes (1)</summary>
* js/desktop/src/hooks/use-dock-badge.ts
</details>
</details>
---
<!-- walkthrough_start -->
<details>
<summary>📝 Walkthrough</summary>
## Walkthrough
The `useDockBadge` hook updates the macOS dock badge count from Firestore-derived `unseenCount` via `useEffect`. The cleanup function that previously reset the badge to `0` on unmount or dependency changes has been removed.
## Changes
**Dock Badge Effect Behavior**
| Layer / File(s) | Summary |
|---|---|
| **Dock badge effect cleanup removal** <br> `js/desktop/src/hooks/use-dock-badge.ts` | The `useEffect` hook that updates `platform.app.setDockBadge(unseenCount)` no longer includes a cleanup handler to reset the badge to `0` when the component unmounts or dependencies change. |
## Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
## Poem
> 🐰 *A badge that persists when the effect takes leave,*
> *No reset in sight, quite bold to believe,*
> *One line removed, a cleanup passed by,*
> *The dock badge stands tall beneath the sky!*
</details>
<!-- walkthrough_end -->
<!-- pre_merge_checks_walkthrough_start -->
<details>
<summary>🚥 Pre-merge checks | ✅ 5</summary>
<details>
<summary>✅ Passed checks (5 passed)</summary>
| Check name | Status | Explanation |
| :------------------------: | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title directly addresses the main change: fixing an invalid dock badge count by removing a problematic cleanup function in the useDockBadge hook. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
</details>
<sub>✏️ Tip: You can configure your own custom pre-merge checks in the settings.</sub>
</details>
<!-- pre_merge_checks_walkthrough_end -->
<!-- finishing_touch_checkbox_start -->
<details>
<summary>✨ Finishing Touches</summary>
<details>
<summary>📝 Generate docstrings</summary>
- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> Create stacked PR
- [ ] <!-- {"checkboxId": "3e1879ae-f29b-4d0d-8e06-d12b7ba33d98"} --> Commit on current branch
</details>
<details>
<summary>🧪 Generate unit tests (beta)</summary>
- [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create PR with unit tests
- [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Commit unit tests in branch `239-web-app-showing-inaccurate-badge-count`
</details>
</details>
<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->
---
<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>
<!-- tips_end -->
<!-- internal state start -->
<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4AzeAA8u8DBLQX49WvgYBrSALRaUgVsDFwD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xViyWwspVcmlKzk0bO8Lo1VBjlCkBZVctlZyuAZIud6zhvK7kCoJVlYSol7nIA/KEegDVjKKvoHYa8gUURuGwK8d2DAi0mqYIY3MkB5gvPOKqnRGTVXTtLUyhhXr0UhukPgCweAm2cNceodShaV3sQ7dZB29qxLhUdkgGYJq1LMECogfliAbDyAdmuqg2lYD7muKeLdVLfWIuRUGutcalEJosEm/FnDl2JNlpmilkHc10oGZrTp9Bum9Ocsy2NlaOU1raVcht/KJKPOWc815WFYgMEOmMb2kAOlYQfVk5AGI1idrnh+Eun0eADFBcSAAjhxzQ5a4UPTA4G9ikmMXQYeLB5ZGGCWsdoLhjjlYenSEQMDUlizyWLOzcc9D+aCXOzwPPOdTAET7MLp2NsJTCOnOI1yyD5GSUEqedGWj9B6OMbWCxFjzhsMoB6RxyAXHhKrn7VegT/QpyifE8Bq5oGCUBpRXJ2N8alNwZTUsXAzsbDzFsyQFJCNtMyr0+wAzCzx4yMnkMtAB5eGbO2bsyjBKmQ9f/iAmmfX4gkCpFyKkOwRs2DpCkFk/8GC/3/kyJ4DJ/6PBsP/L+j5aDJD61/eIaAv4gIYAIJkX9/6JD2KhGwLLCzDNwLwxlAzaY2BpjYKk8QmQCBsPEAQZ2TvxC/pTH+aBabxFoAthgXJaZoEW/tgQIOmSJBIIj1QTI0A2FpjsJBT3xu0FoPsPYpKGvYKgJQ6hpA6HLNvmQ8+ODfr4BJuedMTDXjM5Ya9Aw2NbvcMC7QSsuBkSzUfkI9QUEwiE2SET3adOGeBeZzQUhc8adQGcL5MxcvaH3xmBJVnQJWGFiaEomg+NObJCZOTQI8RaZgH/nQf+YBaZMnptb9B8QwBfxIFD9HOwv5fzQPEeIE934q9MW4dXhDURa4wAr95QYgA=== -->
<!-- internal state end -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #239
Summary by CodeRabbit
Bug Fixes
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
91f8df6a-643d-486d-97c9-c0ef6742f439📥 Commits
Reviewing files that changed from the base of the PR and between
c1f5b6c8c1anddf5495a8bd.📒 Files selected for processing (1)
js/desktop/src/hooks/use-dock-badge.ts💤 Files with no reviewable changes (1)
📝 Walkthrough
Walkthrough
The
useDockBadgehook updates the macOS dock badge count from Firestore-derivedunseenCountviauseEffect. The cleanup function that previously reset the badge to0on unmount or dependency changes has been removed.Changes
Dock Badge Effect Behavior
js/desktop/src/hooks/use-dock-badge.tsuseEffecthook that updatesplatform.app.setDockBadge(unseenCount)no longer includes a cleanup handler to reset the badge to0when the component unmounts or dependencies change.Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
📝 Generate docstrings
🧪 Generate unit tests (beta)
239-web-app-showing-inaccurate-badge-countComment
@coderabbitai helpto get the list of available commands and usage tips.