From 88035f228cf6f92cede5cd2e52fa3a3fc454a02c Mon Sep 17 00:00:00 2001 From: brettheap Date: Sun, 28 Dec 2025 17:31:49 -0400 Subject: [PATCH 1/3] fix(tui): make auth URLs clickable regardless of line wrapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../cli/cmd/tui/component/dialog-provider.tsx | 5 ++-- packages/opencode/src/cli/cmd/tui/ui/link.tsx | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 packages/opencode/src/cli/cmd/tui/ui/link.tsx diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx index 5cc114f92f0c..d976485319fa 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx @@ -5,6 +5,7 @@ import { DialogSelect } from "@tui/ui/dialog-select" import { useDialog } from "@tui/ui/dialog" import { useSDK } from "../context/sdk" import { DialogPrompt } from "../ui/dialog-prompt" +import { Link } from "../ui/link" import { useTheme } from "../context/theme" import { TextAttributes } from "@opentui/core" import type { ProviderAuthAuthorization } from "@opencode-ai/sdk/v2" @@ -128,7 +129,7 @@ function AutoMethod(props: AutoMethodProps) { esc - {props.authorization.url} + {props.authorization.instructions} Waiting for authorization... @@ -170,7 +171,7 @@ function CodeMethod(props: CodeMethodProps) { description={() => ( {props.authorization.instructions} - {props.authorization.url} + Invalid code diff --git a/packages/opencode/src/cli/cmd/tui/ui/link.tsx b/packages/opencode/src/cli/cmd/tui/ui/link.tsx new file mode 100644 index 000000000000..3b328e478d61 --- /dev/null +++ b/packages/opencode/src/cli/cmd/tui/ui/link.tsx @@ -0,0 +1,28 @@ +import type { JSX } from "solid-js" +import type { RGBA } from "@opentui/core" +import open from "open" + +export interface LinkProps { + href: string + children?: JSX.Element | string + fg?: RGBA +} + +/** + * Link component that renders clickable hyperlinks. + * Clicking anywhere on the link text opens the URL in the default browser. + */ +export function Link(props: LinkProps) { + const displayText = props.children ?? props.href + + return ( + { + open(props.href).catch(() => {}) + }} + > + {displayText} + + ) +} From 30a9199e00ca9582a81641117a6c403f1e358677 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 21:55:06 +0000 Subject: [PATCH 2/3] Initial plan From b5d3f050d16c7627017a7050aea8aee93e391a2e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 22:02:43 +0000 Subject: [PATCH 3/3] Add underline styling to Link component for better visual clarity Co-authored-by: brettheap <1513478+brettheap@users.noreply.github.com> --- packages/opencode/src/cli/cmd/tui/ui/link.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/opencode/src/cli/cmd/tui/ui/link.tsx b/packages/opencode/src/cli/cmd/tui/ui/link.tsx index 3b328e478d61..1f798c54cca2 100644 --- a/packages/opencode/src/cli/cmd/tui/ui/link.tsx +++ b/packages/opencode/src/cli/cmd/tui/ui/link.tsx @@ -18,6 +18,7 @@ export function Link(props: LinkProps) { return ( { open(props.href).catch(() => {}) }}