Skip to content

Conversation

@brettheap
Copy link

Merge fix for clickable auth URLs into our fork.

See upstream PR: anomalyco#6317

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>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Link component that renders clickable hyperlinks using the open package
  • Replaced static text URLs with the Link component 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.

Comment on lines 19 to 26
<text
fg={props.fg}
onMouseUp={() => {
open(props.href).catch(() => {})
}}
>
{displayText}
</text>
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link

Copilot AI commented Dec 28, 2025

@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.

Copilot AI and others added 2 commits December 28, 2025 22:02
Co-authored-by: brettheap <1513478+brettheap@users.noreply.github.com>
Add underline styling to Link component
@brettheap brettheap merged commit 3dff333 into dev Dec 28, 2025
@brettheap brettheap deleted the fix-tui-auth-url-clickability branch December 31, 2025 08:08
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.

2 participants