Skip to content

fix: input disable when onboarding org creation#855

Open
MaheshtheDev wants to merge 4 commits intomainfrom
04-15-fix_input_disable_when_onboarding_org_creation
Open

fix: input disable when onboarding org creation#855
MaheshtheDev wants to merge 4 commits intomainfrom
04-15-fix_input_disable_when_onboarding_org_creation

Conversation

@MaheshtheDev
Copy link
Copy Markdown
Member

No description provided.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
🔵 In progress
View logs
supermemory-mcp 6610fbc Apr 15 2026, 11:47 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 15, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
supermemory-app daec1a7 Commit Preview URL Apr 16 2026, 01:07 AM

@MaheshtheDev MaheshtheDev marked this pull request as ready for review April 15, 2026 23:47
Copy link
Copy Markdown
Member Author


How to use the Graphite Merge Queue

Add the label Main to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown

claude bot commented Apr 15, 2026

Claude finished @MaheshtheDev's task in 1m 46s —— View job


PR Review Complete

  • Fetch PR diff and analyze changes
  • Check if previously identified race condition was addressed
  • Review for bugs, security issues, and logic errors
  • Post review summary

Overview: This PR disables input during onboarding org creation, prevents double-submissions, and adds "Skip Onboarding" functionality with proper race condition handling.

Issues found: None — previously identified issues have been addressed.

The race condition flagged by Sentry and the previous review has been correctly fixed in commit daec1a7:

  • Both initial-header.tsx:44 and setup/header.tsx:72 now gate the Skip button on !isLoading
  • Since isLoading = org === null (from useOrgOnboarding), the button only renders once the org context is populated
  • This prevents the scenario where markOrgOnboarded() is called before org.id is available

What looks good:

  • submitLockRef pattern in page.tsx:106 correctly prevents double-click race conditions during org creation
  • Multiple layers of input protection in input-step.tsx: container pointer-events-none, input disabled, early returns, and button disabled
  • Layout logic to skip the "input" step for users with existing orgs is a sensible UX improvement
  • The showSkipOnboarding prop flow correctly hides the button during the "input" step (before any org exists)

Score: 9/10

Solid implementation with the previously identified edge case now properly addressed. Ready to ship.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comment thread apps/web/components/initial-header.tsx
@graphite-app graphite-app bot requested a review from Dhravya April 16, 2026 00:29
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview: This PR disables input during onboarding org creation and adds "Skip Onboarding" functionality.

Issues found:

The Sentry bot correctly identified a race condition issue that I've verified:

Race condition in Skip Onboarding handlers (initial-header.tsx:22-26, setup/header.tsx:20-24)

The handleSkip() function calls markOrgOnboarded() then immediately redirects. However, markOrgOnboarded() silently fails if org?.id is falsy (it only logs an error and returns). After org creation, there's a propagation delay before the org context is populated. If the user clicks "Skip Onboarding" during this window, the API call to mark the org as onboarded is skipped while the user is still redirected to "/".

The useOrgOnboarding hook already exposes isLoading: org === null. A fix would be to disable the Skip button until the org context is ready:

const { markOrgOnboarded, isLoading } = useOrgOnboarding()

// In the JSX:
<button
  type="button"
  onClick={handleSkip}
  disabled={isLoading}
  className={cn(
    "text-sm text-white/40 hover:text-white/70 transition-colors",
    isLoading ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
  )}
>
  Skip Onboarding
</button>

What looks good:

  • The submitLockRef pattern in page.tsx correctly prevents double-click race conditions during org creation
  • Input and button disabled states in input-step.tsx properly block interaction during submission
  • The layout logic to skip the "input" step for users with existing orgs is a good UX improvement

Score: 8/10

Solid implementation with one edge case to address. The race condition won't cause data loss, but it will leave the org in a non-onboarded state while the user believes they've completed onboarding.

Comment thread apps/web/app/(app)/onboarding/welcome/layout.tsx
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.

2 participants