Skip to content

Add profile QR code for sharing and inviting friends - #10659

Merged
vineyardbovines merged 19 commits into
mainfrom
app-2142
Jun 10, 2026
Merged

vineyardbovines merged 19 commits into
mainfrom
app-2142

Conversation

@vineyardbovines

@vineyardbovines vineyardbovines commented May 29, 2026 •

Copy link
Copy Markdown
Member
CleanShot 2026-06-01 at 11 59 56
  • adds 'invite friends' sheet, containing a QR code that links to the logged in user's profile
  • sheet allows copying the link to clipboard, sharing the link, downloading the QR code itself, and a trigger to scan a QR code
  • added sheet trigger to profile and drawer, as well as a button within 'find contacts and friends'
  • nux also added!
CleanShot.2026-06-01.at.12.02.39.mp4

@linear-code

linear-code Bot commented May 29, 2026

Copy link
Copy Markdown

APP-2142

@github-actions

github-actions Bot commented May 29, 2026 •

Copy link
Copy Markdown
Contributor
Old size New size Diff
7.6 MB 7.75 MB 146.23 KB (1.88%)

- Drawer: move the share button inline with the display name (right-aligned)
  and keep the drawer open when opening the share sheet
- Settings: remove the redundant "Find and invite friends" item and rename the
  existing contacts link to "Find and invite friends"
- Invite dialog: add a "Done" button and a full-width header divider using the
  Dialog.Header renderLeft + edge-to-edge content padding pattern
- NUX announcement: wire up the promo illustration as the full-bleed header
  background with the "New Feature" tag overlaid
- Fix "Try it": mount the invite dialog persistently in NuxDialogs so it
  survives the announcement being dismissed, then open it after the handoff
The invite-friends share sheet is native-only (InviteFriendsDialog is a web
no-op), so the drawer share button did nothing on web. Only pass onPressShare
on native so the button is not rendered on web.
Addresses code-review findings on the invite-friends feature:
- Gate the profile-header share button and followers promo banner to
  native; the invite dialog is a no-op on web, so these were dead buttons.
- Show the real canonical profile URL in the invite-link field so the
  displayed text matches what Copy/Share/QR actually use.
- Add a web fallback for the QR scanner screen (route is registered on
  all platforms) and remove the unimplemented gallery picker button.
- Reuse shared hexToRgb/rgbToHex from alf/util/colorGeneration in ThemedQrCard.
- Rebuild ThemePicker on the shared Menu component instead of a hand-rolled
  Modal dropdown.
- Fix an import-sort lint error in dialogs/nuxs/index.
- Add promo banner illustration (assets/images/invite_friends_promo_banner.webp)
  and replace the empty placeholder box in FollowersPromoBanner.
- Redirect the followers empty-state banner to the Find and Invite Friends
  settings screen instead of opening the share sheet, gated to mirror that
  screen's availability (native, geolocation allowlist, feature flag) so we
  don't promote contact import where the settings entry is hidden.
- Drop the now-dead invite dialog mount/control from ProfileFollowers and
  update the banner a11y copy to match the new destination.
- Scanner: collapse the unused error-message state to a boolean (the overlay
  renders its own localized copy).

@ds-boyce ds-boyce left a comment

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.

Protip: You can use the Lingui codemod to update the msg calls.

jscodeshift -t .jscodeshift/file/lingui-v5.js <path>`

Comment thread .claude/.pre-pr-sweep-state Resolved
Comment thread src/features/inviteFriends/urls.ts Resolved
- Remove commented-out Dialog.Handle in InviteFriendsDialog
- Defer NUX -> invite handoff with requestAnimationFrame instead of setTimeout
- Un-nest the dismiss Pressable in FollowersPromoBanner (avoids Android touch conflicts)
- Drop redundant toLowerCase in getInviteShareUrl (handles are API-normalized, matches makeProfileLink)
- Request write-only media library permission when saving the QR code
- Migrate InviteFriendsAnnouncement to the l macro

@ds-boyce ds-boyce left a comment

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.

A couple copy nits but looks great!

Tracks the NUX funnel, dialog opens by surface, share/copy/download/scan
actions, theme picker selection, scanner results, and the empty-followers
promo banner impressions.

@estrattonbailey estrattonbailey left a comment

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.

Looking good! Looks like lint needs a bop and I have one nit.

Will give it a test run tomorrow 🎉

Comment thread src/components/dialogs/nuxs/index.tsx Outdated
Comment on lines +213 to +221
{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?

@estrattonbailey estrattonbailey left a comment

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.

Looking good! Couple small things + let's do a circle avi as noted in Slack

Comment thread src/view/shell/Drawer.tsx Resolved
Avatar on the Invite Friends QR code card was a rounded square; align
with the rest of the app where user avatars are circles.
@vineyardbovines

Copy link
Copy Markdown
Member Author

Includes fix for APP-2351 (Invite Friends avatar circular) in 2e48d5c.

- Pin "New Feature" tag color to lightPalette in the announcement NUX so
  it stays legible against the always-light header illustration in dark
  mode (APP-2349)
- Replace useEffect+eslint-disable with useCallOnce for the
  invite:nux:presented metric in InviteFriendsAnnouncement
- Close the drawer when tapping share-to-invite so the dialog doesn't
  open over a still-open drawer
- Lift the FollowersPromoBanner out of the empty-state early-return in
  ProfileFollowers so it renders independently of the placeholder/list
  switch
Replaces the four-rect scrim with a single SVG path that punches a
rounded-rect cutout, so the dark scrim's inner corners line up with the
colored frame above it instead of being square.

@surfdude29 surfdude29 left a comment

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.

Very cool! I noticed a few copy nits, and given that some of the strings are quite similar to existing QR code strings, it might make sense to align them to reuse the existing translations and reduce string duplication?

]}>
<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.”

{l`Download`}
</StackedButton>
<StackedButton
label={l({message: 'Open QR scanner'})}

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.

Suggested change
label={l({message: 'Open QR scanner'})}
label={l({message: 'Open QR code scanner'})}

nit: Very minor, but existing strings all refer to QR code rather than just QR


const onShare = async () => {
if (!canonicalShareUrl) {
Toast.show(l`Could not share - please try again`, {type: 'error'})

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.

Suggested change
Toast.show(l`Could not share - please try again`, {type: 'error'})
Toast.show(l`Could not share – please try again`, {type: 'error'})

nit: Suggest en-dash rather than hyphen

const onDownload = async () => {
if (!IS_NATIVE) return
if (!canonicalShareUrl) {
Toast.show(l`Could not download - please try again`, {type: 'error'})

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.

Suggested change
Toast.show(l`Could not download - please try again`, {type: 'error'})
Toast.show(l`Could not download – please try again`, {type: 'error'})

nit: ditto

const permission = await requestPermissionsAsync(true)
if (!permission.granted) {
Toast.show(
l`You must grant access to your photo library to save the QR code`,

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.

Suggested change
l`You must grant access to your photo library to save the QR code`,
l`You must grant access to your photo library to save a QR code`,

nit: Suggest slight reword to match the current string at src/components/StarterPack/QrCodeDialog.tsx:68, which will reuse the existing translation and reduce string duplication

try {
await createAssetAsync(`file://${uri}`)
ax.metric('invite:action:download', {})
Toast.show(l`QR code saved to your camera roll`)

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.

Suggested change
Toast.show(l`QR code saved to your camera roll`)
Toast.show(l`QR code saved to your camera roll!`)

nit: Suggest adding exclamation mark to match the current string at src/components/StarterPack/QrCodeDialog.tsx:119, which will reuse the existing translation and reduce string duplication

Toast.show(l`QR code saved to your camera roll`)
} catch (err) {
logger.error('InviteFriendsDialog: download failed', {safeMessage: err})
Toast.show(l`Could not save QR code`, {type: 'error'})

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.

Suggested change
Toast.show(l`Could not save QR code`, {type: 'error'})
Toast.show(l`An error occurred while saving the QR code!`, {type: 'error'})

nit: Suggest reword to reuse the existing error string (and translation) at src/components/StarterPack/QrCodeDialog.tsx:78, which will reduce string duplication


const onCopy = async () => {
if (!canonicalShareUrl) {
Toast.show(l`Could not copy - please try again`, {type: 'error'})

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.

Suggested change
Toast.show(l`Could not copy - please try again`, {type: 'error'})
Toast.show(l`Could not copy – please try again`, {type: 'error'})

nit: Suggest en-dash instead of hyphen

Toast.show(l`Invite link copied`)
} catch (err) {
logger.error('InviteFriendsDialog: copy failed', {safeMessage: err})
Toast.show(l`Could not copy link`, {type: 'error'})

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.

Suggested change
Toast.show(l`Could not copy link`, {type: 'error'})
Toast.show(l`Failed to copy link`, {type: 'error'})

nit: Suggest using existing error string and translation at src/components/Lightbox/Lightbox.web.tsx:302 to reduce string duplication.

]}>
<Divider style={[a.flex_1]} />
<Text style={[a.text_sm, t.atoms.text_contrast_medium]}>
{l`Invite link`}

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.

I think adding context here might be helpful, as the translation for a group chat invite link – which is what the existing string refers to – might need a different translation in some locales to an invite link to a profile

@estrattonbailey estrattonbailey left a comment

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.

LGTM! Good copy edits from Surfdude imo, and got a couple lints left 👍

Comment on lines +250 to +254
`M0 0 H${width} V${height} H0 Z ` +
`M${x + r} ${y} H${right - r} A${r} ${r} 0 0 1 ${right} ${y + r} ` +
`V${bottom - r} A${r} ${r} 0 0 1 ${right - r} ${bottom} ` +
`H${x + r} A${r} ${r} 0 0 1 ${x} ${bottom - r} ` +
`V${y + r} A${r} ${r} 0 0 1 ${x + r} ${y} Z`

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.

RIP my eyeballs lol

Comment on lines +33 to +38
const firePresented = useCallOnce(() => {
ax.metric('invite:nux:presented', {})
// Fire once on mount - the NUX has a single lifecycle per session.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
})
useEffect(() => {
firePresented()
}, [firePresented])

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.

Oh sorry to even have brought this up. You can just do useCallOnce(() => {})() for stuff like this, but this is also fine!

@arcalinea
arcalinea temporarily deployed to app-2142 - social-app PR #10659 June 10, 2026 14:17 — with Render Destroyed
<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

@arcalinea
arcalinea temporarily deployed to app-2142 - social-app PR #10659 June 10, 2026 17:37 — with Render Destroyed
@vineyardbovines
vineyardbovines merged commit c6f9803 into main Jun 10, 2026
21 checks passed
estrattonbailey added a commit that referenced this pull request Jun 10, 2026
* origin/main:
  Add indication of total number of images in ComposerReplyTo (#10836)
  Add profile QR code for sharing and inviting friends (#10659)
  Invert group chat feature gate (#10851)
  Restore on-device translation from overflow menu (#10850)
  New layout for expanded notification bundles (#10664)
  Enable Google Translate in post overflow menu (#10849)
  [Chat] Fix duplicate messages when history fetch races firehose (#10839)
  [Chat] Delete `GroupChatGate` (#10846)

This branch was successfully deployed

No deployments
app-2142 - social-app PR #10659 — 24cfc397 Deployed Jun 10, 2026 by arcalinea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants