Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
42732c8
add invite friends ui
vineyardbovines May 29, 2026
11ff9fa
Invite friends QA polish
vineyardbovines Jun 1, 2026
5b4d7fa
Hide drawer invite-friends button on web
vineyardbovines Jun 1, 2026
7e6198e
Invite friends: fix web dead buttons/links, harden scanner, dedupe utils
vineyardbovines Jun 1, 2026
ac83105
Invite friends: wire followers banner to find-friends settings, polish
vineyardbovines Jun 1, 2026
1c68046
Fix prettier formatting in ProfileFollowers
vineyardbovines Jun 1, 2026
a202fd4
prettier fix
vineyardbovines Jun 1, 2026
bb9f0b9
bye claude
vineyardbovines Jun 1, 2026
218c997
Address PR review feedback for invite friends
vineyardbovines Jun 2, 2026
114bf0d
Sentence-case screen titles for invite/QR scanner
vineyardbovines Jun 4, 2026
b9c5ef1
Add analytics events for invite friends flow
vineyardbovines Jun 5, 2026
2e48d5c
Make QR card avatar circular (APP-2351)
vineyardbovines Jun 9, 2026
27ab4af
Address remaining PR review feedback for invite friends
vineyardbovines Jun 9, 2026
19f0477
Match scanner scrim corners to the scan-frame outline
vineyardbovines Jun 9, 2026
dad13d3
Colocate invite dialog handoff in InviteFriendsAnnouncement instead o…
vineyardbovines Jun 9, 2026
164584b
use inline useCallOnce for presented metric
vineyardbovines Jun 10, 2026
7b24015
fix no-misused-promises lint errors on async press handlers
vineyardbovines Jun 10, 2026
4b9fa8e
address review feedback: copy clarity, en dashes, reuse existing strings
vineyardbovines Jun 10, 2026
24cfc39
Merge branch 'main' into app-2142
vineyardbovines Jun 10, 2026
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/invite_friends_promo_banner.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ import {
import {useAnalytics} from '#/analytics'
import {setNavigationMetadata} from '#/analytics/metadata'
import {IS_LIQUID_GLASS, IS_NATIVE, IS_WEB} from '#/env'
import {InviteScannerScreen} from '#/features/inviteFriends'
import {router} from '#/routes'
import {Referrer} from '../modules/expo-bluesky-swiss-army'
import {renderMessagesSplitViewLayout} from './screens/Messages/components/splitView/MessagesSplitViewLayout'
Expand Down Expand Up @@ -307,6 +308,11 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) {
getComponent={() => DebugModScreen}
options={{title: title(msg`Moderation states`), requireAuth: true}}
/>
<Stack.Screen
name="InviteScanner"
getComponent={() => InviteScannerScreen}
options={{title: title(msg`Scan QR code`), requireAuth: true}}
/>
<Stack.Screen
name="SharedPreferencesTester"
getComponent={() => SharedPreferencesTesterScreen}
Expand Down
39 changes: 39 additions & 0 deletions src/analytics/metrics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1189,4 +1189,43 @@ export type Events = {
totalImages: number
postUri: string
}

/*
* Invite friends (profile QR share sheet)
*/

// NUX announcement dialog was shown to the user
'invite:nux:presented': {}
// user pressed "Try it" on the NUX announcement
'invite:nux:tryItPressed': {}
// invite friends dialog opened, with the surface that triggered it
'invite:dialog:open': {
logContext:
| 'ProfileHeader'
| 'Drawer'
| 'FindContactsSettings'
| 'NuxAnnouncement'
}
// user copied the invite link to clipboard
'invite:action:copy': {}
// user invoked the native share sheet with the invite link
'invite:action:share': {}
// user saved the QR code image to their camera roll (success only)
'invite:action:download': {}
// user pressed the scan button to open the QR scanner
'invite:action:scan': {}
// user changed the QR card color theme
'invite:theme:change': {
themeKey: 'dawn' | 'day' | 'dusk' | 'night'
}
// QR scanner decoded a code; result indicates whether it resolved to a profile
'invite:scanner:scanned': {
result: 'profileFound' | 'invalidQr'
}
// empty-followers banner promoting invite/find friends was shown
'invite:followersPromo:seen': {}
// user pressed the empty-followers promo banner
'invite:followersPromo:press': {}
// user dismissed the empty-followers promo banner
'invite:followersPromo:dismiss': {}
}
166 changes: 166 additions & 0 deletions src/components/dialogs/nuxs/InviteFriendsAnnouncement.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import {useCallback, useEffect} from 'react'
import {View} from 'react-native'
import {Image} from 'expo-image'
import {Trans, useLingui} from '@lingui/react/macro'

import {useCallOnce} from '#/lib/once'
import {atoms as a, useTheme, web} from '#/alf'
import {themes} from '#/alf/themes'
import {Button, ButtonText} from '#/components/Button'
import * as Dialog from '#/components/Dialog'
import {useNuxDialogContext} from '#/components/dialogs/nuxs'
import {Sparkle_Stroke2_Corner0_Rounded as SparkleIcon} from '#/components/icons/Sparkle'
import {Text} from '#/components/Typography'
import {useAnalytics} from '#/analytics'
import {IS_E2E, IS_NATIVE, IS_WEB} from '#/env'
import {createIsEnabledCheck} from './utils'

export const enabled = createIsEnabledCheck(() => {
// Native-only feature (matches the rest of the invite-friends scope).
// Skipped in E2E to keep tests deterministic.
return !IS_E2E && IS_NATIVE
})

export function InviteFriendsAnnouncement() {
const t = useTheme()
const {t: l} = useLingui()
const ax = useAnalytics()
const nuxDialogs = useNuxDialogContext()
const control = Dialog.useDialogControl()

Dialog.useAutoOpen(control)

const firePresented = useCallOnce(() => {
ax.metric('invite:nux:presented', {})
})
useEffect(() => {
firePresented()
}, [firePresented])

const onClose = useCallback(() => {
nuxDialogs.dismissActiveNux()
}, [nuxDialogs])

const onPressTryIt = useCallback(() => {
ax.metric('invite:nux:tryItPressed', {})
// Close this announcement (which dismisses + unmounts the NUX), then open
// the invite dialog. The invite dialog is mounted persistently by NuxDialogs
// (not here) so it survives the dismissal - the native bottom sheet cannot
// hand off to a second sheet mounted in this same subtree. Defer the open to
// the next frame so the announcement's teardown completes first.
control.close(() => {
requestAnimationFrame(() => nuxDialogs.openInviteFriends())
})
}, [ax, control, nuxDialogs])

return (
<>
<Dialog.Outer
control={control}
onClose={onClose}
nativeOptions={{preventExpansion: true}}>
<Dialog.Handle fill={t.palette.primary_400} />

<Dialog.ScrollableInner
label={l`Invite your friends`}
style={[web({maxWidth: 440})]}
contentContainerStyle={[
{paddingTop: 0, paddingLeft: 0, paddingRight: 0},
]}>
<View
style={[
a.w_full,
a.relative,
a.overflow_hidden,
{
borderTopLeftRadius: a.rounded_md.borderRadius,
borderTopRightRadius: a.rounded_md.borderRadius,
},
]}>
{/* The image is the full header background; the tag sits on top of it. */}
<Image
accessibilityIgnoresInvertColors
source={require('../../../../assets/images/invite_friends_announcement_nux.webp')}
style={[a.w_full, {aspectRatio: 754 / 440}]}
alt={l`An illustration of the Bluesky app with a paper airplane flying out of it, representing inviting friends`}
/>
<View
style={[
a.absolute,
a.align_center,
{top: 0, left: 0, right: 0, paddingTop: IS_WEB ? 24 : 20},
]}>
{/* Pinned to the light palette: the header illustration has a
fixed light background, so the tag must stay dark in any
theme to remain legible. */}
<View style={[a.flex_row, a.align_center, a.gap_xs]}>
<SparkleIcon fill={themes.lightPalette.primary_800} size="sm" />
<Text
style={[
a.font_semi_bold,
{color: themes.lightPalette.primary_800},
]}>
<Trans>New Feature</Trans>
</Text>
</View>
</View>
</View>
<View style={[a.align_center, a.px_xl, a.pt_xl, a.gap_2xl, a.pb_sm]}>
<View style={[a.gap_sm, a.align_center]}>
<Text
style={[
a.text_3xl,
a.leading_tight,
a.font_bold,
a.text_center,
{fontSize: IS_WEB ? 28 : 32, maxWidth: 300},
]}>
<Trans>Invite your friends</Trans>
</Text>
<Text
style={[
a.text_md,
a.leading_snug,
a.text_center,
t.atoms.text_contrast_medium,
{maxWidth: 340},
]}>
<Trans>
You can now invite friends with a link or QR code. Share it
anywhere or let them scan to join you on Bluesky.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think the copy could be a bit clearer here. Over to Claude to explain better than I can:

The second sentence has an unclear antecedent: “Share it” follows two nouns (link, QR code), and “let them scan” has no object at all. Besides reading slightly off in English, this is an i18n hazard – translators must pick a gender/inflection for “it” with no clear referent. Suggest making the nouns explicit, e.g. “Share the link anywhere, or let them scan the code to join you on Bluesky.”

</Trans>
</Text>
</View>

{!IS_WEB && (
<View style={[a.w_full, a.gap_sm]}>
<Button
label={l`Try it`}
size="large"
color="primary"
onPress={onPressTryIt}
style={[a.w_full]}>
<ButtonText>
<Trans>Try it</Trans>
</ButtonText>
</Button>
<Button
label={l`Cancel`}
size="large"
color="secondary"
onPress={() => control.close()}
style={[a.w_full]}>
<ButtonText>
<Trans>Cancel</Trans>
</ButtonText>
</Button>
</View>
)}
</View>

<Dialog.Close />
</Dialog.ScrollableInner>
</Dialog.Outer>
</>
)
}
34 changes: 33 additions & 1 deletion src/components/dialogs/nuxs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,31 @@ import {
import {useProfileQuery} from '#/state/queries/profile'
import {type SessionAccount, useSession} from '#/state/session'
import {useOnboardingState} from '#/state/shell'
import * as Dialog from '#/components/Dialog'
import {
DraftsAnnouncement,
enabled as isDraftsAnnouncementEnabled,
} from '#/components/dialogs/nuxs/DraftsAnnouncement'
import {
enabled as isInviteFriendsAnnouncementEnabled,
InviteFriendsAnnouncement,
} from '#/components/dialogs/nuxs/InviteFriendsAnnouncement'
import {isSnoozed, snooze, unsnooze} from '#/components/dialogs/nuxs/snoozing'
import {type EnabledCheckProps} from '#/components/dialogs/nuxs/utils'
import {useAnalytics} from '#/analytics'
import {InviteFriendsDialog} from '#/features/inviteFriends'
import {useGeolocation} from '#/geolocation'

type Context = {
activeNux: Nux | undefined
dismissActiveNux: () => void
/**
* Opens the invite-friends dialog. It is mounted persistently by NuxDialogs
* (not inside the announcement NUX) so it survives the announcement being
* dismissed - the native bottom sheet cannot hand off between two sheets
* mounted in the same subtree.
*/
openInviteFriends: () => void
}

const queuedNuxs: {
Expand All @@ -40,11 +53,16 @@ const queuedNuxs: {
id: Nux.DraftsAnnouncement,
enabled: isDraftsAnnouncementEnabled,
},
{
id: Nux.InviteFriendsAnnouncement,
enabled: isInviteFriendsAnnouncementEnabled,
},
]

const Context = createContext<Context>({
activeNux: undefined,
dismissActiveNux: () => {},
openInviteFriends: () => {},
})
Context.displayName = 'NuxDialogContext'

Expand Down Expand Up @@ -97,6 +115,7 @@ function Inner({
const [activeNux, setActiveNux] = useState<Nux | undefined>()
const {mutateAsync: saveNux} = useSaveNux()
const {mutate: resetNuxs} = useResetNuxs()
const inviteFriendsControl = Dialog.useDialogControl()

const snoozeNuxDialog = useCallback(() => {
snooze()
Expand Down Expand Up @@ -180,13 +199,26 @@ function Inner({
return {
activeNux,
dismissActiveNux,
openInviteFriends: () => {
ax.metric('invite:dialog:open', {logContext: 'NuxAnnouncement'})
inviteFriendsControl.open()
},
}
}, [activeNux, dismissActiveNux])
}, [ax, activeNux, dismissActiveNux, inviteFriendsControl])

return (
<Context.Provider value={ctx}>
{/*For example, activeNux === Nux.NeueTypography && <NeueTypography />*/}
{activeNux === Nux.DraftsAnnouncement && <DraftsAnnouncement />}
{activeNux === Nux.InviteFriendsAnnouncement && (
<InviteFriendsAnnouncement />
)}
{/*
Mounted persistently (not inside the announcement) so the invite dialog
survives the announcement NUX being dismissed during the "Try it"
handoff.
*/}
<InviteFriendsDialog control={inviteFriendsControl} />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

activeNux is on context here, so would we mount InviteFriendsDialog inside InviteFriendsAnnouncement and do the activeNux === Nux.InviteFriendsAnnouncement && in there instead of adding a method the the nux context?

</Context.Provider>
)
}
19 changes: 19 additions & 0 deletions src/features/inviteFriends/InviteFriendsDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Dialog from '#/components/Dialog'
import {InviteFriendsDialogInner} from './InviteFriendsDialogInner'

export function InviteFriendsDialog({
control,
onClose,
}: {
control: Dialog.DialogControlProps
onClose?: () => void
}) {
return (
<Dialog.Outer
control={control}
onClose={onClose}
nativeOptions={{preventExpansion: true}}>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw we have a fullHeight: true prop if you want to use it. It makes full-height sheets less buggy

<InviteFriendsDialogInner control={control} />
</Dialog.Outer>
)
}
13 changes: 13 additions & 0 deletions src/features/inviteFriends/InviteFriendsDialog.web.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {type DialogControlProps} from '#/components/Dialog'

/**
* Web no-op - the invite-friends share sheet is native-only by design.
* Callers may still create a Dialog control and pass it; opening it does
* nothing on web.
*/
export function InviteFriendsDialog(_props: {
control: DialogControlProps
onClose?: () => void
}) {
return null
}
Loading
Loading