Skip to content

fix(tui): prevent crash in theme dialog when filter yields no results - #8879

Closed
renormalize wants to merge 1 commit into
anomalyco:devfrom
renormalize:themepanic
Closed

renormalize wants to merge 1 commit into
anomalyco:devfrom
renormalize:themepanic

Conversation

@renormalize

Copy link
Copy Markdown

What does this PR do?

Fixes #8873

Add guard clause in onMove callback to check if option exists before accessing its properties.

AI disclosure: I used opencode with Claude to figure out what was causing the error in the release (1.1.23, latest as of writing) of opencode I was running. I barely have any JS/TS knowledge, and it guided me to this solution.

If this is not the correct approach to solving this bug, and the maintainers would like to change things elsewhere to prevent this, please let me know and I am more than happy to learn and incorporate their feedback.

How did you verify your code works?

  • ./packages/opencode/script/build.ts --single to build "localcode" with the change I made.
  • ./packages/opencode/dist/opencode-darwin-arm64/bin/opencode to start opencode.
  • Opened the theme selector.
  • Searched for sonokai.
  • I did not observe the error being printed in the console, as it is in 1.1.23 when I typed n.

* Add guard clause in `onMove` callback to check if option exists before
accessing its properties.

Signed-off-by: Saketh Kalaga <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@roerohan roerohan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GG

@renormalize

Copy link
Copy Markdown
Author

Superseded by #10565.

@renormalize renormalize closed this Feb 3, 2026
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

Successfully merging this pull request may close these issues.

bug: theme selector crashes when filtering produces no results

2 participants