I recently tried to use notifications including their buttons/actions in an app, and I was surprised at the unnatural behavior of them. I think there are a lot of things that could be improved regarding notifications. Here are two potential improvements that come to mind, which are inspired by Android/Windows notification system.
When a notification moves from a peek/popup to the notification tray, it becomes fixed in height. This means the text is cut off and the actions disappear. I don't see any reason to do this, and I think they should be expanded in the tray so you are still able to fully read and interact with the notification might you have missed it in the first few seconds of showing.
Some parts of the notification only appear on hovering it, like the dismiss icon and the actions in peek mode. This means you don't know you can interact with a notification until you hover it and also means they become frustratingly unusable on a touchscreen-enabled device. Always displaying these actions and the dismiss icon would fix both these issues and have very little drawback IMO.
The images below should illustrate my points a bit.