ai/at
1
0

Compare commits

...

2 Commits

Author SHA1 Message Date
d77cdc5c0d custom social-app service view 2026-02-16 02:22:13 +09:00
8b26cf9452 fix patch 2026-02-16 01:23:52 +09:00
8 changed files with 215 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@@ -0,0 +1,122 @@
--- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx 2026-02-16 02:12:39
+++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx 2026-02-16 02:13:56
@@ -1,5 +1,5 @@
import {memo, useMemo, useState} from 'react'
-import {View} from 'react-native'
+import {Image, Pressable, View} from 'react-native'
import {
type AppBskyActorDefs,
moderateProfile,
@@ -9,9 +9,11 @@
} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+import {useQuery} from '@tanstack/react-query'
import {useActorStatus} from '#/lib/actor-status'
import {useHaptics} from '#/lib/haptics'
+import {useOpenLink} from '#/lib/hooks/useOpenLink'
import {sanitizeDisplayName} from '#/lib/strings/display-names'
import {sanitizeHandle} from '#/lib/strings/handles'
import {logger} from '#/logger'
@@ -20,7 +22,7 @@
useProfileBlockMutationQueue,
useProfileFollowMutationQueue,
} from '#/state/queries/profile'
-import {useRequireAuth, useSession} from '#/state/session'
+import {useAgent, useRequireAuth, useSession} from '#/state/session'
import {ProfileMenu} from '#/view/com/profile/ProfileMenu'
import {atoms as a, platform, useBreakpoints, useTheme} from '#/alf'
import {SubscribeProfileButton} from '#/components/activity-notifications/SubscribeProfileButton'
@@ -45,6 +47,83 @@
import {ProfileHeaderMetrics} from './Metrics'
import {ProfileHeaderShell} from './Shell'
import {ProfileHeaderSuggestedFollows} from './SuggestedFollows'
+
+const SERVICE_FAVICONS: Record<string, any> = {
+ 'syui.ai': require('../../../../assets/favicons/syui.ai.png'),
+ 'bsky.app': require('../../../../assets/favicons/bsky.app.png'),
+ 'atproto.com': require('../../../../assets/favicons/atproto.com.png'),
+}
+
+function ProfileServiceLinks({
+ profile,
+}: {
+ profile: AppBskyActorDefs.ProfileViewDetailed
+}) {
+ const t = useTheme()
+ const agent = useAgent()
+ const openLink = useOpenLink()
+
+ const {data: services} = useQuery({
+ queryKey: ['profile-services', profile.did],
+ queryFn: async () => {
+ const res = await agent.com.atproto.repo.describeRepo({
+ repo: profile.did,
+ })
+ const collections: string[] = res.data.collections || []
+ const serviceSet = new Set<string>()
+ for (const nsid of collections) {
+ const parts = nsid.split('.')
+ if (parts.length >= 2) {
+ const domain = parts.slice(0, 2).reverse().join('.')
+ serviceSet.add(domain)
+ }
+ }
+ return Array.from(serviceSet)
+ },
+ })
+
+ if (!services || services.length === 0) return null
+
+ return (
+ <View style={[a.flex_row, a.flex_wrap, a.gap_sm, a.pt_xs]}>
+ {services.map(service => (
+ <Pressable
+ key={service}
+ onPress={() =>
+ openLink(
+ `https://syui.ai/@${profile.handle}/at/service/${service}`,
+ )
+ }
+ style={[
+ a.flex_row,
+ a.align_center,
+ a.gap_xs,
+ a.rounded_full,
+ t.atoms.bg_contrast_50,
+ {paddingVertical: 6, paddingHorizontal: 10},
+ ]}>
+ <Image
+ source={
+ SERVICE_FAVICONS[service] || {
+ uri: `https://www.google.com/s2/favicons?domain=${service}&sz=32`,
+ }
+ }
+ style={{width: 14, height: 14, borderRadius: 3}}
+ accessibilityIgnoresInvertColors
+ />
+ <Text
+ style={[
+ a.text_xs,
+ a.font_medium,
+ t.atoms.text_contrast_medium,
+ ]}>
+ {service}
+ </Text>
+ </Pressable>
+ ))}
+ </View>
+ )
+}
interface Props {
profile: AppBskyActorDefs.ProfileViewDetailed
@@ -151,6 +230,7 @@
{!isPlaceholderProfile && !isBlockedUser && (
<View style={a.gap_md}>
<ProfileHeaderMetrics profile={profile} />
+ <ProfileServiceLinks profile={profile} />
{descriptionRT && !moderation.ui('profileView').blur ? (
<View pointerEvents="auto">
<RichText

View File

@@ -0,0 +1,35 @@
diff --git a/src/view/com/posts/PostFeedItem.tsx b/src/view/com/posts/PostFeedItem.tsx
--- a/src/view/com/posts/PostFeedItem.tsx
+++ b/src/view/com/posts/PostFeedItem.tsx
@@ -385,17 +385,19 @@
threadgateRecord={threadgateRecord}
/>
- <PostControls
- post={post}
- record={record}
- richText={richText}
- onPressReply={onPressReply}
- logContext="FeedItem"
- feedContext={feedContext}
- reqId={reqId}
- threadgateRecord={threadgateRecord}
- onShowLess={onShowLess}
- viaRepost={viaRepost}
- />
+ {false && (
+ <PostControls
+ post={post}
+ record={record}
+ richText={richText}
+ onPressReply={onPressReply}
+ logContext="FeedItem"
+ feedContext={feedContext}
+ reqId={reqId}
+ threadgateRecord={threadgateRecord}
+ onShowLess={onShowLess}
+ viaRepost={viaRepost}
+ />
+ )}
</View>
<DiscoverDebug feedContext={feedContext} />

View File

@@ -0,0 +1,50 @@
--- a/src/view/com/posts/PostFeed.tsx 2026-02-16 02:19:59
+++ b/src/view/com/posts/PostFeed.tsx 2026-02-16 02:20:13
@@ -519,16 +519,17 @@
key: 'liveEventFeedsAndTrendingBanner-' + sliceIndex,
})
// Show composer prompt for Discover and Following feeds
- if (
- hasSession &&
- (feedUriOrActorDid === DISCOVER_FEED_URI ||
- feed === 'following')
- ) {
- arr.push({
- type: 'composerPrompt',
- key: 'composerPrompt-' + sliceIndex,
- })
- }
+ // Disabled: hide composer prompt
+ // if (
+ // hasSession &&
+ // (feedUriOrActorDid === DISCOVER_FEED_URI ||
+ // feed === 'following')
+ // ) {
+ // arr.push({
+ // type: 'composerPrompt',
+ // key: 'composerPrompt-' + sliceIndex,
+ // })
+ // }
} else if (sliceIndex === 15) {
if (areVideoFeedsEnabled && !trendingVideoDisabled) {
arr.push({
@@ -545,12 +546,13 @@
} else if (feedKind === 'following') {
if (sliceIndex === 0) {
// Show composer prompt for Following feed
- if (hasSession) {
- arr.push({
- type: 'composerPrompt',
- key: 'composerPrompt-' + sliceIndex,
- })
- }
+ // Disabled: hide composer prompt
+ // if (hasSession) {
+ // arr.push({
+ // type: 'composerPrompt',
+ // key: 'composerPrompt-' + sliceIndex,
+ // })
+ // }
}
} else if (feedKind === 'profile') {
if (sliceIndex === 5) {

View File

@@ -45,6 +45,9 @@ PATCH_FILES_IOS=(
"033-social-app-ios-hide-profile-tabs.patch"
"036-social-app-ios-homeheader-loggedout.patch"
"037-social-app-ios-disable-contacts-nux.patch"
"038-social-app-ios-profile-services.patch"
"039-social-app-ios-hide-feed-controls.patch"
"040-social-app-ios-hide-composer-prompt.patch"
)
function ios-env() {

View File

@@ -1,13 +1,11 @@
diff --git a/packages/oauth/oauth-provider/src/router/create-authorization-page-middleware.ts b/packages/oauth/oauth-provider/src/router/create-authorization-page-middleware.ts
index f653b0353..45c45fac1 100644
--- a/packages/oauth/oauth-provider/src/router/create-authorization-page-middleware.ts
+++ b/packages/oauth/oauth-provider/src/router/create-authorization-page-middleware.ts
@@ -53,7 +53,7 @@ export function createAuthorizationPageMiddleware<
res.setHeader('Cache-Control', 'no-store')
res.setHeader('Pragma', 'no-cache')
- validateFetchSite(req, ['cross-site', 'none'])
+ validateFetchSite(req, ['cross-site', 'same-site', 'none'])
@@ -74,7 +74,7 @@
// @TODO Consider removing this altogether to allow hosting PDS and app on
// the same site but different origins (different subdomains).
- validateFetchSite(req, ['same-origin', 'cross-site', 'none'])
+ validateFetchSite(req, ['same-origin', 'same-site', 'cross-site', 'none'])
validateFetchMode(req, ['navigate'])
validateFetchDest(req, ['document'])
validateOrigin(req, issuerOrigin)