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

Prevent full page spinner from flashing on load #795

Merged
merged 25 commits into from
Oct 20, 2023

Conversation

travjenkins
Copy link
Member

@travjenkins travjenkins commented Oct 18, 2023

Issues

Long standing issue

Changes

OnLoadSpinner

  • Create a context that can show a full page spinner while the app starts
  • Allow default value to be set so OAuth can be extra safe and not use this
  • Added in component that will turn off/on the spinner
  • Added the "turning off" component to full page wrapper and app layout as that seems to cover all the pages that can load while logging in.

Guards

  • The guards no longer need to show their own spinner (except grants) so they now return null during load
  • Removed some suspense uses as it was not doing anything right now

FullPageSpinner

  • Have the full page spinner no longer show right away to give the network a second and not always flash the indicator to people
  • Allow a delay to be passed in in case we need to skip the wait / make it longer

index.html

  • Cleaned up some comments. Considered defaulting the background color but since we dark and light mode this would not always make the app look like it is loading faster.

Tests

Manually tested

Both new and existing users...

  • Logging in
  • Granting tenant access (logged in and logging in)
  • Granting tenant access with fake token
  • Granting tenant access with used token
  • Google Sheets OAuth

Screenshots

Kind of hard to snag a screenshot and don't wanna include a video. Basically when the app is loading you should see one fullpage spinner during login

@travjenkins travjenkins marked this pull request as ready for review October 19, 2023 02:30
@travjenkins travjenkins requested a review from a team as a code owner October 19, 2023 02:30
function OnLoadSpinner({ children, display }: Props) {
const { setLoading } = useOnLoadSpinner();

console.log('OnLoadSpinner', display);
Copy link
Member

Choose a reason for hiding this comment

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

Flagging the presence of a logging statement in the event it should be removed.

@travjenkins travjenkins merged commit 36517db into main Oct 20, 2023
@travjenkins travjenkins deleted the travjenkins/stopLoginFlashing branch October 20, 2023 13:58
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.

2 participants