Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/e2e/__snapshots__/happy-path.e2e.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ exports[`happy-path flow > navigates Welcome → SystemCheck → Authenticate


──────────────────────────────────────────────────────────────────────────────────────────────────
Toggle features to set up (select none to skip):
Toggle features to set up:

❯ Feature Flags
Event Tracking
Expand Down
2 changes: 1 addition & 1 deletion __tests__/e2e/__snapshots__/select-goal.e2e.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`SelectGoal screen > shows goal options for a browser framework > select


──────────────────────────────────────────────────────────────────────────────────────────────────
Toggle features to set up (select none to skip):
Toggle features to set up:

❯ Feature Flags
Event Tracking
Expand Down
5 changes: 3 additions & 2 deletions __tests__/e2e/select-goal.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,14 @@ describe('SelectGoal screen', () => {
expect(session.snapshot()).toContain('instrument event tracking');
});

it('advances to Done when submitting with nothing selected', async () => {
it('stays on goal screen when submitting with nothing selected', async () => {
using session = createSession();

await navigateToGoalSelection(session);
await session.press('Enter');

await session.waitForText('Onboarding skipped');
await session.waitForText('Feature Flags');
await session.waitForText('Toggle features to set up');
});

it('shows goal selection for non-browser project without recording option', async () => {
Expand Down
5 changes: 3 additions & 2 deletions __tests__/ui/screens/SelectGoalScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('SelectGoalScreen', () => {
});
});

it('advances to Done when submitting with nothing selected', async () => {
it('stays on goal screen when submitting with nothing selected', async () => {
using project = createProjectDir();

using sut = renderApp({
Expand All @@ -115,7 +115,8 @@ describe('SelectGoalScreen', () => {
await act(() => sut.stdin.write(ENTER));

await waitFor(() => {
expect(sut.lastFrame()).toContain('Onboarding skipped');
expect(sut.lastFrame()).toContain('Feature Flags');
expect(sut.lastFrame()).toContain('Toggle features to set up');
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/ui/tui/screen-transitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const SCREEN_TRANSITIONS = {
[ScreenId.Authenticate]: { next: ScreenId.InstallPlugins },
[ScreenId.InstallPlugins]: { next: ScreenId.ConnectTools },
[ScreenId.ConnectTools]: { next: ScreenId.SelectGoal },
[ScreenId.SelectGoal]: { next: ScreenId.OnboardProject, skip: ScreenId.Done },
[ScreenId.SelectGoal]: { next: ScreenId.OnboardProject },
[ScreenId.OnboardProject]: { next: ScreenId.Done, skip: ScreenId.Done },
[ScreenId.Done]: {},
[ScreenId.About]: {},
Expand Down
2 changes: 1 addition & 1 deletion src/ui/tui/screens/select-goal/components/BottomPrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function BottomPrompt({ goalSelection }: GoalSelectionProps) {
return (
<PromptPanel
mode="multi-select"
status="Toggle features to set up (select none to skip):"
status="Toggle features to set up:"
options={goalOptionsFor(goalSelection.recordingAvailable)}
onSubmit={goalSelection.submitGoals}
/>
Expand Down
4 changes: 0 additions & 4 deletions src/ui/tui/screens/select-goal/telemetry-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ import type { TelemetryEvent } from '@lib/telemetry.js';
export function goalsSelected(goals: string[]): TelemetryEvent {
return { step: 'select-goal.select', action: goals.join(',') };
}

export function goalSkipped(): TelemetryEvent {
return { step: 'select-goal.skip', action: 'skipped', completion: 'completing' };
}
8 changes: 1 addition & 7 deletions src/ui/tui/screens/select-goal/useGoalSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { BROWSER_PLATFORMS } from '@lib/sdk-options.js';
import { track } from '@lib/telemetry.js';
import { useNavigation } from '../../hooks/useNavigation.js';
import { useLogger } from '../../hooks/useLog.js';
import { skipped } from '../../lib/log-messages.js';
import { store, useSession } from '../../store.js';
import { goalLabel } from './actions.js';
import { goalsChosen } from './log-messages.js';
Expand All @@ -23,12 +22,7 @@ export function useGoalSelection(): GoalSelection {
const recordingAvailable = !!session.framework && BROWSER_PLATFORMS.has(session.framework);

function submitGoals(values: OnboardingGoal[]) {
if (values.length === 0) {
track(te.goalSkipped());
log(skipped());
navigate.to('skip');
return;
}
if (values.length === 0) return;

store.setOnboardingGoals(values);
track(te.goalsSelected(values));
Expand Down