Make OAuth auth link clickable as one unit, not a wrapped blob#23
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The provider auth dialog (
/connect→ e.g. ChatGPT Pro/Plus) rendered the full authorization URL as theLinkdisplay 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 browserlabel instead of the wrapped URL, in bothAutoMethod(browser flow) andCodeMethod:Link'sonMouseUphandler.cstill copies the full URL (hint relabeledcopy link).attributespassthrough toLinkso 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 viagit diffagainst a fresh pinned checkout — not hand-edited).Verification
scripts/build.shsucceeds (exit 0, smoke test passed) — the TUI compiles cleanly with the patch applied./connectto eyeball.🤖 Generated with Claude Code