Skip to content
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

Simplify Raven notification group #452

Merged
merged 4 commits into from
Sep 30, 2023
Merged

Conversation

EbonJaeger
Copy link
Member

Description

This does a couple of things. First, when constructing a notification group, just get the image directly from our Notification object. We did all the work to get the correct image, let's actually use it.

Secondly, remove our HashTable mapping application name to notification group. We don't need it; anything it was used for we can get from the ListBox. This avoids having to keep track of groups in multiple data structures (the table and the list box). This makes the code easier to maintain, and slightly more memory efficient.

The NotificationGroup widget has been changed to a Gtk.ListBoxRow to make it easier to find and remove groups from the view.

Lastly, switch to ngettext to build the text for the notification view header instead of an if/elseif chain.

Fixes #450

Submitter Checklist

  • Squashed commits with git rebase -i (if needed)
  • Built budgie-desktop and verified that the patch worked (if needed)

@EbonJaeger EbonJaeger added the enhancement New feature or request label Sep 9, 2023
@JoshStrobl JoshStrobl added this to the 10.8.1 milestone Sep 16, 2023
@JoshStrobl
Copy link
Member

JoshStrobl commented Sep 17, 2023

Testing with Discord and seems a bit busted. Incorrect title and notification group icons aren't that of the application, just of the first icon of the first notification you get. Provided details in Matrix.

image

Copy link
Member

@serebit serebit left a comment

Choose a reason for hiding this comment

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

Built-in theme needs a style update to coincide with this, the new notification items look off with the existing styling.

@JoshStrobl
Copy link
Member

JoshStrobl commented Sep 28, 2023

@serebit Could you clarify what styling changes you are referring to?

  • Notification Widget has not seen any changes with this PR. The notification widget clones attributes from the Notification itself, it doesn't embed the Notification.
  • Notification Group, which has seen changes, is already referenced in our internal styling by its class name raven-notifications-group. The Raven Notifications Group Header is still aligned with group item headers, which was the purpose of margin and padding offsets, and the use of the inner box instead of the group itself being the box is still valid as we referenced the group without a parent selector (so it can be any child) and the inner list is still a valid selector
  • Notification View is referenced by raven-notifications-view , saw no related changes from what I can tell.

It looks identical to me, but I do need to get my eyes checked sooooo.

EbonJaeger and others added 4 commits September 30, 2023 18:36
This does a couple things. First, when constructing a notification group, just get the image directly from our Notification object. We did all the work to get the correct image, let's actually use it.

Secondly, remove our HashTable mapping application name to notification group. We don't need it; anything it was used for we can get from the ListBox. This avoids having to keep track of groups in multiple data structures (the table and the list box). This makes the code easier to maintain, and slightly more memory effecient.

Lastly, switch to `ngettext` to build the text for the notification view header instead of an if/elseif chain.

Fixes #450

Signed-off-by: Evan Maddock <[email protected]>
…and fix notification counting

Signed-off-by: Evan Maddock <[email protected]>
- rename app_icon to notification_icon since it is not necessarily the one for the app
- implemented an app_image that will be prefered over image (from notification not app) for Raven. notification popups will use one or the other depending on what is provided.
- broken notification grouping as it was assuming an app_name which can technically be empty when the application only supplies a desktop-entry for app info. use notification's app name otherwise try with the app id.
- missing application name when application only supplies desktop-entry
- incorrect image for some applications such as discord. it would use the Discord message sender's avatar rather than discord icon
- spotify reports as com.spotify.Client and not Spotify nowadays, so added that to list of spam-apps to prevent Raven noise
- missing printf on ngettext for header resulting in number not being added
- missing use_markup on notification title resulting in ampersands not being parsed. noticable in song titles on spotify where many use & instead of "feat."
@JoshStrobl JoshStrobl force-pushed the simplify-raven-notification-group branch from 850dbac to bad102c Compare September 30, 2023 15:36
Copy link
Member

@JoshStrobl JoshStrobl left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉

@serebit serebit self-requested a review September 30, 2023 15:43
@JoshStrobl JoshStrobl merged commit 3fcc4c6 into main Sep 30, 2023
1 check passed
@JoshStrobl JoshStrobl deleted the simplify-raven-notification-group branch September 30, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug] Raven notifications widget sometimes shows broken icon placeholder
3 participants