Allow collapsed entries to fetch data on request
Review Request #11886 — Created Nov. 29, 2021 and updated — Latest diff uploaded
Review Board will collapse old reviews to streamline information.
While the data is visually hidden it will still be computed
and loaded to the client which can cause slowness.This change makes collapsed review entries get sent to the client
empty, then fetch its content on request. When they expand the entry, we
first check if this entry already has content loaded, if not then load it
by using the new function "fetchEntryUpdates" in reviewRequestPageModel.js
which can trigger an immediate update to load the content of an entry.
This function uses and extends the machinery related to "page pending updates"
In order to make it feel even snappier, I add a mouseover event listener
on the expand button and the expand all button. We start to pull down information
before they even lift the mouse button.Only load the entry content if the entry is of type "review". Without this restriction,
when they click the expand all button, the entry of type "initial_status_updates" or
"changedesc"also tries to check whether it has content which causes an error.
Created entryViewTests.es6.js that contains test cases for the
behavior of expanding an entry. All tests passed.Ran all Javascript unit tests and no newly introduced test fails.