Closed T3sT3ro closed 4 months ago
Thanks @T3sT3ro for your suggestion. I have added it to the text input fields, feel free to give it a try in the latest beta.
It's a much smoother experience now, thanks!
I noticed some issues with the undo system however — it is pretty hard to reproduce reliably, so you might want to try several times. The steps go like this:
You have to trigger step 3. at appropriate time, somewhere between the step 2. and around the time the debounce triggers and the file is changed. Try to trigger 3. "at the same time" the debounce kicks in and you may see that there is a frame when the world appears successfully (after undo) and then disappears again (and you can't redo again).
The similar thing happens in the reverse case , for example when you first type, then wait for debounce to kick in and rougly at the same time (few ms before) press undo — the word is erased for a brief moment and pasted again. The first case is worse however, assuming you type some lengthy description you accidentally select and erase a part of the text (e.g. you brush the touchpad and press backspace at the same time) then you can lose all of your input when you mistime your CTRL+Z, because input action is erased from the input history.
Another thing you could do is also consider adding debounce to other types of inputs, for example toggles (for me draft input seems to trigger immediately introducing some delay to responsiveness)
Thanks, @T3sT3ro, for testing it out! I will do some extra testing as well.
I also noticed some with undo for categories and tags input — which most probably need their own issue - adding a category/tag is not undoable. Other inputs may also require some testing.
Describe the bug Typing in the fields like "Description" in the blog's metadata results in instant updates to the file's content. At the same time the field is not very responsive and sometimes "eats" characters when typing fast.
To Reproduce Steps to reproduce the behavior:
Expected behavior The text should be input as user typed.
Possible solution Add debounce, for example for 300ms (or longer), to the text inputs after which you will update the text file. It is possible that longer markdown files can produce even more lag (updates to frontmatter in them can be time consuming), so maybe you should stress test it against some longer blog posts.
Screenshots
https://github.com/estruyf/vscode-front-matter/assets/5300963/a6315658-7816-4749-9d61-ed6ef72f7370
Desktop (please complete the following information):
v9.5.7489259