-
Notifications
You must be signed in to change notification settings - Fork 36
Conversation
Codecov Report
@@ Coverage Diff @@
## master #639 +/- ##
==========================================
+ Coverage 98.42% 98.43% +0.01%
==========================================
Files 45 45
Lines 1267 1279 +12
Branches 292 292
==========================================
+ Hits 1247 1259 +12
Misses 19 19
Partials 1 1
Continue to review full report at Codecov.
|
35361dc
to
ef965d2
Compare
Looks like codecov did not update the coverage report according to the last pushed code... |
Just so I don't forget what I said about this on IRC 😀 could you look into #628 first? Your patch here seems to be making it worse. I do like how you simplified the initial path loading, though. We should definitely do that. |
@kumar303 could you please test this patch? I am not sure if I am the only one seeing UI lags (cf. PR description). It looks like it ends up in the correct state though, but it takes time... |
I've fixed this a bit by protecting the |
Can you file an issue for it? It's because the thunk is loading in the background for each file / diff you traverse. The flicker happens when one of the older diffs finally loads but a newer one loads right after it. I think this means we need debouncing. It may not be trivial to add debouncing. |
Yes. Edit: #644
Maybe we could debounce the keyboard navigation component instead (the key listener maybe?). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is way simpler, I like it!
It works great, I've just requested some fixes to the tests.
Thanks @kumar303, I believe I addressed all the change requests. There is one for which I could not do anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great
Fixes #638
Fixes #628
While the code looked nice and the test suite was covering all the branches, it appears that most of the code was not needed because loading a file from the URL is done by
fetchDiff
, which takes an optionalpath
. Given that there is no URL update triggered by our code, the URL stayed the same and everything just worked as intended. This was nice but complicated and not needed, so I removed it.The fix for the infinite loop is mostly in
src/reducers/versions.tsx
. Because we load a file, we should abort this action too in case of an error. This allows theloadData()
method to check the status of theversion
prop.I added some commits to fix #628 too. I believe it works (i.e. I cannot trigger an infinite loop) but the UI sometimes lags. I covered the following scenarios:
j
twice to end up in a file with some content, http://localhost:3000/en-US/compare/502955/versions/1541794...1541798/?path=META-INF%2Fcose.manifestI think protecting the thunk with a loading flag would help.I've done that in the last commit.