Repository navigation
Add profile QR code for sharing and inviting friends - #10659
Conversation
|
- 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
left a comment
There was a problem hiding this comment.
Protip: You can use the Lingui codemod to update the msg calls.
jscodeshift -t .jscodeshift/file/lingui-v5.js <path>`- 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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Looking good! Looks like lint needs a bop and I have one nit.
Will give it a test run tomorrow 🎉
| {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} /> |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
Looking good! Couple small things + let's do a circle avi as noted in Slack
Avatar on the Invite Friends QR code card was a rounded square; align with the rest of the app where user avatars are circles.
|
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
left a comment
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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'})} |
There was a problem hiding this comment.
| 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'}) |
There was a problem hiding this comment.
| 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'}) |
There was a problem hiding this comment.
| 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`, |
There was a problem hiding this comment.
| 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`) |
There was a problem hiding this comment.
| 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'}) |
There was a problem hiding this comment.
| 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'}) |
There was a problem hiding this comment.
| 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'}) |
There was a problem hiding this comment.
| 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`} |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
LGTM! Good copy edits from Surfdude imo, and got a couple lints left 👍
| `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` |
| 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]) |
There was a problem hiding this comment.
Oh sorry to even have brought this up. You can just do useCallOnce(() => {})() for stuff like this, but this is also fine!
| <Dialog.Outer | ||
| control={control} | ||
| onClose={onClose} | ||
| nativeOptions={{preventExpansion: true}}> |
There was a problem hiding this comment.
fwiw we have a fullHeight: true prop if you want to use it. It makes full-height sheets less buggy
* 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)
CleanShot.2026-06-01.at.12.02.39.mp4