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

implemented skeletons loading page, for all navigation #570

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Saurabhsing21
Copy link

@Saurabhsing21 Saurabhsing21 commented Jan 15, 2025

/claim #533

Implementing Skeleton Loading for Navigation and Images

Skeleton loading is a technique used to display a placeholder while content is being loaded, improving user experience by reducing perceived load times. Below is how to implement skeleton loading for Navigation and Images.

Before I:

image alt

After:

image alt

@Saurabhsing21
Copy link
Author

/claim #533

Copy link

algora-pbc bot commented Jan 15, 2025

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe.

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

Not the right fix, the loading will still appear.

The reason is the loading appears is because index.html loads before other assets

@Saurabhsing21
Copy link
Author

Not the right fix, the loading will still appear.

The reason is the loading appears is because index.html loads before other assets

Thanks, I'm just done with changes you require. i will submit it soon

- Added a simple and lightweight skeleton loading page for all navigation.
- Ensured no JavaScript is loaded via <script> tags for security and performance.
- Custom lightweight inline script is used for minimal interactivity.
- Fixes issue tscircuit#533.
- Implemented skeleton in `index.html` to show loading state until content is fully loaded.

Signed-off-by: Saurabhsing21 <[email protected]>
- Added a simple and lightweight skeleton loading page for all navigation.
- Ensured no JavaScript is loaded via <script> tags for security and performance.
- Custom lightweight inline script is used for minimal interactivity.
- Fixes issue tscircuit#533.
- Implemented skeleton in `index.html` to show loading state until content is fully loaded.

Signed-off-by: Saurabhsing21 <[email protected]>
@Saurabhsing21
Copy link
Author

Saurabhsing21 commented Jan 16, 2025

@seveibar @imrishabh18 , I have completed the skeleton loading page implementation in index.html. Please review it and let me know if any further changes are required.

index.html Outdated
Comment on lines 204 to 214
<script>
document.addEventListener("DOMContentLoaded", () => {
const skeletonLoader = document.getElementById("skeleton-loader");
if (skeletonLoader) {
console.log("Skeleton Loader is displayed.");
setTimeout(() => {
skeletonLoader.style.display = "none";
}, 300); // Hide skeleton after React initializes
}
});
</script>
Copy link
Member

Choose a reason for hiding this comment

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

@Saurabhsing21 I don't we need the cleanup and hiding of the skeleton at both the places, I see you have added this in the useEffect() hook as well.

Copy link
Author

Choose a reason for hiding this comment

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

@imrishabh18 just to clarify, do you mean that I should remove the script tag and keep the skeleton hiding logic only in the useEffect() hook?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, give it a try. I think that should work

@imrishabh18
Copy link
Member

Other than that, this LGTM! Make sure you are fixing the format issues

@Saurabhsing21
Copy link
Author

Other than that, this LGTM! Make sure you are fixing the format issues

ok i will fix this

removed  cleanup and hiding of the skeleton   from script tag inside index.html
using  cleanup and hiding of the skeleton  with useEffect() in app.tsx
Signed-off-by: Saurabhsing21 <[email protected]>
Signed-off-by: Saurabhsing21 <[email protected]>
@Saurabhsing21
Copy link
Author

@imrishabh18 please review this,

@imrishabh18
Copy link
Member

LGTM!

cc: @seveibar

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

LGTM, let's see @ShiboSoftwareDev weigh in!!!!

@ShiboSoftwareDev
Copy link
Contributor

@seveibar if you test the preview, it feels off

Copy link
Contributor

@ShiboSoftwareDev ShiboSoftwareDev left a comment

Choose a reason for hiding this comment

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

I didn't give time to the ai page to preload and this is what I got:

Screen.Recording.2025-01-16.193042.mp4

@Saurabhsing21
Copy link
Author

I didn't give time to the ai page to preload and this is what I got:

Screen.Recording.2025-01-16.193042.mp4

sorry for my mistake. I will change as per requirement.

@Saurabhsing21
Copy link
Author

preview.mov

@ShiboSoftwareDev I fixed required changes; please review this. i have also attched preview if anything other changes are require let o me know

@Saurabhsing21
Copy link
Author

@ShiboSoftwareDev please review this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants