Closed davidbtadokoro closed 3 weeks ago
@OJarrisonn, can you give a glance here? A simple test and top-to-bottom look at the changes would be of much help.
Of course, if you want to make a full review of the PR, you are more than welcome. Just click on the commits tab and you can start adding comments (just don't forget to publish your review in the top right button).
Change merged into the unstable branch :+1:
[Context and Fix]
Patch previews can be rendered by external renderers, like
bat
,delta
, anddiff-so-fancy
. However, this rendering is done for every frame and includes processing the whole patch being previewed through the renderer, then callinginto_text()
(fromansi_to_tui
crate). Even though this whole process isn't too costly, making it at every frame results in ugly slowdowns for not so big patches (around 2000 lines after rendering).To fix this, move the whole rendering process to when we first instantiate a
PatchsetDetailsAndActions
, i.e., when consulting a patchset.[Collateral Effects]
This basically solves the problem, however, there is still minor lag, due to ratatui
Paragraph
getting the whole file, and, for big series, there is a bit a loading when opening patchsets. Also, this does a bit of coupling of the model (App
) with the view (ratatui
).Closes: #77