Repository navigation
feat: notify on errors if not started from terminal - #664
robertwidfen wants to merge 1 commit into
Conversation
7390053 to
ecb5791
Compare
ecb5791 to
8fdf43c
Compare
Closes: Satty-org#630 Changes configuration.rs code slightly to allow a system wide config file in XDG_CONFIG_DIRS/satty/config.toml (usually /etc/xdg/satty/config.toml). File not found on any specified config (--config) is still fatal, I think this is sensible. For the system and user config, they're used if present and skipped via external BaseDirectories::find_config_files if not present. This PR clashes with Satty-org#664. Design choices: - shortcuts are extended (I suppose it would suck if this wasn't the case), there is always none to unset - fallback fonts vec is extended, additional fonts on user side wouldn't hurt much - palette and custom colours are overwritten. otherwise it might be tricky to prevent a full style toolbar on user side, depending on how many entries packagers provide via system config. I didn't feel like providing any special notation to clear this.
|
how about adding a logging component? Collect log messages in the background in a ring buffer (next to printing them to stderr), and have a button that is basically an error counter or something, once you click it, it opens a popup that displays the ring buffer. That way users could review any config errors even if they haven't started from terminal. Notification only displays important stuff, like it is now. |
d83273e to
8e52877
Compare
Closes: #630 Changes configuration.rs code slightly to allow a system wide config file in XDG_CONFIG_DIRS/satty/config.toml (usually /etc/xdg/satty/config.toml). File not found on any specified config (--config) is still fatal, I think this is sensible. For the system and user config, they're used if present and skipped via external BaseDirectories::find_config_files if not present. This PR clashes with #664. Design choices: - shortcuts are extended (I suppose it would suck if this wasn't the case), there is always none to unset - fallback fonts vec is extended, additional fonts on user side wouldn't hurt much - palette and custom colours are overwritten. otherwise it might be tricky to prevent a full style toolbar on user side, depending on how many entries packagers provide via system config. I didn't feel like providing any special notation to clear this.
c213938 to
d93b560
Compare
d93b560 to
3f13847
Compare
|
This sits on top of #698 now which I split from the initial code here. Errors are now logged now and open a notification even if I dare adding a button - we also have no config UI and I hope our users can use a terminal. 😬 |
|
I'm not a fan of bypassing disable-notifications. I understand why, but I don't think we should. If a button is not an option, I suggest we display a message box dialog if notifications are disabled. |
|
Well, let's get this merged for now. Can you please add a remark to disable-notifications that the setting may be ignored in case config errors can't be reported via terminal? In the long run though, I think we should
I believe this approach is even user-friendlier because users would not have to figure out what command line bits they need to start Satty from terminal. And it works if users do not have a notification daemon -- rare, but not impossible. |
244b328 to
b199e7c
Compare
|
IMHO 42 should be sufficient for the history length. I have an idea that solves everything - we create a red text annotations for the messages - this way the user gets it right into the face, can access the text and gets annoyed to fix the issues. 🤣 |
RobertMueller2
left a comment
There was a problem hiding this comment.
I think we need to consider stderr rather than stdout, because that's what we write to.
And I think this checks is_terminal too often. E.g. now I don't get a notification for a successful save. Do we really want to move that kind of stuff to the terminal output?
b199e7c to
60c389a
Compare
Hmm this is odd, why should it swallow the save-notification?
I like it during testing and it does no harm IMHO. |
|
Personally, I prefer toasts for most UI messages (warnings, errors, and success states) because they appear right where the user is looking. The only downside is that toasts do not leave a history like notifications, which could be handy for checking where an image was saved etc. I'm still undecided on the best balance here. |
We don't have to decide that now. #704, if implemented, may offer a history, within Satty. Notifications can remain the default for now. But if a user chooses to disable them via config, we can use toasts for errors that we can recover from, and a message box for errors that are fatal -- fatal errors are the only location where I'd personally see a use of an is_terminal check. The lack of a history is a deliberate user choice. We don't know why a user makes it, but e.g. not having a notification daemon may be one of them, in that case the user would get nothing at all if we send a notification. I'd rather respect the user choice than selectively ignore it. In a way that is very difficult to predict from a user perspective. |
60c389a to
8b2e5d2
Compare
8b2e5d2 to
bde9897
Compare
See Satty-org#663 One reasons for this: When starting from a key binding the user will not see logged errors or warnings. Thus we also ignore the `notify` config.
bde9897 to
60f26fe
Compare
See #663
One reasons for this: When starting from a key binding
the user will not see logged errors or warnings. Thus
we also ignore the
notifyconfig.