Issue: Input fields need debounce — typing is laggy and often misses characters #580

Closed
opened 2026-10-05 02:54:07 +02:00 by adam · 4 comments
Owner

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:

  1. Create blog post, assure the schema and metadata allow for inputting in the description field in the sidebar's "Metadata" section
  2. Type very fast (e.g. move your finger very quickly over "qwertyuiop")
  3. See that some characters were eaten during typing

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):

  • OS: Ubuntu 22.04
  • Browser VSCode 1.85.1
  • Version v9.5.7489259
**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: 1. Create blog post, assure the schema and metadata allow for inputting in the description field in the sidebar's "Metadata" section 2. Type very fast (e.g. move your finger very quickly over "qwertyuiop") 3. See that some characters were eaten during typing **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):** - OS: Ubuntu 22.04 - Browser VSCode 1.85.1 - Version `v9.5.7489259` <!-- github-sync-id:2080442068 -->
adam closed this issue 2026-10-05 02:54:07 +02:00
Author
Owner

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.

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. <!-- github-comment-id:1891642421 -->
Author
Owner

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:

  1. input some sentence into the "description" field
  2. Use CTRL+BACKSPACE to erase last word
  3. Use CTRL+Z to undo the action of deleting the word

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)

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: 1. input some sentence into the "description" field 2. Use CTRL+BACKSPACE to erase last word 3. Use CTRL+Z to undo the action of deleting the word 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) <!-- github-comment-id:1892206160 -->
Author
Owner

Thanks, @T3sT3ro, for testing it out! I will do some extra testing as well.

Thanks, @T3sT3ro, for testing it out! I will do some extra testing as well. <!-- github-comment-id:1892210768 -->
Author
Owner

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.

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. <!-- github-comment-id:1892211707 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#580