non need to get `ncells`, `for (i in cells)`will loop through the index. also, would it be possible to either use smth map or debounce, This is one of the call that might hang the notebook as the js is stuck in a tight for loop. (eventually call the `expand_output` in a set_timeout 0