Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long texts take a long time to open #798

Closed
gerroon opened this issue Dec 31, 2019 · 10 comments
Closed

Long texts take a long time to open #798

gerroon opened this issue Dec 31, 2019 · 10 comments

Comments

@gerroon
Copy link

gerroon commented Dec 31, 2019

Hi

The longer the note gets longer it takes to show it.

For instance web clip this page for testing. You will see it takes some seconds to open it. This gets words if the user has much longer texts, which I do. I sometimes wait 5-10 secs for a page to show up.

I am mainly on Linux.

https://docs.blender.org/api/current/bmesh.ops.html

@zadam
Copy link
Owner

zadam commented Jan 1, 2020

Yes, it is indeed very slow to load. This is caused by CKEditor and I can't really do much about it. However, it looks like CKEditor team will look into performance issues soon enough: ckeditor/ckeditor5#5880

I attached this page as an example to that ticket.

@gerroon
Copy link
Author

gerroon commented Jan 1, 2020

Would having read only and edit modes help in this case? For instance Trilium could turn read only mode for large texts by default

@zadam
Copy link
Owner

zadam commented Apr 6, 2020

I was testing some long clipped text notes and it was really painful. I just implemented what you proposed - read only text view is shown if text is long (by default 10KB) with the option to switch to edit mode. Shorter notes are always in the edit mode as usual.

@zadam zadam closed this as completed Apr 6, 2020
@gerroon
Copy link
Author

gerroon commented Apr 8, 2020

Thanks for the fix. It seems like this works only in the desktop version. Just tested it with the server version on Firefox 74 and long text are still very painful there, not sure if this is a package limitation.

Also it would be nice if there is an option to set the file size at some point.

@gerroon
Copy link
Author

gerroon commented Apr 25, 2020

@zadam

Is it possible to add this fix to all other text types like markdown and regular text? Although they are not as bad as the regular text type but can still use the same trick.

@zadam
Copy link
Owner

zadam commented Apr 25, 2020

Specifically for code notes there would be a loss of functionality since no editor means no syntax highlighting ...

@gerroon
Copy link
Author

gerroon commented Apr 25, 2020

I am guessing that you mean the view only mode?

@zadam
Copy link
Owner

zadam commented Apr 25, 2020

Yes, the view only mode would just display plain text (that's how code notes are stored) with no syntax highlighting.

It is possible to include (faster) read only highlighter but there would be probably differences in exact highlighting style.

All this is mostly non-problem for "text" notes since CKEditor produces HTML and also provides "content styles" so read only view can then look very similar to how the content looks in editor mode.

@gerroon
Copy link
Author

gerroon commented Apr 25, 2020

Personally I prefer performance over the looks, and given that only huge files will be effected by this it might be ok.

@zadam
Copy link
Owner

zadam commented Apr 26, 2020

Yeah, makes sense. I added the preview mode to code notes as well (will be in 0.42).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants