Skip to content

Onboard new accounts with a coding-agent setup prompt - #221

Merged
devhims merged 4 commits into
mainfrom
onboarding-setup-prompt
Oct 21, 2026
Merged

devhims merged 4 commits into
mainfrom
onboarding-setup-prompt

Conversation

@devhims

@devhims devhims commented Oct 21, 2026

Copy link
Copy Markdown
Owner

What

New accounts now get a short onboarding before the 1,000-credit welcome toast. On the dashboard visit after signup (?welcome=1), a dialog opens over the dashboard:

  1. Which coding agents do you use? Claude Code, Codex, Cursor, OpenCode, Other (multi-select). "Skip for now" goes straight to the dashboard.
  2. What are you building? Optional; added to the prompt as context.
  3. You're all set. A setup prompt to copy into the agent, "Go to dashboard", and the live credit balance.

The welcome toast and confetti now fire on "Go to dashboard" (or skip) instead of on arrival.

Setup prompt

Built in web/lib/setup-prompt.ts. It tells the agent to:

  • install the skills for the chosen agents: npx skills add devhims/video2ctx --skill '*' -a claude-code -a codex -g -y (ids are the skills CLI's own --agent values; "Other" explains how to target itself)
  • install @video2ctx/cli and sign in with video2ctx auth login (browser approval)
  • prove it works with GET /v1/usage (free) and one transcript call (1 credit)

It never embeds or asks for an API key, matching the docs' rule against pasting credentials into agent conversations.

Saved answers

  • PUT /v1/onboarding, browser-session only (API keys and CLI sessions get 403 SESSION_REQUIRED). Validates agent ids, rejects duplicates, caps the goal at 500 characters.
  • Migration 0027_onboarding_answers.sql: one row per account (user_id, agents JSON array, goal, created_at, updated_at), upserted on re-answer, ON DELETE CASCADE with the user.
  • The dialog saves best effort: the prompt never waits on it, unchanged answers are not resent, and a failed save retries on the next generate.
  • Vercel Analytics also gets Coding agent selected and Setup prompt copied events (no goal text).

Count accounts per agent:

SELECT value AS agent, COUNT(*) FROM onboarding_answers, json_each(agents) GROUP BY value;

Other changes

  • WelcomeToast.tsx renamed to Welcome.tsx; it reads useSearchParams during render so the dialog is server-rendered with the page (no dashboard flash).
  • The dialog focus trap moved out of NewProjectDialog into use-dialog-focus.ts so both dialogs share it.
  • docs/internals/endpoints.mdx regenerated for the new route.

Testing

  • Platform: vitest run (2,123 passed), tsc --noEmit, docs:check. New test/onboarding.test.ts covers saving, agent ordering, validation and the session-only boundary.
  • Web: npm test (120 passed, including new prompt-builder tests), tsc --noEmit.
  • Migration SQL exercised in SQLite: upsert keeps created_at, json_each counts, empty arrays rejected, user delete cascades.
  • Browser: full flow against a mocked platform API, desktop and mobile. Verified the PUT body, no resend on unchanged answers, resend after an edit, the clipboard fallback, and the toast and confetti after "Go to dashboard".

On the dashboard visit after signup, ask which coding agents the account
uses and what it is building, then hand it a setup prompt that installs
the video2ctx skills for those agents, signs the CLI in through the
browser, and makes one test call. The welcome toast and confetti now
follow "Go to dashboard" instead of firing on arrival.

Answers are saved through a browser-session-only PUT /v1/onboarding into
a new onboarding_answers table (migration 0027), one row per account,
removed with the account.
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
video2ctx-web Ready Ready Preview Oct 21, 2026 4:02am UTC

The welcome toast now follows the onboarding dialog, so the celebration
test skips it first. A new test covers choosing agents, the focused goal
field, the generated install command, the saved answers, and that an
unchanged answer is not saved twice.

devhims commented Oct 21, 2026

Copy link
Copy Markdown
Owner Author

Review of 79375fc

Verdict: CHANGES NEEDED. The welcome E2E expectation is updated, but a modal keyboard-focus issue remains.

P2 — Trap backward tabbing from the focused step heading

WelcomeOnboarding.tsx:32–35 moves focus to a tabIndex=-1 heading when entering the prompt step or going back to agent selection. use-dialog-focus.ts:18–22 only intercepts Shift+Tab when the active element equals the first tabbable control. The heading is excluded from that list, so backward navigation is left unhandled.

Reproduction path: generate the setup prompt, then press Shift+Tab from its programmatically focused heading. Expected: focus stays within onboarding. The current handler permits native backward navigation toward dashboard controls behind the modal. This risks keyboard users operating obscured controls. Handle non-tabbable focus anchors/containment too, and add keyboard regression coverage after Generate and Back. A source-loaded hook probe confirms that the heading case does not prevent default while the first-control case does; actual Chromium focus movement was not independently reproduced because browser launch was blocked by the execution environment.

Revisited validation

The new E2E changes correctly replace the obsolete immediate-toast assertion and add prompt generation/save/dedup/finish coverage. The prior head's Dashboard E2E (other) failed; its exact log cause was unavailable. Latest-head CI is still in progress, so this is not a green-check approval.

Independent checks: 120 web tests passed on this head. The prior head had 2,123 platform tests passed / 59 skipped, platform typecheck passed, 35 onboarding/auth-boundary tests plus four additional boundary assertions passed, and independent SQLite migration/upsert/cascade checks passed. This commit changes only the E2E specification; platform/runtime source is unchanged. The updated browser E2E was reviewed but not run locally. No production signup, credential grant or email was performed.

Merge coordination, not a separate defect in this branch: PR220 changes welcome copy to use each account's recorded signup grant. Preserve that behavior when reconciling this renamed Welcome component, rather than retaining its literal 1,000-credit message for launch accounts. The two differently named 0027 migrations are tracked by full filename; duplicate numeric prefixes alone do not establish a migration failure.

No code changes, pushes, merges or deployments performed.

Onboarding moves focus to each step's heading, which has tabIndex=-1, so
the focus trap never matched it as the first or last control and Shift+Tab
fell through to the dashboard behind the modal. When focus is on such an
anchor, or outside the dialog, pick the next or previous tabbable control
in document order and wrap at the ends. The E2E covers Shift+Tab and Tab
from the heading after Generate and after Back.

devhims commented Oct 21, 2026

Copy link
Copy Markdown
Owner Author

Re-review of e6adab9

Verdict: APPROVE. The prior P2 focus issue is resolved and the latest-head CI checks pass.

The updated focus hook now handles non-tabbable step headings and focus outside the modal. Independent source-loaded hook probes passed nine assertions covering forward/backward navigation from headings and middle anchors, outside-dialog recovery, boundary wrapping and ordinary middle Tab behavior. The E2E now explicitly covers the original Generate/Back keyboard reproduction, as well as the deferred welcome flow.

Independent verification at this head:

  • Platform suite: 2,126 passed / 59 skipped.
  • Web unit suite: 120 passed.
  • Platform TypeScript check passed.
  • Nine additional focused hook assertions passed using a simulated DOM.
  • All applicable CI checks pass, including both dashboard E2E groups; Mintlify intentionally skipped.

Earlier independently verified API principal/validation and SQLite migration/upsert/cascade checks remain applicable: those onboarding backend files are unchanged. The main-branch update incorporates already-reviewed PR219 model changes; no new material issue found.

Limits: local Chromium launch was blocked, so the independent hook probe is not a browser execution. Browser E2E success above is GitHub CI evidence. No production signup, email or account mutation was performed. Preserve PR220's recorded-grant welcome logic when reconciling the two PRs; this approval is for this exact head, not an unreviewed conflict resolution. No implementation, push, merge or deployment performed.

@devhims
devhims merged commit 66cc41f into main Oct 21, 2026
11 checks passed
@devhims
devhims deleted the onboarding-setup-prompt branch October 21, 2026 04:40

This branch was successfully deployed

1 active deployment
Preview — e6adab9d Deployed Oct 21, 2026 by vercel[bot]
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