addons-code-manager
addons-code-manager copied to clipboard
Create a loading indicator for comments
As discussed https://github.com/mozilla/addons-code-manager/issues/114#issuecomment-547967305
STR:
- Load a Browser page which contains reviewer comments https://code.addons-dev.allizom.org/en-US/browse/390151/versions/1688302/?messageUid=0f2fa4cbd8354a6fb1020f5f7ec2369e&path=mozilla-recommendation.json
- Observe the NavBar while the page is loading.
Expected result:
A loading indicator is available for Comments and Comment Summary.
Actual result:
Comments and Comment Summary appear with a small delay.
Notes: This issue is reproducible with the reviewer comments too. Same fix should be applied but perhaps after https://github.com/mozilla/addons-code-manager/issues/114 lands.
the Nav Bar

the Comments

┆Issue is synchronized with this Jira Task
@ioanarusiczki ah, I also noticed that the API could be faster here. I filed https://github.com/mozilla/addons/issues/7100
Here are some thoughts on the loading indicator
- It's currently impossible to know if a version has saved comments or not before making an API request for those comments. Thus, it wouldn't make sense (or would it?) to show a loading indicator for the case where the version does not have comments. This needs some thought.
- Maybe there is a way to patch the initial get version API response to indicate whether saved comments exist or not for the current user. This would solve the problem above.
@kumar303 Indeed, I see that the response timings increase with the number of comments made.
12 comments from AMO dev

12 comments from Postman - the API response :
