feat(code): inbox onboarding takeover + Agents callout#2567
Conversation
|
React Doctor found 7 issues in 2 files · 7 warnings. 7 warnings
Reviewed by React Doctor for commit |
Prompt To Fix All With AIFix 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/inbox/components/onboarding/useInboxOnboardingState.ts:63-77
`isLoading` only covers `teamConfigLoading || sourcesLoading`, but `useIntegrationSelectors` reads from a zustand store that starts empty (`integrations: []`) and is populated asynchronously by `useIntegrations()`. Until that fetch resolves, `hasSlackIntegration` and `hasGithubIntegration` are both `false`, so `isComplete` computes as `false` before any integrations have loaded. Meanwhile, `isLoading` is already `false` if team-config and sources fetches finished first, meaning `showOnboarding = true` in `InboxView` and the welcome takeover flashes for fully-onboarded users on every page load. `useRepositoryIntegration` already exposes `isLoadingRepos` (= `integrationsPending || reposPending`) — including it covers both the integration-list and repos loading windows.
```suggestion
const {
hasGithubIntegration,
repositories,
isLoadingRepos,
} = useRepositoryIntegration();
const { data: teamConfig, isLoading: teamConfigLoading } =
useSignalTeamConfig();
const { displayValues, isLoading: sourcesLoading } = useSignalSourceToggles();
const slackSkipped = useInboxOnboardingSessionStore((s) => s.slackSkipped);
const slackDone = hasSlackIntegration || slackSkipped;
const githubDone = hasGithubIntegration && repositories.length > 0;
const sourcesDone = Object.values(displayValues).some(Boolean);
const notificationsApplicable = hasSlackIntegration && !slackSkipped;
const notificationsDone =
!notificationsApplicable ||
!!teamConfig?.default_slack_notification_channel;
const isLoading = teamConfigLoading || sourcesLoading || isLoadingRepos;
```
Reviews (1): Last reviewed commit: "fix(code): onboarding welcome – PR-first..." | Re-trigger Greptile |
| const { hasGithubIntegration, repositories } = useRepositoryIntegration(); | ||
| const { data: teamConfig, isLoading: teamConfigLoading } = | ||
| useSignalTeamConfig(); | ||
| const { displayValues, isLoading: sourcesLoading } = useSignalSourceToggles(); | ||
| const slackSkipped = useInboxOnboardingSessionStore((s) => s.slackSkipped); | ||
|
|
||
| const slackDone = hasSlackIntegration || slackSkipped; | ||
| const githubDone = hasGithubIntegration && repositories.length > 0; | ||
| const sourcesDone = Object.values(displayValues).some(Boolean); | ||
| const notificationsApplicable = hasSlackIntegration && !slackSkipped; | ||
| const notificationsDone = | ||
| !notificationsApplicable || | ||
| !!teamConfig?.default_slack_notification_channel; | ||
|
|
||
| const isLoading = teamConfigLoading || sourcesLoading; |
There was a problem hiding this comment.
isLoading only covers teamConfigLoading || sourcesLoading, but useIntegrationSelectors reads from a zustand store that starts empty (integrations: []) and is populated asynchronously by useIntegrations(). Until that fetch resolves, hasSlackIntegration and hasGithubIntegration are both false, so isComplete computes as false before any integrations have loaded. Meanwhile, isLoading is already false if team-config and sources fetches finished first, meaning showOnboarding = true in InboxView and the welcome takeover flashes for fully-onboarded users on every page load. useRepositoryIntegration already exposes isLoadingRepos (= integrationsPending || reposPending) — including it covers both the integration-list and repos loading windows.
| const { hasGithubIntegration, repositories } = useRepositoryIntegration(); | |
| const { data: teamConfig, isLoading: teamConfigLoading } = | |
| useSignalTeamConfig(); | |
| const { displayValues, isLoading: sourcesLoading } = useSignalSourceToggles(); | |
| const slackSkipped = useInboxOnboardingSessionStore((s) => s.slackSkipped); | |
| const slackDone = hasSlackIntegration || slackSkipped; | |
| const githubDone = hasGithubIntegration && repositories.length > 0; | |
| const sourcesDone = Object.values(displayValues).some(Boolean); | |
| const notificationsApplicable = hasSlackIntegration && !slackSkipped; | |
| const notificationsDone = | |
| !notificationsApplicable || | |
| !!teamConfig?.default_slack_notification_channel; | |
| const isLoading = teamConfigLoading || sourcesLoading; | |
| const { | |
| hasGithubIntegration, | |
| repositories, | |
| isLoadingRepos, | |
| } = useRepositoryIntegration(); | |
| const { data: teamConfig, isLoading: teamConfigLoading } = | |
| useSignalTeamConfig(); | |
| const { displayValues, isLoading: sourcesLoading } = useSignalSourceToggles(); | |
| const slackSkipped = useInboxOnboardingSessionStore((s) => s.slackSkipped); | |
| const slackDone = hasSlackIntegration || slackSkipped; | |
| const githubDone = hasGithubIntegration && repositories.length > 0; | |
| const sourcesDone = Object.values(displayValues).some(Boolean); | |
| const notificationsApplicable = hasSlackIntegration && !slackSkipped; | |
| const notificationsDone = | |
| !notificationsApplicable || | |
| !!teamConfig?.default_slack_notification_channel; | |
| const isLoading = teamConfigLoading || sourcesLoading || isLoadingRepos; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/onboarding/useInboxOnboardingState.ts
Line: 63-77
Comment:
`isLoading` only covers `teamConfigLoading || sourcesLoading`, but `useIntegrationSelectors` reads from a zustand store that starts empty (`integrations: []`) and is populated asynchronously by `useIntegrations()`. Until that fetch resolves, `hasSlackIntegration` and `hasGithubIntegration` are both `false`, so `isComplete` computes as `false` before any integrations have loaded. Meanwhile, `isLoading` is already `false` if team-config and sources fetches finished first, meaning `showOnboarding = true` in `InboxView` and the welcome takeover flashes for fully-onboarded users on every page load. `useRepositoryIntegration` already exposes `isLoadingRepos` (= `integrationsPending || reposPending`) — including it covers both the integration-list and repos loading windows.
```suggestion
const {
hasGithubIntegration,
repositories,
isLoadingRepos,
} = useRepositoryIntegration();
const { data: teamConfig, isLoading: teamConfigLoading } =
useSignalTeamConfig();
const { displayValues, isLoading: sourcesLoading } = useSignalSourceToggles();
const slackSkipped = useInboxOnboardingSessionStore((s) => s.slackSkipped);
const slackDone = hasSlackIntegration || slackSkipped;
const githubDone = hasGithubIntegration && repositories.length > 0;
const sourcesDone = Object.values(displayValues).some(Boolean);
const notificationsApplicable = hasSlackIntegration && !slackSkipped;
const notificationsDone =
!notificationsApplicable ||
!!teamConfig?.default_slack_notification_channel;
const isLoading = teamConfigLoading || sourcesLoading || isLoadingRepos;
```
How can I resolve this? If you propose a fix, please make it concise.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
6b2e984 to
ee7e31d
Compare
593e8ba to
76381e4
Compare
d31c1b2 to
8031116
Compare
c254873 to
6066d0b
Compare
Rework the inbox onboarding into a sleeker, navigable stepper: Welcome -> Connect GitHub -> Connect Slack -> Activate agents, with an explicit cursor so the user can move backward as well as forward. - Welcome is now the first step (content extracted to InboxWelcomeContent); the pane owns Back/Continue, gated on each step being satisfied. - Activate step bundles signal sources + the default Slack channel; the primary CTA becomes "Activate agents". A session latch decouples visibility from isComplete so finishing the last step doesn't yank the pane mid-flow. - Welcome previews: extract a presentational PullRequestCardView reused by the real PullRequestCard, plus a high-fidelity FakeSlack component set (real report-notification block layout, PostHog Slack-app avatar, app-scaled text, Slack-style button hover/active, meep sound effects, Silicon Valley characters). - Fix broken Radix decimal gap tokens (gap="2.5" etc.) by switching to Tailwind gap utilities.

Stacked on top of #2547 (Inbox 2.0).
Summary
Adds the inbox onboarding flow that was pulled out of the Inbox 2.0 PR to keep the review surfaces cleanly separated.
Step 2 of 4 · Self-driving setup) and a per-step hedgehog tip below the action card.useInboxOnboardingStatederives per-step done-status from existing integration / team-config / source-toggle hooks. The GitHub gate uses the sameuseRepositoryIntegrationsignal the Agents view consumes ("Connected and active (N repos)") so the two surfaces agree. Session store carriesslackSkipped+welcomeAcknowledged.Test plan