Skip to content

Commit 9790db2

Browse files
capJavertclaude
andcommitted
fix(onboarding): address PR review feedback
- Add error handling to experience level mutation (.catch) - Wrap OnboardingV2 in ErrorBoundary + Toast - Replace inline GitHub SVGs with GitHubIcon component (filled.svg with currentColor) - Add StrictMode guard for autoTriggerProvider (tracks provider name) - Fix mobileAppUrl to use https://api.daily.dev/mobile redirect - Move OnboardingV2Styles before content to prevent FOUC - Remove secondary from existing GitHubIcon usage (was no-op) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4e5320a commit 9790db2

7 files changed

Lines changed: 37 additions & 65 deletions

File tree

packages/shared/src/components/auth/AuthOptionsInner.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,16 @@ function AuthOptionsInner({
561561

562562
const onProviderClickRef = useRef(onProviderClick);
563563
onProviderClickRef.current = onProviderClick;
564+
const autoTriggerFiredProvider = useRef<string | null>(null);
564565

565566
useEffect(() => {
566-
if (!autoTriggerProvider) {
567+
if (
568+
!autoTriggerProvider ||
569+
autoTriggerFiredProvider.current === autoTriggerProvider
570+
) {
567571
return;
568572
}
569-
573+
autoTriggerFiredProvider.current = autoTriggerProvider;
570574
onProviderClickRef.current(autoTriggerProvider, false);
571575
}, [autoTriggerProvider]);
572576

packages/shared/src/components/auth/common.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const providerMap: ProviderMap = {
4242
value: 'google',
4343
},
4444
github: {
45-
icon: <GitHubIcon className="socialIcon" secondary />,
45+
icon: <GitHubIcon className="socialIcon" />,
4646
label: 'GitHub',
4747
value: 'github',
4848
},
Lines changed: 3 additions & 0 deletions
Loading

packages/shared/src/components/icons/GitHub/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import React from 'react';
33
import type { IconProps } from '../../Icon';
44
import Icon from '../../Icon';
55
import WhiteIcon from './white.svg';
6+
import FilledIcon from './filled.svg';
67

78
export const GitHubIcon = (props: IconProps): ReactElement => (
8-
<Icon {...props} IconPrimary={WhiteIcon} IconSecondary={WhiteIcon} />
9+
<Icon {...props} IconPrimary={WhiteIcon} IconSecondary={FilledIcon} />
910
);

packages/shared/src/lib/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const slackIntegration = 'https://r.daily.dev/slack';
3333
export const statusPage = 'https://r.daily.dev/status';
3434
export const businessWebsiteUrl = 'https://r.daily.dev/business';
3535
export const appsUrl = 'https://daily.dev/apps';
36-
export const mobileAppUrl = 'https://app.daily.dev';
36+
export const mobileAppUrl = 'https://api.daily.dev/mobile';
3737
export const timezoneSettingsUrl = 'https://r.daily.dev/timezone';
3838
export const isDevelopment = process.env.NODE_ENV === 'development';
3939
export const isProductionAPI =

packages/webapp/components/onboarding/OnboardingV2.tsx

Lines changed: 22 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import { useOnboardingActions } from '@dailydotdev/shared/src/hooks/auth';
5454
import { UPDATE_USER_PROFILE_MUTATION } from '@dailydotdev/shared/src/graphql/users';
5555
import { gqlClient } from '@dailydotdev/shared/src/graphql/common';
5656
import { redirectToApp } from '@dailydotdev/shared/src/features/onboarding/lib/utils';
57+
import { GitHubIcon } from '@dailydotdev/shared/src/components/icons/GitHub';
5758
import { OnboardingV2Styles } from './OnboardingV2Styles';
5859
import { useOnboardingAnimations } from './useOnboardingAnimations';
5960

@@ -332,9 +333,11 @@ export const OnboardingV2 = (): ReactElement => {
332333
setGithubImportProgress((prev) => Math.max(prev, 72));
333334
setGithubImportPhase('confirmingSeniority');
334335

335-
gqlClient.request(UPDATE_USER_PROFILE_MUTATION, {
336-
data: { experienceLevel: UserExperienceLevel[level] },
337-
});
336+
await gqlClient
337+
.request(UPDATE_USER_PROFILE_MUTATION, {
338+
data: { experienceLevel: UserExperienceLevel[level] },
339+
})
340+
.catch(() => undefined);
338341

339342
completeAction(ActionType.CompletedOnboarding);
340343
completeAction(ActionType.EditTag);
@@ -557,6 +560,7 @@ export const OnboardingV2 = (): ReactElement => {
557560
className="onb-page relative tablet:pt-16 laptop:pl-11"
558561
role="presentation"
559562
>
563+
<OnboardingV2Styles />
560564
{/* ── Dummy Header (desktop/tablet only) ── */}
561565
<header className="fixed left-0 top-0 z-3 hidden h-16 w-full items-center border-b border-border-subtlest-tertiary bg-background-default px-4 tablet:flex">
562566
<Logo
@@ -775,14 +779,7 @@ export const OnboardingV2 = (): ReactElement => {
775779
}}
776780
className="onb-btn-shine focus-visible:ring-white/20 group relative flex w-full items-center justify-center gap-2.5 overflow-hidden rounded-14 bg-white px-7 py-3.5 font-bold text-black transition-all duration-300 typo-callout hover:-translate-y-1 hover:shadow-[0_8px_30px_rgba(255,255,255,0.12)] focus-visible:outline-none focus-visible:ring-2 tablet:w-auto"
777781
>
778-
<svg
779-
width="20"
780-
height="20"
781-
viewBox="0 0 24 24"
782-
fill="currentColor"
783-
>
784-
<path d="M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.699-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.268 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.114 2.504.336 1.909-1.292 2.747-1.025 2.747-1.025.546 1.379.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z" />
785-
</svg>
782+
<GitHubIcon secondary size={IconSize.XSmall} />
786783
Continue with GitHub
787784
<svg
788785
width="14"
@@ -1129,8 +1126,6 @@ export const OnboardingV2 = (): ReactElement => {
11291126
</SearchProvider>
11301127
</div>
11311128

1132-
<OnboardingV2Styles />
1133-
11341129
{/* ── Header signup chooser popup ── */}
11351130
{step === 'chooser' && (
11361131
<div
@@ -1297,15 +1292,10 @@ export const OnboardingV2 = (): ReactElement => {
12971292
/>
12981293
))}
12991294
<div className="relative flex h-14 w-14 items-center justify-center rounded-full bg-surface-float">
1300-
<svg
1301-
width="26"
1302-
height="26"
1303-
viewBox="0 0 24 24"
1304-
fill="currentColor"
1305-
className="text-text-primary"
1306-
>
1307-
<path d="M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.699-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.268 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.114 2.504.336 1.909-1.292 2.747-1.025 2.747-1.025.546 1.379.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z" />
1308-
</svg>
1295+
<GitHubIcon
1296+
secondary
1297+
className="h-[26px] w-[26px] text-text-primary"
1298+
/>
13091299
</div>
13101300
</div>
13111301

@@ -1379,14 +1369,7 @@ export const OnboardingV2 = (): ReactElement => {
13791369
}}
13801370
className="onb-btn-shine focus-visible:ring-white/20 group relative flex w-full items-center justify-center gap-2.5 overflow-hidden rounded-14 bg-white px-5 py-3.5 font-bold text-black transition-all duration-300 typo-callout hover:-translate-y-1 hover:shadow-[0_8px_30px_rgba(255,255,255,0.12)] focus-visible:outline-none focus-visible:ring-2"
13811371
>
1382-
<svg
1383-
width="20"
1384-
height="20"
1385-
viewBox="0 0 24 24"
1386-
fill="currentColor"
1387-
>
1388-
<path d="M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.699-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.268 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.114 2.504.336 1.909-1.292 2.747-1.025 2.747-1.025.546 1.379.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z" />
1389-
</svg>
1372+
<GitHubIcon secondary size={IconSize.XSmall} />
13901373
Continue with GitHub
13911374
<svg
13921375
width="14"
@@ -1979,15 +1962,10 @@ export const OnboardingV2 = (): ReactElement => {
19791962

19801963
if (importFlowSource === 'github') {
19811964
return (
1982-
<svg
1983-
width="26"
1984-
height="26"
1985-
viewBox="0 0 24 24"
1986-
fill="currentColor"
1987-
className="text-text-primary"
1988-
>
1989-
<path d="M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.699-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.268 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.114 2.504.336 1.909-1.292 2.747-1.025 2.747-1.025.546 1.379.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z" />
1990-
</svg>
1965+
<GitHubIcon
1966+
secondary
1967+
className="h-[26px] w-[26px] text-text-primary"
1968+
/>
19911969
);
19921970
}
19931971

@@ -2271,15 +2249,10 @@ export const OnboardingV2 = (): ReactElement => {
22712249
<>
22722250
<div className="mb-4 flex items-center gap-3">
22732251
<div className="flex h-11 w-11 shrink-0 items-center justify-center rounded-full border border-white/[0.08]">
2274-
<svg
2275-
width="22"
2276-
height="22"
2277-
viewBox="0 0 24 24"
2278-
fill="currentColor"
2279-
className="text-text-primary"
2280-
>
2281-
<path d="M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.699-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.268 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.114 2.504.336 1.909-1.292 2.747-1.025 2.747-1.025.546 1.379.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z" />
2282-
</svg>
2252+
<GitHubIcon
2253+
secondary
2254+
className="h-[22px] w-[22px] text-text-primary"
2255+
/>
22832256
</div>
22842257
<div>
22852258
<h3 className="font-bold text-text-primary typo-title3">
@@ -2408,14 +2381,7 @@ export const OnboardingV2 = (): ReactElement => {
24082381
}
24092382
}}
24102383
>
2411-
<svg
2412-
width="20"
2413-
height="20"
2414-
viewBox="0 0 24 24"
2415-
fill="currentColor"
2416-
>
2417-
<path d="M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.699-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.268 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.114 2.504.336 1.909-1.292 2.747-1.025 2.747-1.025.546 1.379.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z" />
2418-
</svg>
2384+
<GitHubIcon secondary size={IconSize.XSmall} />
24192385
Continue with GitHub
24202386
<svg
24212387
width="14"

packages/webapp/pages/onboarding.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,12 @@ function Page(props: PageProps) {
372372
feature: featureOnboardingV2,
373373
});
374374

375-
if (isOnboardingV2) {
376-
return <OnboardingV2 />;
377-
}
375+
const OnboardingComponent = isOnboardingV2 ? OnboardingV2 : Onboarding;
378376

379377
return (
380378
<JotaiProvider>
381379
<ErrorBoundary feature="onboarding">
382-
<Onboarding {...props} />
380+
<OnboardingComponent {...props} />
383381
</ErrorBoundary>
384382
<Toast autoDismissNotifications={autoDismissNotifications} />
385383
</JotaiProvider>

0 commit comments

Comments
 (0)