Skip to content

feat(mark): persist unread project state and badge dock icon#348

Merged
matt2e merged 3 commits intomainfrom
app-count
Mar 5, 2026
Merged

feat(mark): persist unread project state and badge dock icon#348
matt2e merged 3 commits intomainfrom
app-count

Conversation

@matt2e
Copy link
Contributor

@matt2e matt2e commented Mar 5, 2026

Summary

  • Persist unread project IDs to disk so the unread state survives app restarts
  • Update the macOS dock badge count to reflect the number of unread projects
  • Add core:window:allow-set-badge-count Tauri capability
  • Prune stale unread entries when projects are deleted
  • Fix type error: use undefined instead of null for setBadgeCount parameter

Test plan

  • Verify unread badge appears on dock icon when a project has unread changes
  • Verify badge clears when navigating to the unread project
  • Restart the app and confirm unread state is restored
  • Delete a project and verify its unread entry is pruned

🤖 Generated with Claude Code

matt2e and others added 2 commits March 5, 2026 16:21
Unread project state was previously ephemeral and lost on app restart.
Now persisted to preferences.json and the macOS dock icon is badged
with the count of unread projects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@matt2e matt2e requested review from baxen and wesbillman as code owners March 5, 2026 05:23
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e66cdf872

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +290 to +292
// Restore persisted unread state and sync the dock badge.
try {
await projectStateStore.initFromStore();

Choose a reason for hiding this comment

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

P2 Badge Initialize unread state before pruning deleted projects

initNavigation() now calls projectStateStore.pruneDeletedProjects(...), but this startup block restores unread IDs only afterwards, so prune runs against an empty in-memory map and cannot remove stale persisted unread IDs. In the current order (App.svelte calls initNavigation() before projectStateStore.initFromStore()), deleted projects can still be restored as unread on restart and inflate the dock badge count; loading unread state first (or pruning the persisted IDs directly) avoids that mismatch.

Useful? React with 👍 / 👎.

Previously pruneDeletedProjects iterated over the in-memory states map,
which was empty when called before initFromStore(). Now reads directly
from the persistent store so stale unread entries are correctly removed
regardless of initialization order.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@matt2e matt2e merged commit b47e2a8 into main Mar 5, 2026
4 checks passed
@matt2e matt2e deleted the app-count branch March 5, 2026 06:16
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.

1 participant