Repository navigation
feat: add Maximum Notifications and Multiline Message Text settings - #98
Conversation
733db0e to
5bf1d60
Compare
Adds the Maximum Notifications setting (default 3). Notifications and voice channel chat rows share that many rows; the rest wait their turn, notifications first, instead of pushing rows out.
Long messages wrap onto up to 3 lines, and cut-off text ends with an ellipsis (Blitz doesn't draw text-overflow). Only the built-in template is affected.
5bf1d60 to
4b3d491
Compare
| self.show_pending() | ||
| } | ||
|
|
||
| pub fn show_pending(&mut self) -> bool { |
There was a problem hiding this comment.
Am I correct in saying that this waits for old notifications to expire before showing newer ones?
If this is the case, I think I'd prefer if notifications were more like a sliding window: if we are at the max, and a new notification comes in, the oldest should immediately be discarded to make room for the newest.
There was a problem hiding this comment.
Yes, it waited. Now when the area is full, the oldest row (notification or chat, whichever came first) is dropped right away to make room for the new one. The pending queues are gone.
| <button class="action secondary" data-action="1">Reject</button> | ||
| ``` | ||
|
|
||
| "Show Full Message Text" and the "…" for cut-off text only apply to the built-in template. Custom templates are rendered as before, with the whole body text. |
| #[serde(default = "default_max_notifications")] | ||
| pub max_notifications: u32, | ||
| #[serde(default)] | ||
| pub notification_full_text: bool, |
There was a problem hiding this comment.
I think notification_full_text is a bit of a misleading name imo, since we still truncate them. Maybe something like extended_notification_bodies or multiline_notification_bodies?
There was a problem hiding this comment.
Renamed to multiline_notification_bodies (multilineNotificationBodies in config.json). The toggle is now labeled "Multiline Message Text" too.
|
thank you! |
Adds two notification settings:
Long text now also ends with "…", which wasn't drawn before. Since the line breaks are estimated from the text length, this only applies to the built-in template; custom templates are unchanged.
Tested on Windows with long English and Japanese messages.
cargo fmtandclippypass.