From 850a470c7c2c5038aba3577d0e9d986d25587016 Mon Sep 17 00:00:00 2001 From: luckeyfaraday Date: Mon, 15 Jun 2026 14:44:13 +0200 Subject: [PATCH] Make OAuth auth link clickable as one unit, not a wrapped blob MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The provider auth dialog rendered the full authorization URL as the Link display text. opentui has no OSC 8 hyperlink support, so the terminal's own URL detection only links the first physical line once the long URL word-wraps — hence "only the first part is clickable". Show a compact "Open authorization page in browser" label instead (AutoMethod + CodeMethod). The full URL still opens via the Link's onMouseUp, and `c` still copies it (hint relabeled "copy link"). Adds an `attributes` passthrough to Link so the label renders underlined. Co-Authored-By: Claude Opus 4.8 --- patches/opencode-athena.patch | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/patches/opencode-athena.patch b/patches/opencode-athena.patch index 831b9fe..94eb85b 100644 --- a/patches/opencode-athena.patch +++ b/patches/opencode-athena.patch @@ -172,6 +172,38 @@ index b309edc..4751cae 100644 builtin: true, sounds: { default: defaultSoundPath, +diff --git a/packages/tui/src/component/dialog-provider.tsx b/packages/tui/src/component/dialog-provider.tsx +index 2767508..9aef9c5 100644 +--- a/packages/tui/src/component/dialog-provider.tsx ++++ b/packages/tui/src/component/dialog-provider.tsx +@@ -294,12 +294,14 @@ function AutoMethod(props: AutoMethodProps) { + + + +- ++ ++ ↗ Open authorization page in browser ++ + {props.authorization.instructions} + + Waiting for authorization... + +- c copy ++ c copy link + + + ) +@@ -339,7 +341,9 @@ function CodeMethod(props: CodeMethodProps) { + description={() => ( + + {props.authorization.instructions} +- ++ ++ ↗ Open authorization page in browser ++ + + Invalid code + diff --git a/packages/tui/src/component/prompt/index.tsx b/packages/tui/src/component/prompt/index.tsx index 0a9f103..2d93003 100644 --- a/packages/tui/src/component/prompt/index.tsx @@ -631,6 +663,36 @@ index e8a5f2c..eaaa790 100644 aura, ayu, catppuccin, +diff --git a/packages/tui/src/ui/link.tsx b/packages/tui/src/ui/link.tsx +index cfd78bc..7729823 100644 +--- a/packages/tui/src/ui/link.tsx ++++ b/packages/tui/src/ui/link.tsx +@@ -9,11 +9,17 @@ export interface LinkProps { + bg?: RGBA + width?: number | "auto" | `${number}%` + wrapMode?: "word" | "none" ++ attributes?: number + } + + /** + * Link component that renders clickable hyperlinks. + * Clicking anywhere on the link text opens the URL in the default browser. ++ * ++ * Terminals only auto-link URLs that fit on a single physical line, so passing ++ * a long `href` as the display text leaves it word-wrapped and only the first ++ * line clickable. Prefer a short label via `children` (the full `href` still ++ * opens on click) for anything that would wrap. + */ + export function Link(props: LinkProps) { + const displayText = props.children ?? props.href +@@ -24,6 +30,7 @@ export function Link(props: LinkProps) { + bg={props.bg} + width={props.width} + wrapMode={props.wrapMode} ++ attributes={props.attributes} + onMouseUp={() => { + open(props.href).catch(() => {}) + }} diff --git a/packages/tui/src/util/presentation.ts b/packages/tui/src/util/presentation.ts index cf432bf..aad5a4f 100644 --- a/packages/tui/src/util/presentation.ts