-
Notifications
You must be signed in to change notification settings - Fork 80
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
Reload button to manually reload file tree #108
Conversation
This might also acts as a workaround for #67 |
Thanks @Linus045 ! I will go over it soon (crazy times so may take more time than usual) and it should be included in the next version. |
This looks like a nice feature. How can I help to test this change? |
I suppose you can checkout this branch, build and add the extension to your browser and see how it performs on small and big pull requests. The main goal is to fix the problem with github's batch loading when the PR contains a lot of changes. Currently the tree is generated once and only updates when you type something in the filter bar. (There is an if statement to check if the sidebar file count and actual shown files count match and if not it will reload the tree, but iirc that doesn't work, therefore I added the automatic reload) |
Back after a long while to revisit this. I can accept this after:
|
I removed the automatic reloading and replaced the bind(this) function with an arrow function. |
When looking at a single commit of a PR the file tree doesn't update correctly when the page is still loading.
This is because we stop trying to reload the file tree after the first time since we can't get the changed file count for the single commit.
I added a reload button that manually reloads the file tree when clicked.
Additionally I added a feature so that if you look at a single commit, it tries to refresh the tree a few times (max. 10 times currently).
Normally I don't program in React so there might be some things that can be done in a better fashion.