fix: fixes issue where the autocomplete tui dialog flickers while typing#11641
Merged
rekram1-node merged 2 commits intoanomalyco:devfrom Feb 2, 2026
Merged
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
opencode-agent bot
added a commit
that referenced
this pull request
Feb 1, 2026
…lickers while typing
opencode-agent bot
added a commit
that referenced
this pull request
Feb 1, 2026
…lickers while typing
opencode-agent bot
added a commit
that referenced
this pull request
Feb 1, 2026
…lickers while typing
opencode-agent bot
added a commit
that referenced
this pull request
Feb 1, 2026
…lickers while typing
opencode-agent bot
added a commit
that referenced
this pull request
Feb 1, 2026
…lickers while typing
opencode-agent bot
added a commit
that referenced
this pull request
Feb 1, 2026
…lickers while typing
opencode-agent bot
added a commit
that referenced
this pull request
Feb 2, 2026
…lickers while typing
Collaborator
|
/review |
| setSearch("") | ||
| return | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Suggestion: The two if statements on lines 136-143 can be combined since they both do the same thing (setSearch("") and return). Since undefined and "" are both falsy, you could simplify to:
Suggested change
| createEffect(() => { | |
| const next = filter() | |
| if (!next) { | |
| setSearch("") | |
| return | |
| } | |
| setSearch(next) | |
| }) |
This is just a suggestion for cleaner code - the current implementation is functionally correct.
|
|
||
| // filter() reads reactive props.value plus non-reactive cursor/text state. | ||
| // On keypress those can be briefly out of sync, so filter() may return an empty/partial string. | ||
| // Copy it into search in an effect because effects run after reactive updates have/render and paint have |
Contributor
There was a problem hiding this comment.
Minor typo in comment: "have/render" appears to be a copy-paste artifact. Consider fixing to make the comment clearer (e.g., "...after reactive updates, render, and paint have been applied...").
Contributor
Author
|
@rekram1-node addressed the pr feedback if you get another chance at some point. Thanks! |
ishaksebsib
pushed a commit
to ishaksebsib/opencode
that referenced
this pull request
Feb 4, 2026
ishaksebsib
pushed a commit
to ishaksebsib/opencode
that referenced
this pull request
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theOpencodelogo flicker behind as the dialog opens and closes rapidlyThis PR fixes that issue by making sure to only update the
searchvalue after the value of thefilterhas 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.
Screen.Recording.2026-02-01.at.11.12.56.AM.mov
Another better example:
Screen.Recording.2026-02-01.at.11.18.46.AM.mov
How did you verify your code works?
I tested manually. GIFS below of after state
Screen.Recording.2026-02-01.at.11.16.00.AM.mov
Another example with it fixed and simpler inputs
Screen.Recording.2026-02-01.at.11.20.35.AM.mov
Note: PR updated with better assets, but still framerate may make it difficult to see at times.