fix:Guard against missing agent, add warning & fallbacks, and fix dialog mouse selection handling#19685
fix:Guard against missing agent, add warning & fallbacks, and fix dialog mouse selection handling#19685yejiming wants to merge 5 commits into
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
| if (renderer.getSelection()) { | ||
| renderer.clearSelection() | ||
| } |
There was a problem hiding this comment.
Please check if renderer.clearSelection() is no-op safe. It may not be necessary to check before clearing
There was a problem hiding this comment.
You’re right, renderer.clearSelection() is no-op safe. I’ve changed it to call renderer.clearSelection() directly.
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #19565
Closes #19591
Type of change
What does this PR do?
This PR fixes two TUI interaction bugs:
Prevents crashes when
local.agent.current()is temporarily undefined (startup/race condition path, reported on Windows).prompt/index.tsx.currentas optional.Fixes dialog overlay dismiss behavior so clicking outside closes on the first click.
ui/dialog.tsx, clearing selection no longer consumes the first outside click.These changes preserve existing behavior when data is ready, while avoiding undefined access and improving dialog UX.
How did you verify your code works?
bun typecheckinpackages/opencode(fails in this environment becausetsgois not installed).bun test test/cli/tui --filter dialoginpackages/opencode(fails in this environment because@opentui/solid/preloadis unavailable).agentdefensively and compile logically.Screenshots / recordings
N/A (TUI interaction fix; no browser UI screenshot).
Checklist