tbonelee commented on code in PR #5022:
URL: https://github.com/apache/zeppelin/pull/5022#discussion_r2291300802


##########
zeppelin-web/src/app/jobmanager/jobmanager.html:
##########


Review Comment:
   Thansk for the detailed explanation! From what I understand, the 'UI delay' 
you mentioned might not necessarily come from the `ng-if` nesting itself, but 
possibly from the 'digest cycle' of AngularJS (which cause UI updates) not 
being triggered when the state is updated inside a `Promise.then()`.
   
   If the promise is a native ES6 `Promise` (rather than AngularJS's `$q` or 
`$http`), AngularJS doesn't automatically run a digest cycle. In that case, the 
view won't update until the next `$apply()` happens somewhere else, which can 
fell like a rendering delay.
   
   One possible way to address this could be wrapping the state update in 
`$scope.$apply()` within the `then()` callback.
   
   ```js
   asyncNotebookJobFilter(...)
     .then(() => {
       $scope.apply(() => {
         $scope.isFilterLoaded = true;
       });
     });
   ```
   
   The other could be replacing `new Promise()` in `asyncNotebookJobFilter` 
with `$q()`Since `$q` is integrated with the digest cycle, view updates will be 
reflected automatically. You would need to inject `$q` into 
`JobManagerController`.
   
   If this doesn't match the issue you observed, please feel free to correct me!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to