Skip to content

feat: gate onboarding behind hard sudoku puzzle#2226

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/secret-sudoku-onboarding
Draft

feat: gate onboarding behind hard sudoku puzzle#2226
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-code/secret-sudoku-onboarding

Conversation

@posthog
Copy link
Copy Markdown
Contributor

@posthog posthog Bot commented May 19, 2026

Summary

  • Adds a hidden first onboarding step that shows Arto Inkala's hard sudoku puzzle. The user must place valid 1–9 digits across rows, columns, and 3x3 boxes before they can proceed.
  • Gated by the new posthog-code-secret-sudoku-onboarding feature flag, set to 0% rollout for now. When the flag is off, the onboarding flow is unchanged.
  • When the flag is on, the puzzle becomes a hard gate: arrow-key step navigation and the dev "Skip setup" button are disabled, and a persisted hasSolvedSecretSudoku flag forces the user back to the puzzle if they somehow land on a later step.

Implementation

  • apps/code/src/shared/constants.ts — new SECRET_SUDOKU_ONBOARDING_FLAG constant.
  • apps/code/src/renderer/features/onboarding/sudoku.ts — puzzle data + solver utilities (isBoardSolved, findConflicts).
  • apps/code/src/renderer/features/onboarding/components/SudokuStep.tsx — interactive 9x9 grid (keyboard + click input, conflict highlighting, peer highlighting, on-screen number pad). The "Verify" button only fires onSolved when the board is correctly filled.
  • apps/code/src/renderer/features/onboarding/types.ts — added "secret-sudoku" step.
  • apps/code/src/renderer/features/onboarding/stores/onboardingStore.ts — persists hasSolvedSecretSudoku.
  • apps/code/src/renderer/features/onboarding/hooks/useOnboardingFlow.ts — gate logic: prepends the puzzle to activeSteps and forces currentStep back to it whenever the gate is unresolved.
  • apps/code/src/renderer/features/onboarding/components/OnboardingFlow.tsx — renders SudokuStep, disables arrow hotkeys + skip button while on the gate.

Test plan

  • With the flag off, onboarding behaves exactly as before.
  • With the flag on, the sudoku step is the first thing the user sees.
  • Cell input via keyboard (1–9, Backspace) and click works; arrow keys move focus across the grid.
  • Conflicting digits highlight in red; the Verify button stays disabled until the board is fully filled.
  • Verify reports "not quite right" for valid-but-wrong fills, and advances when the board is solved.
  • After solving, subsequent steps render normally and the gate does not reappear (verified via the persisted flag).
  • Logging out resets hasSolvedSecretSudoku so the gate will reappear on the next session.

Created with PostHog Code

Adds a hidden first onboarding step that presents Arto Inkala's hard
sudoku puzzle. Gated by the posthog-code-secret-sudoku-onboarding flag
(rolled out to 0% for now). Once enabled, the puzzle blocks every other
onboarding step until solved — the dev skip button and arrow-key
navigation are disabled while the gate is active, and the
hasSolvedSecretSudoku flag is persisted so the gate redirects users
back if they try to land on a later step.

Generated-By: PostHog Code
Task-Id: b21854e6-9af2-4f79-83f1-83e51e34b530
@adboio adboio changed the title feat(onboarding): secret sudoku gate behind feature flag feat(onboarding): hard sudoku gate during onboarding May 19, 2026
@adboio adboio changed the title feat(onboarding): hard sudoku gate during onboarding feat: gate onboarding behind hard sudoku puzzle May 19, 2026
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