Incomplete rendering issues when upgrading from codemirror/view 6.35.0 to 6.41.0 #1700
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Joplin mobile app currently uses the CodeMirror 6 editor. When upgrading codemirror/view from 6.35.0 to 6.41.0 (see diff on this PR for the related dependency updated https://github.com/laurent22/joplin/pull/15007), this results in a rendering issue which frequently occurs when scrolling slowly on large notes. See the attached video. The note data was anonymized for privacy reasons, which makes it difficult to read. But when looking carefully it looks like when the rendering does occur after the white area, the scroll position also jumps a bit and is not in the position where it should be.
EDIT: After testing a few versions of codemirror/view, I'm unable to reproduce the issue in v6.38.8, but I can in v6.39.17
Are you able to reproduce this outside of your system, in a simpler setup? That would help a lot in narrowing down what causes it and whether it's something the Joplin code is doing.
That's quite a big ask, as I didn't write the code for the CodeMirror integration in Joplin. But I can try to narrow it down to the exact version of codemirror/view where the issue starts happening, if that would help?
It might, let's see. But if it doesn't, allow me to point out that it's an even bigger ask from you to expect me to debug 3rd-party code.
I'm able to reproduce the issue by:
output.txtfile provided by @mrjo118 in https://github.com/laurent22/joplin/issues/15141.See the downstream issue for a screen recording of the issue in the try-it editor.
Another contributor (in this downstream pull request) has narrowed the issue down to one of the changes between
@codemirror/view6.39.9 and 6.39.10.Thank you everyone for looking into this!
Update: I think the issue is related to ff312713bde1cc795468ded4a767b9ce5c59e53a: If I upgrade Joplin's editor to
@codemirror/viewv6.39.10, but revert 6.39.10's changes toheightmap.ts, the issue doesn't seem to occur.@personalizedrefrigerator wrote in #1700 (comment):
Judging from that code, I guess a fix could be to add
|| Math.round(lineHeight) != Math.round(this.lineHeight)back in from the original conditions?Patch
codemirror/view@7d2c53e697should fix this. It was related to the way character width is measured, which isn't stable for variable-width fonts, leading to a lot of unnecessary geometry resets.