Skip to content

Commit 03b61b0

Browse files
committed
fix: add cloud sync sign-in disclosure (bosmain-ee2)
1 parent b89ea20 commit 03b61b0

5 files changed

Lines changed: 91 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { cloudSyncSignInLinks } from '@/lib/constants/productUrls'
2+
import { cn } from '@/lib/utils'
3+
4+
interface CloudSyncDisclosureProps {
5+
className?: string
6+
}
7+
8+
export function CloudSyncDisclosure({ className }: CloudSyncDisclosureProps) {
9+
const [termsLink, privacyLink, cloudSyncLink] = cloudSyncSignInLinks
10+
11+
return (
12+
<p
13+
className={cn(
14+
'text-center text-muted-foreground text-xs leading-relaxed',
15+
className,
16+
)}
17+
>
18+
By signing in, you agree to the <DisclosureLink link={termsLink} /> and
19+
acknowledge the <DisclosureLink link={privacyLink} />.{' '}
20+
<DisclosureLink link={cloudSyncLink} />.
21+
</p>
22+
)
23+
}
24+
25+
function DisclosureLink({
26+
link,
27+
}: {
28+
link: (typeof cloudSyncSignInLinks)[number]
29+
}) {
30+
return (
31+
<a
32+
href={link.url}
33+
target="_blank"
34+
rel="noopener noreferrer"
35+
className="font-medium underline underline-offset-2 hover:text-foreground"
36+
>
37+
{link.label}
38+
</a>
39+
)
40+
}

packages/browseros-agent/apps/agent/entrypoints/app/login/LoginPage.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
import type { FC } from 'react'
99
import { useEffect, useState } from 'react'
1010
import { useNavigate } from 'react-router'
11+
import { CloudSyncDisclosure } from '@/components/auth/CloudSyncDisclosure'
1112
import { Alert, AlertDescription } from '@/components/ui/alert'
1213
import { Button } from '@/components/ui/button'
1314
import {
@@ -199,6 +200,8 @@ export const LoginPage: FC = () => {
199200
)}
200201
Continue with Google
201202
</Button>
203+
204+
<CloudSyncDisclosure />
202205
</CardContent>
203206
</Card>
204207
)

packages/browseros-agent/apps/agent/entrypoints/onboarding/steps/StepTwo.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { AlertCircle, CheckCircle2, Loader2, Mail } from 'lucide-react'
22
import { useState } from 'react'
3+
import { CloudSyncDisclosure } from '@/components/auth/CloudSyncDisclosure'
34
import { Alert, AlertDescription } from '@/components/ui/alert'
45
import { Button } from '@/components/ui/button'
56
import { Input } from '@/components/ui/input'
@@ -199,6 +200,8 @@ export const StepTwo = ({ direction, onContinue }: StepTwoProps) => {
199200
</Button>
200201
</form>
201202

203+
<CloudSyncDisclosure />
204+
202205
<div className="text-center">
203206
<Button
204207
variant="ghost"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { describe, expect, it } from 'bun:test'
2+
import {
3+
cloudSyncHelpUrl,
4+
cloudSyncSignInLinks,
5+
privacyPolicyUrl,
6+
termsOfServiceUrl,
7+
} from './productUrls'
8+
9+
describe('cloud sync sign-in links', () => {
10+
it('points to the public legal and cloud sync documentation URLs', () => {
11+
expect(termsOfServiceUrl).toBe('https://browseros.com/terms')
12+
expect(privacyPolicyUrl).toBe('https://browseros.com/privacy')
13+
expect(cloudSyncHelpUrl).toBe(
14+
'https://docs.browseros.com/features/sync-to-cloud',
15+
)
16+
})
17+
18+
it('includes legal and cloud sync documentation links in display order', () => {
19+
expect(cloudSyncSignInLinks).toEqual([
20+
{ label: 'Terms of Service', url: termsOfServiceUrl },
21+
{ label: 'Privacy Policy', url: privacyPolicyUrl },
22+
{ label: 'Learn more about cloud sync', url: cloudSyncHelpUrl },
23+
])
24+
})
25+
})

packages/browseros-agent/apps/agent/lib/constants/productUrls.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,26 @@ export const githubOrgUrl = 'https://github.com/browseros-ai'
2323
*/
2424
export const privacyPolicyUrl = 'https://browseros.com/privacy'
2525

26+
/**
27+
* @public
28+
*/
29+
export const termsOfServiceUrl = 'https://browseros.com/terms'
30+
31+
/**
32+
* @public
33+
*/
34+
export const cloudSyncHelpUrl =
35+
'https://docs.browseros.com/features/sync-to-cloud'
36+
37+
/**
38+
* @public
39+
*/
40+
export const cloudSyncSignInLinks = [
41+
{ label: 'Terms of Service', url: termsOfServiceUrl },
42+
{ label: 'Privacy Policy', url: privacyPolicyUrl },
43+
{ label: 'Learn more about cloud sync', url: cloudSyncHelpUrl },
44+
] as const
45+
2646
/**
2747
* @public
2848
*/

0 commit comments

Comments
 (0)