You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While building side by side diff view for notebook (#94810), I ran into another challenge with dynamic cell heights.
At the beginning, List View supports dynamic items at creation/rendering time but it doesn't support item height change once it's rendered. Then we introduced updateElementHeight API to allow notebook cells grow its height (when there are outputs). Rendering notebooks side by side has more requirements: if a cell is modified/changed (for example, outputs are different), its scroll top in two editors should be the same, and its accumulated total height should be the same as well.
To solve this problem, we can either leverage updateElementHeight to update cell heights based on diff information (then cellHeight = inputHeight + outputsHeight + additionalHeight), or introduce a view zone API which is identical to Monaco's view zone. The API would allow you to preserve a whitespace area after an index:
The diff component can then use this API to adjust the scroll tops of cells without messing up with the layout info of cells. Diff information would be transparent to NotebookEditor or ListView.
The text was updated successfully, but these errors were encountered:
@roblourens is working on moving the height calculation logic into the List View other than doing all the math in notebook renderer. Maybe this can also be done by addViewZone and then update the height of the viewzone when DOM changes.
To solve this problem, we can either leverage updateElementHeight to update cell heights based on diff information (then cellHeight = inputHeight + outputsHeight + additionalHeight), or introduce a view zone API which is identical to Monaco's view zone. The API would allow you to preserve a whitespace area after an index:
Given the two approaches, the first one seems much better since it introduces no API and appears simple. Why do you seem to have a preference for a view zone API? And why can't a view zone feature set be built on top of the existing ListView API?
While building side by side diff view for notebook (#94810), I ran into another challenge with dynamic cell heights.
At the beginning, List View supports dynamic items at creation/rendering time but it doesn't support item height change once it's rendered. Then we introduced
updateElementHeight
API to allow notebook cells grow its height (when there are outputs). Rendering notebooks side by side has more requirements: if a cell is modified/changed (for example, outputs are different), its scroll top in two editors should be the same, and its accumulated total height should be the same as well.To solve this problem, we can either leverage
updateElementHeight
to update cell heights based on diff information (thencellHeight = inputHeight + outputsHeight + additionalHeight
), or introduce a view zone API which is identical to Monaco's view zone. The API would allow you to preserve a whitespace area after an index:The diff component can then use this API to adjust the scroll tops of cells without messing up with the layout info of cells. Diff information would be transparent to
NotebookEditor
orListView
.The text was updated successfully, but these errors were encountered: