Skip to content

Add toggle setting for Mac tray icon unread count display #1429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Weiged
Copy link

@Weiged Weiged commented Jun 16, 2025

This PR improves the Mac tray icon functionality by adding user control over unread message count display and improving the visual representation.

Changes:

  • Add toggle setting to control whether to display unread message count on Mac tray icon
  • Change Mac system tray unread message display to use icon with unread count text to avoid theme-related display issues

Fixes:

Improves Mac user experience with system tray functionality. The previous implementation had issues with icon color not automatically switching between black and white based on system theme, and users had no control over whether to show unread counts.

Screenshots and screen captures:
image
企业微信截图_2407321c-29eb-469a-8fc2-1c5808a90075

[You should add screenshots showing the tray icon before/after changes and the new toggle setting]

Platforms this PR was tested on:

  • Windows
  • macOS
  • Linux (specify distro)
Self-review checklist
  • Self-reviewed the changes for clarity and maintainability
    (variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

  • Explains differences from previous plans (e.g., issue description).
  • Highlights technical choices and bugs encountered.
  • Calls out remaining decisions and concerns.
  • Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

  • Each commit is a coherent idea.
  • Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

  • Visual appearance of the changes.
  • Responsiveness and internationalization.
  • Strings and tooltips.
  • End-to-end functionality of buttons, interactions and flows.
  • Corner cases, error conditions, and easily imagined bugs.

@timabbott
Copy link
Member

Thanks for the PR @Weiged! Can you clean up the commit history in addition to dropping the (I assume AI-generated) translations? Check out our GitHub guide and commit guidelines for more details.

@Weiged Weiged force-pushed the main branch 2 times, most recently from cc7608e to fa2fc00 Compare June 18, 2025 03:33
@zulipbot zulipbot added size: L and removed size: XL labels Jun 18, 2025
Add a new configuration option 'trayBadgeCount' that allows users to
display unread message count on the tray icon for macOS. When enabled,
the tray icon shows the unread count as a title badge instead of
modifying the icon image itself.

This change:
- Adds trayBadgeCount configuration option to config schema
- Adds toggle-tray-badge-count IPC message for preference updates
- Implements displayTrayIcon() function to handle platform-specific
  tray icon display logic
- Updates preference UI to show the option only on macOS
- Refactors tray logic to use consistent display methods across platforms

The feature is macOS-specific because other platforms already use
icon overlays to show unread counts, while macOS can use the cleaner
title badge approach.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants