[PR #11641] fix: fixes issue where the autocomplete tui dialog flickers while typing #13872

Closed
opened 2026-02-16 18:18:42 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11641

State: closed
Merged: Yes


Fixes #11640

What does this PR do?

I noticed that when typing @ and / commands in the opencode TUI that you would see the dialog flickering as you type. This is especially true when you type pretty fast here. (For example while typing you'd see the Opencode logo flicker behind as the dialog opens and closes rapidly

This PR fixes that issue by making sure to only update the search value after the value of the filter has settled (i.e. has been flushed due to how Solid works). The issue was caused because the filter depends on both the value (reactive) and non-reactive values that need to be flushed (the input ref/cursor)

Here is the "before" state with the flickering: NOTE that due to framerate you might not see it as well as you would locally well here.

https://github.com/user-attachments/assets/5b7088bb-f22b-4515-aac6-4c01b6ac9989

Another better example:

https://github.com/user-attachments/assets/5a1a25a5-1181-4920-8144-d852846ada68

How did you verify your code works?

I tested manually. GIFS below of after state

https://github.com/user-attachments/assets/c1222657-aecf-4f9c-a7fe-a1c314af7170

Another example with it fixed and simpler inputs

https://github.com/user-attachments/assets/c60949e4-e1a9-48d3-b8f3-5f33e744744d

Note: PR updated with better assets, but still framerate may make it difficult to see at times.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11641 **State:** closed **Merged:** Yes --- Fixes #11640 ### What does this PR do? I noticed that when typing @ and `/` commands in the opencode TUI that you would see the dialog flickering as you type. This is especially true when you type pretty fast here. (For example while typing you'd see the `Opencode` logo flicker behind as the dialog opens and closes rapidly This PR fixes that issue by making sure to only update the `search` value after the value of the `filter` has settled (i.e. has been flushed due to how Solid works). The issue was caused because the filter depends on both the value (reactive) and non-reactive values that need to be flushed (the input ref/cursor) *Here is the "before" state with the flickering:* NOTE that due to framerate you might not see it as well as you would locally well here. https://github.com/user-attachments/assets/5b7088bb-f22b-4515-aac6-4c01b6ac9989 Another better example: https://github.com/user-attachments/assets/5a1a25a5-1181-4920-8144-d852846ada68 ### How did you verify your code works? I tested manually. GIFS below of after state https://github.com/user-attachments/assets/c1222657-aecf-4f9c-a7fe-a1c314af7170 Another example with it fixed and simpler inputs https://github.com/user-attachments/assets/c60949e4-e1a9-48d3-b8f3-5f33e744744d Note: PR updated with better assets, but still framerate may make it difficult to see at times.
yindo added the pull-request label 2026-02-16 18:18:42 -05:00
yindo closed this issue 2026-02-16 18:18:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13872