make onboarding skippable and gate sidekick until setup is complete#30
Merged
ArjunCodess merged 14 commits intoMay 22, 2026
Merged
Conversation
Contributor
|
Unable to deploy a commit from a private repository on your GitHub organization to the arjuncodess' projects team on Vercel, which is currently on the Hobby plan. In order to deploy, you can:
To read more about collaboration on Vercel, click here. |
…stead of defining them again
…components for the same
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.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.
Greptile Summary
This PR makes both the initial onboarding (Instagram connection) and the Sidekick setup flow skippable, and gates Sidekick features (chat API, DM webhook replies, dashboard UI) behind a new
getSidekickSetupStatusByUserIdreadiness check. It also migrates Inngest from v3 to v4, updating all function definitions to the newtriggersarray syntax.getSidekickSetupStatusByUserIdconsolidates five DB queries into a single status check, auto-persists the completion flag, and returns a consistent result-object so callers can distinguish DB errors from genuine "not ready" states.sidekick-onboarding/page.tsxhas aNumber(null) === 0bug that makes thestatus.resumeStepfallback dead code, landing users at step 0 whenever they navigate to the page without an explicit?step=param.Confidence Score: 4/5
Safe to merge with one fix: the step resume logic in the sidekick onboarding page silently drops the resume position for any entry without a
?step=param.The DB-error handling in the chat route and DM webhook was correctly redesigned to distinguish transient failures from genuine "not ready" states. The one concrete defect is in
sidekick-onboarding/page.tsx:Number(null)evaluates to0, so users who navigate directly to/sidekick-onboardingalways land on step 0 rather than their actual resume step — thestatus.resumeStepfallback introduced in this PR is dead code. The fix is a one-liner and does not affect any other changed surface.apps/app/src/app/(onboarding)/sidekick-onboarding/page.tsx — the URL step-parsing logic at lines 569-578.
Important Files Changed
Number(null) === 0bug that makesstatus.resumeStepdead code.getSidekickSetupStatusByUserIdwith consistent result-object contract and auto-persists completion flag;resumeStepdefaults to 0 when all steps are complete.generateReply(fail-open, correct), blocking only when setup is genuinely incomplete.triggersarray syntax inside the config object.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[User visits dashboard] --> B[DashboardLayout checks setup status] B -->|isReady false| C[Show amber setup banner] B -->|isReady true| D[Show SidekickToggle] B -->|DB error| E[Hide banner and toggle] C --> F[User clicks Resume setup] F --> G[sidekick-onboarding with step param] G --> H{step param present?} H -->|Yes| I[Navigate to correct step] H -->|No - BUG: Number null = 0| J[Always lands on step 0] D --> K[Sidekick page] K --> L{Instagram connected AND isReady?} L -->|Both true| M[Full SidekickLayout] L -->|Instagram missing| N[InstagramLockedSidekick] L -->|Not ready| O[SidekickUnavailable] P[POST api/chat] --> Q[getSidekickSetupStatusByUserId] Q -->|success false| R[503 Unable to verify] Q -->|isReady false| S[403 Complete setup] Q -->|isReady true| T[Continue to chat] U[Instagram DM webhook] --> V[getSidekickSetupStatusByUserId] V -->|success false| W[Log error then fall through to generateReply] V -->|isReady false| X[Block with sidekickBlocked true] V -->|isReady true| Y[generateReply]Reviews (3): Last reviewed commit: "fix errors" | Re-trigger Greptile