Skip to content

feat(onboarding): split git connect and repo select into separate steps#2389

Merged
k11kirky merged 7 commits into
mainfrom
posthog-code/split-onboarding-git-and-repo-steps
May 27, 2026
Merged

feat(onboarding): split git connect and repo select into separate steps#2389
k11kirky merged 7 commits into
mainfrom
posthog-code/split-onboarding-git-and-repo-steps

Conversation

@k11kirky
Copy link
Copy Markdown
Contributor

Summary

Streamlines onboarding by splitting the previously combined "pick repo + connect GitHub" step into two pages:

  • connect-git (optional) — merges the existing CLI install check page with the GitHub OAuth panel. Explains what git integration unlocks: cloud sandboxes, branch pushes, in-app PR review.
  • select-repo (final) — folder picker only, with an explicit Skip & get started path. When skipped, useSetupDiscovery already no-ops on empty selectedDirectory, so enricher-based first-task suggestions naturally skip too.

Also retires the tools_not_installed skip reason in favor of no_repo_selected, and renames cli_skippedrepo_skipped on the ONBOARDING_COMPLETED event to match the new final step.

Structural cleanup

ConnectGitStep.tsx started at ~900 lines covering three independent concerns. A follow-up commit splits it into:

  • GitHubConnectPanel.tsx — self-contained GitHub OAuth UI (status header, alternative-project copy, connect buttons, integration rows, disconnect dialog).
  • CliCheckPanel.tsx + InstalledBadge — generic shell for the Git / GitHub CLI install panels, deduping the near-identical Box + header + spinner + status-badge scaffold.
  • ConnectGitStep.tsx now ~350 lines of orchestration.

Test plan

  • Fresh install: walk through onboarding from welcome and confirm both new steps render and animate correctly.
  • On connect-git, verify all three panels render: GitHub OAuth (Optional badge when not connected, Connected/Reconnect-needed states when connected), Git CLI, GitHub CLI.
  • On select-repo, verify the button flips between Get started (when a folder is selected) and Skip & get started (when empty).
  • Skip the repo step → verify no enricher tasks appear on the home screen and no setup discovery agent run is triggered.
  • Pick a repo → verify the typical setup-discovery flow kicks in.
  • Verify analytics events fire with the renamed repo_skipped property on ONBOARDING_COMPLETED.

k11kirky added 4 commits May 27, 2026 10:30
Splits the combined "pick repo + connect GitHub" step into two pages:

- `connect-git` (optional) — merges the existing CLI install check page
  with the GitHub OAuth panel. Explains what git integration unlocks
  (cloud sandboxes, branch pushes, in-app PR review).
- `select-repo` (final) — folder picker only, with an explicit
  "Skip & get started" path. When skipped, `useSetupDiscovery` already
  no-ops on empty `selectedDirectory`, so enricher-based first-task
  suggestions naturally skip too.

Also retires the `tools_not_installed` skip reason in favor of
`no_repo_selected`, and renames `cli_skipped` → `repo_skipped` on the
ONBOARDING_COMPLETED event to match the new final step.

Generated-By: PostHog Code
Task-Id: d15be8ed-c5d9-44cc-8cc7-de90e1e84f2e
ConnectGitStep was ~900 lines covering three independent concerns. Split into:

- `GitHubConnectPanel` — self-contained GitHub OAuth UI (status header,
  alternative-project copy, connect buttons, integration rows, disconnect
  dialog).
- `CliCheckPanel` + `InstalledBadge` — generic shell for the Git / GitHub
  CLI install panels, deduping the near-identical Box + header + spinner
  +status-badge scaffold.
- `ConnectGitStep` — now ~350 lines, orchestrates the header, benefits
  list, the three panels, and step actions.

No behavior change.

Generated-By: PostHog Code
Task-Id: d15be8ed-c5d9-44cc-8cc7-de90e1e84f2e
Adds tracking for the new connect-git step, following the analytics
conventions in docs/conventions.md (Object verbed naming, generic-event-
with-discriminator-property over bespoke events).

- `Onboarding github connect started` — fires on any GitHub connect
  button click, with `flow_type` (team_existing / team_alternative /
  user_new) and `is_retry`. Captures the click→success funnel that
  `Onboarding github connected` (success) alone can't measure.
- `Onboarding github connect failed` — fires on OAuth error / timeout,
  deduped per failure fingerprint so it doesn't refire on re-renders.
  Properties: `reason` (timeout / error), `error_type` (from the
  GithubUserConnectError code).
- `Onboarding step completed` extended with optional context fields
  (`github_connected`, `git_installed`, `gh_installed`, `gh_authenticated`)
  populated when leaving the connect-git step, so the snapshot at the
  decision point rides on the existing generic step event rather than
  on a bespoke `Onboarding git setup completed` event.

`onNext` now optionally accepts a step-completion context, threaded
through to `trackStepCompleted`. Other steps continue to call
`onNext()` with no args.

Generated-By: PostHog Code
Task-Id: d15be8ed-c5d9-44cc-8cc7-de90e1e84f2e
The combined connect-git screen had three concerns (benefits intro,
GitHub OAuth panel, two CLI install panels) and overflowed the viewport.
Splits it into two shorter, focused steps:

- `connect-github` — header, benefits list (cloud sandboxes / branch
  pushes / PR review), and the GitHub OAuth panel.
- `install-cli` — Git and GitHub CLI install panels.

Step tracking carries the relevant snapshot per step on the existing
`Onboarding step completed` event: `github_connected` from the GitHub
step, and `git_installed` / `gh_installed` / `gh_authenticated` from
the CLI step. `GitHubConnectPanel` and `CliCheckPanel` are unchanged
and reused as-is.

Generated-By: PostHog Code
Task-Id: d15be8ed-c5d9-44cc-8cc7-de90e1e84f2e
@k11kirky k11kirky marked this pull request as ready for review May 27, 2026 11:34
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 27, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/renderer/features/onboarding/components/GitHubConnectPanel.tsx:42
The `PANEL_SHADOW` constant carries the same value already defined in `CliCheckPanel.tsx` (line 5) and again in `SelectRepoStep.tsx` (line 20). Having three identical definitions violates the OnceAndOnlyOnce principle that the repo follows. Extracting this to a shared constants file (e.g. `onboardingStyles.ts`) would make future theme changes a one-line edit.

```suggestion
export const PANEL_SHADOW = "0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02)";
```

Reviews (1): Last reviewed commit: "refactor(onboarding): split connect-git ..." | Re-trigger Greptile

Comment thread apps/code/src/renderer/features/onboarding/components/GitHubConnectPanel.tsx Outdated
k11kirky added 3 commits May 27, 2026 12:53
Extracts the existing inline "Optional" pill from GitHubConnectPanel into
a shared OptionalBadge component and renders it next to the connect-github
and install-cli step titles. The body copy no longer leads with
"Optional," — it now reads naturally as a description of what the step
unlocks.

Generated-By: PostHog Code
Task-Id: d15be8ed-c5d9-44cc-8cc7-de90e1e84f2e
Three onboarding components defined an identical PANEL_SHADOW constant.
Extract it to onboardingStyles.ts so future theme changes are a one-line edit.

Generated-By: PostHog Code
Task-Id: d15be8ed-c5d9-44cc-8cc7-de90e1e84f2e
Generated-By: PostHog Code
Task-Id: d15be8ed-c5d9-44cc-8cc7-de90e1e84f2e
@k11kirky k11kirky added the Create Release This will trigger a new release label May 27, 2026
@k11kirky k11kirky merged commit 399af7f into main May 27, 2026
14 checks passed
@k11kirky k11kirky deleted the posthog-code/split-onboarding-git-and-repo-steps branch May 27, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Create Release This will trigger a new release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants