Repository navigation
feat(quickstart): adjust welcome screen content when features preset - #113
Conversation
filipmyllari
left a comment
There was a problem hiding this comment.
Review notes (AI-assisted). I read all source changes; tests and the e2e snapshot were only skimmed. Inline comments below.
| export function tagline(session: WizardSession): string { | ||
| if (!session.goalsPreset) return DEFAULT_TAGLINE; | ||
| return `${capitalize(goalList(session.onboardingGoals))}, set up with AI in minutes.`; | ||
| } | ||
|
|
||
| export function intro(session: WizardSession): string { | ||
| if (!session.goalsPreset) return DEFAULT_INTRO; | ||
| return `This wizard will set up ${goalList(session.onboardingGoals)} in your project.`; | ||
| } | ||
|
|
||
| export function steps(session: WizardSession): readonly string[] { | ||
| if (!session.goalsPreset) return DEFAULT_STEPS; | ||
| const goals = session.onboardingGoals; | ||
| const common = DEFAULT_STEPS.slice(0, 4); | ||
| const last = | ||
| goals.length === 1 && goals[0] === 'feature-flags' | ||
| ? DEFAULT_STEPS[4] | ||
| : `Set up ${goalList(goals)} in your project`; | ||
| return [...common, last]; | ||
| } |
There was a problem hiding this comment.
The welcome copy uses the raw preset onboardingGoals, but useGoalSelection later drops session-recordings on non-browser frameworks (continueWithoutRecordings). So --features recordings on a Go project promises "Session recordings, set up with AI in minutes" and then says recordings aren't supported. Filter out incompatible goals here, or fall back to the default copy when the preset contains a goal that may be dropped.
There was a problem hiding this comment.
Added a warning about incompatibility on the welcome screen and removed the “Start” option if features are preset to be recordings
|
|
||
| export function tagline(session: WizardSession): string { | ||
| if (!session.goalsPreset) return DEFAULT_TAGLINE; | ||
| return `${capitalize(goalList(session.onboardingGoals))}, set up with AI in minutes.`; |
There was a problem hiding this comment.
Goals aren't deduped (commands/default.ts:21 maps --features as-is), so --features flags flags renders "Feature flags and feature flags, ...". The prompt preamble in build-prompt.ts has the same issue. Suggest [...new Set(goals)] in default.ts so every consumer benefits.
| import type { WizardSession } from '@spotify-confidence/core'; | ||
| import { capitalize, conjoin } from '@spotify-confidence/core'; | ||
|
|
||
| const GOAL_NAMES: Record<OnboardingGoal, string> = { |
There was a problem hiding this comment.
This is a third goal→label map, alongside GOAL_LABELS in build-prompt.ts and goalLabel in select-goal/actions.ts. They'll drift when a goal is added. Consider reusing goalLabel (lower-cased) or moving one shared map into ui/lib/.
There was a problem hiding this comment.
I'd push back: they are different in the contents yet. Extracting and adding conditions to figure out what to render where will probably be convoluted
| const common = DEFAULT_STEPS.slice(0, 4); | ||
| const last = | ||
| goals.length === 1 && goals[0] === 'feature-flags' | ||
| ? DEFAULT_STEPS[4] | ||
| : `Set up ${goalList(goals)} in your project`; | ||
| return [...common, last]; |
There was a problem hiding this comment.
Step 4 "Integrate the SDK into your project" overlaps with "Set up event tracking in your project". With flags + another goal, the "working feature flag example" step disappears entirely. Consider keeping step 5 whenever feature-flags is included and adding a separate step for the other goals.
| @@ -0,0 +1,8 @@ | |||
| export function capitalize(s: string): string { | |||
There was a problem hiding this comment.
capitalize('') / conjoin([]) return ''. content.ts relies on goalsPreset implying at least one goal; if that ever broke, the tagline would render ", set up with AI in minutes." A guard or a comment would make the dependency explicit.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…goals Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
capitalizeandconjoinstring utilities intopackages/core/src/utils/strings.ts, replacing duplicated join logic inbuild-prompt.tstagline,intro,steps) in the welcome screen'scontent.tsslice — when--featuresis preset, the welcome screen shows tailored copy instead of the generic defaultscapitalize/conjoinand for preset-goal welcome screen renderingwelcome-preset-features.e2e.tsText examples
--features flags--features events--features flags events