Skip to content

feat: notify on errors if not started from terminal - #664

Open
robertwidfen wants to merge 1 commit into
Satty-org:mainfrom
robertwidfen:feat/notify-on-config-errors
Open

robertwidfen wants to merge 1 commit into
Satty-org:mainfrom
robertwidfen:feat/notify-on-config-errors

Conversation

@robertwidfen

@robertwidfen robertwidfen commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

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 notify config.

@robertwidfen
robertwidfen force-pushed the feat/notify-on-config-errors branch from 7390053 to ecb5791 Compare September 11, 2026 14:41
@robertwidfen
robertwidfen force-pushed the feat/notify-on-config-errors branch from ecb5791 to 8fdf43c Compare September 11, 2026 17:49
RobertMueller2 added a commit to RobertMueller2/Satty that referenced this pull request Sep 13, 2026
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.
@RobertMueller2

Copy link
Copy Markdown
Member

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.

@robertwidfen
robertwidfen force-pushed the feat/notify-on-config-errors branch 2 times, most recently from d83273e to 8e52877 Compare October 2, 2026 23:23
robertwidfen pushed a commit that referenced this pull request Oct 2, 2026
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.
@robertwidfen
robertwidfen force-pushed the feat/notify-on-config-errors branch 3 times, most recently from c213938 to d93b560 Compare October 3, 2026 15:05
@robertwidfen robertwidfen changed the title Feat/notify on config errors feat: notify on errors if not started from terminal Oct 3, 2026
@robertwidfen
robertwidfen force-pushed the feat/notify-on-config-errors branch from d93b560 to 3f13847 Compare October 3, 2026 15:10
@robertwidfen

Copy link
Copy Markdown
Collaborator Author

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 notify = false is set but not when started from terminal.

I dare adding a button - we also have no config UI and I hope our users can use a terminal. 😬

@robertwidfen
robertwidfen marked this pull request as ready for review October 3, 2026 15:20
@RobertMueller2

RobertMueller2 commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

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.

@RobertMueller2

RobertMueller2 commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

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

  • collect messages in a ring buffer (I don't know how big, maybe 1000 entries max)
  • allow users to display them in a list dialog
  • figure out a clever way to make users aware that there were config related messages and they need to open the dialog to show them
  • add an accessible non-button way to open the dialog ;)
  • perhaps even allow different log levels (info/warning/debug/trace)

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.

@robertwidfen
robertwidfen force-pushed the feat/notify-on-config-errors branch 2 times, most recently from 244b328 to b199e7c Compare October 3, 2026 19:26
@robertwidfen

Copy link
Copy Markdown
Collaborator Author

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 RobertMueller2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

@robertwidfen

Copy link
Copy Markdown
Collaborator Author

And I think this checks is_terminal too often. E.g. now I don't get a notification for a successful save.

Hmm this is odd, why should it swallow the save-notification?

Do we really want to move that kind of stuff to the terminal output?

I like it during testing and it does no harm IMHO.

@robertwidfen

Copy link
Copy Markdown
Collaborator Author

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.

@RobertMueller2

Copy link
Copy Markdown
Member

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.

@robertwidfen
robertwidfen force-pushed the feat/notify-on-config-errors branch from 60c389a to 8b2e5d2 Compare October 5, 2026 16:15
@robertwidfen
robertwidfen force-pushed the feat/notify-on-config-errors branch from 8b2e5d2 to bde9897 Compare October 5, 2026 21:05
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.
@robertwidfen
robertwidfen force-pushed the feat/notify-on-config-errors branch from bde9897 to 60f26fe Compare October 7, 2026 19:35
@robertwidfen
robertwidfen requested a review from a team October 7, 2026 19:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config errors should *NOT* lead to abort of startup but be reported

2 participants