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

Add initial loading-screen to index.html #1825

Merged
merged 9 commits into from
Feb 3, 2024

Conversation

SebinSong
Copy link
Collaborator

@SebinSong SebinSong commented Jan 28, 2024

closes #1822

@taoeffect
I thought I would try using the existing screen in the app, which is Loading.vue with adding a GI logo in it like below screenshot. The logo will only be exposed there when the component is used as the initial loading screen btw.

If you have a more interesting idea for it though, let me know. happy to work on that.

@SebinSong SebinSong self-assigned this Jan 28, 2024
Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Hmm, I'm not seeing the loading screen... 🤔

Notice the blank white page after refresh is clicked (this in FFDev):

loading.missing.mov

Copy link

cypress bot commented Jan 28, 2024

Passing run #1847 ↗︎

0 110 8 0 Flakiness 0

Details:

Merge 3aa4fb8 into 7233a5c...
Project: group-income Commit: 5658ee1085 ℹ️
Status: Passed Duration: 11:15 💡
Started: Feb 2, 2024 3:12 AM Ended: Feb 2, 2024 3:24 AM

Review all test suite changes for PR #1825 ↗︎

@SebinSong
Copy link
Collaborator Author

SebinSong commented Jan 28, 2024

@taoeffect I see.
I just looked into it again and that blank white screen shows regardless of the value of ephemeral.ready. In fact, it is when even before the Vue application is initialised. So if we are aiming to replace it, apparently it has to be handled outside of the Vue context. (e.g. adding raw html/css to the index.html) does it sound good?

@taoeffect
Copy link
Member

I'll reply on Slack

@SebinSong
Copy link
Collaborator Author

@taoeffect
here is the screenshot for the proof.

image

@SebinSong SebinSong changed the title add initial loading-screen to index.html [WIP] add initial loading-screen to index.html Jan 31, 2024
frontend/main.js Outdated
const loadingScreenEl = document.querySelector('#main-loading-screen')
if (loadingScreenEl) {
loadingScreenEl.classList.add('is-removed')
}
Copy link
Collaborator

@snowteamer snowteamer Jan 31, 2024

Choose a reason for hiding this comment

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

This will minimize the element so that it becomes a single pixel wide. Why couldn't it be removed instead, or its display set to none? I think a clarifying comment would be useful here

Copy link
Collaborator Author

@SebinSong SebinSong Feb 1, 2024

Choose a reason for hiding this comment

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

@snowteamer I think it makes sense to remove it completely instead of hiding it if there is no other cases that the app needs to display this loader screen.

@SebinSong
Copy link
Collaborator Author

@taoeffect
I spent some time re-ordering the existing operation steps in startApp() in main.js so that Vue app initialisation happens faster. that did reduce little bit of loading time but what I noticed instead during the process was that, the browser is still waiting a long list of javascript files for the most time when that white blank screen is showing (will attach a video recording for this in Slack).
So I decided that the loading animation has to be an element that is part of index.html instead of being rendered as a Vue component. I tried to make it as minimal as I can in favor of this opinion of yours in Slack.

In SPAs, index.html is treated as a blank loader usually. In other words, it should be small and uncluttered.

Hope that looks good for you too.

@SebinSong SebinSong changed the title [WIP] add initial loading-screen to index.html Add initial loading-screen to index.html Feb 1, 2024
Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Interesting approach @SebinSong!

When I loaded a previously loaded session (after starting FFDev), I was greeted with the following:

Screenshot 2024-02-01 at 5 37 28 PM

So there are 2 bugs here:

  1. Vue correctly complains about <loading> component not being defined as part of the components of App.vue in main.js
  2. The loading screen covers this prompt that is supposed to appear when quitting grunt dev and restarting it while there was an existing user+group:

Screenshot 2024-02-01 at 5 41 52 PM

To reproduce, create a group, then restart grunt dev and refresh the page after grunt dev fully loads.

Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Great work @SebinSong - seems like all of the issue were fixed!

Only thing is, some debug console.log statements were still left in the PR. Once those are removed I can merge!

@SebinSong
Copy link
Collaborator Author

@taoeffect my bad on all those console.log :)
Updated again.

Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

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

Nicely done @SebinSong!

With some more testing I noticed an issue I didn't notice before.

If you perform a refresh it always redirects to the dashboard. For example, if you are viewing the general chatroom and refresh, it takes you to the dashboard still.

However, this seems to be an issue on master too, not just this PR, so I'll go ahead and approve and then open a new issue.

@taoeffect taoeffect merged commit 36b7b59 into master Feb 3, 2024
4 checks passed
@taoeffect taoeffect deleted the sebin/task/#1822-initial-app-loading-screen branch February 3, 2024 02:22
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.

Create initial app loading screen
3 participants