fix(tui): make auth URLs clickable regardless of line wrapping#1
fix(tui): make auth URLs clickable regardless of line wrapping#1
Conversation
Add a new Link component that opens URLs in the default browser when clicked. This fixes the issue where OAuth authorization URLs that wrap across multiple lines were only partially clickable (only the first line would work). The Link component uses an onMouseUp handler with the 'open' package to open URLs, which works in all terminal emulators. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds clickable link functionality to authentication URLs in the TUI by creating a new Link component and integrating it into the dialog provider. This fix addresses an issue where auth URLs could not be clicked when they wrapped across multiple lines.
Key Changes
- Created a new
Linkcomponent that renders clickable hyperlinks using theopenpackage - Replaced static text URLs with the
Linkcomponent in two authorization dialog methods (auto and code)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/opencode/src/cli/cmd/tui/ui/link.tsx |
New reusable Link component that opens URLs in the default browser on click |
packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx |
Updated AutoMethod and CodeMethod to use the Link component for authorization URLs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <text | ||
| fg={props.fg} | ||
| onMouseUp={() => { | ||
| open(props.href).catch(() => {}) | ||
| }} | ||
| > | ||
| {displayText} | ||
| </text> |
There was a problem hiding this comment.
The Link component should include an underline style to visually indicate that the text is clickable. Based on other link styles in the codebase (see theme.tsx lines 908, 915, 922), clickable links should have underline styling. Consider adding underline: true to a style prop or using a similar mechanism to make the clickable nature of the link more apparent to users.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@brettheap I've opened a new pull request, #2, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: brettheap <1513478+brettheap@users.noreply.github.com>
Add underline styling to Link component
Merge fix for clickable auth URLs into our fork.
See upstream PR: anomalyco#6317