Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

add: PreloaderModal and integrated to the Toolbar #81

Merged
merged 5 commits into from
Jan 4, 2023
Merged

Conversation

omedvediev
Copy link
Contributor

No description provided.

@netlify
Copy link

netlify bot commented Dec 6, 2022

Deploy Preview for 3dstreet-editor-builds ready!

Name Link
🔨 Latest commit d0c0611
🔍 Latest deploy log https://app.netlify.com/sites/3dstreet-editor-builds/deploys/63b3f4450972470008aafd68
😎 Deploy Preview https://deploy-preview-81--3dstreet-editor-builds.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@kfarr kfarr left a comment

Choose a reason for hiding this comment

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

@omedvediev

  • I left one comment asking about the 2.5 second timeout -- is there no method to remove the save dialog only when file downloaded?
  • Also can we change the name from "PreloaderModal" to "SavingModal"? Reason being, we will later have a loading modal for the entire application which is different than this saving indicator.

new Promise(resolve => {
const sceneElem = AFRAME.scenes[0];
sceneElem.components.screenshot.capture('perspective');
setTimeout(() => resolve(), 2500);
Copy link
Contributor

Choose a reason for hiding this comment

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

why wait 2500 ms? is there not a mechanism to wait to remove the saving modal until the file is downloaded?

Copy link
Contributor Author

@omedvediev omedvediev Dec 20, 2022

Choose a reason for hiding this comment

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

Hello @kfarr!

  1. I've tried. But for some reason, it triggers much earlier (approx 2.5 sec). I think it's because the capture() function ends with triggering the download and not with the download ends. If it's a critical issue, I could investigate how to make this in the other way;

  2. Sure, I'll rename the component

@omedvediev
Copy link
Contributor Author

Hello, @kfarr, I've reduced timeout to 1s, and renamed PreloaderModal to SavingModal

@kfarr
Copy link
Contributor

kfarr commented Dec 27, 2022

Thanks @omedvediev the last request is it possible to actually keep the loader up until the snapshot is actually completed and downloaded, for example with some sort of callback? A timeout is not a great solution IMHO but if that's the only thing possible right now it is at least better than nothing. We could also make a separate ticket for adding callback in the future.

@omedvediev
Copy link
Contributor Author

Hello, @kfarr! Ok, I'm investigating possible solutions.

@omedvediev
Copy link
Contributor Author

Hello @kfarr , it looks like 'setTimeout' is the best solution for now. As the Browser's file downloading is beyond the scope of the Web App, I haven't found any solution for download finish detection for React.

@kfarr
Copy link
Contributor

kfarr commented Jan 2, 2023

@omedvediev thanks for the research. Understood it's easiest to stick with setTimeout, at least for a first version.

To finish this out:

  • Can you set it for 2 seconds, instead of 1?
  • Can you also rebase this / resolve conflicts? I started down the path to do that myself but honestly there are too many conflicts so I don't know how to make it work.

For future reference: (KF TODO make a new ticket for this)

  • The primary cause of the delay is a-frame / three.js screencapture function. It should be possible to callback on this or related. It may not be possible to get a callback from the built-in a-frame function, so instead we may need to copy and modify our own.
  • After the generation is done, then the file is downloaded. At this point there could be different indication to user that the generation is complete and that downloading is the next step, perhaps including instructions on how to approve browser user agent asking for download permission.

@omedvediev
Copy link
Contributor Author

Hello @kfarr , timeout is set to 2sec, conflicts are resolved.

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

Successfully merging this pull request may close these issues.

2 participants