Skip to content

Make OAuth auth link clickable as one unit, not a wrapped blob#23

Merged
luckeyfaraday merged 1 commit into
mainfrom
fix/auth-link-clickable
Jun 15, 2026
Merged

Make OAuth auth link clickable as one unit, not a wrapped blob#23
luckeyfaraday merged 1 commit into
mainfrom
fix/auth-link-clickable

Conversation

@luckeyfaraday

Copy link
Copy Markdown
Owner

Problem

The provider auth dialog (/connect → e.g. ChatGPT Pro/Plus) rendered the full authorization URL as the Link display text. opentui has no OSC 8 hyperlink support, so the terminal's own URL auto-detection only links the first physical line once the long URL word-wraps — hence "only the first part of the link is clickable".

Screenshot of the bug: a multi-line URL where only https://auth.openai.com/oauth/authorize? (line 1) is underlined/clickable.

Fix

Show a compact, single-line ↗ Open authorization page in browser label instead of the wrapped URL, in both AutoMethod (browser flow) and CodeMethod:

  • Clicking it still opens the full URL via the Link's onMouseUp handler.
  • c still copies the full URL (hint relabeled copy link).
  • Adds an attributes passthrough to Link so the label renders underlined, plus a doc comment explaining the wrap pitfall.

Since a too-long URL can never be a real terminal hyperlink in this stack (no OSC 8, and raw escapes in <text> would corrupt opentui's width math), the click-to-open + copy affordances are the correct UX.

Implementation notes

Touches upstream opencode TUI files, so it's carried as added hunks in patches/opencode-athena.patch (regenerated via git diff against a fresh pinned checkout — not hand-edited).

Verification

  • Patch applies cleanly on the pristine pinned revision; the other 16 files' hunks are byte-identical (no drift), only 2 files added.
  • scripts/build.sh succeeds (exit 0, smoke test passed) — the TUI compiles cleanly with the patch applied.
  • The rendered glyph/underline still needs an interactive /connect to eyeball.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@luckeyfaraday luckeyfaraday merged commit 646d040 into main Jun 15, 2026
2 checks passed
@luckeyfaraday luckeyfaraday deleted the fix/auth-link-clickable branch June 15, 2026 12:56
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.

1 participant