spine-tools / Spine-Toolbox

Spine Toolbox is an open source Python package to manage data, scenarios and workflows for modelling and simulation. You can have your local workflow, but work as a team through version control and SQL databases.
https://www.tools-for-energy-system-modelling.org/
GNU Lesser General Public License v3.0
72 stars 17 forks source link

Error checking in Spine Toolbox and Model #681

Closed spine-o-bot closed 3 years ago

spine-o-bot commented 3 years ago

In GitLab by @jkiviluo on Sep 11, 2018, 10:10

We should establish a guideline for error checking (in Wiki). Below is my proposal. What do you think?

  1. try to avoid error messages and get the Toolbox and Model to do things the user expected it to do.
  2. ask a question and allow to store a default answer as a setting
  3. throw a clear error message with instruction what to do instead
spine-o-bot commented 3 years ago

In GitLab by @PekkaSavolainen on Sep 11, 2018, 12:26

I think this is an area that is referred as 'error handling' in the User Experience design field. There are a ton of webpages with 'best practices' on how to deal with this. Here's a couple of things that could be added:

Last one is mostly for webpages but we should use inline validation in Spine Toolbox as well.

spine-o-bot commented 3 years ago

In GitLab by @PekkaSavolainen on Sep 11, 2018, 13:04

About logging.debug and logging.error messages

I used to print a lot of debug messages into the console but I think it's a poor practice. If everything is going smoothly, the console should stay silent (debug messages are OK for features in development). Only error messages should appear in console and they should be of the type that give developers more information to fix the error. If there's something that the user should know or would maybe like to know, this should be printed into the application (Event Log) or into some other notification popup message (not available yet, but this could be implemented at some point). There are also some status bar messages in use, but I think they are very easy to miss at the moment.

spine-o-bot commented 3 years ago

In GitLab by @jkiviluo on Sep 11, 2018, 13:20

Yes, all true. I also noticed that the console was bit overwhelming.

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Sep 11, 2018, 16:05

About showing messages in the status bar: I agree we need to do better. This touches the Data Store Form aka treeview. I think we have at least three options here (I'm talking exclusively about the treeview):

spine-o-bot commented 3 years ago

In GitLab by @PekkaSavolainen on Sep 11, 2018, 16:23

By a notification popup message I mean the kind of notifications you see on webpages and mobile apps that are shown for a couple of seconds and then disappear. Maybe that could be a solution for some messages.

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Sep 11, 2018, 16:28

That's a great idea. Any clue on how to do it with Qt?

spine-o-bot commented 3 years ago

In GitLab by @PekkaSavolainen on Sep 11, 2018, 17:01

I guess you have to do it by hand. A borderless widget(Qt.Window) without buttons and no focus. Set some stylesheets on it. Use Qt animations for the fade in/fade out effects and close it with a timer. Should be a walk in the park.

There's a QSystemTrayIcon class but we don't really want that.

spine-o-bot commented 3 years ago

In GitLab by @manuelma on Sep 11, 2018, 17:23

Sounds interesting. I feel the same about QSystemTrayIcon

spine-o-bot commented 3 years ago

In GitLab by @jkiviluo on Sep 12, 2018, 09:51

Sounds good. If possible, don't let the notice to overlap with the Windows taskbar. It's irritating to wait for the notice to go away if you want to access the taskbar.