Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature splashscreen #309

Merged
merged 8 commits into from
Jul 18, 2023
Merged

Feature splashscreen #309

merged 8 commits into from
Jul 18, 2023

Conversation

cguedes
Copy link
Collaborator

@cguedes cguedes commented Jul 18, 2023

This PR closes #308 by delaying app execution with a Tauri splash screen.

The splash screen is shown by default (main window is hidden by default) and then, when, the app is ready the command close_splashscreen) is executed and will hide splash screen and show the main window.

Note that the main window code still runs, while the app is not visible, so we have updated the root component to ensure the <App>...</App> component is only rendered when the app is ready.

Also, there is an initial white background in the splashscreen. Before rendering the content. There is a pending issue reported to track that.

Screen.Recording.2023-07-18.at.12.05.20.mov

@cguedes cguedes linked an issue Jul 18, 2023 that may be closed by this pull request
@cguedes cguedes requested a review from sehyod July 18, 2023 11:07
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #309 (67af815) into main (934806a) will increase coverage by 0.14%.
The diff coverage is 84.07%.

@@            Coverage Diff             @@
##             main     #309      +/-   ##
==========================================
+ Coverage   86.33%   86.47%   +0.14%     
==========================================
  Files         135      137       +2     
  Lines        7528     7577      +49     
  Branches      823      833      +10     
==========================================
+ Hits         6499     6552      +53     
+ Misses       1016     1011       -5     
- Partials       13       14       +1     
Impacted Files Coverage Δ
src/application/App.tsx 0.00% <0.00%> (ø)
src/application/components/MainPanel.tsx 0.00% <0.00%> (ø)
src/main.tsx 0.00% <0.00%> (ø)
src/splash.tsx 0.00% <0.00%> (ø)
src/AppStartup.tsx 100.00% <100.00%> (ø)
src/application/views/WelcomeView.tsx 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

src/main.tsx Outdated Show resolved Hide resolved
src/main.tsx Outdated Show resolved Hide resolved
sehyod
sehyod previously approved these changes Jul 18, 2023
@cguedes
Copy link
Collaborator Author

cguedes commented Jul 18, 2023

We can get rid of the white background by using a transparent splashscreen window with the "macOSPrivateApi": true config setting active. And configuring the background-color as transparent:

image

Note: Using the macOSPrivateApi would prevent the app from being uploaded to the AppStore.

Check the implementation here.

src/__tests__/AppStartup.test.tsx Show resolved Hide resolved
@cguedes cguedes merged commit bbc32df into main Jul 18, 2023
10 of 11 checks passed
@cguedes cguedes deleted the feature-splashscreen branch July 18, 2023 13:14
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.

Ensure settings are initialized before app starts
2 participants