I just deployed enhanced notifications and some other small stuff. π
Notifications
- You can now tell which post or comment you got sats from
- Sat receipts are displayed in order with replies
- When you click on a notification it now takes you to the context of the notification (e.g. the comment) - this worked previously but it broke when a package was updated
- I also do a kind of flash animation to bring your attention to the exact context should it be surrounded in other comments. (I might change this animation in the future to something prettier.)
Small stuff
- I cleaned up the sat balance and karma (aka stacked) area. Previously it was
[<stacked>, <spendable balance>]
. Now it's<spendable balance> \ <stacked>
. The comma was confusing some international users. I also reversed the sat balance and stacked. The new arrangement seems more intuitive to me - the more permanent thing (karma) is 'anchored' in the corner.
Immediate plans
I plan to also add mentions to notifications shortly and pending feedback and my own usage I might go further to make them more concise. This is just a starting point.
Tomorrow, I'm going to begin working on more sat-related features - tips and laying the ground work for faucets, referrals, etc.
For the nerds
The notification improvements were interesting to implement. The hard part is mostly the SQL query. In order to cursor (for pagination) over both replies and upvotes, I union them together. In an attempt to make the sat notifications concise, we have to solve a gaps and islands problem to find "islands" of upvotes so they can be merged together. We use window functions to do this. You can view the relatively large SQL query here.
In order to make notifications even more concise should we need to in the future, we just have to find more islands based on some other criteria, e.g. time or notification type.
CMD
+ENTER
π