Skip to content

Conversation

@fredcw
Copy link
Contributor

@fredcw fredcw commented Dec 12, 2024

Continuing on from the great work by @romario-07 in #12561 this adds a different color notification badge on the right of the icon and both badge sizes are adjusted automatically to the size of the icon. The "Show window count numbers" config option is removed as it seems fairly pointless.

@clefebvre @mtwebster Is this too late for the beta?

28px panel:
Screenshot from 2024-12-12 07-40-46

40px panel (Mint default):
Screenshot from 2024-12-12 07-40-55

48px panel:
Screenshot from 2024-12-12 07-41-15

The issue mentioned in this comment is fixed.

In Mint-Y, 40 px:
Screenshot from 2024-12-12 07-56-51

closes #10124

Edit: Changed window count badge to bottom left and adjusted notification color:

Screenshot from 2025-04-27 16-25-31

Known issue: If config option "Group windows by application" is changed, current notification counts in applet are reset to zero.

@clefebvre
Copy link
Member

Yes, new features don't go in past BETA.

@clefebvre clefebvre changed the title GWL: add notification badges to panel icons [Next] GWL: add notification badges to panel icons Dec 19, 2024
@anaximeno
Copy link
Contributor

I don't know if I like the two numbers side by side (it excludes a big portion of the top of the icon and presents two conflicting pieces of information side by side, requiring more effort than necessary to interpret the values since they are very close, despite having different colors). We could try to think of a better way to present that information until the next merge period for the next release.

@Secret-chest
Copy link
Contributor

The "Show window count numbers" config option is removed as it seems fairly pointless.

Why? I'm not using a phone OS

@clefebvre clefebvre changed the title [Next] GWL: add notification badges to panel icons GWL: add notification badges to panel icons Feb 24, 2025
@mtwebster mtwebster requested review from Copilot and rcalixte April 25, 2025 12:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds new notification badges for panel icons by introducing a separate badge for notifications along with the existing window count badge and removes the "Show window count numbers" configuration. Key changes include:

  • Passing a new desktopEntry hint to notifications in both notificationDaemon.js and messageTray.js.
  • Adding event handling for notification updates in workspace.js.
  • Overhauling the appGroup.js code to support separate badges for windows and notifications.

Reviewed Changes

Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
js/ui/notificationDaemon.js Updated notification creation to include the desktopEntry hint.
js/ui/messageTray.js Extended Notification class and documentation to support desktopEntry.
files/usr/share/cinnamon/applets/[email protected]/workspace.js Added connection to notify-applet-update and a new notificationReceived handler.
files/usr/share/cinnamon/applets/[email protected]/applet.js Removed the obsolete updateWindowNumberState function.
files/usr/share/cinnamon/applets/[email protected]/appGroup.js Modified badge layout and introduced methods for updating notification and window count badges.
Files not reviewed (3)
  • data/theme/cinnamon-sass/_colors.scss: Language not supported
  • data/theme/cinnamon-sass/widgets/_windowlist.scss: Language not supported
  • files/usr/share/cinnamon/applets/[email protected]/settings-schema.json: Language not supported

@fredcw
Copy link
Contributor Author

fredcw commented Apr 27, 2025

@anaximeno How about in opposite corners.

Screenshot from 2025-04-27 16-25-31

I can't think of anything else that will work with all themes except badges.

@anaximeno
Copy link
Contributor

anaximeno commented Apr 27, 2025

@anaximeno How about in opposite corners.

Screenshot from 2025-04-27 16-25-31

It looks better this way you did it now, in my opinion. Good choice.

I can't think of anything else that will work with all themes except badges.

Yeah, the options are limited thanks to that.

@leigh123linux
Copy link
Contributor

Is there an option to disable it completely?

@fredcw
Copy link
Contributor Author

fredcw commented Sep 11, 2025

@leigh123linux Not atm. Perhaps I should add that?

@leigh123linux
Copy link
Contributor

@leigh123linux Not atm. Perhaps I should add that?

It would match the option to disable window count.

image

@fredcw
Copy link
Contributor Author

fredcw commented Sep 11, 2025

@leigh123linux Ah, I removed that as well. :P

@fredcw
Copy link
Contributor Author

fredcw commented Sep 27, 2025

@leigh123linux I've added the option to hide notification badges. Do you think the option to show window number should be added back? I don't have a strong opinion on this myself.

@fredcw
Copy link
Contributor Author

fredcw commented Sep 29, 2025

@clefebvre Why is there a thumbsdown on this PR by a member of your github team? Are my contributions no longer welcome?

@Nekkowe
Copy link

Nekkowe commented Oct 4, 2025

@leigh123linux I've added the option to hide notification badges. Do you think the option to show window number should be added back? I don't have a strong opinion on this myself.

I'd say so...! The more options for customization, the better ✨
There's no single one-size solution that'll fit everyone.

Initially, you had both at the top, then you decided to move the window count to the bottom left and the notification count to the top right - I personally might prefer the window count in the top left and the notification count in the bottom right, while yet another person might prefer to have only the window count, only the badge number, or neither number showing up at all.

For my two cents, ideally both numbers should be optional, and the user should have a choice of which corner belongs to which number.

How would you feel about having a dropdown for each corner in the settings, with the choices of "Window Count", "Notification Count", and "None"? That'd leave room for more corner options in the future, too.

@fredcw fredcw force-pushed the gwlnotifications branch 2 times, most recently from 62de34f to 4c43b1a Compare November 21, 2025 06:10
GWL: add notification badges to top right of panel icons and add config option to disable notification badges

GWL: move window count badge from top left to bottom left of panel icon.

Remove 'notifications' extension role as it only allows for one extension. Use extensionsHandlingNotifications variable in messageTray.js for applets to increment/decrement when added/removed from panel instead.

Ensure notificationDaemon can identify source of notifications from flatpak apps.

Increase max notifications per source from 10 to 20.
@fredcw
Copy link
Contributor Author

fredcw commented Nov 21, 2025

Added back show window count config option.

@clefebvre
Copy link
Member

@clefebvre Why is there a thumbsdown on this PR by a member of your github team? Are my contributions no longer welcome?

Of course they are. I don't know why @leigh123linux thumbed it down, but even if someone in the team or even if most of the team didn't like a particular PR, it wouldn't mean your contributions are not appreciated.

@clefebvre clefebvre self-assigned this Nov 21, 2025
@Nekkowe
Copy link

Nekkowe commented Nov 25, 2025

This is wonderful! Thank you for your work on this feature, I've been excited to see it implemented for a long time now (and so have others, judging by issue #10124)

Yes, new features don't go in past BETA.

Is this the only thing this PR is waiting on, now? I'll confess I'm not sure how all the release timing stuff works, exactly... is it possible to merge now, or if not, around when could it be merged?

@clefebvre
Copy link
Member

Is this the only thing this PR is waiting on, now? I'll confess I'm not sure how all the release timing stuff works, exactly... is it possible to merge now, or if not, around when could it be merged?

Yes, we're hoping to merge this.

@clefebvre
Copy link
Member

@fredcw I think this is great and it's working well.

Here's my feedback on what still requires change.

I don't like the use of updateBadgesTextSize(). The label was given a font-size in the SCSS and that worked well imo. Injecting CSS at runtime takes control away from the theme.

In the default theme, I'd like to keep the badges small, with their original color and original position (top-left). These numbers are only there as hints, they're not supposed to catch your attention.

image

There's plenty of space top-right for the notification badge if it's the same size. It has a noticeable color, and it complements the notification applet and the notification itself, so same thing here, there's no need for this number to be big.

It's a pity we store the notifications in an array and not just the number since that's all we need, but I understand it's more reliable that way. If we were to concurrently increase/decrease, we could run into bugs.

@clefebvre
Copy link
Member

Small detail, I noticed we're doing maths on the same childBox actor to allocate multiple things (icon and the 2 badges). We're modifying it as we go along so the math is relative to the changes made before.. it's a bit messy :)

It might cleaner to declare child boxes for the two badges and let them make their own maths from scratch, they'd look more similar that way in the code.

It doesn't really matter but I saw it so I thought I'd mention it.

@fredcw
Copy link
Contributor Author

fredcw commented Nov 27, 2025

@clefebvre In notificationDaemon.js, I've found that the only reliable way to determine the source app of a notification from a flatpak app is the desktop-entry hint. While this is set correctly for most flatpak apps, some set it incorrectly, hence the list of "exceptions". While I tested quite a few, I expect there to be some that are not listed. My thinking is that some of these will be found during the beta and can be added to the list. An alternative is to try to guess the app from the appName using a subString search of installed apps' names and ids. I can implement that if you think it's better.

@clefebvre
Copy link
Member

@clefebvre In notificationDaemon.js, I've found that the only reliable way to determine the source app of a notification from a flatpak app is the desktop-entry hint. While this is set correctly for most flatpak apps, some set it incorrectly, hence the list of "exceptions". While I tested quite a few, I expect there to be some that are not listed. My thinking is that some of these will be found during the beta and can be added to the list. An alternative is to try to guess the app from the appName using a subString search of installed apps' names and ids. I can implement that if you think it's better.

Let's go with that imo. As you said we can always improve it when we get feedback.

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.

[Feature Request] Notification badges on dock app icons

6 participants