Skip to content

feat: inline GitHub connect modal + local-dev OAuth config#335

Merged
alchaplinsky merged 3 commits into
mainfrom
feat/inline-github-connect
Jul 4, 2026
Merged

feat: inline GitHub connect modal + local-dev OAuth config#335
alchaplinsky merged 3 commits into
mainfrom
feat/inline-github-connect

Conversation

@alchaplinsky

Copy link
Copy Markdown
Member

Problem

Connecting to GitHub to push/open PRs was broken in two ways:

  1. "GitHub is not configured" — the device-flow needs QUORUM_GITHUB_CLIENT_ID, baked in at compile time via option_env! (oauth.rs). It was only ever supplied by CI secrets and was never documented, so any local/dev build compiled it empty and reported "GitHub sign-in is not configured".
  2. Detour + hidden error — the Git-panel "Connect GitHub" button routed to Settings → Account, requiring another click to start the flow and only then revealing the config error. Multiple clicks to surface the problem.

Changes

Config plumbing

  • src-tauri/build.rs loads the repo-root .env at build time and forwards QUORUM_GITHUB_CLIENT_ID / QUORUM_GOOGLE_CLIENT_* into the compile. A value already in the environment always wins, so CI (which supplies them as process env) is unaffected, and this also covers direct cargo / rust-analyzer builds.
  • .env.example now documents the OAuth keys (GitHub OAuth App with Device Flow enabled; client ID is not secret, no client secret needed).

Inline connect (UX)

  • New reusable GithubConnectModal (src/components/GithubConnect/), mounted once at the app root and driven by store state (githubConnectOpen + openGithubConnect/closeGithubConnect in the ui slice). It auto-starts the OAuth device flow on open, shows the user code + verification URL (browser opens automatically), surfaces any config/sign-in error in place, and closes on success.
  • The Git-panel connect-github action (useGitActions.ts) now calls openGithubConnect() instead of openSettingsScreen("account") — one click begins connecting.

Existing Settings and New-Project connect surfaces are unchanged (they already run the flow inline); adopting this modal there to remove the small device-code-UI duplication is a possible follow-up.

Setup

Add the client ID to a gitignored repo-root .env:

QUORUM_GITHUB_CLIENT_ID="Iv1.xxxxxxxx"

Testing

  • .env parser in build.rs verified standalone against quoted / export / comment / empty / malformed lines.
  • Frontend tsc/biome not run in this worktree (no node_modules); prop shapes were checked manually. Recommend bun run check && bun run lint before merge.

🤖 Generated with Claude Code

Connecting to GitHub previously detoured through Settings and, on a
dev build, only revealed "GitHub sign-in is not configured" after
several clicks. Two fixes:

- Config: build.rs now loads the repo-root .env at build time and
  forwards the OAuth client keys into the compile (real env still
  wins, so CI is unaffected); .env.example documents the keys. The
  missing piece was that QUORUM_GITHUB_CLIENT_ID was never listed, so
  no dev .env ever set it.
- UX: a reusable GithubConnectModal, mounted at the app root and
  driven by store state, auto-starts the OAuth device flow on open and
  surfaces the code / any error in place. The Git-panel "Connect
  GitHub" action now opens it directly instead of routing to Settings,
  so a single click starts connecting.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@greptile-apps

greptile-apps Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds inline GitHub connection support and local OAuth config for dev builds. The main changes are:

  • Build-time loading of repo-root OAuth values from .env.
  • Documented GitHub and Google OAuth keys in .env.example.
  • A new app-level GitHub connect modal that starts the device flow inline.
  • Git panel connect actions now open the modal directly.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Reviews (3): Last reviewed commit: "refactor: gate GitHub connect auto-start..." | Re-trigger Greptile

Comment thread src-tauri/build.rs Outdated
Comment thread src/components/GithubConnect/index.tsx
Emit cargo::rerun-if-changed for ../.env even when it is absent, so
creating the file later reruns the build script. Otherwise a direct
cargo/rust-analyzer build keeps the old empty option_env! values and
still shows GitHub sign-in as not configured until an unrelated input
changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

The auto-start effect depended on [open, connect]. connect's identity
changes on every busy transition, so the effect re-ran mid-flow; it
stayed correct only because the started guard is never reset while
open. Depend on open alone and read connect via a ref, so the effect
fires exactly once per open and the connect-identity re-run can't
occur at all.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@alchaplinsky alchaplinsky merged commit 376aed5 into main Jul 4, 2026
3 checks passed
@alchaplinsky alchaplinsky deleted the feat/inline-github-connect branch July 4, 2026 09:17
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