[ALG-77] include 'for you' in see more suggested users (#10241)

This commit is contained in:
Spence Pope
2026-04-14 18:50:00 -04:00
committed by GitHub
parent 59a2d19c26
commit 8d3eba2381
3 changed files with 45 additions and 24 deletions
+31 -16
View File
@@ -109,21 +109,32 @@ export function FollowDialogWithoutGuide({
let lastSelectedInterest = ''
let lastSearchText = ''
const FOR_YOU_TAB = 'all'
function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
const {t: l} = useLingui()
const ax = useAnalytics()
const interestsDisplayNames = useInterestsDisplayNames()
const rawInterestsDisplayNames = useInterestsDisplayNames()
const {data: preferences} = usePreferencesQuery()
const personalizedInterests = preferences?.interests?.tags
const interests = Object.keys(interestsDisplayNames)
.sort(boostInterests(popularInterests))
.sort(boostInterests(personalizedInterests))
const interests = useMemo(
() => [
FOR_YOU_TAB,
...Object.keys(rawInterestsDisplayNames)
.sort(boostInterests(popularInterests))
.sort(boostInterests(personalizedInterests)),
],
[rawInterestsDisplayNames, personalizedInterests],
)
const interestsDisplayNames = useMemo(
() => ({
[FOR_YOU_TAB]: l`For You`,
...rawInterestsDisplayNames,
}),
[l, rawInterestsDisplayNames],
)
const [selectedInterest, setSelectedInterest] = useState(
() =>
lastSelectedInterest ||
(personalizedInterests && interests.includes(personalizedInterests[0])
? personalizedInterests[0]
: interests[0]),
() => lastSelectedInterest || FOR_YOU_TAB,
)
const [searchText, setSearchText] = useState(lastSearchText)
const moderationOpts = useModerationOpts()
@@ -137,14 +148,15 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
lastSelectedInterest = selectedInterest
}, [searchText, selectedInterest])
const {
data: suggestions,
isFetching: isFetchingSuggestions,
error: suggestionsError,
} = useGetSuggestedUsersForSeeMoreQuery({
category: selectedInterest,
const isForYou = selectedInterest === FOR_YOU_TAB
const seeMoreQuery = useGetSuggestedUsersForSeeMoreQuery({
category: isForYou ? undefined : selectedInterest,
limit: 50,
})
const suggestions = seeMoreQuery.data
const isFetchingSuggestions = seeMoreQuery.isFetching
const suggestionsError = seeMoreQuery.error
const {
data: searchResults,
isFetching: isFetchingSearchResults,
@@ -277,7 +289,10 @@ function DialogInner({guide}: {guide?: Follow10ProgressGuide}) {
recId: recIdForLogging,
position: position !== -1 ? position : 0,
suggestedDid: item.profile.did,
category: selectedInterestRef.current,
category:
selectedInterestRef.current === FOR_YOU_TAB
? null
: selectedInterestRef.current,
})
}
}