Skip to content

We sometimes briefly see empty files when watching #157

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

Closed
mbostock opened this issue Nov 13, 2023 · 3 comments · Fixed by #603
Closed

We sometimes briefly see empty files when watching #157

mbostock opened this issue Nov 13, 2023 · 3 comments · Fixed by #603
Assignees
Labels
bug Something isn’t working

Comments

@mbostock
Copy link
Member

It appears that sometimes we see empty files briefly when watching, which are then immediately updated with a non-empty file. The end result on the client is the same, except we end up scrolling to the top because the page is briefly empty in the interim. We should either debounce file watching in general, or specifically when the file is empty, to avoid re-evaluating the entire page and scrolling to the top. It’s okay if the reactive update is delayed by one–two hundred milliseconds.

@mbostock
Copy link
Member Author

I’m seeing a lot of scroll-to-the-top behavior when editing a longer page (the new getting-started.md in #603). We should investigate what is happening here.

@mbostock
Copy link
Member Author

Here’s evidence that it’s seeing the page as briefly empty: all the nodes are removed, and then immediately after another update adds them back.

Screenshot 2024-01-31 at 10 24 04 AM

@mbostock
Copy link
Member Author

Also, e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 is the empty hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants