Skip to content

Unify provider sign-in on the hidden flow and match actions to errors - #120

Merged
badcuban merged 3 commits into
mainfrom
feat/unified-provider-signin
Aug 7, 2026
Merged

Unify provider sign-in on the hidden flow and match actions to errors#120
badcuban merged 3 commits into
mainfrom
feat/unified-provider-signin

Conversation

@badcuban

@badcuban badcuban commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Implements the two approved follow-ups from the onboarding review: per-error actions on provider status surfaces, and one sign-in flow everywhere.

Unified hidden sign-in

  • Extracted the settings sign-in machinery into useProviderConnectFlow (subscription, event folding via the existing providerConnectFlow.logic state machine, auto-expand timing, start/stop). The settings panel, the first-run setup card row, and the composer notices all mount the same hook now; settings lost ~130 duplicated lines.
  • Clicking Sign in anywhere runs the provider's login in the server-side PTY: inline "Signing in…" with the live output line where you clicked, no thread terminal. Stalled (>15s) or failed-interactive runs hand off to /settings/providers?instance=<id> (new search param) where the full terminal re-attaches to the same live session.
  • Held-send auto-release: on sign-in success, the held-send notice triggers the existing recheck — the message dispatches through the normal preflight gate, no second click, and never on the auth session's word alone.
  • Replay guard: the server replays a finished session's status on attach; a run-observed ref ensures onSucceeded only fires for runs this surface watched begin, so a stale success can't auto-send anything.
  • Concurrency: both surfaces subscribe to the same instance session, so a flow started in settings disables the chat button and vice versa.
  • The transcript's historical auth-reconnect card keeps the old visible-terminal path deliberately (it's a record, not a composer action); MCP auth reconnect untouched.

Per-error status actions + linkify

resolveProviderStatusNoticeActions reads structured snapshot fields only: signed out → Sign in alone; not installed → Open Settings + Refresh; disabled → Open Settings; probe trouble / can't-verify → Refresh + Diagnostics (unchanged). URLs in provider status details render as anchors via a shared LinkifiedText, fixing the dead Claude install link in settings.

Testing

  • vp fmt / vp lint / vp run typecheck green; web unit suite 2074 pass.
  • Browser: ChatView 111 (new: held-send Sign in starts the RPC, success dispatches exactly once, failure keeps the draft and dispatches nothing), FirstRunSetupCard + providerStatusNotice 11, SettingsPanels 32, sessionStartupNotice 4. The Flaky browser test: create-folder affordances command palette input fails to render #117 flake didn't fire.
  • 5 unit cases pin the action mapping; linkifier has a focused test.
  • Cold-boot screenshot verification runs pre-merge.

Every Sign in button (setup card row, composer notices) now drives the
same server-side login flow the settings panel uses, through a shared
useProviderConnectFlow hook: inline "Signing in" status with the live
output line where the user clicked, no thread terminal takeover, and a
hand-off to the settings panel (deep-linked to the instance) when a run
stalls past the auto-expand threshold or fails while interactive. On the
held-send notice, a successful sign-in triggers the existing recheck, so
the held message releases itself through the normal preflight gate with
no second click. A replay guard keeps an attached surface from treating
a finished session from minutes ago as the run the user just started.

The provider status notice now earns its actions from the structured
snapshot instead of always offering Refresh and Diagnostics: signed out
gets Sign in alone, a missing CLI gets Open Settings plus Refresh,
disabled gets Open Settings, and probe trouble keeps Refresh plus
Diagnostics. URLs in provider status details render as real links via a
shared linkifier, so the Claude install address stops being dead text.
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
threadlines Skipped Skipped Aug 7, 2026 7:59am

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL labels Aug 7, 2026
Comment thread apps/web/src/lib/linkifiedText.test.tsx Fixed
CodeQL flagged the test's tag-stripping regex as incomplete multi
character sanitization. It was never sanitizing, just recovering text
content from static markup, but the pure segment splitter's documented
invariant (concatenated segments reproduce the input) states the same
property directly without the alert-bait pattern.
Screenshot verification caught the settings hand-off restarting the
stall timer: a user who already waited out the threshold in chat arrived
at settings and waited it out again before the terminal appeared. The
?instance= deep link now threads through the provider card to the login
flow, which opens its terminal immediately while the session is active.
@badcuban
badcuban merged commit e9409fe into main Aug 7, 2026
14 of 15 checks passed
@badcuban
badcuban deleted the feat/unified-provider-signin branch August 7, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants