FreeCAD icon indicating copy to clipboard operation
FreeCAD copied to clipboard

Gui: Scrolling splash screen

Open 3x380V opened this issue 1 year ago • 21 comments

When Splash screen is configured to show startup messages, it does so by showing only one at time and adds 50ms delay each time new one is shown to let user notice it. This approach considerably extends application start-up time, so replace it with scrolling messages.

Please note, that after merging #16071, it is a bit problematic to find single suitable color and placement for the messages, so I'm leaving that to the Design Group ;-)

3x380V avatar Sep 06 '24 12:09 3x380V

@maxwxyz, I guess 1.0 milestone is a bit too optimistic, let me explain.

This is just another approach to #15435, but question remains the same. How should it look like? It was easier with single splash image. Now each randomly chosen splash image should have defined an area where messages will appear. Perhaps even text color should be selected per image. And now we have transparency, so outlined text would be nice... All that is making displaying text harder and I do not want to decide any visual stuff. Any takers?

Also, technically splash screen can be shown just at the beginning of main() and hidden once application enters event loop (at this time it should react to user input). The more FreeCAD specific content we want to show, the later it can be shown.

Proof of concept just force pushed, comments welcome.

3x380V avatar Sep 07 '24 00:09 3x380V

Just remove the text, we can't read it. they are too fast or cut in half. If you need something to understand it is not stuck it should be a progress bar... then a thin line at the bottom would be enough.

leoheck avatar Sep 07 '24 20:09 leoheck

Progress bar is out of scope as there is no way finding where in the start process we are. Some kind of message driven periodic movement is doable, but text works as well then and you actually see the last few lines printed. On slower systems it is pretty readable. Btw, non transparent background under text works better and that thin line at the bottom would have the same problem with transparent background. The question is, however, whenever this PR extends the time splash is displayed for people complaining it is shows for too short time?

3x380V avatar Sep 07 '24 21:09 3x380V

The question is, however, whenever this PR extends the time splash is displayed for people complaining it is shows for too short time?

I will grab my computer to check this...

leoheck avatar Sep 07 '24 23:09 leoheck

It took me some time to build it. The launch time was increased a bit, indeed. But it is still pretty quick. This splash is almost not needed on my machine considering how long it is presented. Screencast from 2024-09-08 00-14-05.webm

leoheck avatar Sep 08 '24 03:09 leoheck

Thanks for testing this. But there is something to clarify. Total launch time should be almost the same. It is increased by the time needed to render text, which is not measurable on my system. Splash display time should be longer. Splash could be displayed even sooner, with yet another round of refactoring. I'll give it a try.

However, this PR is primarily about getting messages back without slowing down startup. My machine has classic HDD, which needs some time to load all that workbenches, so I can enjoy reading :)

And as can be seen on your the video, displaying text over random splash image is a bit problematic. So, unless some UI designer comes with clever approach, I'm going to compute text display area based on splash image size and use that. Messages are disabled by default now anyway, so it should not bother anyone and those bothered are welcome to improve it.

3x380V avatar Sep 08 '24 09:09 3x380V

Lets limit this PR to scrolling splash messages as originally intended. I will open another one with splash and about dialog refactoring.

3x380V avatar Sep 10 '24 18:09 3x380V

@chennes or whoever will eventually merge this PR: it conflicts with #16438 and I'd like that cleanup to be merged first. Then I rebase this one, resolve conflicts and force push.

3x380V avatar Sep 11 '24 14:09 3x380V

How does this relate to https://github.com/FreeCAD/FreeCAD/pull/16438?

wwmayer avatar Oct 26 '24 17:10 wwmayer

#16438 is 3x380V:dlgabout branch based on main branch, it does code refactor and cleanup. This is 3x380V:splash branch based on 3x380V:dlgabout branch and does implement scrolling messages. Unfortunately I do not know how to open PR this way; feature branch based on top of another feature branch. It seems github cannot do this, but I might be wrong. Anyway, once #16438 merged, those commits now seen in both PRs will disappear on rebase.

3x380V avatar Oct 27 '24 09:10 3x380V

@wwmayer, what is needed to move forward with this PR? Apart from visual appearance, which I cannot cope with. I'd like to use it as a base for indeterminate progress bar. I can either add a commit here or start another PR, but then we run in the same issue with the same commits in different PRs. As spash messages are now disabled by default, it does not make any real difference unless user enables them explicitly.

3x380V avatar Nov 22 '24 14:11 3x380V

The actual content of the individual log messages are not important. But (for me) the reason to show log messages at all was that already at startup I could easily see if something went wrong. Because most messages start with the word "Initializing" and the text is always written at the exact same location it's easy to see if there is suddenly a different log message starting with "Error".

Then to get more details for a better diagnosis about the failure one has to restart the application with the --write-log option which writes everything into the FreeCAD.log file.

IMO, I don't see a real need to make a scrolling splash screen.

wwmayer avatar Nov 27 '24 17:11 wwmayer

The reason I implemented it is to remove 50ms delay after each message printed, so it does not slow down startup. It could be improved by printing errors in different color, etc. Also it is ground base for indeterminate progress bar some people are asking for.

I'm not pushing for merging this as I'm using my own build in production, which has this patch included. I'll leave it open, just in case anyone finds in useful.

3x380V avatar Nov 27 '24 17:11 3x380V

  • with scrolling area set to single line height, scrolling splash behavior is the same (minus delay).
  • it is possible to keep important messages; assume error (possibly rendered in different color) is scrolling away, until it reaches last line, then it stays here, scrolling area height decreases by one line.

For a reason to implement this see forum post.

3x380V avatar Nov 27 '24 17:11 3x380V

@3x380V I think the best path here would be to allow users to turn messages off (or scrolling) or on (as it is now). It could totally be on by default. Would it suit you to implement that?

yorikvanhavre avatar Dec 02 '24 17:12 yorikvanhavre

@yorikvanhavre, unless I'm missing something, it is implemented that way.

3x380V avatar Dec 02 '24 17:12 3x380V

I understand in your PR the former behaviour is removed entirely (at least some pieces like alignment and the 50ms delay)... What I meant in my previous comment is to keep that behaviour as optional, for people who prefer it.

yorikvanhavre avatar Dec 03 '24 09:12 yorikvanhavre

I see! The reason for removal was that delay, which increased startup time significantly. I have no problem adding it back (make no scrolling a case where scrolling area is only one line high) and adding delay as a configurable parameter. That way a splash can be configured to behave exactly same way. However I would prefer not adding any delays, so let me point you back to the idea of important messages staying on screen as described above. I still would like someone from design group to look at this, since with addition of the new splash images, there is no suitable place to put those messages. Solid color rectangle can be drawn, but... After all, this issue is mostly about visual stuff, code is simple enough, so the real question is how messages on splash should look like.

3x380V avatar Dec 03 '24 09:12 3x380V

Adding a rectangle might be a good solution... After all, that mode is specifically for debugging. It wouldn't be meant for average users...

yorikvanhavre avatar Dec 03 '24 11:12 yorikvanhavre

I think that this is fine and much needed as many people think that loading process is slow - while it is really not. We either should disable these logs by default or have solution that does not contain arbitrary delay that slows loading process without reason - which this PR provides. From DWG perspective both are fine but having ability to see what is going on sometimes so I'd lean towards merging that one.

kadet1090 avatar Dec 06 '24 17:12 kadet1090

I'll implement SplashAlignment property again with two options Top and Bottom; scroll from top down and from bottom up. Additionally there will be new config entry for number of lines shown. Originally SplashAlignment allowed also Left and Right, but those should be probably implicit based on language settings. Switching back to Draft until implemented.

3x380V avatar Dec 09 '24 06:12 3x380V