fix(tui): open authorization links - #40905
Merged
Merged
Conversation
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.
What
Make OAuth device authorization links keyboard-accessible in the TUI. The waiting dialog now advertises
o open, whilec copyremains available as the manual fallback.Before / After
Before: The authorization URL was visible and mouse-clickable, but keyboard users could only copy the device code or URL and open it manually.
After: Pressing
oopens the authorization URL in the default browser. If browser launch fails, the dialog shows an error directing the user to copy the URL. Rendered links also use OpenTUI's native<a href>element so supported terminals receive hyperlink metadata.How
packages/tui/src/component/dialog-integration.tsxregisters the modalocommand and renders its key hint.packages/tui/src/ui/link.tsxrenders the shared link through OpenTUI's native anchor element while preserving mouse opening.Scope
This only changes automatic OAuth/device authorization dialogs. Manual code-entry dialogs are unchanged.
Testing
bun typecheckfrompackages/tuibun run test test/cli/cmd/tui/integration-options.test.tsfrompackages/tuitermctrl, from/connectthrough the OpenCode Console authorization dialogDemo
Fresh isolated TUI showing
o openandc copyin one action row. The displayed authorization attempt was canceled immediately after capture.