diff --git a/assets/images/atmosphere-tab-banner.webp b/assets/images/atmosphere-tab-banner.webp new file mode 100644 index 0000000000000000000000000000000000000000..c4ae5716fc363c4450dc2f8ad81f45318a2a5478 GIT binary patch literal 56210 zcmWFXbaU&v&A<@u>J$(bU=hK^z`!8Dz`$^siD4llgQHJ?$9qNw2G#{BxAUYutK=uF z`nKQo{Vr>tTO9%)kK4LRyBuM;<8o3VTx3(~&P^>$ik=NF{B{jn7rmOcK3msS?sf8> z>ciT}mQ%JdtuzQ&sNC?>V5jzr^WT5JUAre`QP90t9x=BkHgNIW*ttk1nyvO%S#5pA z_DHVhLAf%T%{{5Qfr0WtUtT@_xn=EEao3iKmK##rQ=6yGesTTy(@0T?rbjn=Q+3ve zPK~~>xj#R&I`r+wjujht0!|#!+f_DKU;bT=c9_e_hZtxBn!jStt=X#pvbz^V3@=sv4})efi+Ja99xA$y+ZTPJjJa zxnDq{%yi?gT7EIU=-DqGz27gM*=YRo@pJJBUiYq^cy;`+gyzd9*OzNWt_%yiA3AMP z+`sE@`;=zg{5$=EoB97N&D%F$_I8wg`!#*@{I&6KzI^t-C3VZ+>XzoBg>zqKOrQ4c z*5xH_Wy=@u-M;1P|I0^y)c>*nC;z|y|MCBi|9|{XU+(|ej0|A`778Ud85lkkFwJGu zy27-G(auq!*HvkeqWa>=oEJWDaHeLSeHmfD@o@9^`hTCr|NoZ$$8WOz;9t4qN}YQ9 zC97>LAKjO)4z_V?EfKuu4d)0=fB!NF#ak3DgXQZ zTdN21KWeq4tN#nx71ht*Zn8|ZT5?QcmH1gef?$pyZ?Xc zum3swC46VNC{;vCX|!i?7#Kz|DTorwf_tM9bfwYLH)hDb2W_hA^+9?ufJ}5qy2*V zFZ190f9fvCf3E-afA9Z^pPK)A|2_Uc{`>t;``q>~u5bB&{^$QsjQ>~P+W&+7@BaY) zzfAWFfALf6nZTP>ce)j+C|GMuf|C@i0|IGfp|NH*m|Nrrw{NMWT`R~e~KmPy! z@BQ}s`|kh$|E0$I--G{8{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^b*$puozslL(sGlmh{88%JzfF^^4_(l?_)1V}!j1F-2KgoIsz(=M0*lUSZ>g8vT|G)|@3%KECnHPy-l2< zzj#mZ(Z?bm%S(@IT)DElD!t9aYX+O_3bmr&2Y59T0(Y2%C*BclZ7y$nVK)C<_ literal 0 HcmV?d00001 diff --git a/lexicons.json b/lexicons.json index 389c1f31d..157f97356 100644 --- a/lexicons.json +++ b/lexicons.json @@ -270,6 +270,12 @@ "com.atproto.sync.requestCrawl", "com.atproto.sync.subscribeRepos", "com.germnetwork.declaration", + "place.stream.badge.defs", + "place.stream.livestream", + "site.standard.document", + "site.standard.publication", + "social.grain.gallery", + "social.grain.photo", "tools.ozone.inbox.appealActionedSubject", "tools.ozone.inbox.defs", "tools.ozone.inbox.getAccountStatus", @@ -760,7 +766,7 @@ }, "app.bsky.unspecced.getAtmosphereExploreTab": { "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.unspecced.getAtmosphereExploreTab", - "cid": "bafyreiez66qb7byto44nzivpn27ykzdgilgpuqogeusypl3mln7wicjnry" + "cid": "bafyreihbh326n4onxitcho3mrbvk5kblz3mexq7i2xjv2g62kvkbye6wzm" }, "app.bsky.video.defs": { "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.video.defs", @@ -1362,6 +1368,66 @@ "uri": "at://did:plc:qyqmmncrm6qx33kpy7vqndik/com.atproto.lexicon.schema/com.germnetwork.declaration", "cid": "bafyreickqsspgkujwucg3low5or64ywjryf44eua6xtszd6zsl2yteumoi" }, + "community.lexicon.location.address": { + "uri": "at://did:plc:mtr7qrqtcyseedx3jyr5o7db/com.atproto.lexicon.schema/community.lexicon.location.address", + "cid": "bafyreicdvexolyvp6j6yksqiib7hihwktt6ogalbvyzvtkj6ecrtqqw5fq" + }, + "community.lexicon.location.hthree": { + "uri": "at://did:plc:mtr7qrqtcyseedx3jyr5o7db/com.atproto.lexicon.schema/community.lexicon.location.hthree", + "cid": "bafyreic6xmiv4ycbcfvcvj5uu537ytl7hnjazcxf7hhd7g6o6s7p6tonky" + }, + "place.stream.badge.defs": { + "uri": "at://did:plc:gqtagsooi75obldmytuow57q/com.atproto.lexicon.schema/place.stream.badge.defs", + "cid": "bafyreidhldtcylff7awx67jd76miapjz3q4gumtq24opaaw345vznvftwm" + }, + "place.stream.chat.defs": { + "uri": "at://did:web:stream.place/com.atproto.lexicon.schema/place.stream.chat.defs", + "cid": "bafyreieqmxs6sq36qkyptjptaurafwgcs75ysabphvxs2u4kqrcxl4k654" + }, + "place.stream.chat.pinnedRecord": { + "uri": "at://did:web:stream.place/com.atproto.lexicon.schema/place.stream.chat.pinnedRecord", + "cid": "bafyreihhzztor57z6meie6cawiev2q3faanfj66mkipjmvaak7hh2b4hia" + }, + "place.stream.chat.profile": { + "uri": "at://did:web:stream.place/com.atproto.lexicon.schema/place.stream.chat.profile", + "cid": "bafyreifhhyqutckyjkl4epfqhfbsxmq5t5d3glp36i7pj6w5qzfze6ujx4" + }, + "place.stream.defs": { + "uri": "at://did:plc:gqtagsooi75obldmytuow57q/com.atproto.lexicon.schema/place.stream.defs", + "cid": "bafyreigkmglxxmqu47mhvfsjckbc6vzbbdeu2rcu2gfu2jrubauf7vryge" + }, + "place.stream.livestream": { + "uri": "at://did:plc:gqtagsooi75obldmytuow57q/com.atproto.lexicon.schema/place.stream.livestream", + "cid": "bafyreigezmbplvoj53hjr5bkwl75jbd2q6vqx4fcbtwuwv73as3vhwfl3q" + }, + "site.standard.document": { + "uri": "at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.document", + "cid": "bafyreifylc5lfr4vqfzrwdtqm4pnfg7cbra7z4acbgikylqandzefwdeaq" + }, + "site.standard.publication": { + "uri": "at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.publication", + "cid": "bafyreiapvnarfn3nl2wvg27hsylli5zqvou7a74p7od5mu4detprtejapy" + }, + "site.standard.theme.basic": { + "uri": "at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.theme.basic", + "cid": "bafyreiabm6f64zosv5jcdmwd3qvekjhoi7enevg53rxj734ney4sd6lmku" + }, + "site.standard.theme.color": { + "uri": "at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.theme.color", + "cid": "bafyreicps42z5maxdqwml7t3klsrrpk332jthyfgpeb4zjn3wlvp5vyjia" + }, + "social.grain.defs": { + "uri": "at://did:plc:e7rftrdyz5e2rw4y6ocszew2/com.atproto.lexicon.schema/social.grain.defs", + "cid": "bafyreia3nt5ow66tq325s2p4vxqwzntvfgnasf5circqmaa7cqhlrq327e" + }, + "social.grain.gallery": { + "uri": "at://did:plc:e7rftrdyz5e2rw4y6ocszew2/com.atproto.lexicon.schema/social.grain.gallery", + "cid": "bafyreic645nrikuhuc34gfmieief6jwprz245movnuaubxv2u4qhk6noua" + }, + "social.grain.photo": { + "uri": "at://did:plc:e7rftrdyz5e2rw4y6ocszew2/com.atproto.lexicon.schema/social.grain.photo", + "cid": "bafyreigigzkmnzz4qycj2wbaonl7zdqgi2566qipjhdcqdrr5g4gz3y64y" + }, "tools.ozone.inbox.appealActionedSubject": { "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.inbox.appealActionedSubject", "cid": "bafyreihyc3tqs3mqacjp2vp645ood7qrsx3xz7hxup7p6zkz3dskns3u3a" diff --git a/lexicons/README.md b/lexicons/README.md index be1c94f55..6d285fc9c 100644 --- a/lexicons/README.md +++ b/lexicons/README.md @@ -11,7 +11,8 @@ The `app.bsky.unspecced` namespace is intentionally unpublished (it is a DNS carveout upstream, and resolving it is a CI violation there), so the installer cannot fetch it. These schemas are copied from merged upstream sources: -- [`lexicons/app/bsky/unspecced/getAtmosphereExploreTab.json` at `293d6494ed90`](https://github.com/bluesky-social/bsky/blob/293d6494ed9058e28a04b97133d16ab8abe7ef5e/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.json) +- `lexicons-overrides/app/bsky/unspecced/getAtmosphereExploreTab.json` at atproto + `7b640e8fee709d22a0d62262068db0ddb3106741` (from atproto PR 5809) - `lexicons-overrides/app/bsky/unspecced/getAtmosphereApps.json` at atproto `11f52c5588279d159ab12404a1b323731a467fdd` (from atproto PR 5801) @@ -20,3 +21,13 @@ pins, not published record CIDs, and their `uri` values are only installer compatibility hints, not published record locations. An unscoped network update will fail when it tries to fetch these schemas. Update them from upstream JSON and compute each local CID with `cidForLex` from `@atproto/lex-cbor`. + +## Exception: `place.stream.badge.defs` + +`place.stream.livestream` reaches `place.stream.badge.defs` through +`place.stream.chat.defs`, but `_lexicon.badge.stream.place` has no TXT record, +so the installer cannot resolve it by NSID. It is pinned by AT URI from the +`did:plc` repo that publishes `place.stream.livestream`; its CID matches the copy +in the `did:web:stream.place` repo. Install it with +`pnpm lexicons:install at://did:plc:gqtagsooi75obldmytuow57q/com.atproto.lexicon.schema/place.stream.badge.defs` +when adding or refreshing `place.stream.*` schemas. diff --git a/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.json b/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.json index 0ca19de08..d00ff9f26 100644 --- a/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.json +++ b/lexicons/app/bsky/unspecced/getAtmosphereExploreTab.json @@ -4,7 +4,7 @@ "defs": { "main": { "type": "query", - "description": "Get Atmosphere Explore content. Articles are recommended when algorithmic recommendations are enabled for the request, and curated otherwise; other sections are curated. Authentication is optional; authenticated requests include viewer-specific profile state.", + "description": "Get Atmosphere Explore content. Articles are recommended when algorithmic recommendations are enabled for the request, and curated otherwise; other sections are curated. Curated content is selected using the x-atproto-bsky-geo-country, x-atproto-bsky-geo-region, and x-atproto-bsky-topics request headers. Authentication is optional; authenticated requests include viewer-specific profile state.", "parameters": { "type": "params", "properties": { @@ -12,14 +12,6 @@ "type": "array", "description": "Preferred languages for article recommendations when algorithmic recommendations are enabled. Ignored otherwise.", "items": { "type": "string", "format": "language" } - }, - "countryCode": { - "type": "string", - "description": "The ISO 3166-1 alpha-2 country code used to select curated content." - }, - "regionCode": { - "type": "string", - "description": "The ISO 3166-2 region code used to select curated content." } } }, @@ -112,7 +104,15 @@ "type": "object", "required": ["featured", "view"], "properties": { - "featured": { "type": "boolean" }, + "featured": { + "type": "boolean", + "description": "Deprecated. Retained for compatibility; always false." + }, + "bskyPostRef": { + "type": "ref", + "ref": "com.atproto.repo.strongRef", + "description": "The Bluesky post associated with the article, as declared by its author. The referenced post may not be available." + }, "view": { "type": "ref", "ref": "app.bsky.embed.external#viewArticle" } } }, @@ -120,7 +120,10 @@ "type": "object", "required": ["featured", "view"], "properties": { - "featured": { "type": "boolean" }, + "featured": { + "type": "boolean", + "description": "Deprecated. Retained for compatibility; always false." + }, "view": { "type": "ref", "ref": "app.bsky.embed.external#viewArticlePublication" @@ -131,7 +134,10 @@ "type": "object", "required": ["featured", "view"], "properties": { - "featured": { "type": "boolean" }, + "featured": { + "type": "boolean", + "description": "Deprecated. Retained for compatibility; always false." + }, "view": { "type": "ref", "ref": "app.bsky.embed.external#viewGallery" } } }, @@ -139,7 +145,15 @@ "type": "object", "required": ["featured", "view"], "properties": { - "featured": { "type": "boolean" }, + "featured": { + "type": "boolean", + "description": "Deprecated. Retained for compatibility; always false." + }, + "bskyPostRef": { + "type": "ref", + "ref": "com.atproto.repo.strongRef", + "description": "The Bluesky post that announced the livestream, as declared by its author. The referenced post may not be available." + }, "view": { "type": "ref", "ref": "app.bsky.embed.external#viewLivestream" @@ -164,16 +178,35 @@ "id": { "type": "string", "maxLength": 4096 }, "title": { "type": "string", "maxLength": 4096 }, "description": { "type": "string", "maxLength": 4096 }, - "logo": { "type": "string", "format": "uri", "maxLength": 4096 }, + "logo": { + "type": "string", + "format": "uri", + "maxLength": 4096, + "description": "Compatibility field. The profile avatar when available, otherwise the editorial logo." + }, "backgroundImage": { "type": "string", "format": "uri", - "maxLength": 4096 + "maxLength": 4096, + "description": "Compatibility field. The profile banner when available, otherwise the editorial background image." + }, + "overlayColor": { + "type": "string", + "maxLength": 4096, + "description": "Deprecated. Retained for compatibility." + }, + "textColor": { + "type": "string", + "maxLength": 4096, + "description": "Deprecated. Retained for compatibility." }, - "overlayColor": { "type": "string", "maxLength": 4096 }, - "textColor": { "type": "string", "maxLength": 4096 }, "url": { "type": "string", "format": "uri", "maxLength": 4096 }, - "category": { "type": "string", "maxLength": 4096 } + "category": { "type": "string", "maxLength": 4096 }, + "profile": { + "type": "ref", + "ref": "app.bsky.actor.defs#profileViewDetailed", + "description": "The app's account profile, when available." + } } } } diff --git a/lexicons/community/lexicon/location/address.json b/lexicons/community/lexicon/location/address.json new file mode 100644 index 000000000..ad97f77b0 --- /dev/null +++ b/lexicons/community/lexicon/location/address.json @@ -0,0 +1,42 @@ +{ + "id": "community.lexicon.location.address", + "defs": { + "main": { + "type": "object", + "required": [ + "country" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the location." + }, + "region": { + "type": "string", + "description": "The administrative region of the country. For example, a state in the USA." + }, + "street": { + "type": "string", + "description": "The street address." + }, + "country": { + "type": "string", + "maxLength": 10, + "minLength": 2, + "description": "The ISO 3166 country code. Preferably the 2-letter code." + }, + "locality": { + "type": "string", + "description": "The locality of the region. For example, a city in the USA." + }, + "postalCode": { + "type": "string", + "description": "The postal code of the location." + } + }, + "description": "A physical location in the form of a street address." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/community/lexicon/location/hthree.json b/lexicons/community/lexicon/location/hthree.json new file mode 100644 index 000000000..2c7e588cd --- /dev/null +++ b/lexicons/community/lexicon/location/hthree.json @@ -0,0 +1,24 @@ +{ + "id": "community.lexicon.location.hthree", + "defs": { + "main": { + "type": "object", + "required": [ + "value" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the location." + }, + "value": { + "type": "string", + "description": "The h3 encoded location." + } + }, + "description": "A physical location in the form of a H3 encoded location." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/place/stream/badge/defs.json b/lexicons/place/stream/badge/defs.json new file mode 100644 index 000000000..56a7759f4 --- /dev/null +++ b/lexicons/place/stream/badge/defs.json @@ -0,0 +1,146 @@ +{ + "id": "place.stream.badge.defs", + "defs": { + "bot": { + "type": "token", + "description": "This user is a bot. Self-applied via place.stream.chat.profile selfLabels." + }, + "mod": { + "type": "token", + "description": "This user is a moderator. Displayed with a sword icon." + }, + "vip": { + "type": "token", + "description": "This user is a very important person." + }, + "event": { + "type": "token", + "description": "This user has won or earned a special event or contest badge." + }, + "streamer": { + "type": "token", + "description": "This user is the streamer. Displayed with a star icon." + }, + "badgeSlot": { + "type": "object", + "required": [ + "available" + ], + "properties": { + "selected": { + "ref": "#badgeIssuanceView", + "type": "ref", + "description": "The currently selected badge in this slot, if any." + }, + "available": { + "type": "array", + "items": { + "ref": "#badgeIssuanceView", + "type": "ref" + }, + "description": "All badges available for this slot." + } + }, + "description": "A display slot containing available issuance-based badges and which one (if any) is currently selected." + }, + "badgeView": { + "type": "object", + "required": [ + "badgeType", + "issuer", + "recipient" + ], + "properties": { + "name": { + "type": "string", + "description": "Display name from the badge definition." + }, + "issuer": { + "type": "string", + "format": "did", + "description": "DID of the badge issuer." + }, + "imageUrl": { + "type": "string", + "format": "uri", + "description": "Resolved image URL for the badge icon." + }, + "badgeType": { + "type": "string", + "knownValues": [ + "place.stream.badge.defs#mod", + "place.stream.badge.defs#streamer", + "place.stream.badge.defs#vip", + "place.stream.badge.defs#event", + "place.stream.badge.defs#bot" + ] + }, + "recipient": { + "type": "string", + "format": "did", + "description": "DID of the badge recipient." + }, + "signature": { + "type": "string", + "description": "TODO: Cryptographic signature of the badge (of a place.stream.key)." + }, + "description": { + "type": "string", + "description": "Description from the badge definition." + } + }, + "description": "View of a badge record, with fields resolved for display. If the DID in issuer is not the current streamplace node, the signature field shall be required." + }, + "badgeIssuanceView": { + "type": "object", + "required": [ + "issuanceUri", + "badgeType", + "issuer" + ], + "properties": { + "name": { + "type": "string", + "description": "Display name from the badge definition." + }, + "issuer": { + "type": "string", + "format": "did", + "description": "DID of the badge issuer." + }, + "imageUrl": { + "type": "string", + "format": "uri", + "description": "Resolved image URL for the badge icon." + }, + "selected": { + "type": "boolean", + "description": "Whether this badge is currently in the user's chat profile selection." + }, + "badgeType": { + "type": "string", + "knownValues": [ + "place.stream.badge.defs#vip", + "place.stream.badge.defs#event" + ] + }, + "description": { + "type": "string", + "description": "Description from the badge definition." + }, + "issuanceCid": { + "type": "string", + "description": "CID of the place.stream.badge.issuance record." + }, + "issuanceUri": { + "type": "string", + "format": "at-uri", + "description": "AT URI of the place.stream.badge.issuance record." + } + }, + "description": "A resolved view of a badge issuance, including def fields for display." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/place/stream/chat/defs.json b/lexicons/place/stream/chat/defs.json new file mode 100644 index 000000000..b2e6287b6 --- /dev/null +++ b/lexicons/place/stream/chat/defs.json @@ -0,0 +1,97 @@ +{ + "id": "place.stream.chat.defs", + "defs": { + "messageView": { + "type": "object", + "required": [ + "uri", + "cid", + "author", + "record", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "author": { + "ref": "app.bsky.actor.defs#profileViewBasic", + "type": "ref" + }, + "badges": { + "type": "array", + "items": { + "ref": "place.stream.badge.defs#badgeView", + "type": "ref" + }, + "maxLength": 3, + "description": "Up to 3 badge tokens to display with the message. First badge is server-controlled, remaining badges are user-settable. Tokens are looked up in badges.json for display info." + }, + "record": { + "type": "unknown" + }, + "deleted": { + "type": "boolean", + "description": "If true, this message has been deleted or labeled and should be cleared from the cache" + }, + "replyTo": { + "refs": [ + "#messageView" + ], + "type": "union" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "chatProfile": { + "ref": "place.stream.chat.profile", + "type": "ref" + } + } + }, + "pinnedRecordView": { + "type": "object", + "required": [ + "uri", + "cid", + "record", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "record": { + "ref": "place.stream.chat.pinnedRecord", + "type": "ref" + }, + "message": { + "ref": "#messageView", + "type": "ref" + }, + "pinnedBy": { + "ref": "place.stream.chat.profile", + "type": "ref" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + } + }, + "description": "View of a pinned chat record with hydrated message data." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/place/stream/chat/pinnedRecord.json b/lexicons/place/stream/chat/pinnedRecord.json new file mode 100644 index 000000000..503b76bbb --- /dev/null +++ b/lexicons/place/stream/chat/pinnedRecord.json @@ -0,0 +1,41 @@ +{ + "id": "place.stream.chat.pinnedRecord", + "defs": { + "main": { + "key": "tid", + "type": "record", + "record": { + "type": "object", + "required": [ + "pinnedMessage", + "createdAt" + ], + "properties": { + "pinnedBy": { + "type": "string", + "format": "did", + "description": "DID of the user who pinned the message." + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "When this pin was created." + }, + "expiresAt": { + "type": "string", + "format": "datetime", + "description": "Optional expiration time. If set, the pin is considered inactive after this time." + }, + "pinnedMessage": { + "type": "string", + "format": "at-uri", + "description": "AT-URI of the pinned chat message." + } + } + }, + "description": "Record pinning a chat message for prominent display." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/place/stream/chat/profile.json b/lexicons/place/stream/chat/profile.json new file mode 100644 index 000000000..79267a38d --- /dev/null +++ b/lexicons/place/stream/chat/profile.json @@ -0,0 +1,108 @@ +{ + "id": "place.stream.chat.profile", + "defs": { + "main": { + "key": "literal:self", + "type": "record", + "record": { + "type": "object", + "properties": { + "color": { + "ref": "#color", + "type": "ref" + }, + "badges": { + "ref": "#badgeSelections", + "type": "ref", + "description": "Badge selections for display in chat." + }, + "selfLabels": { + "type": "array", + "items": { + "ref": "#selfLabel", + "type": "ref" + }, + "maxLength": 10, + "description": "Self-applied labels for this profile, e.g. 'bot'." + } + } + }, + "description": "Record containing customizations for a user's chat profile." + }, + "color": { + "type": "object", + "required": [ + "red", + "green", + "blue" + ], + "properties": { + "red": { + "type": "integer", + "maximum": 255, + "minimum": 0 + }, + "blue": { + "type": "integer", + "maximum": 255, + "minimum": 0 + }, + "green": { + "type": "integer", + "maximum": 255, + "minimum": 0 + } + }, + "description": "Customizations for the color of a user's name in chat" + }, + "selfLabel": { + "type": "string", + "description": "Label that a user can apply to their own profile.", + "knownValues": [ + "bot" + ] + }, + "badgeSelections": { + "type": "object", + "properties": { + "global": { + "ref": "com.atproto.repo.strongRef", + "type": "ref", + "description": "Selected globally-issued badge (e.g. event badge)." + }, + "streamer": { + "type": "array", + "items": { + "ref": "#streamerBadgeSelection", + "type": "ref" + }, + "maxLength": 20, + "description": "Selected streamer-issued badges, one per streamer channel." + } + }, + "description": "Selected badges for display in chat, organized by slot." + }, + "streamerBadgeSelection": { + "type": "object", + "required": [ + "streamer", + "badge" + ], + "properties": { + "badge": { + "ref": "com.atproto.repo.strongRef", + "type": "ref", + "description": "Strong reference to the selected place.stream.badge.issuance record." + }, + "streamer": { + "type": "string", + "format": "did", + "description": "DID of the streamer whose channel this selection applies to." + } + }, + "description": "A selected badge for a specific streamer's channel." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/place/stream/defs.json b/lexicons/place/stream/defs.json new file mode 100644 index 000000000..a4e7791ab --- /dev/null +++ b/lexicons/place/stream/defs.json @@ -0,0 +1,107 @@ +{ + "id": "place.stream.defs", + "defs": { + "blockView": { + "type": "object", + "required": [ + "uri", + "cid", + "blocker", + "record", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "record": { + "ref": "app.bsky.graph.block", + "type": "ref" + }, + "blocker": { + "ref": "app.bsky.actor.defs#profileViewBasic", + "type": "ref" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + } + } + }, + "rendition": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "renditions": { + "type": "object", + "required": [ + "renditions" + ], + "properties": { + "renditions": { + "type": "array", + "items": { + "ref": "#rendition", + "type": "ref" + } + } + } + }, + "activityGame": { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string", + "format": "at-uri" + }, + "name": { + "type": "string", + "description": "Cached display name of the game." + } + }, + "description": "A game from the gamesgamesgamesgames catalog, identified by its AT URI." + }, + "activityLabel": { + "type": "object", + "required": [ + "label" + ], + "properties": { + "label": { + "type": "string", + "knownValues": [ + "events", + "just_chatting", + "podcasting", + "music", + "art", + "software_dev", + "cooking", + "miniatures", + "makers_crafting", + "fitness", + "sports" + ] + } + }, + "description": "A non-game activity with a well-known label." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/place/stream/livestream.json b/lexicons/place/stream/livestream.json new file mode 100644 index 000000000..933aec8fc --- /dev/null +++ b/lexicons/place/stream/livestream.json @@ -0,0 +1,230 @@ +{ + "id": "place.stream.livestream", + "defs": { + "main": { + "key": "tid", + "type": "record", + "record": { + "type": "object", + "required": [ + "title", + "createdAt" + ], + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "The URL where this stream can be found. This is primarily a hint for other Streamplace nodes to locate and replicate the stream." + }, + "post": { + "ref": "com.atproto.repo.strongRef", + "type": "ref", + "description": "The post that announced this livestream." + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + }, + "maxLength": 10, + "description": "Freeform tags for this stream. Each tag must be alphanumeric (a-z, A-Z, 0-9) plus colon. Tags with colons indicate a specific tag group (e.g. 'lang:en' indicates the stream's primary language)." + }, + "agent": { + "type": "string", + "description": "The source of the livestream, if available, in a User Agent format: ` / ` e.g. Streamplace/0.7.5 iOS" + }, + "thumb": { + "type": "blob", + "accept": [ + "image/*" + ], + "maxSize": 1000000 + }, + "title": { + "type": "string", + "maxLength": 1400, + "description": "The title of the livestream, as it will be announced to followers.", + "maxGraphemes": 140 + }, + "endedAt": { + "type": "string", + "format": "datetime", + "description": "Client-declared timestamp when this livestream ended. Ended livestreams are not supposed to start up again." + }, + "activity": { + "refs": [ + "place.stream.defs#activityGame", + "place.stream.defs#activityLabel" + ], + "type": "union", + "description": "The game or activity being streamed." + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "Client-declared timestamp when this livestream started." + }, + "lastSeenAt": { + "type": "string", + "format": "datetime", + "description": "Client-declared timestamp when this livestream was last seen by the Streamplace station." + }, + "canonicalUrl": { + "type": "string", + "format": "uri", + "description": "The primary URL where this livestream can be viewed, if available." + }, + "idleTimeoutSeconds": { + "type": "integer", + "description": "Time in seconds after which this livestream should be automatically ended if idle. Zero means no timeout." + }, + "notificationSettings": { + "ref": "place.stream.livestream#notificationSettings", + "type": "ref" + } + } + }, + "description": "Record announcing a livestream is happening" + }, + "viewerCount": { + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer" + } + } + }, + "livestreamView": { + "type": "object", + "required": [ + "uri", + "cid", + "author", + "record", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "author": { + "ref": "app.bsky.actor.defs#profileViewBasic", + "type": "ref" + }, + "record": { + "type": "unknown" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "viewerCount": { + "ref": "#viewerCount", + "type": "ref", + "description": "The number of viewers watching this livestream. Use when you can't reasonably use #viewerCount directly." + } + } + }, + "teleportArrival": { + "type": "object", + "required": [ + "teleportUri", + "source", + "viewerCount", + "startsAt" + ], + "properties": { + "source": { + "ref": "app.bsky.actor.defs#profileViewBasic", + "type": "ref", + "description": "The streamer who is teleporting their viewers here" + }, + "startsAt": { + "type": "string", + "format": "datetime", + "description": "When this teleport started" + }, + "chatProfile": { + "ref": "place.stream.chat.profile", + "type": "ref", + "description": "The chat profile of the source streamer" + }, + "teleportUri": { + "type": "string", + "format": "at-uri", + "description": "The URI of the teleport record" + }, + "viewerCount": { + "type": "integer", + "description": "How many viewers are arriving from this teleport" + } + } + }, + "teleportCanceled": { + "type": "object", + "required": [ + "teleportUri", + "reason" + ], + "properties": { + "reason": { + "enum": [ + "deleted", + "denied", + "expired" + ], + "type": "string", + "description": "Why this teleport was canceled" + }, + "teleportUri": { + "type": "string", + "format": "at-uri", + "description": "The URI of the teleport record that was canceled" + } + } + }, + "streamplaceAnything": { + "type": "object", + "required": [ + "livestream" + ], + "properties": { + "livestream": { + "refs": [ + "#livestreamView", + "#viewerCount", + "#teleportArrival", + "#teleportCanceled", + "place.stream.defs#blockView", + "place.stream.defs#renditions", + "place.stream.defs#rendition", + "place.stream.chat.defs#messageView", + "place.stream.chat.defs#pinnedRecordView" + ], + "type": "union" + } + } + }, + "notificationSettings": { + "type": "object", + "properties": { + "pushNotification": { + "type": "boolean", + "description": "Whether this livestream should trigger a push notification to followers." + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/site/standard/document.json b/lexicons/site/standard/document.json new file mode 100644 index 000000000..e3df15348 --- /dev/null +++ b/lexicons/site/standard/document.json @@ -0,0 +1,126 @@ +{ + "id": "site.standard.document", + "defs": { + "main": { + "key": "tid", + "type": "record", + "record": { + "type": "object", + "required": [ + "site", + "title", + "publishedAt" + ], + "properties": { + "path": { + "type": "string", + "description": "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash." + }, + "site": { + "type": "string", + "format": "uri", + "description": "Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes." + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "maxLength": 1280, + "maxGraphemes": 128 + }, + "description": "Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags." + }, + "links": { + "refs": [], + "type": "union", + "description": "Array of values describing relationships between this document and external resources" + }, + "title": { + "type": "string", + "maxLength": 5000, + "description": "Title of the document.", + "maxGraphemes": 500 + }, + "labels": { + "refs": [ + "com.atproto.label.defs#selfLabels" + ], + "type": "union", + "description": "Self-label values for this post. Effectively content warnings." + }, + "content": { + "refs": [], + "type": "union", + "closed": false, + "description": "Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats." + }, + "updatedAt": { + "type": "string", + "format": "datetime", + "description": "Timestamp of the documents last edit." + }, + "coverImage": { + "type": "blob", + "accept": [ + "image/*" + ], + "maxSize": 1000000, + "description": "Image to used for thumbnail or cover image. Less than 1MB is size." + }, + "bskyPostRef": { + "ref": "com.atproto.repo.strongRef", + "type": "ref", + "description": "Strong reference to a Bluesky post. Useful to keep track of comments off-platform." + }, + "description": { + "type": "string", + "maxLength": 30000, + "description": "A brief description or excerpt from the document.", + "maxGraphemes": 3000 + }, + "publishedAt": { + "type": "string", + "format": "datetime", + "description": "Timestamp of the documents publish time." + }, + "textContent": { + "type": "string", + "description": "Plaintext representation of the documents contents. Should not contain markdown or other formatting." + }, + "contributors": { + "type": "array", + "items": { + "ref": "#contributor", + "type": "ref" + } + } + } + }, + "description": "A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently." + }, + "contributor": { + "type": "object", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + }, + "role": { + "type": "string", + "maxLength": 1000, + "maxGraphemes": 100 + }, + "displayName": { + "type": "string", + "maxLength": 1000, + "maxGraphemes": 100 + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/site/standard/publication.json b/lexicons/site/standard/publication.json new file mode 100644 index 000000000..c9e3326b1 --- /dev/null +++ b/lexicons/site/standard/publication.json @@ -0,0 +1,73 @@ +{ + "id": "site.standard.publication", + "defs": { + "main": { + "key": "tid", + "type": "record", + "record": { + "type": "object", + "required": [ + "url", + "name" + ], + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path." + }, + "icon": { + "type": "blob", + "accept": [ + "image/*" + ], + "maxSize": 1000000, + "description": "Square image to identify the publication. Should be at least 256x256." + }, + "name": { + "type": "string", + "maxLength": 5000, + "description": "Name of the publication.", + "maxGraphemes": 500 + }, + "labels": { + "refs": [ + "com.atproto.label.defs#selfLabels" + ], + "type": "union", + "description": "Self-label values for this publication. Effectively content warnings." + }, + "basicTheme": { + "ref": "site.standard.theme.basic", + "type": "ref", + "description": "Simplified publication theme for tools and apps to utilize when displaying content." + }, + "description": { + "type": "string", + "maxLength": 30000, + "description": "Brief description of the publication.", + "maxGraphemes": 3000 + }, + "preferences": { + "ref": "#preferences", + "type": "ref", + "description": "Object containing platform specific preferences (with a few shared properties)." + } + } + }, + "description": "A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings." + }, + "preferences": { + "type": "object", + "properties": { + "showInDiscover": { + "type": "boolean", + "default": true, + "description": "Boolean which decides whether the publication should appear in discovery feeds." + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/site/standard/theme/basic.json b/lexicons/site/standard/theme/basic.json new file mode 100644 index 000000000..d0de900fd --- /dev/null +++ b/lexicons/site/standard/theme/basic.json @@ -0,0 +1,51 @@ +{ + "id": "site.standard.theme.basic", + "defs": { + "main": { + "key": "tid", + "type": "record", + "record": { + "type": "object", + "required": [ + "background", + "foreground", + "accent", + "accentForeground" + ], + "properties": { + "accent": { + "refs": [ + "site.standard.theme.color#rgb" + ], + "type": "union", + "description": "Color used for links and button backgrounds." + }, + "background": { + "refs": [ + "site.standard.theme.color#rgb" + ], + "type": "union", + "description": "Color used for content background." + }, + "foreground": { + "refs": [ + "site.standard.theme.color#rgb" + ], + "type": "union", + "description": "Color used for content text." + }, + "accentForeground": { + "refs": [ + "site.standard.theme.color#rgb" + ], + "type": "union", + "description": "Color used for button text." + } + } + }, + "description": "A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/site/standard/theme/color.json b/lexicons/site/standard/theme/color.json new file mode 100644 index 000000000..48ac1025a --- /dev/null +++ b/lexicons/site/standard/theme/color.json @@ -0,0 +1,63 @@ +{ + "id": "site.standard.theme.color", + "defs": { + "rgb": { + "type": "object", + "required": [ + "r", + "g", + "b" + ], + "properties": { + "b": { + "type": "integer", + "maximum": 255, + "minimum": 0 + }, + "g": { + "type": "integer", + "maximum": 255, + "minimum": 0 + }, + "r": { + "type": "integer", + "maximum": 255, + "minimum": 0 + } + } + }, + "rgba": { + "type": "object", + "required": [ + "r", + "g", + "b", + "a" + ], + "properties": { + "a": { + "type": "integer", + "maximum": 100, + "minimum": 0 + }, + "b": { + "type": "integer", + "maximum": 255, + "minimum": 0 + }, + "g": { + "type": "integer", + "maximum": 255, + "minimum": 0 + }, + "r": { + "type": "integer", + "maximum": 255, + "minimum": 0 + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/social/grain/defs.json b/lexicons/social/grain/defs.json new file mode 100644 index 000000000..f9356f586 --- /dev/null +++ b/lexicons/social/grain/defs.json @@ -0,0 +1,25 @@ +{ + "id": "social.grain.defs", + "defs": { + "aspectRatio": { + "type": "object", + "required": [ + "width", + "height" + ], + "properties": { + "width": { + "type": "integer", + "minimum": 1 + }, + "height": { + "type": "integer", + "minimum": 1 + } + }, + "description": "width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit." + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/social/grain/gallery.json b/lexicons/social/grain/gallery.json new file mode 100644 index 000000000..19814ebcb --- /dev/null +++ b/lexicons/social/grain/gallery.json @@ -0,0 +1,59 @@ +{ + "id": "social.grain.gallery", + "defs": { + "main": { + "key": "tid", + "type": "record", + "record": { + "type": "object", + "required": [ + "title", + "createdAt" + ], + "properties": { + "title": { + "type": "string", + "maxLength": 100 + }, + "facets": { + "type": "array", + "items": { + "ref": "app.bsky.richtext.facet", + "type": "ref" + }, + "description": "Annotations of description text (mentions, URLs, hashtags, etc)" + }, + "labels": { + "refs": [ + "com.atproto.label.defs#selfLabels" + ], + "type": "union", + "description": "Self-label values for this post. Effectively content warnings." + }, + "address": { + "ref": "community.lexicon.location.address", + "type": "ref" + }, + "location": { + "ref": "community.lexicon.location.hthree", + "type": "ref" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + }, + "description": { + "type": "string", + "maxLength": 1000 + } + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/lexicons/social/grain/photo.json b/lexicons/social/grain/photo.json new file mode 100644 index 000000000..15faf9213 --- /dev/null +++ b/lexicons/social/grain/photo.json @@ -0,0 +1,40 @@ +{ + "id": "social.grain.photo", + "defs": { + "main": { + "key": "tid", + "type": "record", + "record": { + "type": "object", + "required": [ + "photo", + "aspectRatio", + "createdAt" + ], + "properties": { + "alt": { + "type": "string", + "description": "Alt text description of the image, for accessibility." + }, + "photo": { + "type": "blob", + "accept": [ + "image/*" + ], + "maxSize": 1000000 + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "aspectRatio": { + "ref": "social.grain.defs#aspectRatio", + "type": "ref" + } + } + } + } + }, + "$type": "com.atproto.lexicon.schema", + "lexicon": 1 +} diff --git a/src/alf/util/flatten.test.ts b/src/alf/util/flatten.test.ts new file mode 100644 index 000000000..1329c1aa5 --- /dev/null +++ b/src/alf/util/flatten.test.ts @@ -0,0 +1,59 @@ +import {StyleSheet} from 'react-native' + +import {extractPadding} from './flatten' + +describe('extractPadding', () => { + it('defaults missing styles to zero', () => { + expect(extractPadding()).toEqual({ + paddingTop: 0, + paddingBottom: 0, + paddingLeft: 0, + paddingRight: 0, + }) + }) + + it('resolves nested style arrays with edge, axis, then shorthand precedence', () => { + const styles = StyleSheet.create({ + base: {padding: 12}, + axes: {paddingVertical: 8, paddingHorizontal: 10}, + edges: {paddingTop: 4, paddingRight: 6}, + }) + + expect( + extractPadding([styles.base, false, [styles.axes, styles.edges]]), + ).toEqual({ + paddingTop: 4, + paddingBottom: 8, + paddingLeft: 10, + paddingRight: 6, + }) + }) + + it('preserves explicit zero axis padding over shorthand padding', () => { + expect( + extractPadding({padding: 12, paddingVertical: 0, paddingHorizontal: 0}), + ).toEqual({ + paddingTop: 0, + paddingBottom: 0, + paddingLeft: 0, + paddingRight: 0, + }) + }) + + it('preserves explicit zero edges over axis and shorthand padding', () => { + expect( + extractPadding({ + padding: 12, + paddingVertical: 8, + paddingHorizontal: 10, + paddingTop: 0, + paddingRight: 0, + }), + ).toEqual({ + paddingTop: 0, + paddingBottom: 8, + paddingLeft: 10, + paddingRight: 0, + }) + }) +}) diff --git a/src/alf/util/flatten.ts b/src/alf/util/flatten.ts index b218c8879..823777534 100644 --- a/src/alf/util/flatten.ts +++ b/src/alf/util/flatten.ts @@ -40,13 +40,12 @@ interface PaddingStyle { * paddingTop/paddingBottom, etc.). Values are expected to be numbers — any * non-numeric `DimensionValue` (e.g. percentages) is treated as 0. */ -export function extractPadding(style: PaddingStyle | PaddingStyle[]) { +export function extractPadding(style?: StyleProp) { const s = flatten(style) - const base = num(s.padding) return { - paddingTop: num(s.paddingTop) || num(s.paddingVertical) || base, - paddingBottom: num(s.paddingBottom) || num(s.paddingVertical) || base, - paddingLeft: num(s.paddingLeft) || num(s.paddingHorizontal) || base, - paddingRight: num(s.paddingRight) || num(s.paddingHorizontal) || base, + paddingTop: num(s.paddingTop ?? s.paddingVertical ?? s.padding), + paddingBottom: num(s.paddingBottom ?? s.paddingVertical ?? s.padding), + paddingLeft: num(s.paddingLeft ?? s.paddingHorizontal ?? s.padding), + paddingRight: num(s.paddingRight ?? s.paddingHorizontal ?? s.padding), } } diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index 3ef437438..6e4bdcea0 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -229,7 +229,7 @@ export function Inner({ // note: flatten is required for some reason -sfn style={flatten([ a.relative, - a.rounded_md, + a.rounded_xl, a.w_full, a.border, t.atoms.bg, diff --git a/src/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow.tsx b/src/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow.tsx index d2ee4cf54..c91ccf14a 100644 --- a/src/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow.tsx +++ b/src/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow.tsx @@ -6,8 +6,8 @@ import {Trans} from '@lingui/react/macro' import {toNiceDomain} from '#/lib/strings/url-helpers' import {atoms as a, useTheme} from '#/alf' import { - matchStandardSitePublisher, - matchStandardSitePublisherByUri, + matchStandardSiteHostByPublication, + matchStandardSiteHostByUrl, } from '#/components/Post/Embed/StandardSiteEmbed/publishers' import type * as ssTypes from '#/components/Post/Embed/StandardSiteEmbed/types' import { @@ -24,7 +24,7 @@ export function StandardSiteMetaRow({ type?: 'document' | 'publication' }) { const t = useTheme() - const highlightedPublisher = !!matchStandardSitePublisher(view) + const highlightedPublisher = !!matchStandardSiteHostByPublication(view) const didsFromRecords = view.associatedRefs ?.filter( @@ -39,7 +39,7 @@ export function StandardSiteMetaRow({ ? view.associatedProfiles?.find(p => p.did === authorDid) : undefined const articleDomain = toNiceDomain(view.uri) - const articlePublisher = matchStandardSitePublisherByUri(view.uri) + const articlePublisher = matchStandardSiteHostByUrl(view.uri) const domainHandleMatch = authorProfile?.handle && (articleDomain === authorProfile.handle || diff --git a/src/components/Post/Embed/StandardSiteEmbed/index.tsx b/src/components/Post/Embed/StandardSiteEmbed/index.tsx index 6368bfb31..68d5f5132 100644 --- a/src/components/Post/Embed/StandardSiteEmbed/index.tsx +++ b/src/components/Post/Embed/StandardSiteEmbed/index.tsx @@ -18,7 +18,7 @@ import {Clock_Stroke2_Corner0_Rounded as Clock} from '#/components/icons/Clock' import {StandardSite} from '#/components/icons/community/StandardSite' import {Link, type LinkProps} from '#/components/Link' import {MediaInsetBorder} from '#/components/MediaInsetBorder' -import {matchStandardSitePublisher} from '#/components/Post/Embed/StandardSiteEmbed/publishers' +import {matchStandardSiteHostByPublication} from '#/components/Post/Embed/StandardSiteEmbed/publishers' import {StandardSiteMetaRow} from '#/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow' import {StandardSiteThemeProvider} from '#/components/Post/Embed/StandardSiteEmbed/StandardSiteThemeProvider' import type * as ssTypes from '#/components/Post/Embed/StandardSiteEmbed/types' @@ -464,7 +464,7 @@ export function SubscribeButton({ const {t: l} = useLingui() const haptics = useHaptics() - const highlightedPublisher = matchStandardSitePublisher(view) + const highlightedPublisher = matchStandardSiteHostByPublication(view) const cta = highlightedPublisher ? l`Subscribe on ${highlightedPublisher.name}` : l`View publication` diff --git a/src/components/Post/Embed/StandardSiteEmbed/publishers.ts b/src/components/Post/Embed/StandardSiteEmbed/publishers.ts index d85cea820..64af21efc 100644 --- a/src/components/Post/Embed/StandardSiteEmbed/publishers.ts +++ b/src/components/Post/Embed/StandardSiteEmbed/publishers.ts @@ -33,19 +33,20 @@ export function hostMatches(host: string, target: string): boolean { return host === target || host.endsWith('.' + target) } -function matchByHost(host: string | null): StandardSitePublisher | null { +function matchHostByDomain(url: string): StandardSitePublisher | null { + const host = hostFromUri(url) if (!host) return null return STANDARD_SITE_PUBLISHERS.find(p => hostMatches(host, p.host)) ?? null } -export function matchStandardSitePublisher( +export function matchStandardSiteHostByPublication( view: app.bsky.embed.external.ViewExternal, ): StandardSitePublisher | null { - return matchByHost(getStandardSitePublisherHost(view)) + return matchHostByDomain(view.uri) } -export function matchStandardSitePublisherByUri( - uri: string | undefined, +export function matchStandardSiteHostByUrl( + url: string | undefined, ): StandardSitePublisher | null { - return matchByHost(hostFromUri(uri)) + return matchHostByDomain(url || '') } diff --git a/src/components/atmosphere/SiteStandard/Document.tsx b/src/components/atmosphere/SiteStandard/Document.tsx new file mode 100644 index 000000000..c84940a2a --- /dev/null +++ b/src/components/atmosphere/SiteStandard/Document.tsx @@ -0,0 +1,186 @@ +import {type StyleProp, View, type ViewStyle} from 'react-native' +import {Image} from 'expo-image' +import {useLingui} from '@lingui/react/macro' + +import {useHaptics} from '#/lib/haptics' +import {shareUrl} from '#/lib/sharing' +import {toNiceDomain} from '#/lib/strings/url-helpers' +import {AtmosphereCardMenu} from '#/screens/Atmosphere/components/AtmosphereCardMenu' +import {atoms as a, useTheme, web} from '#/alf' +import {DocumentPublicationRow} from '#/components/atmosphere/SiteStandard/DocumentPublicationRow' +import {DocumentStats} from '#/components/atmosphere/SiteStandard/DocumentStats' +import {StandardSiteMetaRow} from '#/components/atmosphere/SiteStandard/StandardSiteMetaRow' +import type * as ssTypes from '#/components/atmosphere/SiteStandard/types' +import {Divider} from '#/components/Divider' +import {useInteractionState} from '#/components/hooks/useInteractionState' +import {Link} from '#/components/Link' +import {Text} from '#/components/Typography' +import {useAnalytics} from '#/analytics' +import {IS_NATIVE} from '#/env' +import {type app, site} from '#/lexicons' + +export function Document({ + preview, + view, + onEmbedInteractionCallback, + style, +}: ssTypes.PreviewProps & + ssTypes.PublicApiProps & { + view: app.bsky.embed.external.ViewArticle + style?: StyleProp + }) { + const ax = useAnalytics() + const {t: l} = useLingui() + const t = useTheme() + const haptics = useHaptics() + const niceUrl = toNiceDomain(view.uri) + const imageUri = view.image + const publisher = view.publisher + const hasMedia = Boolean(imageUri) + /* + * The menu is a sibling of the article link, not inside it, since + * interactive elements can't nest in one. With no image to hold it, content + * that would sit under it is padded away. + */ + const hasMenu = !preview + const menuClearance = hasMenu && !hasMedia && a.pr_5xl + + const { + state: interacted, + onIn: onInteract, + onOut: onInteractOut, + } = useInteractionState() + const onPress = () => { + haptics.tap() + onEmbedInteractionCallback?.() + ax.metric('embed:standardSite:article:press', {url: view.uri}) + } + const onLongPress = IS_NATIVE + ? () => { + if (view.uri) { + haptics.longPress() + void shareUrl(view.uri) + ax.metric('embed:standardSite:article:longPress', {url: view.uri}) + } + } + : undefined + + return ( + + {/* + * The article is an in-flow `Link` wrapping the content so the iOS peek + * menu has something to lift. + */} + + {({pressed}) => ( + + {imageUri ? ( + + ) : undefined} + + + + {publisher && ( + + )} + + + {view.title} + + {view.description ? ( + + {view.description} + + ) : undefined} + + + + + + + {!publisher && ( + + + + + + + )} + + )} + + + {hasMenu && ( + + )} + + ) +} diff --git a/src/components/atmosphere/SiteStandard/DocumentCompact.test.tsx b/src/components/atmosphere/SiteStandard/DocumentCompact.test.tsx new file mode 100644 index 000000000..8e2205a75 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/DocumentCompact.test.tsx @@ -0,0 +1,95 @@ +import {render} from '@testing-library/react-native' + +import {type app} from '#/lexicons' +import {DocumentCompact, DocumentCompactCard} from './DocumentCompact' + +const mockMenu = jest.fn( + () => null, +) + +jest.mock('@lingui/react', () => ({ + useLingui: () => ({_: (value: {message: string}) => value.message}), +})) +jest.mock('#/alf', () => ({ + atoms: new Proxy( + {}, + { + // Real card padding so caller overrides conflict with the default. + get: (_, name) => (name === 'p_md' ? {padding: 12} : {}), + }, + ), + extractPadding: + jest.requireActual( + '#/alf/util/flatten', + ).extractPadding, + useTheme: () => ({atoms: new Proxy({}, {get: () => ({})})}), + web: () => undefined, +})) +jest.mock('#/env', () => ({IS_NATIVE: false})) +jest.mock('#/analytics', () => ({useAnalytics: () => ({metric: jest.fn()})})) +jest.mock('#/lib/haptics', () => ({ + useHaptics: () => ({tap: jest.fn(), longPress: jest.fn()}), +})) +jest.mock('#/lib/sharing', () => ({shareUrl: jest.fn()})) +jest.mock('expo-image', () => ({Image: () => null})) +jest.mock('#/components/Link', () => ({ + Link: ({children}: {children: React.ReactNode}) => children, +})) +jest.mock('#/components/Typography', () => ({Text: () => null})) +jest.mock( + '#/components/atmosphere/SiteStandard/DocumentPublicationRow', + () => ({ + DocumentPublicationRow: () => null, + }), +) +jest.mock('#/components/atmosphere/SiteStandard/DocumentStats', () => ({ + DocumentStats: () => null, +})) +jest.mock('#/screens/Atmosphere/components/AtmosphereCardMenu', () => ({ + AtmosphereCardMenu: (props: {offsetY?: number; offsetX?: number}) => + mockMenu(props), +})) + +const view = { + uri: 'https://example.com/post', + title: 'Title', +} as unknown as app.bsky.embed.external.ViewArticle + +const menuOffsets = () => { + const {offsetY, offsetX} = mockMenu.mock.calls[0][0] + return {offsetY, offsetX} +} + +beforeEach(() => mockMenu.mockClear()) + +it.each([DocumentCompact, DocumentCompactCard])( + 'aligns the menu with the container padding (%p)', + Component => { + render( + , + ) + + expect(menuOffsets()).toEqual({offsetY: 8, offsetX: 20}) + }, +) + +it('aligns the card menu with its default padding', () => { + render() + + expect(menuOffsets()).toEqual({offsetY: 12, offsetX: 12}) +}) + +it('aligns the card menu with a caller padding override', () => { + render() + + expect(menuOffsets()).toEqual({offsetY: 2, offsetX: 2}) +}) + +it('hides the menu in preview', () => { + render() + + expect(mockMenu).not.toHaveBeenCalled() +}) diff --git a/src/components/atmosphere/SiteStandard/DocumentCompact.tsx b/src/components/atmosphere/SiteStandard/DocumentCompact.tsx new file mode 100644 index 000000000..c93833a57 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/DocumentCompact.tsx @@ -0,0 +1,201 @@ +import {type StyleProp, View, type ViewStyle} from 'react-native' +import {Image} from 'expo-image' +import {useLingui} from '@lingui/react/macro' + +import {useHaptics} from '#/lib/haptics' +import {shareUrl} from '#/lib/sharing' +import {toNiceDomain} from '#/lib/strings/url-helpers' +import {AtmosphereCardMenu} from '#/screens/Atmosphere/components/AtmosphereCardMenu' +import {atoms as a, extractPadding, useTheme, web} from '#/alf' +import {DocumentPublicationRow} from '#/components/atmosphere/SiteStandard/DocumentPublicationRow' +import {DocumentStats} from '#/components/atmosphere/SiteStandard/DocumentStats' +import type * as ssTypes from '#/components/atmosphere/SiteStandard/types' +import {useInteractionState} from '#/components/hooks/useInteractionState' +import {Link} from '#/components/Link' +import {Text} from '#/components/Typography' +import {useAnalytics} from '#/analytics' +import {IS_NATIVE} from '#/env' +import {type app, site} from '#/lexicons' + +type DocumentCompactProps = ssTypes.PreviewProps & + ssTypes.PublicApiProps & { + view: app.bsky.embed.external.ViewArticle + /** + * Applied to the outer wrapper around the article link and its menu, so + * outer layout (margins, flex) moves both together. + */ + style?: StyleProp + /** + * Insets the article content and its independent menu. Padding stays + * inside the article link's hit area. The menu follows the resolved + * padding. Use this, not `style`, to inset rows in a list. + */ + containerStyle?: StyleProp + } + +/** + * Fills its host column with no outer padding, border, or rounding of its own. + */ +export function DocumentCompact(props: DocumentCompactProps) { + return +} + +/** + * The framed presentation: bordered, rounded, and inset. + */ +export function DocumentCompactCard({ + containerStyle, + ...props +}: DocumentCompactProps) { + return ( + + ) +} + +function DocumentCompactBase({ + card, + preview, + view, + onEmbedInteractionCallback, + style, + containerStyle, +}: DocumentCompactProps & {card: boolean}) { + const ax = useAnalytics() + const {t: l} = useLingui() + const t = useTheme() + const haptics = useHaptics() + const niceUrl = toNiceDomain(view.uri) + const publisher = view.publisher + const {paddingTop, paddingRight} = extractPadding(containerStyle) + /* A sibling of the article link; interactive elements can't nest in one. */ + const hasMenu = !preview + const { + state: interacted, + onIn: onInteract, + onOut: onInteractOut, + } = useInteractionState() + + const onPress = () => { + haptics.tap() + onEmbedInteractionCallback?.() + ax.metric('embed:standardSite:article:press', {url: view.uri}) + } + const onLongPress = IS_NATIVE + ? () => { + if (view.uri) { + haptics.longPress() + void shareUrl(view.uri) + ax.metric('embed:standardSite:article:longPress', {url: view.uri}) + } + } + : undefined + + return ( + + + + + {!!publisher && ( + + {publisher && } + + )} + + + + + {view.title} + + {!!view.description && ( + + {view.description} + + )} + + + {!!view.image && ( + + )} + + + + + + + + {hasMenu && ( + + )} + + ) +} diff --git a/src/components/atmosphere/SiteStandard/DocumentPublicationRow.tsx b/src/components/atmosphere/SiteStandard/DocumentPublicationRow.tsx new file mode 100644 index 000000000..85e94d7d0 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/DocumentPublicationRow.tsx @@ -0,0 +1,34 @@ +import {type StyleProp, View, type ViewStyle} from 'react-native' + +import {atoms as a, useTheme} from '#/alf' +import {PublicationIcon} from '#/components/atmosphere/SiteStandard/PublicationIcon' +import {Text} from '#/components/Typography' +import {type app} from '#/lexicons' + +export function DocumentPublicationRow({ + view, + style, +}: { + view: app.bsky.embed.external.ViewArticlePublication + style?: StyleProp +}) { + const t = useTheme() + + return ( + + + + {view.title} + + + ) +} diff --git a/src/components/atmosphere/SiteStandard/DocumentStats.tsx b/src/components/atmosphere/SiteStandard/DocumentStats.tsx new file mode 100644 index 000000000..5d66fe6f8 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/DocumentStats.tsx @@ -0,0 +1,57 @@ +import {View} from 'react-native' +import {plural} from '@lingui/core/macro' +import {useLingui} from '@lingui/react/macro' + +import {niceDate} from '#/lib/strings/time' +import {formatCount} from '#/view/com/util/numeric/format' +import {atoms as a, useTheme} from '#/alf' +import {Clock_Stroke2_Corner0_Rounded as Clock} from '#/components/icons/Clock' +import {Heart2_Stroke2_Corner0_Rounded as Heart} from '#/components/icons/Heart2' +import {Text} from '#/components/Typography' +import {type app} from '#/lexicons' + +export function DocumentStats({ + view, +}: { + view: app.bsky.embed.external.ViewArticle +}) { + const {t: l, i18n} = useLingui() + const t = useTheme() + const likeCount = view.likeCount + + if (!(view.createdAt || likeCount || view.readingTime)) return null + + return ( + + {view.createdAt && ( + + {niceDate(i18n, view.createdAt, 'long', 'none')} + + )} + {!!likeCount && ( + + + + {formatCount(i18n, likeCount)} + + + )} + {!!view.readingTime && ( + + + + {l({ + message: plural(view.readingTime, { + one: '#m', + other: '#m', + }), + comment: `How long it takes to read an article, in minutes. Displayed in a short form, e.g. "5m" for 5 minutes.`, + })} + + + )} + + ) +} diff --git a/src/components/atmosphere/SiteStandard/Publication.test.tsx b/src/components/atmosphere/SiteStandard/Publication.test.tsx new file mode 100644 index 000000000..7e85ad437 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/Publication.test.tsx @@ -0,0 +1,182 @@ +import {render, screen} from '@testing-library/react-native' + +import {type app} from '#/lexicons' +import {Publication, PublicationCard} from './Publication' + +const mockMenu = jest.fn< + void, + [{author?: object; offsetY?: number; offsetX?: number}] +>() + +jest.mock('@lingui/react', () => { + const {i18n} = + jest.requireActual('@lingui/core') + i18n.loadAndActivate({locale: 'en', messages: {}}) + return {useLingui: () => ({_: i18n._.bind(i18n), i18n})} +}) +jest.mock('#/alf', () => ({ + atoms: new Proxy( + {}, + { + // Real card padding so caller overrides conflict with the default. + get: (_, name) => (name === 'p_md' ? {padding: 12} : {}), + }, + ), + extractPadding: + jest.requireActual( + '#/alf/util/flatten', + ).extractPadding, + useTheme: () => ({atoms: new Proxy({}, {get: () => ({})})}), + web: () => undefined, +})) +jest.mock('#/env', () => ({IS_NATIVE: false})) +jest.mock('#/analytics', () => ({useAnalytics: () => ({metric: jest.fn()})})) +jest.mock('#/lib/haptics', () => ({ + useHaptics: () => ({tap: jest.fn(), longPress: jest.fn()}), +})) +jest.mock('#/lib/sharing', () => ({shareUrl: jest.fn()})) +jest.mock('#/components/Link', () => ({ + Link: ({ + children, + }: { + children: (state: {pressed: boolean}) => React.ReactNode + }) => { + const {View} = + jest.requireActual('react-native') + return {children({pressed: false})} + }, +})) +jest.mock('#/components/AvatarStack', () => ({ + AvatarStack: () => { + const {View} = + jest.requireActual('react-native') + return + }, +})) +jest.mock('#/components/Typography', () => ({ + Text: ({children}: {children?: React.ReactNode}) => { + const {Text: HostText} = + jest.requireActual('react-native') + return {children} + }, +})) +jest.mock('#/components/atmosphere/SiteStandard/PublicationIcon', () => ({ + PublicationIcon: () => null, +})) +jest.mock('#/components/atmosphere/SiteStandard/StandardSiteMetaRow', () => ({ + StandardSiteMetaRow: () => null, +})) +jest.mock('#/screens/Atmosphere/components/AtmosphereCardMenu', () => ({ + AtmosphereCardMenu: (props: {author?: object; offsetY?: number}) => { + mockMenu(props) + return null + }, +})) + +const owner: app.bsky.actor.defs.ProfileViewBasic = { + did: 'did:plc:ewvi7nxzyoun6zhxrhs64oiz', + handle: 'owner.test', +} +const view = { + uri: 'https://example.com', + title: 'Title', + description: 'Description', +} satisfies app.bsky.embed.external.ViewArticlePublication + +const menuOffsets = () => { + const {offsetY, offsetX} = mockMenu.mock.calls[0][0] + return {offsetY, offsetX} +} + +beforeEach(() => mockMenu.mockClear()) + +describe('Publication', () => { + it.each([Publication, PublicationCard])( + 'aligns the menu with the container padding (%p)', + Component => { + render( + , + ) + + expect(menuOffsets()).toEqual({offsetY: 8, offsetX: 20}) + }, + ) + + it('shows the subscriber avatars only when there are subscribers', () => { + const {rerender} = render() + expect(screen.queryByTestId('avatarStack')).toBeNull() + + rerender() + expect(screen.getByTestId('avatarStack')).toBeTruthy() + }) + + it.each([ + [1, '1 subscriber'], + [2, '2 subscribers'], + [12345, '12.3K subscribers'], + ])('pluralizes the subscription count (%s)', (subscriptionCount, text) => { + render() + + expect(screen.getByText(text)).toBeTruthy() + }) + + it('omits the subscriber row when there are no subscriptions', () => { + render() + + expect(screen.queryByText(/subscriber/)).toBeNull() + expect(screen.queryByTestId('avatarStack')).toBeNull() + }) + + it('names the host of a hosted publication without subscribers', () => { + // Hosted publications hide their domain, so this is the only host name + render() + + expect(screen.getByText('Powered by Leaflet')).toBeTruthy() + }) + + it('hides the menu in preview', () => { + render() + + expect(mockMenu).not.toHaveBeenCalled() + }) + + it('gives the menu the profile whose repo holds the publication record', () => { + const other: app.bsky.actor.defs.ProfileViewBasic = { + did: 'did:plc:other', + handle: 'other.test', + } + render( + , + ) + + expect(mockMenu.mock.calls[0][0].author).toBe(owner) + }) +}) + +describe('PublicationCard', () => { + it('aligns the menu with its default padding', () => { + render() + + expect(menuOffsets()).toEqual({offsetY: 12, offsetX: 12}) + }) + + it('aligns the menu with a caller padding override', () => { + render() + + expect(menuOffsets()).toEqual({offsetY: 2, offsetX: 2}) + }) +}) diff --git a/src/components/atmosphere/SiteStandard/Publication.tsx b/src/components/atmosphere/SiteStandard/Publication.tsx new file mode 100644 index 000000000..c715ae386 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/Publication.tsx @@ -0,0 +1,234 @@ +import {type StyleProp, View, type ViewStyle} from 'react-native' +import {AtUri} from '@atproto/syntax' +import {plural} from '@lingui/core/macro' +import {useLingui} from '@lingui/react/macro' + +import {useHaptics} from '#/lib/haptics' +import {shareUrl} from '#/lib/sharing' +import {formatCount} from '#/view/com/util/numeric/format' +import {AtmosphereCardMenu} from '#/screens/Atmosphere/components/AtmosphereCardMenu' +import {atoms as a, extractPadding, useTheme, web} from '#/alf' +import {PublicationIcon} from '#/components/atmosphere/SiteStandard/PublicationIcon' +import {matchStandardSiteHostByUrl} from '#/components/atmosphere/SiteStandard/publishers' +import {StandardSiteMetaRow} from '#/components/atmosphere/SiteStandard/StandardSiteMetaRow' +import type * as ssTypes from '#/components/atmosphere/SiteStandard/types' +import {isStandardSitePublicationUri} from '#/components/atmosphere/SiteStandard/utils' +import {AvatarStack} from '#/components/AvatarStack' +import {useInteractionState} from '#/components/hooks/useInteractionState' +import {Link} from '#/components/Link' +import {Text} from '#/components/Typography' +import {useAnalytics} from '#/analytics' +import {IS_NATIVE} from '#/env' +import {type app, site} from '#/lexicons' + +type PublicationProps = ssTypes.PreviewProps & + ssTypes.PublicApiProps & { + view: app.bsky.embed.external.ViewArticlePublication + /** + * Applied to the outer frame. + */ + style?: StyleProp + /** + * Insets the content and its independent menu. Padding stays inside the + * link's hit area. The menu follows the resolved padding. Use this, not + * `style`, to inset rows in a list. + */ + containerStyle?: StyleProp + } + +/** + * Fills its host column with no outer padding, border, or rounding of its own. + */ +export function Publication(props: PublicationProps) { + return +} + +/** + * The framed presentation: bordered, rounded, filled, and inset. + */ +export function PublicationCard({containerStyle, ...props}: PublicationProps) { + return ( + + ) +} + +function PublicationBase({ + card, + preview, + view, + onEmbedInteractionCallback, + style, + containerStyle, +}: PublicationProps & {card: boolean}) { + const ax = useAnalytics() + const t = useTheme() + const {t: l, i18n} = useLingui() + const haptics = useHaptics() + const {paddingTop, paddingRight} = extractPadding(containerStyle) + /* A sibling of the link; interactive elements can't nest in one. */ + const hasMenu = !preview + const { + state: interacted, + onIn: onInteract, + onOut: onInteractOut, + } = useInteractionState() + + /* The publication's owner is the repo that holds its publication record. */ + const publicationRef = view.associatedRefs?.find(isStandardSitePublicationUri) + const authorDid = publicationRef && new AtUri(publicationRef.uri).host + const author = authorDid + ? view.associatedProfiles?.find(p => p.did === authorDid) + : undefined + const articlePublisher = matchStandardSiteHostByUrl(view.uri) + const hasSubscribers = !!view.subscribers?.length || !!view.subscriptionCount + + const onPress = () => { + haptics.tap() + onEmbedInteractionCallback?.() + ax.metric('embed:standardSite:publication:press', {url: view.uri}) + } + const onLongPress = IS_NATIVE + ? () => { + haptics.longPress() + void shareUrl(view.uri) + ax.metric('embed:standardSite:publication:longPress', {url: view.uri}) + } + : undefined + + return ( + + + {({pressed}) => ( + + + + + + + {view.title} + + + + + + + {!!view.description && ( + + {view.description} + + )} + + {(hasSubscribers || !!articlePublisher) && ( + + {!!view.subscribers?.length && ( + + )} + {!!view.subscriptionCount && ( + + {l({ + message: plural(view.subscriptionCount, { + one: `${formatCount(i18n, view.subscriptionCount)} subscriber`, + other: `${formatCount(i18n, view.subscriptionCount)} subscribers`, + }), + comment: + 'Number of people subscribed to a publication.', + })} + + )} + + {!!articlePublisher && ( + + {hasSubscribers ? ' • ' : ''} + {l`Powered by ${articlePublisher.name}`} + + )} + + )} + + + )} + + + {hasMenu && ( + + )} + + ) +} diff --git a/src/components/atmosphere/SiteStandard/PublicationIcon.tsx b/src/components/atmosphere/SiteStandard/PublicationIcon.tsx new file mode 100644 index 000000000..662c46468 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/PublicationIcon.tsx @@ -0,0 +1,59 @@ +import {View} from 'react-native' + +import {UserAvatar} from '#/view/com/util/UserAvatar' +import {atoms as a, useTheme} from '#/alf' +import {getPublicationTheme} from '#/components/atmosphere/SiteStandard/utils' +import {MediaInsetBorder} from '#/components/MediaInsetBorder' +import {Text} from '#/components/Typography' +import {type app} from '#/lexicons' + +/** Below this size, the standard corner radius looks too round. */ +const SMALL_SIZE = 28 + +export function PublicationIcon({ + view, + size, +}: { + view: app.bsky.embed.external.ViewArticlePublication + size: number + interacted?: boolean +}) { + const t = useTheme() + const theme = getPublicationTheme(view) + const rounded = size < SMALL_SIZE ? a.rounded_xs : a.rounded_sm + return view.logo ? ( + + + + + ) : ( + + + {[...view.title][0] ?? ''} + + + + ) +} diff --git a/src/components/atmosphere/SiteStandard/StandardSiteMetaRow.tsx b/src/components/atmosphere/SiteStandard/StandardSiteMetaRow.tsx new file mode 100644 index 000000000..a35a08152 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/StandardSiteMetaRow.tsx @@ -0,0 +1,93 @@ +import {Fragment, type ReactNode} from 'react' +import {View} from 'react-native' +import {AtUri} from '@atproto/syntax' +import {Trans} from '@lingui/react/macro' + +import {toNiceDomain} from '#/lib/strings/url-helpers' +import {atoms as a, useTheme} from '#/alf' +import {matchStandardSiteHostByUrl} from '#/components/atmosphere/SiteStandard/publishers' +import type * as ssTypes from '#/components/atmosphere/SiteStandard/types' +import { + isStandardSiteDocumentUri, + isStandardSitePublicationUri, +} from '#/components/atmosphere/SiteStandard/utils' +import {ChainLink_Stroke2_Corner0_Rounded as ChainLinkIcon} from '#/components/icons/ChainLink' +import {Text} from '#/components/Typography' +import {type app} from '#/lexicons' + +export function StandardSiteMetaRow({ + type = 'document', + view, +}: ssTypes.PreviewProps & { + view: + | app.bsky.embed.external.ViewArticle + | app.bsky.embed.external.ViewArticlePublication + type?: 'document' | 'publication' +}) { + const t = useTheme() + const didsFromRecords = + view.associatedRefs + ?.filter( + type === 'document' + ? isStandardSiteDocumentUri + : isStandardSitePublicationUri, + ) + .map(ref => new AtUri(ref.uri).host) || [] + // atm should only be one docment + const authorDid = didsFromRecords.at(0) + const authorProfile = authorDid + ? view.associatedProfiles?.find(p => p.did === authorDid) + : undefined + const articleDomain = toNiceDomain(view.uri) + const articlePublisher = matchStandardSiteHostByUrl(view.uri) + const highlightedPublisher = type === 'publication' && !!articlePublisher + const domainHandleMatch = + authorProfile?.handle && + (articleDomain === authorProfile.handle || + articleDomain.endsWith(`.${authorProfile.handle}`)) + const metaTextStyle = [ + a.text_xs, + a.leading_tight, + t.atoms.text_contrast_medium, + ] + + const items: {key: string; node: ReactNode}[] = [] + + if (authorProfile) { + items.push({ + key: 'author', + node: ( + + by @{authorProfile.handle} + + ), + }) + } + + if (!highlightedPublisher && !domainHandleMatch) { + items.push({ + key: 'domain', + node: ( + + + + {articleDomain} + + + ), + }) + } + + if (items.length === 0) return null + + return ( + + {items.map((item, i) => ( + + {i > 0 && •} + {item.node} + + ))} + + ) +} diff --git a/src/components/atmosphere/SiteStandard/StandardSiteThemeProvider.tsx b/src/components/atmosphere/SiteStandard/StandardSiteThemeProvider.tsx new file mode 100644 index 000000000..138a0ad91 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/StandardSiteThemeProvider.tsx @@ -0,0 +1,62 @@ +import {Context, useAlf, utils} from '#/alf' +import {getPublicationTheme} from '#/components/atmosphere/SiteStandard/utils' +import {type app} from '#/lexicons' + +/** + * Overrides only the values needed for `secondary_inverted` buttons atm. + * + * Renders the alf Context directly (rather than nesting a ThemeProvider) so + * that font-scale and other parent state stay live in the subtree. + */ +export function StandardSiteThemeProvider({ + view, + children, +}: { + view: app.bsky.embed.external.ViewArticlePublication + children: React.ReactNode +}) { + const alf = useAlf() + const theme = getPublicationTheme(view) + if (!theme) return children + + const {accent, accentForeground} = theme + const atomsOverride = { + text_inverted: {color: accentForeground}, + } + const paletteOverride = { + contrast_975: utils.darken(accent, 5), // hover + contrast_900: accent, // bg + contrast_600: utils.lighten(accent, 5), // disabled bg + contrast_300: accentForeground, // disabled text + } + + const themes = { + ...alf.themes, + lightPalette: {...alf.themes.lightPalette, ...paletteOverride}, + darkPalette: {...alf.themes.darkPalette, ...paletteOverride}, + dimPalette: {...alf.themes.dimPalette, ...paletteOverride}, + light: { + ...alf.themes.light, + atoms: {...alf.themes.light.atoms, ...atomsOverride}, + palette: {...alf.themes.light.palette, ...paletteOverride}, + }, + dark: { + ...alf.themes.dark, + atoms: {...alf.themes.dark.atoms, ...atomsOverride}, + palette: {...alf.themes.dark.palette, ...paletteOverride}, + }, + dim: { + ...alf.themes.dim, + atoms: {...alf.themes.dim.atoms, ...atomsOverride}, + palette: {...alf.themes.dim.palette, ...paletteOverride}, + }, + } + + const value = { + ...alf, + themes, + theme: themes[alf.themeName], + } + + return {children} +} diff --git a/src/components/atmosphere/SiteStandard/Storybook.tsx b/src/components/atmosphere/SiteStandard/Storybook.tsx new file mode 100644 index 000000000..ac0f8c8c1 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/Storybook.tsx @@ -0,0 +1,100 @@ +import {View} from 'react-native' + +import {atoms as a} from '#/alf' +import {Document} from '#/components/atmosphere/SiteStandard/Document' +import { + DocumentCompact, + DocumentCompactCard, +} from '#/components/atmosphere/SiteStandard/DocumentCompact' +import { + Publication, + PublicationCard, +} from '#/components/atmosphere/SiteStandard/Publication' +import {H1, H2} from '#/components/Typography' +import {type app, site} from '#/lexicons' + +const IMAGE = + 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGklEQVR42mOQ9bsBRLpX9gMRAwoHQkGEUDgAaFoYGUn9uwMAAAAASUVORK5CYII=' + +const author = { + did: 'did:plc:abcdefghijklmnopqrstuvwx', + handle: 'riley.example.com', + displayName: 'Riley Rivers', +} satisfies app.bsky.actor.defs.ProfileViewBasic + +const publication = { + uri: 'https://example.com/field-notes', + title: 'Field Notes', + description: 'Small observations about nature, design, and everyday life.', + logo: IMAGE, + associatedRefs: [ + { + uri: `at://${author.did}/${site.standard.publication.$type}/storybook`, + cid: 'bafyreicl6ujc6ncfktctxxroxognfn7d2fqavvrryoc2lv6m4i6hpbkfti', + }, + ], + associatedProfiles: [author], +} satisfies app.bsky.embed.external.ViewArticlePublication + +const document = { + uri: 'https://example.com/field-notes/looking-closely', + title: 'The art of looking closely', + description: + 'A walk around the neighborhood reveals a whole world hiding in plain sight.', + image: IMAGE, + createdAt: '2026-01-15T12:00:00.000Z', + readingTime: 5, + likeCount: 23, + publisher: publication, + associatedRefs: [ + { + uri: `at://${author.did}/${site.standard.document.$type}/storybook`, + cid: 'bafyreig3yg2msah74sgvow25uxddqbabex3f3mh6hysess3w5kmgiv6zqy', + }, + ...publication.associatedRefs, + ], + associatedProfiles: [author], +} satisfies app.bsky.embed.external.ViewArticle + +export function SiteStandardStorybook() { + return ( + +

SiteStandard v2

+ + +

Document compact

+ +
+ + +

Document compact card

+ +
+ + +

Document compact with containerStyle

+ +
+ + +

Document

+ +
+ + +

Publication

+ +
+ + +

Publication card

+ +
+ + +

Publication with containerStyle

+ +
+
+ ) +} diff --git a/src/components/atmosphere/SiteStandard/index.ts b/src/components/atmosphere/SiteStandard/index.ts new file mode 100644 index 000000000..968d3dc62 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/index.ts @@ -0,0 +1,9 @@ +export {Document} from '#/components/atmosphere/SiteStandard/Document' +export { + DocumentCompact, + DocumentCompactCard, +} from '#/components/atmosphere/SiteStandard/DocumentCompact' +export { + Publication, + PublicationCard, +} from '#/components/atmosphere/SiteStandard/Publication' diff --git a/src/components/atmosphere/SiteStandard/publishers.ts b/src/components/atmosphere/SiteStandard/publishers.ts new file mode 100644 index 000000000..55c2471e8 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/publishers.ts @@ -0,0 +1,46 @@ +import {Leaflet} from '#/components/icons/community/Leaflet' +import {Offprint} from '#/components/icons/community/Offprint' +import {Pckt} from '#/components/icons/community/Pckt' +import {type app} from '#/lexicons' + +export type StandardSiteHost = { + domain: string + name: string + Icon: typeof Leaflet +} + +const STANDARD_SITE_HOSTS: StandardSiteHost[] = [ + {domain: 'leaflet.pub', name: 'Leaflet', Icon: Leaflet}, + {domain: 'pckt.blog', name: 'pckt', Icon: Pckt}, + {domain: 'offprint.app', name: 'Offprint', Icon: Offprint}, +] + +function domainFromUrl(uri: string | undefined): string | null { + try { + return new URL(uri || '').host + } catch { + return null + } +} + +function domainMatches(subject: string, predicate: string): boolean { + return subject === predicate || subject.endsWith('.' + predicate) +} + +function matchHostByDomain(url: string): StandardSiteHost | null { + const domain = domainFromUrl(url) + if (!domain) return null + return STANDARD_SITE_HOSTS.find(p => domainMatches(domain, p.domain)) ?? null +} + +export function matchStandardSiteHostByPublication( + view: app.bsky.embed.external.ViewArticlePublication, +): StandardSiteHost | null { + return matchHostByDomain(view.uri) +} + +export function matchStandardSiteHostByUrl( + url: string | undefined, +): StandardSiteHost | null { + return matchHostByDomain(url || '') +} diff --git a/src/components/atmosphere/SiteStandard/types.ts b/src/components/atmosphere/SiteStandard/types.ts new file mode 100644 index 000000000..8c360aaf1 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/types.ts @@ -0,0 +1,14 @@ +export type PreviewProps = { + /** + * Indicates the card is showing the composer. Interactive elements should be + * disabled when this value is true. + */ + preview?: boolean +} + +export type PublicApiProps = { + /** + * Passed down from feed contexts etc, used to fire off interaction tracking + */ + onEmbedInteractionCallback?: () => void +} diff --git a/src/components/atmosphere/SiteStandard/utils.test.ts b/src/components/atmosphere/SiteStandard/utils.test.ts new file mode 100644 index 000000000..634364765 --- /dev/null +++ b/src/components/atmosphere/SiteStandard/utils.test.ts @@ -0,0 +1,109 @@ +import {type app, type com, site} from '#/lexicons' +import { + getPublicationTheme, + isStandardSiteDocumentUri, + isStandardSiteEmbed, + isStandardSitePublicationUri, +} from './utils' + +const CID = 'bafyreicl6ujc6ncfktctxxroxognfn7d2fqavvrryoc2lv6m4i6hpbkfti' + +function ref(collection: string): com.atproto.repo.strongRef.Main { + return {uri: `at://did:plc:abc/${collection}/foo`, cid: CID} +} + +function makeArticle( + partial: Partial = {}, +): app.bsky.embed.external.ViewArticle { + return { + uri: 'https://example.com/post', + title: 'title', + description: 'description', + ...partial, + } +} + +describe('isStandardSiteEmbed', () => { + it('returns true when any associated ref is in the site.standard namespace', () => { + expect( + isStandardSiteEmbed( + makeArticle({ + associatedRefs: [ref(site.standard.publication.$type)], + }), + ), + ).toBe(true) + }) + + it('returns false for unrelated associated refs', () => { + expect( + isStandardSiteEmbed( + makeArticle({associatedRefs: [ref('app.bsky.feed.post')]}), + ), + ).toBe(false) + }) + + it('returns falsy when associatedRefs is missing', () => { + expect(isStandardSiteEmbed(makeArticle())).toBeFalsy() + }) +}) + +describe('StandardSite record refs', () => { + it('matches the exact document collection', () => { + expect(isStandardSiteDocumentUri(ref(site.standard.document.$type))).toBe( + true, + ) + expect( + isStandardSiteDocumentUri(ref(`${site.standard.document.$type}.other`)), + ).toBe(false) + }) + + it('matches the exact publication collection', () => { + expect( + isStandardSitePublicationUri(ref(site.standard.publication.$type)), + ).toBe(true) + expect( + isStandardSitePublicationUri( + ref(`${site.standard.publication.$type}.other`), + ), + ).toBe(false) + }) +}) + +describe('getPublicationTheme', () => { + function publication( + theme?: app.bsky.embed.external.ViewArticlePublicationTheme, + ): app.bsky.embed.external.ViewArticlePublication { + return { + uri: 'https://example.com', + title: 'Publication', + description: '', + theme, + } + } + + it('reads and normalizes the new hex colors', () => { + const theme = {accent: '#123456', accentForeground: '#fff'} + expect(getPublicationTheme(publication(theme))).toEqual({ + accent: '#123456', + accentForeground: '#ffffff', + }) + }) + + it('keeps theme colors opaque so the contrast check matches the rendering', () => { + expect( + getPublicationTheme( + publication({accent: '#12345600', accentForeground: '#ffffffff'}), + ), + ).toEqual({accent: '#123456', accentForeground: '#ffffff'}) + }) + + it.each([ + undefined, + {}, + {accent: '#123456'}, + {accent: 'invalid', accentForeground: '#ffffff'}, + {accent: '#123456', accentForeground: '#nope'}, + ])('keeps ALF defaults for an absent or invalid pair: %j', theme => { + expect(getPublicationTheme(publication(theme))).toBeUndefined() + }) +}) diff --git a/src/components/atmosphere/SiteStandard/utils.ts b/src/components/atmosphere/SiteStandard/utils.ts new file mode 100644 index 000000000..a4639306f --- /dev/null +++ b/src/components/atmosphere/SiteStandard/utils.ts @@ -0,0 +1,41 @@ +import {AtUri} from '@atproto/syntax' + +import {hexToRgb, rgbToHex} from '#/alf/util/colorGeneration' +import {type app, type com, site} from '#/lexicons' + +export function isStandardSiteDocumentUri( + ref: com.atproto.repo.strongRef.Main, +) { + return new AtUri(ref.uri).collection === site.standard.document.$type +} + +export function isStandardSitePublicationUri( + ref: com.atproto.repo.strongRef.Main, +) { + return new AtUri(ref.uri).collection === site.standard.publication.$type +} + +export function isStandardSiteUri(ref: com.atproto.repo.strongRef.Main) { + return new AtUri(ref.uri).collection.startsWith('site.standard.') +} + +export function isStandardSiteEmbed( + view: + | app.bsky.embed.external.ViewArticle + | app.bsky.embed.external.ViewArticlePublication, +) { + return view.associatedRefs?.some(ref => isStandardSiteUri(ref)) +} + +/** Normalizes to opaque hex so contrast checks match the rendered colors. */ +export function getPublicationTheme( + view: app.bsky.embed.external.ViewArticlePublication, +) { + const accent = hexToRgb(view.theme?.accent ?? '') + const foreground = hexToRgb(view.theme?.accentForeground ?? '') + if (!accent || !foreground) return undefined + return { + accent: rgbToHex(accent.r, accent.g, accent.b), + accentForeground: rgbToHex(foreground.r, foreground.g, foreground.b), + } +} diff --git a/src/components/moderation/ReportDialog/action.test.tsx b/src/components/moderation/ReportDialog/action.test.tsx new file mode 100644 index 000000000..24a43a894 --- /dev/null +++ b/src/components/moderation/ReportDialog/action.test.tsx @@ -0,0 +1,100 @@ +import {type ReactNode} from 'react' +import {QueryClient, QueryClientProvider} from '@tanstack/react-query' +import {act, renderHook, waitFor} from '@testing-library/react-native' + +import {com, tools} from '#/lexicons' +import {useSubmitReportMutation} from './action' +import {initialState, type ReportState} from './state' +import {type ParsedReportSubject} from './types' + +const mockCall = jest.fn() + +jest.mock('@lingui/react', () => ({ + useLingui: () => ({_: (value: {message: string}) => value.message}), +})) +jest.mock('#/logger', () => ({logger: {info: jest.fn()}})) +jest.mock('#/state/session', () => ({ + useAppviewClient: () => ({call: mockCall}), +})) + +const labelerDid = 'did:plc:labeler' +const state = { + ...initialState, + selectedOption: { + title: 'Spam', + reason: tools.ozone.report.defs.reasonMisleadingSpam.value, + }, + selectedLabeler: { + creator: {did: labelerDid, handle: 'labeler.test'}, + reasonTypes: [], + }, + details: 'some details', + includeVideoTimestamp: true, +} as unknown as ReportState + +const ref = { + uri: 'at://did:plc:6ayddqghxhciedbaofoxkcbs/app.test.thing/3kabc', + cid: 'bafyreicl6ujc6ncfktctxxroxognfn7d2fqavvrryoc2lv6m4i6hpbkfti', + nsid: 'app.test.thing', +} + +const subjects: [string, ParsedReportSubject][] = [ + ['article', {type: 'article', ...ref}], + ['photo', {type: 'photo', ...ref}], + ['publication', {type: 'publication', ...ref}], + ['gallery', {type: 'gallery', ...ref}], + ['livestream', {type: 'livestream', ...ref}], + ['record', {type: 'record', ...ref}], + ['an existing record type', {type: 'feed', ...ref}], +] + +describe('useSubmitReportMutation', () => { + const dev = __DEV__ + + beforeEach(() => { + mockCall.mockReset().mockResolvedValue(undefined) + // The development dry run would otherwise skip the (mocked) request. + ;(globalThis as unknown as {__DEV__: boolean}).__DEV__ = false + }) + afterEach(() => { + ;(globalThis as unknown as {__DEV__: boolean}).__DEV__ = dev + }) + + it.each(subjects)( + 'submits %s as a strongRef to the labeler', + async (_n, subject) => { + const queryClient = new QueryClient() + const {result} = renderHook(() => useSubmitReportMutation(), { + wrapper: ({children}: {children: ReactNode}) => ( + + {children} + + ), + }) + + await act(async () => { + await result.current.mutateAsync({ + subject, + state, + videoTimestampSeconds: 12, + }) + }) + + await waitFor(() => expect(result.current.isSuccess).toBe(true)) + expect(mockCall).toHaveBeenCalledTimes(1) + expect(mockCall).toHaveBeenCalledWith( + com.atproto.moderation.createReport, + { + reasonType: tools.ozone.report.defs.reasonMisleadingSpam.value, + reason: 'some details', + subject: { + $type: 'com.atproto.repo.strongRef', + uri: ref.uri, + cid: ref.cid, + }, + }, + expect.objectContaining({service: `${labelerDid}#atproto_labeler`}), + ) + }, + ) +}) diff --git a/src/components/moderation/ReportDialog/action.ts b/src/components/moderation/ReportDialog/action.ts index 2b79d8b24..2b308250e 100644 --- a/src/components/moderation/ReportDialog/action.ts +++ b/src/components/moderation/ReportDialog/action.ts @@ -78,7 +78,13 @@ export function useSubmitReportMutation() { case 'list': case 'feed': case 'starterPack': - case 'profileLink': { + case 'profileLink': + case 'article': + case 'photo': + case 'publication': + case 'gallery': + case 'livestream': + case 'record': { report = { reasonType, reason: state.details, diff --git a/src/components/moderation/ReportDialog/copy.test.ts b/src/components/moderation/ReportDialog/copy.test.ts new file mode 100644 index 000000000..3897d4493 --- /dev/null +++ b/src/components/moderation/ReportDialog/copy.test.ts @@ -0,0 +1,31 @@ +import {renderHook} from '@testing-library/react-native' + +import {useCopyForSubject} from './copy' + +jest.mock('@lingui/react', () => ({ + useLingui: () => ({_: (value: {message: string}) => value.message}), +})) + +const ref = {uri: 'at://did:plc:x/app.test.thing/3k', cid: 'cid', nsid: 'a.b.c'} + +it.each(['article', 'photo', 'publication', 'gallery', 'record'] as const)( + 'words %s reports for that content', + type => { + const {result} = renderHook(() => useCopyForSubject({type, ...ref})) + expect(result.current).toEqual({ + title: `Report this ${type}`, + subtitle: `Why should this ${type} be reviewed?`, + }) + }, +) + +it.each(['status', 'livestream'] as const)( + 'words %s reports as a livestream', + type => { + const {result} = renderHook(() => useCopyForSubject({type, ...ref})) + expect(result.current).toEqual({ + title: 'Report this livestream', + subtitle: 'Why should this livestream be reviewed?', + }) + }, +) diff --git a/src/components/moderation/ReportDialog/copy.ts b/src/components/moderation/ReportDialog/copy.ts index f8723eeec..172e875df 100644 --- a/src/components/moderation/ReportDialog/copy.ts +++ b/src/components/moderation/ReportDialog/copy.ts @@ -1,11 +1,18 @@ -import {useMemo} from 'react' import {useLingui} from '@lingui/react/macro' import {type ParsedReportSubject} from './types' export function useCopyForSubject(subject: ParsedReportSubject) { + return useGetCopyForSubject()(subject) +} + +/** + * Returns a getter for report copy, for callers that need copy for several + * subjects at once, e.g. one menu item per reportable record. + */ +export function useGetCopyForSubject() { const {t: l} = useLingui() - return useMemo(() => { + return (subject: ParsedReportSubject) => { switch (subject.type) { case 'account': { return { @@ -13,7 +20,8 @@ export function useCopyForSubject(subject: ParsedReportSubject) { subtitle: l`Why should this user be reviewed?`, } } - case 'status': { + case 'status': + case 'livestream': { return { title: l`Report this livestream`, subtitle: l`Why should this livestream be reviewed?`, @@ -43,6 +51,36 @@ export function useCopyForSubject(subject: ParsedReportSubject) { subtitle: l`Why should this link be reviewed?`, } } + case 'article': { + return { + title: l`Report this article`, + subtitle: l`Why should this article be reviewed?`, + } + } + case 'photo': { + return { + title: l`Report this photo`, + subtitle: l`Why should this photo be reviewed?`, + } + } + case 'publication': { + return { + title: l`Report this publication`, + subtitle: l`Why should this publication be reviewed?`, + } + } + case 'gallery': { + return { + title: l`Report this gallery`, + subtitle: l`Why should this gallery be reviewed?`, + } + } + case 'record': { + return { + title: l`Report this record`, + subtitle: l`Why should this record be reviewed?`, + } + } case 'starterPack': { return { title: l`Report this Starter Pack`, @@ -72,5 +110,5 @@ export function useCopyForSubject(subject: ParsedReportSubject) { } } } - }, [l, subject]) + } } diff --git a/src/components/moderation/ReportDialog/index.tsx b/src/components/moderation/ReportDialog/index.tsx index b655b5ade..7c1dab296 100644 --- a/src/components/moderation/ReportDialog/index.tsx +++ b/src/components/moderation/ReportDialog/index.tsx @@ -65,7 +65,12 @@ import { useReportOptions, } from './utils/useReportOptions' +export {useCopyForSubject, useGetCopyForSubject} from './copy' export {type ReportSubject} from './types' +export { + getAssociatedReportSubjects, + parseReportSubject, +} from './utils/parseReportSubject' export {useDialogControl as useReportDialogControl} from '#/components/Dialog' export function useGlobalReportDialogControl() { diff --git a/src/components/moderation/ReportDialog/types.ts b/src/components/moderation/ReportDialog/types.ts index 3134109e5..4275a0138 100644 --- a/src/components/moderation/ReportDialog/types.ts +++ b/src/components/moderation/ReportDialog/types.ts @@ -1,7 +1,7 @@ import {type $Typed} from '@atproto/lex' import type * as Dialog from '#/components/Dialog' -import {type app, type chat} from '#/lexicons' +import {type app, type chat, type com} from '#/lexicons' export type ReportSubjectConvoMessage = { view: 'convo' | 'message' @@ -24,6 +24,9 @@ export type ReportSubject = | $Typed | $Typed | $Typed + | $Typed + | $Typed + | $Typed | ReportSubjectConvoMessage | ReportSubjectConvo @@ -71,6 +74,18 @@ export type ParsedReportSubject = cid: string nsid: string } + | { + type: + | 'article' + | 'photo' + | 'publication' + | 'gallery' + | 'livestream' + | 'record' + uri: string + cid: string + nsid: string + } | { type: 'account' did: string diff --git a/src/components/moderation/ReportDialog/utils/parseReportSubject.test.ts b/src/components/moderation/ReportDialog/utils/parseReportSubject.test.ts index 46a8af5b8..e2d61ad24 100644 --- a/src/components/moderation/ReportDialog/utils/parseReportSubject.test.ts +++ b/src/components/moderation/ReportDialog/utils/parseReportSubject.test.ts @@ -1,7 +1,46 @@ -import {describe, expect, it} from '@jest/globals' +import {describe, expect, it, jest} from '@jest/globals' -import {type app} from '#/lexicons' -import {parseReportSubject} from './parseReportSubject' +import {type app, type com} from '#/lexicons' +import {BSKY_LABELER_ONLY_SUBJECT_TYPES} from '../const' +import {type ReportSubject} from '../types' +import { + getAssociatedReportSubjects, + parseReportSubject, +} from './parseReportSubject' + +/* Associated ref validation needs real CID parsing, which the repo mocks. */ +jest.unmock('multiformats/cid') + +const CID_A = 'bafyreicl6ujc6ncfktctxxroxognfn7d2fqavvrryoc2lv6m4i6hpbkfti' +const CID_B = 'bafyreig3yg2msah74sgvow25uxddqbabex3f3mh6hysess3w5kmgiv6zqy' +const REPO = 'at://did:plc:6ayddqghxhciedbaofoxkcbs' +const first = {uri: `${REPO}/app.test.first/3kaaa`, cid: CID_A} +const second = {uri: `${REPO}/app.test.second/3kbbb`, cid: CID_B} + +function article(associatedRefs?: {uri: string; cid: string}[]) { + return { + $type: 'app.bsky.embed.external#viewArticle', + uri: 'https://example.com/article', + title: 'An article', + description: '', + associatedRefs, + } as app.bsky.embed.external.ViewArticle & { + $type: 'app.bsky.embed.external#viewArticle' + } +} + +function photo(associatedRefs?: {uri: string; cid: string}[]) { + return { + $type: 'app.bsky.embed.external#viewGallery', + uri: 'https://example.com/photo', + title: 'A photo', + description: '', + items: [], + associatedRefs, + } as app.bsky.embed.external.ViewGallery & { + $type: 'app.bsky.embed.external#viewGallery' + } +} describe('parseReportSubject', () => { it('reports a profile link as its link record', () => { @@ -20,4 +59,132 @@ describe('parseReportSubject', () => { nsid: 'app.bsky.actor.link', }) }) + + it('reports the first valid associated record of an article or photo', () => { + const refs = [ + {uri: 'https://example.com/ref', cid: CID_A}, + {uri: first.uri, cid: 'not-a-cid'}, + first, + second, + ] + const expected = { + type: 'record', + uri: first.uri, + cid: first.cid, + nsid: 'app.test.first', + } + expect(parseReportSubject(article(refs))).toEqual(expected) + expect(parseReportSubject(photo(refs))).toEqual(expected) + }) + + it('classifies a direct record reference by its own collection', () => { + expect(parseReportSubject(strongRef(second))).toEqual({ + type: 'record', + uri: second.uri, + cid: second.cid, + nsid: 'app.test.second', + }) + expect( + parseReportSubject(strongRef({uri: first.uri, cid: 'nope'})), + ).toBeUndefined() + }) + + it('accepts associated refs that carry their own $type', () => { + const ref = {...first, $type: 'com.atproto.repo.strongRef'} + expect(parseReportSubject(article([ref]))).toMatchObject({uri: first.uri}) + }) + + it.each([ + ['missing refs', undefined], + ['empty refs', []], + ['an invalid CID', [{uri: first.uri, cid: 'nope'}]], + ['a malformed URI', [{uri: 'at://', cid: CID_A}]], + ['an HTTP URI', [{uri: 'https://example.com/a/b/c', cid: CID_A}]], + ['a repo-only URI', [{uri: REPO, cid: CID_A}]], + ['a collection-only URI', [{uri: `${REPO}/app.test.first`, cid: CID_A}]], + ['a URI with a query', [{uri: `${first.uri}?a=1`, cid: CID_A}]], + ['a URI with a fragment', [{uri: `${first.uri}#a`, cid: CID_A}]], + ])('is not reportable with %s', (_name, refs) => { + expect(parseReportSubject(article(refs))).toBeUndefined() + expect(parseReportSubject(photo(refs))).toBeUndefined() + }) +}) + +type Ref = {uri: string; cid: string} +const strongRef = (ref: Ref) => + ({$type: 'com.atproto.repo.strongRef', ...ref}) as ReportSubject +const enumerate = (refs: Ref[] | undefined) => + getAssociatedReportSubjects(refs as com.atproto.repo.strongRef.Main[]) + +describe('getAssociatedReportSubjects', () => { + const at = (collection: string, rkey = '3kabc') => + `${REPO}/${collection}/${rkey}` + + it.each([ + ['site.standard.document', 'article'], + ['site.standard.publication', 'publication'], + ['social.grain.photo', 'photo'], + ['social.grain.gallery', 'gallery'], + ['place.stream.livestream', 'livestream'], + ['place.stream.livestream.extra', 'record'], + ['social.grain.gallery.item', 'record'], + ['site.standard.document.extra', 'record'], + ['example.site.standard.publication', 'record'], + ['app.test.unknown', 'record'], + ])('classifies %s as %s by exact collection', (collection, type) => { + const ref = {uri: at(collection), cid: CID_A} + expect(enumerate([ref])).toEqual([ + { + subject: {$type: 'com.atproto.repo.strongRef', ...ref}, + parsedSubject: {type, nsid: collection, ...ref}, + }, + ]) + }) + + it('keeps distinct records in response order', () => { + const refs = [ + {uri: at('site.standard.publication'), cid: CID_B}, + {uri: at('site.standard.document', '3kone'), cid: CID_A}, + {uri: at('site.standard.document', '3ktwo'), cid: CID_B}, + ] + expect(enumerate(refs).map(t => t.subject)).toEqual( + refs.map(ref => ({$type: 'com.atproto.repo.strongRef', ...ref})), + ) + }) + + it('skips invalid refs and keeps the first valid ref for a URI', () => { + const uri = at('site.standard.document') + const targets = enumerate([ + {uri, cid: 'not-a-cid'}, + {uri: 'https://example.com/ref', cid: CID_A}, + {uri, cid: CID_A}, + {uri, cid: CID_B}, + ]) + expect(targets).toHaveLength(1) + expect(targets[0].subject).toMatchObject({uri, cid: CID_A}) + }) + + it('does not mutate its input', () => { + const refs = [first, {uri: first.uri, cid: CID_B}, second].map(ref => + Object.freeze({...ref}), + ) + const copy = refs.map(ref => ({...ref})) + enumerate(refs) + expect(refs).toEqual(copy) + }) + + it('has nothing to report without valid refs', () => { + expect(enumerate(undefined)).toEqual([]) + expect(enumerate([])).toEqual([]) + expect(enumerate([{uri: REPO, cid: CID_A}])).toEqual([]) + }) +}) + +it('keeps place.stream livestreams out of the Bluesky-only subject types', () => { + const [target] = enumerate([ + {uri: `${REPO}/place.stream.livestream/3kabc`, cid: CID_A}, + ]) + expect(target.parsedSubject.type).toBe('livestream') + expect(BSKY_LABELER_ONLY_SUBJECT_TYPES.has('livestream')).toBe(false) + expect(BSKY_LABELER_ONLY_SUBJECT_TYPES.has('status')).toBe(true) }) diff --git a/src/components/moderation/ReportDialog/utils/parseReportSubject.ts b/src/components/moderation/ReportDialog/utils/parseReportSubject.ts index c79f1dd94..3c3596c78 100644 --- a/src/components/moderation/ReportDialog/utils/parseReportSubject.ts +++ b/src/components/moderation/ReportDialog/utils/parseReportSubject.ts @@ -1,8 +1,11 @@ +import {type $Typed} from '@atproto/lex' +import {parseAtUriString} from '@atproto/syntax' + import { type ParsedReportSubject, type ReportSubject, } from '#/components/moderation/ReportDialog/types' -import {app} from '#/lexicons' +import {app, com, place, site, social} from '#/lexicons' import * as bsky from '#/types/bsky' export function parseReportSubject( @@ -70,6 +73,17 @@ export function parseReportSubject( cid: subject.cid, nsid: 'app.bsky.actor.link', } + } else if (bsky.isType(com.atproto.repo.strongRef.main, subject)) { + return parseRecordRef(subject) + } else if ( + bsky.isType(app.bsky.embed.external.viewArticle, subject) || + bsky.isType(app.bsky.embed.external.viewGallery, subject) + ) { + /* + * The view's own uri is the external destination, so report the first + * valid record it was associated with instead. + */ + return getAssociatedReportSubjects(subject.associatedRefs)[0]?.parsedSubject } else if (bsky.isType(app.bsky.feed.defs.postView, subject)) { const record = subject.record const embed = bsky.post.parseEmbed(subject.embed) @@ -103,3 +117,61 @@ export function parseReportSubject( } } } + +/** + * Every distinct record in `refs` that can be reported, in response order. + * + * `subject` is the exact ref to hand the dialog, so that it cannot reselect + * another one. `parsedSubject` is what the dialog derives from it, e.g. for + * its copy. A repeated URI keeps its first valid ref. + */ +export function getAssociatedReportSubjects( + refs: readonly com.atproto.repo.strongRef.Main[] | undefined, +): { + subject: $Typed + parsedSubject: ParsedReportSubject +}[] { + const targets: ReturnType = [] + for (const ref of refs ?? []) { + const parsedSubject = parseRecordRef(ref) + if (!parsedSubject || targets.some(t => t.subject.uri === ref.uri)) continue + targets.push({ + subject: { + $type: 'com.atproto.repo.strongRef', + uri: ref.uri, + cid: ref.cid, + }, + parsedSubject, + }) + } + return targets +} + +/** + * Validates a record reference and classifies it by its exact collection, so + * unrecognized collections are still reportable as a generic record. + */ +function parseRecordRef(ref: unknown): ParsedReportSubject | undefined { + if (!bsky.matches(com.atproto.repo.strongRef.main, ref)) return + const uri = parseAtUriString(ref.uri) + if (!uri.success || !uri.value.collection || !uri.value.rkey) return + const nsid = uri.value.collection + return {type: getRecordType(nsid), uri: ref.uri, cid: ref.cid, nsid} +} + +function getRecordType(nsid: string) { + switch (nsid) { + case site.standard.document.$type: + return 'article' + case site.standard.publication.$type: + return 'publication' + case social.grain.photo.$type: + return 'photo' + case social.grain.gallery.$type: + return 'gallery' + case place.stream.livestream.$type: + return 'livestream' + default: + return 'record' + } +} diff --git a/src/lib/api/feed/utils.ts b/src/lib/api/feed/utils.ts index 832ee8b9e..7732c2923 100644 --- a/src/lib/api/feed/utils.ts +++ b/src/lib/api/feed/utils.ts @@ -18,16 +18,19 @@ export function createBskyTopicsHeader(userInterests?: string) { } } -/** - * Only disclose platform and IP-based service data to Bluesky-owned feeds, - * never GPS data. - * Read at request time so long-lived feed APIs pick up service updates. - */ +/** Only disclose platform and service geolocation to Bluesky-owned feeds. */ export function createBskyFeedHeaders(feedUri: string) { - const headers: Record = {} - if (!isBlueskyOwnedFeed(feedUri)) return headers + return isBlueskyOwnedFeed(feedUri) ? createBskyAppviewHeaders() : {} +} - headers['x-atproto-bsky-platform'] = Platform.OS +/** + * Platform and IP-based service data for Bluesky appview requests, never GPS. + * Read at request time so callers pick up service updates. + */ +export function createBskyAppviewHeaders() { + const headers: Record = { + 'x-atproto-bsky-platform': Platform.OS, + } const geolocation = device.get(['geolocationServiceResponse']) if (geolocation?.countryCode) { diff --git a/src/screens/Atmosphere/AppsTab.tsx b/src/screens/Atmosphere/AppsTab.tsx index 96fe6bfbf..81bcf9c5d 100644 --- a/src/screens/Atmosphere/AppsTab.tsx +++ b/src/screens/Atmosphere/AppsTab.tsx @@ -12,6 +12,7 @@ import * as Layout from '#/components/Layout' import {Loader} from '#/components/Loader' import {Text} from '#/components/Typography' import {AppCard} from './components/AppCard' +import {useAtmosphereAppCategories} from './components/appCategories' export function AtmosphereAppsTab() { const t = useTheme() @@ -21,19 +22,9 @@ export function AtmosphereAppsTab() { const [isRefreshing, setIsRefreshing] = useState(false) const dragProgress = useSharedValue(0) - /** Keys other than `all` are the category values sent by the backend. */ const categoryDefinitions = [ {key: 'all', label: l`All`}, - {key: 'writing', label: l`Blogging`}, - {key: 'photography', label: l`Photo`}, - {key: 'video', label: l`Video`}, - {key: 'games', label: l`Games`}, - {key: 'feeds', label: l`Feeds`}, - {key: 'social', label: l`Social`}, - {key: 'dev', label: l`Dev`}, - {key: 'audio', label: l`Audio`}, - {key: 'events', label: l`Events`}, - {key: 'utils', label: l`Utils`}, + ...useAtmosphereAppCategories(), ] /* * Only show categories with at least one renderable app. All is always diff --git a/src/screens/Atmosphere/ExploreTab.tsx b/src/screens/Atmosphere/ExploreTab.tsx index e745d7d5b..20eb73b3c 100644 --- a/src/screens/Atmosphere/ExploreTab.tsx +++ b/src/screens/Atmosphere/ExploreTab.tsx @@ -3,9 +3,11 @@ import {RefreshControl, View} from 'react-native' import {useLingui} from '@lingui/react/macro' import {ErrorMessage} from '#/view/com/util/error/ErrorMessage' +import {EXPLORE_SECTION_PADDING} from '#/screens/Atmosphere/const' import { getAtmosphereAnnouncementBanner, getAtmosphereArticles, + getAtmosphereExploreApps, getAtmosphereLivestreams, getAtmospherePhotos, getAtmospherePublications, @@ -17,12 +19,17 @@ import {Loader} from '#/components/Loader' import {AnnouncementBanner} from './components/AnnouncementBanner' import {AtmosphereNux} from './components/AtmosphereNux' import {ExploreGalleryBleed} from './components/ExploreGallery' +import {FeaturedApps} from './components/FeaturedApps' import {FeaturedArticles} from './components/FeaturedArticles' import {FeaturedLivestreams} from './components/FeaturedLivestreams' import {FeaturedPhotos} from './components/FeaturedPhotos' import {FeaturedPublications} from './components/FeaturedPublications' -export function AtmosphereExploreTab() { +export function AtmosphereExploreTab({ + onPressSeeMoreApps, +}: { + onPressSeeMoreApps?: () => void +}) { const t = useTheme() const {t: l} = useLingui() const {data, isError, isPending, refetch} = useAtmosphereExploreQuery() @@ -86,18 +93,26 @@ export function AtmosphereExploreTab() { refreshControl={refreshControl} contentContainerStyle={[a.pb_xl]}> - - {isError ? errorMessage : undefined} + + {isError ? ( + + {errorMessage} + + ) : undefined} {announcementBanner ? ( ) : undefined} + + + - - diff --git a/src/screens/Atmosphere/__tests__/AppsTab.test.tsx b/src/screens/Atmosphere/__tests__/AppsTab.test.tsx index b5f79a081..47636b217 100644 --- a/src/screens/Atmosphere/__tests__/AppsTab.test.tsx +++ b/src/screens/Atmosphere/__tests__/AppsTab.test.tsx @@ -3,8 +3,8 @@ import {createDeferrable} from '@atproto/common-web' import {act, fireEvent, render, screen} from '@testing-library/react-native' import {AtmosphereAppsTab} from '#/screens/Atmosphere/AppsTab' -import {type AtmosphereAppsData} from '#/screens/Atmosphere/data/exploreData' import {useAtmosphereAppsQuery} from '#/screens/Atmosphere/data/useAtmosphereAppsQuery' +import {type app} from '#/lexicons' jest.mock('@lingui/react', () => ({ useLingui: () => ({ @@ -134,7 +134,7 @@ function setQuery(result: Partial>) { } const url = 'https://example.com/app' -const data: AtmosphereAppsData = { +const data: app.bsky.unspecced.getAtmosphereApps.$OutputBody = { apps: [ {id: 'blog', title: 'Blog app', url, category: 'writing'}, {id: 'photo', title: 'Photo app', url, category: 'photography'}, diff --git a/src/screens/Atmosphere/__tests__/ExploreTab.test.tsx b/src/screens/Atmosphere/__tests__/ExploreTab.test.tsx index 0fc1b7c28..0df08fa73 100644 --- a/src/screens/Atmosphere/__tests__/ExploreTab.test.tsx +++ b/src/screens/Atmosphere/__tests__/ExploreTab.test.tsx @@ -4,7 +4,6 @@ import {act, fireEvent, render, screen} from '@testing-library/react-native' import {exploreResponseFixture} from '#/screens/Atmosphere/__tests__/fixtures/exploreResponse' import {livestreamPreviewFixture} from '#/screens/Atmosphere/__tests__/fixtures/livestreamPreview' -import {type AtmosphereData} from '#/screens/Atmosphere/data/exploreData' import {useAtmosphereExploreQuery} from '#/screens/Atmosphere/data/useAtmosphereExploreQuery' import {AtmosphereExploreTab} from '#/screens/Atmosphere/ExploreTab' import {app} from '#/lexicons' @@ -119,7 +118,13 @@ function setQuery( } as never) } -const data: AtmosphereData = { +const publisher: app.bsky.embed.external.ViewArticlePublication = { + uri: 'https://example.com/publication', + title: 'Publication', + description: '', +} + +const data: app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody = { announcementBanner: {title: 'Launch', url: 'https://example.com/launch'}, articles: { items: [ @@ -129,6 +134,7 @@ const data: AtmosphereData = { uri: 'https://example.com/article', title: 'Live article', description: '', + publisher, }, }, ], @@ -136,7 +142,14 @@ const data: AtmosphereData = { publications: {items: []}, photos: {items: []}, livestreams: {items: []}, - apps: [{id: 'app', title: 'Live app', url: 'https://example.com/app'}], + apps: [ + { + id: 'app', + title: 'Live app', + url: 'https://example.com/app', + backgroundImage: 'https://example.com/app-background.jpg', + }, + ], } beforeEach(() => { @@ -175,8 +188,7 @@ describe('AtmosphereExploreTab', () => { expect(screen.getByText('nux')).toBeTruthy() expect(screen.getByText('banner:Launch')).toBeTruthy() expect(screen.getByText('articles:Live article')).toBeTruthy() - /* Apps live in their own tab, even though the response includes them. */ - expect(screen.queryByText(/^apps:/)).toBeNull() + expect(screen.getByText('apps:Live app')).toBeTruthy() expect(screen.queryByText(/^livestreams:/)).toBeNull() expect(screen.queryByText(/^photos:/)).toBeNull() expect( @@ -187,22 +199,48 @@ describe('AtmosphereExploreTab', () => { expect(screen.queryByTestId('retry')).toBeNull() }) - it('renders nonfeatured recommendations in server order', () => { + it('renders the first five nonfeatured recommendations in server order', () => { setQuery({ data: { ...data, articles: { recIdStr: '18446744073709551615', - items: ['Second', 'First'].map(title => ({ - featured: false, - view: {uri: `https://example.com/${title}`, title, description: ''}, - })), + items: ['Second', 'First', 'Third', 'Fourth', 'Fifth', 'Sixth'].map( + title => ({ + featured: false, + view: { + uri: `https://example.com/${title}`, + title, + description: '', + publisher, + }, + }), + ), }, }, }) render() - expect(screen.getByText('articles:Second,First')).toBeTruthy() + expect( + screen.getByText('articles:Second,First,Third,Fourth,Fifth'), + ).toBeTruthy() + expect(screen.queryByText(/Sixth/)).toBeNull() + }) + + it('renders apps after the banners and before articles', () => { + setQuery({data}) + render() + + expect( + screen + .getAllByText(/^(nux|banner:|apps:|articles:)/) + .map(node => node.props.children), + ).toEqual([ + 'nux', + 'banner:Launch', + 'apps:Live app', + 'articles:Live article', + ]) }) it('hides only articles when recommendations are empty', () => { @@ -218,10 +256,21 @@ describe('AtmosphereExploreTab', () => { expect(screen.queryByText(/^articles:/)).toBeNull() expect(screen.getByText(/^photos:/)).toBeTruthy() expect(screen.getByText(/^livestreams:/)).toBeTruthy() - expect(screen.queryByText(/^apps:/)).toBeNull() + expect(screen.getByText(/^apps:/)).toBeTruthy() expect(screen.getByText(/^banner:/)).toBeTruthy() }) + it('renders publications below photos', () => { + setQuery({data: exploreResponseFixture}) + render() + + expect( + screen + .getAllByText(/^(articles|photos|publications):/) + .map(section => (section.props.children as string).split(':')[0]), + ).toEqual(['articles', 'photos', 'publications']) + }) + it('renders publications from the response, even when articles are empty', () => { setQuery({ data: { diff --git a/src/screens/Atmosphere/__tests__/fixtures/exploreResponse.ts b/src/screens/Atmosphere/__tests__/fixtures/exploreResponse.ts index 448716a19..090221478 100644 --- a/src/screens/Atmosphere/__tests__/fixtures/exploreResponse.ts +++ b/src/screens/Atmosphere/__tests__/fixtures/exploreResponse.ts @@ -1,4 +1,3 @@ -import {type AtmosphereData} from '#/screens/Atmosphere/data/exploreData' import {type app} from '#/lexicons' const author: app.bsky.actor.defs.ProfileViewBasic = { @@ -31,8 +30,8 @@ const image = { alt: 'A test photo', } -/** Small synthetic response for schema, mapping, and screen tests. */ -export const exploreResponseFixture: AtmosphereData = { +/** Small synthetic response for schema, selection, and screen tests. */ +export const exploreResponseFixture = { announcementBanner: { id: 'banner', title: 'Test announcement', @@ -99,4 +98,4 @@ export const exploreResponseFixture: AtmosphereData = { url: 'https://example.com/app', }, ], -} +} satisfies app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody diff --git a/src/screens/Atmosphere/components/AnnouncementBanner.tsx b/src/screens/Atmosphere/components/AnnouncementBanner.tsx index c843997cb..1eb173cec 100644 --- a/src/screens/Atmosphere/components/AnnouncementBanner.tsx +++ b/src/screens/Atmosphere/components/AnnouncementBanner.tsx @@ -3,20 +3,23 @@ import {Image} from 'expo-image' import {LinearGradient} from 'expo-linear-gradient' import {useLingui} from '@lingui/react/macro' -import {type AtmosphereAnnouncementBannerData} from '#/screens/Atmosphere/data/exploreData' +import {EXPLORE_SECTION_PADDING} from '#/screens/Atmosphere/const' import {atoms as a, utils} from '#/alf' import {Link} from '#/components/Link' import {Text} from '#/components/Typography' +import {type app} from '#/lexicons' export function AnnouncementBanner({ banner, }: { - banner: AtmosphereAnnouncementBannerData + banner: app.bsky.unspecced.getAtmosphereExploreTab.AnnouncementBanner }) { const {t: l} = useLingui() + if (!banner.title || !banner.url) return null + return ( - + ) : undefined} - {app.banner ? ( - - ) : undefined} - + + + ) } diff --git a/src/screens/Atmosphere/components/AppDialog.tsx b/src/screens/Atmosphere/components/AppDialog.tsx new file mode 100644 index 000000000..9a532465b --- /dev/null +++ b/src/screens/Atmosphere/components/AppDialog.tsx @@ -0,0 +1,157 @@ +import {type GestureResponderEvent, View} from 'react-native' +import {Image} from 'expo-image' +import {useLingui} from '@lingui/react/macro' +import {useNavigation} from '@react-navigation/native' + +import {useOpenLink} from '#/lib/hooks/useOpenLink' +import {makeProfileLink} from '#/lib/routes/links' +import {type NavigationProp} from '#/lib/routes/types' +import {toNiceDomain} from '#/lib/strings/url-helpers' +import {atoms as a, useTheme, web} from '#/alf' +import {ButtonIcon, ButtonText} from '#/components/Button' +import * as Dialog from '#/components/Dialog' +import {SquareArrowTopRight_Stroke2_Corner0_Rounded as ArrowIcon} from '#/components/icons/Square' +import {isClickEventWithMetaKey, Link} from '#/components/Link' +import {MediaInsetBorder} from '#/components/MediaInsetBorder' +import {Text} from '#/components/Typography' +import {IS_NATIVE} from '#/env' +import {type app} from '#/lexicons' +import {useAtmosphereAppCategories} from './appCategories' + +const LOGO_SIZE = 56 + +export function AppDialog({ + control, + app, +}: { + control: Dialog.DialogOuterProps['control'] + app: app.bsky.unspecced.getAtmosphereApps.AppCard +}) { + const {t: l} = useLingui() + return ( + + + + + + + ) +} + +function AppDialogInner({ + app, +}: { + app: app.bsky.unspecced.getAtmosphereApps.AppCard +}) { + const {t: l} = useLingui() + const t = useTheme() + const {close} = Dialog.useDialogContext() + const openLink = useOpenLink() + const navigation = useNavigation() + const categories = useAtmosphereAppCategories() + const categoryLabel = categories.find(c => c.key === app.category)?.label + const profile = app.profile + const url = app.url ?? '' + + /* + * Links keep real hrefs for semantics, but navigation must wait for the + * dialog to finish closing, so we take over the press from Link. + */ + const closeThen = (e: GestureResponderEvent, action: () => void) => { + // Modified clicks open a new tab via Link; keep the dialog open. + if (isClickEventWithMetaKey(e)) return + e.preventDefault() + close(action) + return false as const + } + + return ( + + {app.banner ? ( + + ) : undefined} + + {app.logo ? ( + + + + + ) : undefined} + + + + {app.title} + + + {' · '} + {toNiceDomain(url)} + + + {categoryLabel ? ( + + + {categoryLabel} + + + ) : undefined} + + + {app.description ? ( + + {app.description} + + ) : undefined} + + closeThen(e, () => openLink(url))}> + {l`Visit app`} + + + {profile ? ( + + closeThen(e, () => + navigation.navigate('Profile', {name: profile.did}), + ) + }> + {l`View profile`} + + ) : undefined} + + + ) +} diff --git a/src/screens/Atmosphere/components/AppKnownFollowers.tsx b/src/screens/Atmosphere/components/AppKnownFollowers.tsx new file mode 100644 index 000000000..ed02dc99c --- /dev/null +++ b/src/screens/Atmosphere/components/AppKnownFollowers.tsx @@ -0,0 +1,77 @@ +import {View} from 'react-native' +import {Plural, useLingui} from '@lingui/react/macro' + +import {makeProfileLink} from '#/lib/routes/links' +import {atoms as a, useTheme} from '#/alf' +import {AvatarStack} from '#/components/AvatarStack' +import {shouldShowKnownFollowers} from '#/components/KnownFollowers' +import {Link} from '#/components/Link' +import {Text} from '#/components/Typography' +import {type app} from '#/lexicons' + +/** Avatar plus its 1px border, matching a 16px avatar. */ +const AVATAR_STACK_SIZE = 18 + +/** + * Compact “N followers you know” row for app cards. Renders nothing when none + * of the viewer's follows follow the app's profile. + */ +export function AppKnownFollowers({ + profile, + link = false, +}: { + profile: app.bsky.actor.defs.ProfileViewDetailed + /** + * Link to the profile's known followers screen. Leave off when the row sits + * inside another pressable. + */ + link?: boolean +}) { + const {t: l} = useLingui() + const t = useTheme() + const knownFollowers = profile.viewer?.knownFollowers + + if (!knownFollowers || !shouldShowKnownFollowers(knownFollowers)) return null + + const content = ({hovered = false}: {hovered?: boolean}) => ( + + + + + + + ) + + if (!link) return content({}) + + return ( + + {({hovered}) => content({hovered})} + + ) +} diff --git a/src/screens/Atmosphere/components/ArticleCard.tsx b/src/screens/Atmosphere/components/ArticleCard.tsx deleted file mode 100644 index 59de77b42..000000000 --- a/src/screens/Atmosphere/components/ArticleCard.tsx +++ /dev/null @@ -1,122 +0,0 @@ -import {View} from 'react-native' -import {Image} from 'expo-image' -import {useLingui} from '@lingui/react/macro' - -import {type AtmosphereArticleCardData} from '#/screens/Atmosphere/data/exploreData' -import {atoms as a, useTheme, web} from '#/alf' -import {useInteractionState} from '#/components/hooks/useInteractionState' -import {Link} from '#/components/Link' -import {Text} from '#/components/Typography' -import {IS_NATIVE} from '#/env' -import {type ExploreGalleryFocusProps} from './ExploreGallery' - -export function ArticleCard({ - article, - width, - galleryFocus, -}: { - article: AtmosphereArticleCardData - width?: number - galleryFocus?: ExploreGalleryFocusProps -}) { - const {t: l} = useLingui() - const t = useTheme() - const { - state: interacted, - onIn: onInteract, - onOut: onInteractOut, - } = useInteractionState() - - return ( - - - { - onInteract() - galleryFocus?.onFocus() - }} - onBlur={onInteractOut} - style={[a.flex_col, a.flex_1, a.w_full]}> - - {article.image ? ( - - ) : undefined} - - - {article.publisher || article.publisherAvatar ? ( - - {article.publisherAvatar ? ( - - ) : undefined} - {article.publisher ? ( - - {article.publisher} - - ) : undefined} - - ) : undefined} - - - {article.title} - - {article.description ? ( - - {article.description} - - ) : undefined} - - - - - - ) -} diff --git a/src/screens/Atmosphere/components/AtmosphereCardMenu.tsx b/src/screens/Atmosphere/components/AtmosphereCardMenu.tsx new file mode 100644 index 000000000..eee8d41a4 --- /dev/null +++ b/src/screens/Atmosphere/components/AtmosphereCardMenu.tsx @@ -0,0 +1,190 @@ +import {View} from 'react-native' +import {useLingui} from '@lingui/react/macro' +import {useNavigation} from '@react-navigation/native' + +import {useOpenLink} from '#/lib/hooks/useOpenLink' +import {type NavigationProp} from '#/lib/routes/types' +import {atoms as a} from '#/alf' +import {Button, ButtonIcon} from '#/components/Button' +import {DotGrid3x1_Stroke2_Corner0_Rounded as EllipsisIcon} from '#/components/icons/DotGrid' +import {Person_Stroke2_Corner0_Rounded as PersonIcon} from '#/components/icons/Person' +import {SquareArrowTopRight_Stroke2_Corner0_Rounded as ExternalLinkIcon} from '#/components/icons/Square' +import {Warning_Stroke2_Corner0_Rounded as WarningIcon} from '#/components/icons/Warning' +import * as Menu from '#/components/Menu' +import { + getAssociatedReportSubjects, + useGetCopyForSubject, + useGlobalReportDialogControl, +} from '#/components/moderation/ReportDialog' +import {type app} from '#/lexicons' +import {type ExploreGalleryFocusProps} from './ExploreGallery' + +const BUTTON_VISUAL_ADJUSTMENT = 4 + +/** + * Top-right options menu for Atmosphere cards. Render it as a sibling + * of the card's primary link, never inside it, so the two stay un-nested. + * `children` are extra `Menu.Item`s shown before Report. + */ +export function AtmosphereCardMenu({ + type, + item, + reportableTypes, + author, + galleryFocus, + offsetY = 0, + offsetX = 0, + children, +}: ( + | {type: 'article'; item: app.bsky.embed.external.ViewArticle} + | {type: 'photo'; item: app.bsky.embed.external.ViewGallery} + | {type: 'publication'; item: app.bsky.embed.external.ViewArticlePublication} + | {type: 'livestream'; item: app.bsky.embed.external.ViewLivestream} +) & { + /** + * Collections whose associated records may be reported from this card. + */ + reportableTypes: readonly string[] + /** + * Omit when the card can't tell who owns the content; the profile action is + * then left out. + */ + author?: app.bsky.actor.defs.ProfileViewBasic + galleryFocus?: ExploreGalleryFocusProps + /** + * Distance from the card's top edge. + */ + offsetY?: number + /** + * Distance from the card's right edge. + */ + offsetX?: number + /** + * Extra `Menu.Item`s shown after the view/profile actions and before Report. + * Pass `Menu.Item`s directly; native menu groups drop any other children. + */ + children?: React.ReactNode +}) { + const {t: l} = useLingui() + const navigation = useNavigation() + const openLink = useOpenLink() + const reportDialogControl = useGlobalReportDialogControl() + const getReportCopy = useGetCopyForSubject() + let labels: {trigger: string; view: string; report: string} + switch (type) { + case 'article': + labels = { + trigger: l`Article options`, + view: l`View article`, + report: l`Report article`, + } + break + case 'photo': + labels = { + trigger: l`Photo options`, + view: l`View photo`, + report: l`Report photo`, + } + break + case 'publication': + labels = { + trigger: l`Publication options`, + view: l`View publication`, + report: l`Report publication`, + } + break + case 'livestream': + labels = { + trigger: l`Livestream options`, + view: l`View livestream`, + report: l`Report livestream`, + } + break + } + + const reportTargets = getAssociatedReportSubjects(item.associatedRefs).filter( + ({parsedSubject}) => + 'nsid' in parsedSubject && reportableTypes.includes(parsedSubject.nsid), + ) + + return ( + 0 ? offsetY - BUTTON_VISUAL_ADJUSTMENT : 0, + right: offsetX > 0 ? offsetX - BUTTON_VISUAL_ADJUSTMENT : 0, + }, + ]}> + + + {({props}) => ( + + )} + + + + openLink(item.uri)}> + {labels.view} + + + {author && ( + + navigation.navigate('Profile', {name: author.did}) + }> + {l`View author profile`} + + + )} + {children} + + + + {reportTargets.length ? ( + reportTargets.map(({subject, parsedSubject}) => { + /* + * Titled like the report dialog it opens, so the menu and + * dialog always agree. Rendered inline because the native + * Menu.Group only renders direct Menu.Item children. + */ + const {title} = getReportCopy(parsedSubject) + return ( + reportDialogControl.open({subject})}> + {title} + + + ) + }) + ) : ( + {}}> + {labels.report} + + + )} + + + + + ) +} diff --git a/src/screens/Atmosphere/components/AtmosphereNux.tsx b/src/screens/Atmosphere/components/AtmosphereNux.tsx index 10c4c1367..5fa1c06b3 100644 --- a/src/screens/Atmosphere/components/AtmosphereNux.tsx +++ b/src/screens/Atmosphere/components/AtmosphereNux.tsx @@ -1,8 +1,10 @@ import {View} from 'react-native' +import {Image} from 'expo-image' import {Trans, useLingui} from '@lingui/react/macro' import {HITSLOP_10} from '#/lib/constants' import {Nux, useNux, useSaveNux} from '#/state/queries/nuxs' +import {EXPLORE_SECTION_PADDING} from '#/screens/Atmosphere/const' import {atoms as a, tokens} from '#/alf' import {Button, ButtonIcon} from '#/components/Button' import {GradientFill} from '#/components/GradientFill' @@ -31,7 +33,7 @@ export function AtmosphereNux() { } return ( - + - {/* + - */} - = { + items: T[] + label: string + testID: string + renderItem: (item: T, focusProps: ExploreGalleryFocusProps) => React.ReactNode +} + /** * Horizontal card carousel for the Atmosphere Explore sections. Cards own - * their own width and stretch to the tallest card in the strip. + * their own width and stretch to the tallest card in the strip. Items are + * keyed by `uri` unless `getKey` is given, which items without a `uri` need. */ -export function ExploreGallery({ +export function ExploreGallery( + props: ExploreGalleryProps & {getKey?: (item: T) => string}, +): React.ReactNode +export function ExploreGallery( + props: ExploreGalleryProps & {getKey: (item: T) => string}, +): React.ReactNode +export function ExploreGallery({ items, label, testID, renderItem, -}: { - items: T[] - label: string - testID: string - renderItem: (item: T, focusProps: ExploreGalleryFocusProps) => React.ReactNode + getKey = item => item.uri, +}: ExploreGalleryProps<{uri: string; title: string}> & { + getKey?: (item: {uri: string; title: string}) => string }) { return ( {items.map(item => ( - + {focusProps => ( /* * The bottom allowance lives inside the item so it is measured and diff --git a/src/screens/Atmosphere/components/ExploreSectionHeader.tsx b/src/screens/Atmosphere/components/ExploreSectionHeader.tsx index 4eb1d2f96..c34c5f24e 100644 --- a/src/screens/Atmosphere/components/ExploreSectionHeader.tsx +++ b/src/screens/Atmosphere/components/ExploreSectionHeader.tsx @@ -1,10 +1,58 @@ -import {atoms as a} from '#/alf' +import {View} from 'react-native' +import {Trans} from '@lingui/react/macro' + +import {HITSLOP_10} from '#/lib/constants' +import {atoms as a, useTheme} from '#/alf' +import {Button} from '#/components/Button' +import {ArrowRight_Stroke2_Corner0_Rounded as ArrowRightIcon} from '#/components/icons/Arrow' import {Text} from '#/components/Typography' -export function ExploreSectionHeader({title}: {title: React.ReactNode}) { +export function ExploreSectionHeader({ + title, + seeMore, +}: { + title: React.ReactNode + /** + * Adds a trailing "See more" button. `label` is its accessible label. + */ + seeMore?: {label: string; onPress: () => void} +}) { + const t = useTheme() + return ( - - {title} - + + + {title} + + {seeMore ? ( + + ) : undefined} + ) } diff --git a/src/screens/Atmosphere/components/FeaturedAppCard.tsx b/src/screens/Atmosphere/components/FeaturedAppCard.tsx new file mode 100644 index 000000000..f1284fff1 --- /dev/null +++ b/src/screens/Atmosphere/components/FeaturedAppCard.tsx @@ -0,0 +1,154 @@ +import {StyleSheet, View} from 'react-native' +import {Image} from 'expo-image' +import {useLingui} from '@lingui/react/macro' + +import {makeProfileLink} from '#/lib/routes/links' +import {toNiceDomain} from '#/lib/strings/url-helpers' +import {type FeaturedApp} from '#/screens/Atmosphere/data/exploreData' +import {atoms as a, ThemeProvider, useTheme} from '#/alf' +import {ButtonIcon, ButtonText} from '#/components/Button' +import {SquareArrowTopRight_Stroke2_Corner0_Rounded as ExternalLinkIcon} from '#/components/icons/Square' +import {Link} from '#/components/Link' +import {Text} from '#/components/Typography' +import {useAtmosphereAppCategories} from './appCategories' +import {AppKnownFollowers} from './AppKnownFollowers' +import {type ExploreGalleryFocusProps} from './ExploreGallery' + +const LOGO_SIZE = 56 +const BACKGROUND_BLUR_RADIUS = 50 + +/** + * Featured app card. Always renders in the opposite of the current theme so it + * stands out from the surrounding Explore content. Only its two links and + * the known followers link are interactive. + */ +export function FeaturedAppCard({ + app, + galleryFocus, +}: { + app: FeaturedApp + galleryFocus?: ExploreGalleryFocusProps +}) { + const t = useTheme() + + return ( + + + + ) +} + +/** Separate from the card so its tokens come from the inverted theme. */ +function CardContent({ + app, + galleryFocus, +}: { + app: FeaturedApp + galleryFocus?: ExploreGalleryFocusProps +}) { + const {t: l} = useLingui() + const t = useTheme() + const categories = useAtmosphereAppCategories() + const categoryLabel = categories.find(({key}) => key === app.category)?.label + const profile = app.profile + const {title} = app + const isLight = t.name === 'light' + + return ( + + + + + + + {app.logo ? ( + + ) : undefined} + + + {app.title} + + + + + {toNiceDomain(app.url)} + {categoryLabel ? ` · ${categoryLabel}` : ''} + + + + + + {app.description ? ( + + {app.description} + + ) : undefined} + {profile ? : undefined} + + + + {l`Visit app`} + + + {profile ? ( + + {l`View profile`} + + ) : undefined} + + + + ) +} diff --git a/src/screens/Atmosphere/components/FeaturedApps.tsx b/src/screens/Atmosphere/components/FeaturedApps.tsx index 1fb485570..a2f8df001 100644 --- a/src/screens/Atmosphere/components/FeaturedApps.tsx +++ b/src/screens/Atmosphere/components/FeaturedApps.tsx @@ -1,24 +1,47 @@ import {View} from 'react-native' -import {Trans} from '@lingui/react/macro' +import {useLingui} from '@lingui/react/macro' -import {type AtmosphereAppCardData} from '#/screens/Atmosphere/data/exploreData' +import {EXPLORE_SECTION_PADDING} from '#/screens/Atmosphere/const' +import {type FeaturedApp} from '#/screens/Atmosphere/data/exploreData' import {atoms as a} from '#/alf' -import {Text} from '#/components/Typography' -import {AppCard} from './AppCard' +import {ExploreGallery} from './ExploreGallery' +import {ExploreSectionHeader} from './ExploreSectionHeader' +import {FeaturedAppCard} from './FeaturedAppCard' + +const CARD_WIDTH = 320 + +export function FeaturedApps({ + apps, + onPressSeeMore, +}: { + apps: FeaturedApp[] + onPressSeeMore?: () => void +}) { + const {t: l} = useLingui() -export function FeaturedApps({apps}: {apps: AtmosphereAppCardData[]}) { if (!apps.length) return null return ( - - - Apps on the Atmosphere - - - {apps.map(app => ( - - ))} - + + + app.id} + label={l`Featured apps`} + testID="atmosphereAppsGallery" + renderItem={(app, galleryFocus) => ( + + + + )} + /> ) } diff --git a/src/screens/Atmosphere/components/FeaturedArticles.tsx b/src/screens/Atmosphere/components/FeaturedArticles.tsx index ad7278ba1..9cd1f74ac 100644 --- a/src/screens/Atmosphere/components/FeaturedArticles.tsx +++ b/src/screens/Atmosphere/components/FeaturedArticles.tsx @@ -1,38 +1,49 @@ +import {Fragment} from 'react' import {View} from 'react-native' import {useLingui} from '@lingui/react/macro' -import {type AtmosphereArticleCardData} from '#/screens/Atmosphere/data/exploreData' +import {EXPLORE_SECTION_PADDING} from '#/screens/Atmosphere/const' import {atoms as a} from '#/alf' -import {ArticleCard} from './ArticleCard' -import {ExploreGallery} from './ExploreGallery' +import {DocumentCompact} from '#/components/atmosphere/SiteStandard/DocumentCompact' +import {Divider} from '#/components/Divider' +import {type app} from '#/lexicons' import {ExploreSectionHeader} from './ExploreSectionHeader' -const CARD_WIDTH = 250 - export function FeaturedArticles({ articles, }: { - articles: AtmosphereArticleCardData[] + articles: app.bsky.embed.external.ViewArticle[] }) { const {t: l} = useLingui() if (!articles.length) return null return ( - - - ( - - )} - /> + + + + + + {articles.map((article, index) => ( + + {index > 0 && ( + + )} + + + ))} + ) } diff --git a/src/screens/Atmosphere/components/FeaturedLivestreams.tsx b/src/screens/Atmosphere/components/FeaturedLivestreams.tsx index a461f41a9..d132259b9 100644 --- a/src/screens/Atmosphere/components/FeaturedLivestreams.tsx +++ b/src/screens/Atmosphere/components/FeaturedLivestreams.tsx @@ -1,8 +1,9 @@ import {View} from 'react-native' import {useLingui} from '@lingui/react/macro' -import {type AtmosphereLivestreamCardData} from '#/screens/Atmosphere/data/exploreData' +import {EXPLORE_SECTION_PADDING} from '#/screens/Atmosphere/const' import {atoms as a} from '#/alf' +import {type app} from '#/lexicons' import {ExploreGallery} from './ExploreGallery' import {ExploreSectionHeader} from './ExploreSectionHeader' import {LivestreamCard} from './LivestreamCard' @@ -12,14 +13,14 @@ const CARD_WIDTH = 214 export function FeaturedLivestreams({ livestreams, }: { - livestreams: AtmosphereLivestreamCardData[] + livestreams: app.bsky.embed.external.ViewLivestream[] }) { const {t: l} = useLingui() if (!livestreams.length) return null return ( - + + + - ( - - )} - /> + {publications.map(publication => ( + + ))} ) } diff --git a/src/screens/Atmosphere/components/LivestreamCard.tsx b/src/screens/Atmosphere/components/LivestreamCard.tsx index 2de31652e..76dda6b68 100644 --- a/src/screens/Atmosphere/components/LivestreamCard.tsx +++ b/src/screens/Atmosphere/components/LivestreamCard.tsx @@ -1,19 +1,19 @@ import {View} from 'react-native' import {Image} from 'expo-image' import {moderateProfile} from '@bsky/sdk/moderation' -import {plural} from '@lingui/core/macro' import {Trans, useLingui} from '@lingui/react/macro' import {sanitizeDisplayName} from '#/lib/strings/display-names' import {sanitizeHandle} from '#/lib/strings/handles' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {UserAvatar} from '#/view/com/util/UserAvatar' -import {type AtmosphereLivestreamCardData} from '#/screens/Atmosphere/data/exploreData' +import {getAssociatedProfile} from '#/screens/Atmosphere/data/exploreData' import {atoms as a, useTheme} from '#/alf' -import {Eye_Stroke2_Corner0_Rounded as EyeIcon} from '#/components/icons/Eye' import {Play_Filled_Corner2_Rounded as PlayIcon} from '#/components/icons/Play' import {Link} from '#/components/Link' import {Text} from '#/components/Typography' +import {type app, place} from '#/lexicons' +import {AtmosphereCardMenu} from './AtmosphereCardMenu' import {type ExploreGalleryFocusProps} from './ExploreGallery' export function LivestreamCard({ @@ -21,24 +21,25 @@ export function LivestreamCard({ width, galleryFocus, }: { - livestream: AtmosphereLivestreamCardData + livestream: app.bsky.embed.external.ViewLivestream width?: number galleryFocus?: ExploreGalleryFocusProps }) { const {t: l} = useLingui() const t = useTheme() const moderationOpts = useModerationOpts() - const authorProfile = livestream.authorProfile - const moderation = - moderationOpts && authorProfile - ? moderateProfile(authorProfile, moderationOpts) - : undefined - const authorName = authorProfile - ? sanitizeDisplayName( - authorProfile.displayName || sanitizeHandle(authorProfile.handle), - moderation?.ui('displayName'), - ) + const authorProfile = getAssociatedProfile(livestream.associatedProfiles) + const title = livestream.title.trim() + + if (!authorProfile) return null + + const moderation = moderationOpts + ? moderateProfile(authorProfile, moderationOpts) : undefined + const authorName = sanitizeDisplayName( + authorProfile.displayName || sanitizeHandle(authorProfile.handle), + moderation?.ui('displayName'), + ) return ( Live - {livestream.activeCount ? ( - - - - {livestream.activeCount} - - - ) : undefined} ) : undefined} - {livestream.title} + {title} + ) } diff --git a/src/screens/Atmosphere/components/PhotoCard.tsx b/src/screens/Atmosphere/components/PhotoCard.tsx index 7a3177da5..1bc99aafa 100644 --- a/src/screens/Atmosphere/components/PhotoCard.tsx +++ b/src/screens/Atmosphere/components/PhotoCard.tsx @@ -8,19 +8,24 @@ import {sanitizeHandle} from '#/lib/strings/handles' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {formatCount} from '#/view/com/util/numeric/format' import {UserAvatar} from '#/view/com/util/UserAvatar' -import {type AtmospherePhotoCardData} from '#/screens/Atmosphere/data/exploreData' +import { + getAssociatedProfile, + getGalleryImage, +} from '#/screens/Atmosphere/data/exploreData' import {atoms as a, useTheme, web} from '#/alf' import {useInteractionState} from '#/components/hooks/useInteractionState' import {Heart2_Stroke2_Corner0_Rounded as Heart} from '#/components/icons/Heart2' import {Link} from '#/components/Link' import {Text} from '#/components/Typography' +import {type app, social} from '#/lexicons' +import {AtmosphereCardMenu} from './AtmosphereCardMenu' import {type ExploreGalleryFocusProps} from './ExploreGallery' export function PhotoCard({ photo, galleryFocus, }: { - photo: AtmospherePhotoCardData + photo: app.bsky.embed.external.ViewGallery galleryFocus?: ExploreGalleryFocusProps }) { const {t: l, i18n} = useLingui() @@ -31,102 +36,118 @@ export function PhotoCard({ onOut: onInteractOut, } = useInteractionState() const moderationOpts = useModerationOpts() + const authorProfile = getAssociatedProfile(photo.associatedProfiles) + const image = getGalleryImage(photo) + const likeCount = photo.likeCount ?? 0 + + if (!authorProfile || !image) return null + const moderation = moderationOpts - ? moderateProfile(photo.authorProfile, moderationOpts) + ? moderateProfile(authorProfile, moderationOpts) : undefined const authorName = sanitizeDisplayName( - photo.authorProfile.displayName || - sanitizeHandle(photo.authorProfile.handle), + authorProfile.displayName || sanitizeHandle(authorProfile.handle), moderation?.ui('displayName'), ) return ( - { - onInteract() - galleryFocus?.onFocus() - }} - onBlur={onInteractOut} - style={[a.flex_grow, a.w_full, a.flex_col, a.align_start, a.gap_sm]}> - - - {interacted ? ( - + { + onInteract() + galleryFocus?.onFocus() + }} + onBlur={onInteractOut} + style={[a.flex_grow, a.w_full, a.flex_col, a.align_start, a.gap_sm]}> + + - ) : undefined} - {photo.likeCount > 0 ? ( - - - - {formatCount(i18n, photo.likeCount)} - - - ) : undefined} - - - {photo.title} - - - - - {authorName} + {interacted ? ( + + ) : undefined} + {likeCount > 0 ? ( + + + + {formatCount(i18n, likeCount)} + + + ) : undefined} + + + {photo.title} - - + + + + {authorName} + + + + + ) } diff --git a/src/screens/Atmosphere/components/PublicationCard.tsx b/src/screens/Atmosphere/components/PublicationCard.tsx deleted file mode 100644 index 022850fca..000000000 --- a/src/screens/Atmosphere/components/PublicationCard.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import {type AtmospherePublicationCardData} from '#/screens/Atmosphere/data/exploreData' -import {atoms as a, useTheme, utils} from '#/alf' -import {PublicationCard as SharedPublicationCard} from '#/components/Post/Embed/StandardSiteEmbed' -import type * as ssTypes from '#/components/Post/Embed/StandardSiteEmbed/types' -import {type ExploreGalleryFocusProps} from './ExploreGallery' - -export function PublicationCard({ - publication, - width, - galleryFocus, -}: { - publication: AtmospherePublicationCardData - width?: number - galleryFocus?: ExploreGalleryFocusProps -}) { - const t = useTheme() - const {accentRGB, accentForegroundRGB} = publication.view.source?.theme || {} - let themeColors: ssTypes.ThemeColors = { - custom: false, - accent: t.atoms.text.color, - accentForeground: t.atoms.text_inverted.color, - } - if (accentRGB && accentForegroundRGB) { - themeColors = { - custom: true, - accent: utils.rgbToHex(accentRGB.r, accentRGB.g, accentRGB.b), - accentForeground: utils.rgbToHex( - accentForegroundRGB.r, - accentForegroundRGB.g, - accentForegroundRGB.b, - ), - } - } - - return ( - - ) -} diff --git a/src/screens/Atmosphere/components/__tests__/AppDialog.test.tsx b/src/screens/Atmosphere/components/__tests__/AppDialog.test.tsx new file mode 100644 index 000000000..eb96f124f --- /dev/null +++ b/src/screens/Atmosphere/components/__tests__/AppDialog.test.tsx @@ -0,0 +1,128 @@ +import {fireEvent, render, screen} from '@testing-library/react-native' + +import {type app as lexApp} from '#/lexicons' +import {AppDialog} from '../AppDialog' + +const calls: string[] = [] +const mockOpenLink = jest.fn((url: string) => calls.push(`open:${url}`)) +const mockNavigate = jest.fn((...args: unknown[]) => + calls.push(`navigate:${JSON.stringify(args)}`), +) + +jest.mock('@lingui/react', () => ({ + useLingui: () => ({_: (value: {message: string}) => value.message}), +})) +jest.mock('@react-navigation/native', () => ({ + useNavigation: () => ({navigate: mockNavigate}), +})) +jest.mock('#/lib/hooks/useOpenLink', () => ({ + useOpenLink: () => mockOpenLink, +})) +jest.mock('expo-image', () => ({Image: () => null})) +jest.mock('#/components/MediaInsetBorder', () => ({ + MediaInsetBorder: () => null, +})) +jest.mock('#/components/icons/Square', () => ({ + SquareArrowTopRight_Stroke2_Corner0_Rounded: () => null, +})) +jest.mock('#/components/Typography', () => { + const {Text} = + jest.requireActual('react-native') + return {Text} +}) +jest.mock('#/components/Button', () => ({ + ButtonText: ({children}: {children: React.ReactNode}) => children, + ButtonIcon: () => null, +})) +jest.mock('#/components/Link', () => { + const {Pressable} = + jest.requireActual('react-native') + return { + isClickEventWithMetaKey: () => false, + Link: ({ + testID, + onPress, + children, + }: { + testID?: string + onPress: (e: {preventDefault: () => void}) => void + children: React.ReactNode + }) => ( + onPress({preventDefault: () => {}})}> + {children} + + ), + } +}) +jest.mock('#/lib/routes/links', () => ({makeProfileLink: () => '/profile/x'})) +jest.mock('#/components/Dialog', () => ({ + Outer: ({children}: {children: React.ReactNode}) => children, + Handle: () => null, + Close: () => null, + ScrollableInner: ({children}: {children: React.ReactNode}) => children, + useDialogContext: () => ({ + close: (cb?: () => void) => { + calls.push('close') + cb?.() + }, + }), +})) +jest.mock('#/alf', () => ({ + atoms: new Proxy({}, {get: () => ({})}), + web: () => ({}), + useTheme: () => ({ + atoms: new Proxy({}, {get: () => ({})}), + palette: new Proxy({}, {get: () => '#000'}), + }), +})) + +const app: lexApp.bsky.unspecced.getAtmosphereApps.AppCard = { + id: 'app', + title: 'Test app', + description: 'A description', + logo: 'https://example.com/logo.png', + banner: 'https://example.com/banner.png', + url: 'https://example.com/app', + category: 'writing', + profile: {did: 'did:plc:abc', handle: 'app.test'}, +} + +const control = {} as React.ComponentProps['control'] + +beforeEach(() => { + jest.clearAllMocks() + calls.length = 0 +}) + +describe('AppDialog', () => { + it('closes, then opens the app url', () => { + render() + fireEvent.press(screen.getByTestId('appDialogVisit')) + expect(calls).toEqual(['close', `open:${app.url}`]) + }) + + it('closes, then navigates to the profile', () => { + render() + fireEvent.press(screen.getByTestId('appDialogProfile')) + expect(calls).toEqual([ + 'close', + `navigate:${JSON.stringify(['Profile', {name: 'did:plc:abc'}])}`, + ]) + }) + + it('hides View profile without a profile', () => { + render() + expect(screen.queryByTestId('appDialogProfile')).toBeNull() + }) + + it('shows the mapped category label, and omits unknown ones', () => { + const {rerender} = render() + expect(screen.getByText('Blogging')).toBeTruthy() + rerender() + expect(screen.queryByText('Blogging')).toBeNull() + expect(screen.queryByText('nope')).toBeNull() + }) +}) diff --git a/src/screens/Atmosphere/components/__tests__/AtmosphereCardMenu.test.tsx b/src/screens/Atmosphere/components/__tests__/AtmosphereCardMenu.test.tsx new file mode 100644 index 000000000..918b3beb9 --- /dev/null +++ b/src/screens/Atmosphere/components/__tests__/AtmosphereCardMenu.test.tsx @@ -0,0 +1,341 @@ +import {fireEvent, render, screen} from '@testing-library/react-native' + +import * as Menu from '#/components/Menu' +import {type app, place, site, social} from '#/lexicons' +import {AtmosphereCardMenu} from '../AtmosphereCardMenu' + +const mockOpenLink = jest.fn() +const mockNavigate = jest.fn() +const mockOpenReport = jest.fn() + +/* Report availability relies on real CID validation, which the repo mocks. */ +jest.unmock('multiformats/cid') +jest.mock('@lingui/react', () => ({ + useLingui: () => ({ + _: (value: {message: string}) => value.message, + i18n: {number: String}, + }), +})) +jest.mock('#/alf', () => ({atoms: new Proxy({}, {get: () => ({})})})) +jest.mock('#/lib/hooks/useOpenLink', () => ({ + useOpenLink: () => mockOpenLink, +})) +jest.mock('@react-navigation/native', () => ({ + useNavigation: () => ({navigate: mockNavigate}), +})) +jest.mock('#/components/moderation/ReportDialog', () => ({ + getAssociatedReportSubjects: jest.requireActual< + typeof import('#/components/moderation/ReportDialog/utils/parseReportSubject') + >('#/components/moderation/ReportDialog/utils/parseReportSubject') + .getAssociatedReportSubjects, + useGetCopyForSubject: jest.requireActual< + typeof import('#/components/moderation/ReportDialog/copy') + >('#/components/moderation/ReportDialog/copy').useGetCopyForSubject, + useGlobalReportDialogControl: () => ({open: mockOpenReport}), +})) +jest.mock('#/components/Button', () => { + const {Pressable} = + jest.requireActual('react-native') + return { + Button: ({label, testID}: {label: string; testID?: string}) => ( + + ), + ButtonIcon: () => null, + } +}) +jest.mock('#/components/icons/DotGrid', () => ({ + DotGrid3x1_Stroke2_Corner0_Rounded: () => null, +})) +jest.mock('#/components/icons/Person', () => ({ + Person_Stroke2_Corner0_Rounded: () => null, +})) +jest.mock('#/components/icons/Square', () => ({ + SquareArrowTopRight_Stroke2_Corner0_Rounded: () => null, +})) +jest.mock('#/components/icons/Warning', () => ({ + Warning_Stroke2_Corner0_Rounded: () => null, +})) +jest.mock('#/components/Menu', () => { + const {Pressable, Text, View} = + jest.requireActual('react-native') + const {Children, isValidElement} = + jest.requireActual('react') + /* Lowercase so the React Compiler doesn't instrument it inside the factory. */ + const menuItem = ({ + children, + label, + disabled, + onPress, + }: { + children: React.ReactNode + label: string + disabled?: boolean + onPress: () => void + }) => ( + + {children} + + ) + return { + Root: ({children}: {children: React.ReactNode}) => children, + Trigger: ({ + children, + label, + }: { + children: (state: {props: {onFocus: () => void}}) => React.ReactNode + label: string + }) => ( + + {children({props: {onFocus() {}}})} + + ), + Outer: ({children}: {children: React.ReactNode}) => {children}, + /* + * Mirrors the native Group, which drops any child that isn't a direct + * Menu.Item, so wrapped items fail here as they would on device. + */ + Group: ({children}: {children: React.ReactNode}) => ( + + {Children.toArray(children).filter( + child => isValidElement(child) && child.type === menuItem, + )} + + ), + Divider: () => , + Item: menuItem, + ItemText: Text, + ItemIcon: () => null, + } +}) + +const author: app.bsky.actor.defs.ProfileViewBasic = { + did: 'did:plc:6ayddqghxhciedbaofoxkcbs', + handle: 'author.test', +} + +const REPO = 'at://did:plc:6ayddqghxhciedbaofoxkcbs' +const documentRef = { + uri: `${REPO}/${site.standard.document.$type}/3kdoc`, + cid: 'bafyreicl6ujc6ncfktctxxroxognfn7d2fqavvrryoc2lv6m4i6hpbkfti', +} +const publicationRef = { + uri: `${REPO}/${site.standard.publication.$type}/3kpub`, + cid: 'bafyreig3yg2msah74sgvow25uxddqbabex3f3mh6hysess3w5kmgiv6zqy', +} +const view = { + uri: 'https://example.com/thing', + title: 'A thing', + description: '', +} +type Ref = {uri: string; cid: string} +const galleryRef = { + uri: `${REPO}/${social.grain.gallery.$type}/3kgallery`, + cid: documentRef.cid, +} +const photoRef = { + uri: `${REPO}/${social.grain.photo.$type}/3kphoto`, + cid: publicationRef.cid, +} +const livestreamRef = { + uri: `${REPO}/${place.stream.livestream.$type}/3klive`, + cid: documentRef.cid, +} +const associatedRefs = [ + publicationRef, + photoRef, + galleryRef, + livestreamRef, + documentRef, +] +const items = { + article: {...view, associatedRefs}, + photo: {...view, items: [], associatedRefs}, + publication: {...view, associatedRefs}, + livestream: {...view, active: false, associatedRefs}, +} +type MenuType = keyof typeof items +const defaultReportableTypes: Record = { + article: site.standard.document.$type, + photo: social.grain.gallery.$type, + publication: site.standard.publication.$type, + livestream: place.stream.livestream.$type, +} + +function renderMenu( + type: MenuType, + overrides: {associatedRefs?: Ref[]} = {}, + children?: React.ReactNode, + reportableTypes: readonly string[] = [defaultReportableTypes[type]], + withAuthor = true, +) { + const props = { + type, + item: {...items[type], ...overrides}, + reportableTypes, + author: withAuthor ? author : undefined, + children, + } as unknown as React.ComponentProps + return render() +} + +beforeEach(() => { + jest.clearAllMocks() +}) + +describe.each([ + [ + 'article', + 'Article options', + 'View article', + 'Report article', + 'Report this article', + documentRef, + ], + [ + 'photo', + 'Photo options', + 'View photo', + 'Report photo', + 'Report this gallery', + galleryRef, + ], + [ + 'publication', + 'Publication options', + 'View publication', + 'Report publication', + 'Report this publication', + publicationRef, + ], + [ + 'livestream', + 'Livestream options', + 'View livestream', + 'Report livestream', + 'Report this livestream', + livestreamRef, + ], +] as const)( + 'AtmosphereCardMenu %s', + (type, trigger, viewLabel, fallback, reportLabel, record) => { + const labels = () => + screen.getAllByRole('menuitem').map(i => i.props.accessibilityLabel) + + const allowedCollection = defaultReportableTypes[type] + + it('omits the profile action without an author', () => { + renderMenu(type, {}, undefined, undefined, false) + + expect(labels()).toEqual([viewLabel, reportLabel]) + }) + + it('lists only the record types allowed by the callsite', () => { + renderMenu(type) + + expect( + screen.getByTestId('atmosphereCardMenuTrigger').props + .accessibilityLabel, + ).toBe(trigger) + expect(labels()).toEqual([viewLabel, 'View author profile', reportLabel]) + }) + + it('opens the external uri', () => { + renderMenu(type) + + fireEvent.press(screen.getByLabelText(viewLabel)) + expect(mockOpenLink).toHaveBeenCalledWith(view.uri) + }) + + it('navigates to the author by DID', () => { + renderMenu(type) + + fireEvent.press(screen.getByLabelText('View author profile')) + expect(mockNavigate).toHaveBeenCalledWith('Profile', {name: author.did}) + }) + + it('opens the dialog with exactly the allowed record', () => { + renderMenu(type) + + const item = screen.getByLabelText(reportLabel) + expect(item).toBeEnabled() + fireEvent.press(item) + expect(mockOpenReport).toHaveBeenCalledTimes(1) + expect(mockOpenReport).toHaveBeenCalledWith({ + subject: {$type: 'com.atproto.repo.strongRef', ...record}, + }) + }) + + it.each(['app.test.thing', `${allowedCollection}.extra`])( + 'does not offer unlisted collection %s', + collection => { + const unlisted = { + uri: `${REPO}/${collection}/3kabc`, + cid: documentRef.cid, + } + renderMenu(type, {associatedRefs: [unlisted, unlisted]}) + + expect(labels()).toEqual([viewLabel, 'View author profile', fallback]) + expect(screen.getByLabelText(fallback)).toBeDisabled() + }, + ) + + it.each([ + ['no refs', undefined], + ['empty refs', []], + ['only invalid refs', [{uri: 'https://example.com/thing', cid: 'nope'}]], + ])('disables Report and keeps it inert with %s', (_name, refs) => { + renderMenu(type, {associatedRefs: refs}) + + const item = screen.getByLabelText(fallback) + expect(item).toBeDisabled() + fireEvent.press(item) + expect(mockOpenReport).not.toHaveBeenCalled() + }) + }, +) + +it('places extra children after the profile item and before Report', () => { + renderMenu( + 'article', + {}, + {}}> + Extra + , + ) + + expect( + screen.getAllByRole('menuitem').map(i => i.props.accessibilityLabel), + ).toEqual([ + 'View article', + 'View author profile', + 'Extra', + 'Report this article', + ]) +}) + +it('uses the explicit callsite allowlist rather than inferring it from the card', () => { + renderMenu('article', {}, undefined, [social.grain.gallery.$type]) + + expect(screen.queryByLabelText('Report this article')).toBeNull() + fireEvent.press(screen.getByLabelText('Report this gallery')) + expect(mockOpenReport).toHaveBeenCalledWith({ + subject: {$type: 'com.atproto.repo.strongRef', ...galleryRef}, + }) +}) + +it('does not offer reports when the callsite allows no record types', () => { + renderMenu('article', {}, undefined, []) + + expect(screen.getByLabelText('Report article')).toBeDisabled() + expect(screen.queryByLabelText('Report this article')).toBeNull() +}) diff --git a/src/screens/Atmosphere/components/__tests__/ExploreGallery.test.tsx b/src/screens/Atmosphere/components/__tests__/ExploreGallery.test.tsx index 6731bb2b6..c31af516c 100644 --- a/src/screens/Atmosphere/components/__tests__/ExploreGallery.test.tsx +++ b/src/screens/Atmosphere/components/__tests__/ExploreGallery.test.tsx @@ -40,12 +40,12 @@ jest.mock('#/view/shell/BlockDrawerGesture', () => ({ BlockDrawerGesture: ({children}: {children: React.ReactNode}) => children, })) -type Item = {id: string; title: string} +type Item = {uri: string; title: string} const items: Item[] = [ - {id: 'a', title: 'Alpha'}, - {id: 'b', title: 'Beta'}, - {id: 'c', title: 'Gamma'}, + {uri: 'a', title: 'Alpha'}, + {uri: 'b', title: 'Beta'}, + {uri: 'c', title: 'Gamma'}, ] function flat(style: unknown): ViewStyle { @@ -69,7 +69,7 @@ function FocusCard({ }) { return ( { expect(slides()).toHaveLength(0) }) - it('keys slides by id, not by array index', () => { + it('keys slides by URI, not by array index', () => { function Probe({item}: {item: Item}) { // Remembers the title it first mounted with, so a stale index key shows const [initial] = useState(item.title) diff --git a/src/screens/Atmosphere/components/__tests__/ExploreSectionHeader.test.tsx b/src/screens/Atmosphere/components/__tests__/ExploreSectionHeader.test.tsx index 5ed5adb32..4028429f8 100644 --- a/src/screens/Atmosphere/components/__tests__/ExploreSectionHeader.test.tsx +++ b/src/screens/Atmosphere/components/__tests__/ExploreSectionHeader.test.tsx @@ -1,20 +1,65 @@ -import {render, screen} from '@testing-library/react-native' +import {fireEvent, render, screen} from '@testing-library/react-native' import {ExploreSectionHeader} from '../ExploreSectionHeader' +jest.mock('@lingui/react', () => ({ + useLingui: () => ({_: (value: {message: string}) => value.message}), + Trans: ({message}: {message: string}) => message, +})) jest.mock('#/alf', () => ({ - atoms: {text_lg: {}, font_semi_bold: {}}, + atoms: new Proxy({}, {get: () => ({})}), + useTheme: () => ({palette: {primary_500: 'blue'}}), +})) +jest.mock('#/components/icons/Arrow', () => ({ + ArrowRight_Stroke2_Corner0_Rounded: () => null, })) +jest.mock('#/components/Button', () => { + const {Pressable} = + jest.requireActual('react-native') + return { + Button: ({ + children, + label, + onPress, + }: { + children: (state: {hovered: boolean; pressed: boolean}) => React.ReactNode + label: string + onPress: () => void + }) => ( + + {children({hovered: false, pressed: false})} + + ), + } +}) jest.mock('#/components/Typography', () => { const {Text} = jest.requireActual('react-native') return {Text} }) -it('renders an accessible section heading without a see-more link', () => { +it('renders an accessible section heading without a see-more button', () => { render() expect(screen.getByRole('header', {name: 'Featured articles'})).toBeTruthy() expect(screen.queryByText('See more')).toBeNull() - expect(screen.queryByRole('link')).toBeNull() + expect(screen.queryByRole('button')).toBeNull() +}) + +it('calls seeMore.onPress from the see-more button', () => { + const onPress = jest.fn() + render( + , + ) + + fireEvent.press(screen.getByRole('button', {name: 'See more apps'})) + + expect(onPress).toHaveBeenCalledTimes(1) }) diff --git a/src/screens/Atmosphere/components/__tests__/FeaturedAppCard.test.tsx b/src/screens/Atmosphere/components/__tests__/FeaturedAppCard.test.tsx new file mode 100644 index 000000000..ad516ee4b --- /dev/null +++ b/src/screens/Atmosphere/components/__tests__/FeaturedAppCard.test.tsx @@ -0,0 +1,86 @@ +import {render, screen} from '@testing-library/react-native' + +import {type FeaturedApp} from '#/screens/Atmosphere/data/exploreData' +import {FeaturedAppCard} from '../FeaturedAppCard' + +jest.mock('@lingui/react', () => ({ + useLingui: () => ({_: (value: {message: string}) => value.message}), +})) +jest.mock('expo-image', () => ({Image: () => null})) +jest.mock('../AppKnownFollowers', () => ({AppKnownFollowers: () => null})) +jest.mock('#/components/icons/Square', () => ({ + SquareArrowTopRight_Stroke2_Corner0_Rounded: () => null, +})) +jest.mock('#/components/Typography', () => { + const {Text} = + jest.requireActual('react-native') + return {Text} +}) +jest.mock('#/components/Button', () => ({ + ButtonText: ({children}: {children: React.ReactNode}) => children, + ButtonIcon: () => null, +})) +jest.mock('#/components/Link', () => { + const {Pressable} = + jest.requireActual('react-native') + return { + Link: ({ + to, + label, + testID, + }: { + to: string + label: string + testID?: string + }) => ( + + ), + } +}) +jest.mock('#/alf', () => ({ + atoms: new Proxy({}, {get: () => ({})}), + useTheme: () => ({ + name: 'light', + atoms: new Proxy({}, {get: () => ({})}), + }), + ThemeProvider: ({children}: {children: React.ReactNode}) => children, +})) + +const app: FeaturedApp = { + id: 'app', + title: 'Test app', + url: 'https://example.com/app', + backgroundImage: 'https://example.com/bg.jpg', + profile: {did: 'did:plc:6ayddqghxhciedbaofoxkcbs', handle: 'app.test'}, +} + +describe('FeaturedAppCard', () => { + it('links Visit app to the app url', () => { + render() + + expect( + screen.getByTestId('featuredAppVisit').props.accessibilityValue, + ).toEqual({text: app.url}) + }) + + it('links View profile to the profile', () => { + render() + + expect( + screen.getByTestId('featuredAppProfile').props.accessibilityValue, + ).toEqual({text: '/profile/app.test'}) + }) + + it('hides View profile without a profile', () => { + render() + + expect(screen.getByTestId('featuredAppVisit')).toBeTruthy() + expect(screen.queryByTestId('featuredAppProfile')).toBeNull() + }) +}) diff --git a/src/screens/Atmosphere/components/__tests__/FeaturedPublications.test.tsx b/src/screens/Atmosphere/components/__tests__/FeaturedPublications.test.tsx new file mode 100644 index 000000000..47bc892f9 --- /dev/null +++ b/src/screens/Atmosphere/components/__tests__/FeaturedPublications.test.tsx @@ -0,0 +1,143 @@ +import {Children} from 'react' +import {View} from 'react-native' +import {render, screen} from '@testing-library/react-native' + +import {PublicationCard} from '#/components/atmosphere/SiteStandard/Publication' +import {type app} from '#/lexicons' +import {FeaturedPublications} from '../FeaturedPublications' + +jest.mock('@lingui/react', () => ({ + useLingui: () => ({_: (value: {message: string}) => value.message}), +})) +jest.mock('#/alf', () => { + const atoms = new Proxy({}, {get: () => ({})}) + return { + atoms, + web: () => undefined, + extractPadding: + jest.requireActual( + '#/alf/util/flatten', + ).extractPadding, + useTheme: () => ({ + atoms: new Proxy( + {}, + {get: (_, name) => ({color: `theme-${String(name)}`})}, + ), + }), + } +}) +jest.mock('#/env', () => ({IS_NATIVE: false})) +jest.mock('#/analytics', () => ({useAnalytics: () => ({metric: jest.fn()})})) +jest.mock('#/lib/haptics', () => ({ + useHaptics: () => ({tap: jest.fn(), longPress: jest.fn()}), +})) +jest.mock('#/lib/sharing', () => ({shareUrl: jest.fn()})) +jest.mock('#/view/com/util/UserAvatar', () => ({ + UserAvatar: ({avatar}: {avatar?: string}) => { + const {Text} = + jest.requireActual('react-native') + return {avatar} + }, +})) +jest.mock('#/components/AvatarStack', () => ({AvatarStack: () => null})) +jest.mock('#/components/MediaInsetBorder', () => ({ + MediaInsetBorder: () => null, +})) +jest.mock('#/components/Typography', () => { + const {Text} = + jest.requireActual('react-native') + return {Text} +}) +jest.mock('#/components/atmosphere/SiteStandard/StandardSiteMetaRow', () => ({ + StandardSiteMetaRow: () => null, +})) +jest.mock('#/screens/Atmosphere/components/AtmosphereCardMenu', () => ({ + AtmosphereCardMenu: () => null, +})) + +/* + * A stand-in for Link that keeps the props under test on a single host + * element and renders the card's render-prop children. + */ +jest.mock('#/components/Link', () => { + const {Pressable: HostPressable} = + jest.requireActual('react-native') + return { + Link: ({ + children, + label, + to, + }: { + children: (state: {pressed: boolean}) => React.ReactNode + label: string + to: string + }) => ( + + {children({pressed: false})} + + ), + } +}) + +const publication: app.bsky.embed.external.ViewArticlePublication = { + uri: 'https://example.com/pub', + title: 'Test publication', + description: 'A description', + logo: 'https://example.com/logo.png', + theme: { + accent: '#123456', + accentForeground: '#ffffff', + }, +} + +describe('FeaturedPublications', () => { + it('hands the original lexicon view to the card and links it to the publication', () => { + render() + + expect(screen.UNSAFE_getByType(PublicationCard).props.view).toBe( + publication, + ) + expect(screen.getByRole('link').props.accessibilityValue).toEqual({ + text: 'https://example.com/pub', + }) + expect(screen.getByTestId('logo').props.children).toBe( + 'https://example.com/logo.png', + ) + expect(screen.getByText('A description')).toBeTruthy() + }) + + it('does not render a raw text node for an empty description', () => { + render( + , + ) + + /* + * Inspect the supplied children: the native test renderer can drop empty + * strings from its output, while React Native Web checks props directly. + */ + const rawTextNodes = screen + .UNSAFE_getAllByType(View) + .flatMap(view => Children.toArray(view.props.children)) + .filter(child => typeof child === 'string' || typeof child === 'number') + expect(rawTextNodes).toEqual([]) + }) + + it('falls back to an initial when there is no logo or theme', () => { + render( + , + ) + + expect(screen.queryByTestId('logo')).toBeNull() + expect(screen.getByText('T')).toBeTruthy() + expect(screen.getAllByRole('link')).toHaveLength(1) + }) +}) diff --git a/src/screens/Atmosphere/components/__tests__/FeaturedSections.test.tsx b/src/screens/Atmosphere/components/__tests__/FeaturedSections.test.tsx index 7d6f368bb..9eacf4586 100644 --- a/src/screens/Atmosphere/components/__tests__/FeaturedSections.test.tsx +++ b/src/screens/Atmosphere/components/__tests__/FeaturedSections.test.tsx @@ -1,12 +1,6 @@ -import {type StyleProp, StyleSheet, type ViewStyle} from 'react-native' import {render, screen} from '@testing-library/react-native' -import { - type AtmosphereArticleCardData, - type AtmosphereLivestreamCardData, - type AtmospherePhotoCardData, - type AtmospherePublicationCardData, -} from '#/screens/Atmosphere/data/exploreData' +import {type app} from '#/lexicons' import {type ExploreGalleryFocusProps} from '../ExploreGallery' import {FeaturedArticles} from '../FeaturedArticles' import {FeaturedLivestreams} from '../FeaturedLivestreams' @@ -30,6 +24,7 @@ jest.mock('#/view/shell/BlockDrawerGesture', () => ({ })) jest.mock('#/alf', () => ({ atoms: new Proxy({}, {get: () => ({})}), + tokens: {space: {lg: 16}}, web: () => undefined, })) @@ -51,56 +46,80 @@ function mockCard(prefix: string, prop: string) { const {Pressable} = jest.requireActual('react-native') return ({ - width, galleryFocus, ...rest }: Record & { - width?: number galleryFocus?: ExploreGalleryFocusProps }) => { - const item = rest[prop] as {id: string; title: string} + const item = rest[prop] as {uri: string; title: string} return ( ) } } -jest.mock('../ArticleCard', () => ({ - ArticleCard: mockCard('article', 'article'), +jest.mock('#/components/atmosphere/SiteStandard/DocumentCompact', () => ({ + DocumentCompact: mockCard('article', 'view'), })) +jest.mock('#/components/Divider', () => { + const {View} = + jest.requireActual('react-native') + return { + Divider: () => , + } +}) jest.mock('../LivestreamCard', () => ({ LivestreamCard: mockCard('livestream', 'livestream'), })) -jest.mock('../PublicationCard', () => ({ - PublicationCard: mockCard('publication', 'publication'), +jest.mock('#/components/atmosphere/SiteStandard/Publication', () => ({ + PublicationCard: mockCard('publication', 'view'), })) jest.mock('../PhotoCard', () => ({PhotoCard: mockCard('photo', 'photo')})) -const articles = [ - {id: 'a1', title: 'First article'}, - {id: 'a2', title: 'Second article'}, -] as AtmosphereArticleCardData[] -const livestreams = [ - {id: 'l1', title: 'First stream'}, - {id: 'l2', title: 'Second stream'}, -] as AtmosphereLivestreamCardData[] -const photos = [ - {id: 'p1', title: 'First photo'}, - {id: 'p2', title: 'Second photo'}, -] as AtmospherePhotoCardData[] - -const publications = [ - {id: 'u1', title: 'First publication'}, - {id: 'u2', title: 'Second publication'}, -] as AtmospherePublicationCardData[] +const articles: app.bsky.embed.external.ViewArticle[] = [ + {uri: 'https://example.com/a1', title: 'First article', description: ''}, + {uri: 'https://example.com/a2', title: 'Second article', description: ''}, +] +const livestreams: app.bsky.embed.external.ViewLivestream[] = [ + { + uri: 'https://example.com/l1', + title: 'First stream', + description: '', + active: true, + }, + { + uri: 'https://example.com/l2', + title: 'Second stream', + description: '', + active: false, + }, +] +const photos: app.bsky.embed.external.ViewGallery[] = [ + { + uri: 'https://example.com/p1', + title: 'First photo', + description: '', + items: [], + }, + { + uri: 'https://example.com/p2', + title: 'Second photo', + description: '', + items: [], + }, +] + +const publications: app.bsky.embed.external.ViewArticlePublication[] = [ + {uri: 'https://example.com/u1', title: 'First publication', description: ''}, + {uri: 'https://example.com/u2', title: 'Second publication', description: ''}, +] function slides() { return screen.UNSAFE_root.findAll( @@ -110,43 +129,28 @@ function slides() { ) } -function flat(style: unknown): ViewStyle { - return StyleSheet.flatten(style as StyleProp) ?? {} -} - -function width(testID: string) { - return flat(screen.getByTestId(testID).props.style).width -} - describe('FeaturedArticles', () => { - it('renders the header and one slide per article in a labelled gallery', () => { + it('renders compact documents in response order with dividers only between rows', () => { render() expect(screen.getByText('Featured articles')).toBeTruthy() - expect(screen.getByTestId('atmosphereArticlesGallery')).toBeTruthy() - expect(slides().map(slide => slide.props['aria-label'])).toEqual([ - 'First article', - 'Second article', - ]) - expect(width('article-a1')).toBe(250) - expect(width('article-a2')).toBe(250) - }) - - it('wires the gallery focus target to each card', () => { - render() - - expect(screen.getByTestId('article-a1').props.tabIndex).toBe(0) - expect(screen.getByTestId('article-a2').props.tabIndex).toBe(-1) - for (const slide of slides()) { - expect(slide.props.tabIndex).toBeUndefined() - } + expect(screen.getByTestId('atmosphereArticlesList')).toBeTruthy() + expect(screen.queryByTestId('atmosphereArticlesGallery')).toBeNull() + expect(slides()).toHaveLength(0) + expect( + screen + .getAllByTestId(/^(article-|articleDivider$)/) + .map(row => row.props.testID), + ).toEqual(['article-a1', 'articleDivider', 'article-a2']) + expect(screen.getByTestId('article-a1').props.tabIndex).toBeUndefined() }) it('renders nothing, including the header, without articles', () => { render() expect(screen.queryByText('Featured articles')).toBeNull() - expect(screen.queryByTestId('atmosphereArticlesGallery')).toBeNull() + expect(screen.queryByTestId('atmosphereArticlesList')).toBeNull() + expect(screen.queryByTestId('articleDivider')).toBeNull() }) }) @@ -160,8 +164,6 @@ describe('FeaturedLivestreams', () => { 'First stream', 'Second stream', ]) - expect(width('livestream-l1')).toBe(214) - expect(width('livestream-l2')).toBe(214) }) it('wires the gallery focus target to each card', () => { @@ -191,19 +193,6 @@ describe('FeaturedPhotos', () => { ]) }) - it('keeps the card inside a 225px wrapper', () => { - render() - - for (const id of ['p1', 'p2']) { - // The card itself is unsized; the nearest sized ancestor is the wrapper - let node = screen.getByTestId(`photo-${id}`).parent - while (node && flat(node.props.style).width == null) { - node = node.parent - } - expect(flat(node?.props.style).width).toBe(225) - } - }) - it('wires the gallery focus target to each card', () => { render() @@ -220,24 +209,20 @@ describe('FeaturedPhotos', () => { }) describe('FeaturedPublications', () => { - it('renders the header and one slide per publication in a labelled gallery', () => { + it('renders publications as links without gallery focus', () => { render() expect(screen.getByText('Featured publications')).toBeTruthy() - expect(screen.getByTestId('atmospherePublicationsGallery')).toBeTruthy() - expect(slides().map(slide => slide.props['aria-label'])).toEqual([ - 'First publication', - 'Second publication', + expect(screen.queryByTestId('atmospherePublicationsGallery')).toBeNull() + expect(slides()).toHaveLength(0) + expect(screen.getAllByRole('link').map(link => link.props.testID)).toEqual([ + 'publication-u1', + 'publication-u2', ]) - expect(width('publication-u1')).toBe(320) - expect(width('publication-u2')).toBe(320) - }) - - it('wires the gallery focus target to each card', () => { - render() - - expect(screen.getByTestId('publication-u1').props.tabIndex).toBe(0) - expect(screen.getByTestId('publication-u2').props.tabIndex).toBe(-1) + for (const publication of publications) { + const testID = `publication-${publication.uri.split('/').at(-1)}` + expect(screen.getByTestId(testID).props.tabIndex).toBeUndefined() + } }) it('renders nothing, including the header, without publications', () => { diff --git a/src/screens/Atmosphere/components/__tests__/PublicationCard.test.tsx b/src/screens/Atmosphere/components/__tests__/PublicationCard.test.tsx deleted file mode 100644 index ce01e4778..000000000 --- a/src/screens/Atmosphere/components/__tests__/PublicationCard.test.tsx +++ /dev/null @@ -1,251 +0,0 @@ -import {Children} from 'react' -import {StyleSheet, View} from 'react-native' -import {fireEvent, render, screen} from '@testing-library/react-native' - -import {type AtmospherePublicationCardData} from '#/screens/Atmosphere/data/exploreData' -import {PublicationCard} from '../PublicationCard' - -const mockBreakpoints = {gtPhone: true} - -jest.mock('@lingui/react', () => ({ - useLingui: () => ({_: (value: {message: string}) => value.message}), -})) -jest.mock('#/alf', () => { - const atoms = new Proxy( - {}, - {get: (_, name) => (name === 'flex_grow' ? {flexGrow: 1} : {})}, - ) - return { - atoms, - web: () => undefined, - utils: jest.requireActual( - '#/alf/util/colorGeneration', - ), - useBreakpoints: () => mockBreakpoints, - useTheme: () => ({ - atoms: new Proxy( - {}, - {get: (_, name) => ({color: `theme-${String(name)}`})}, - ), - }), - } -}) -jest.mock('#/env', () => ({IS_NATIVE: false})) -jest.mock('#/analytics', () => ({useAnalytics: () => ({metric: jest.fn()})})) -jest.mock('#/lib/haptics', () => ({ - useHaptics: () => ({tap: jest.fn(), longPress: jest.fn()}), -})) -jest.mock('#/lib/sharing', () => ({shareUrl: jest.fn()})) -jest.mock('#/view/com/util/UserAvatar', () => ({ - UserAvatar: ({avatar}: {avatar?: string}) => { - const {Text} = - jest.requireActual('react-native') - return {avatar} - }, -})) -jest.mock('#/components/MediaInsetBorder', () => ({ - MediaInsetBorder: () => null, -})) -jest.mock('#/components/Divider', () => ({Divider: () => null})) -jest.mock('#/components/Button', () => ({ - ButtonIcon: () => null, - ButtonText: ({children}: {children: React.ReactNode}) => children, -})) -jest.mock('#/components/Typography', () => { - const {Text} = - jest.requireActual('react-native') - return {Text} -}) -jest.mock('#/components/icons/Arrow', () => ({ - ArrowTopRight_Stroke2_Corner0_Rounded: () => null, -})) -jest.mock('#/components/icons/Clock', () => ({ - Clock_Stroke2_Corner0_Rounded: () => null, -})) -jest.mock('#/components/icons/community/StandardSite', () => ({ - StandardSite: () => null, -})) -jest.mock( - '#/components/Post/Embed/StandardSiteEmbed/StandardSiteMetaRow', - () => ({StandardSiteMetaRow: () => null}), -) -jest.mock( - '#/components/Post/Embed/StandardSiteEmbed/StandardSiteThemeProvider', - () => ({ - StandardSiteThemeProvider: ({children}: {children: React.ReactNode}) => - children, - }), -) - -/* - * A stand-in for Link that keeps the props under test on a single host - * element. The shared card and its subscribe button render through it. - */ -jest.mock('#/components/Link', () => { - const {Pressable: HostPressable} = - jest.requireActual('react-native') - return { - Link: ({ - children, - label, - to, - ref, - tabIndex, - onFocus, - }: { - children: React.ReactNode - label: string - to: string - ref?: React.Ref - tabIndex?: number - onFocus?: (e: unknown) => void - }) => ( - - {typeof children === 'function' ? null : children} - - ), - } -}) - -const publication: AtmospherePublicationCardData = { - id: 'https://example.com/pub', - title: 'Test publication', - view: { - uri: 'https://example.com/pub', - title: 'Test publication', - description: 'A description', - source: { - uri: 'https://example.com/pub', - title: 'Test publication', - icon: 'https://example.com/logo.png', - theme: { - accentRGB: {r: 18, g: 52, b: 86}, - accentForegroundRGB: {r: 255, g: 255, b: 255}, - }, - }, - }, -} - -function links() { - return screen.getAllByRole('link') -} - -function focusProps(tabIndex: 0 | -1 | undefined) { - return {focusRef: jest.fn(), tabIndex, onFocus: jest.fn()} -} - -beforeEach(() => { - mockBreakpoints.gtPhone = true -}) - -describe.each([true, false])('PublicationCard (gtPhone: %s)', gtPhone => { - /* The Atmosphere card hides the CTA on wide layouts (`hideSubscribe`). */ - const linkCount = gtPhone ? 1 : 2 - - beforeEach(() => { - mockBreakpoints.gtPhone = gtPhone - }) - - it('lets the shared card fill a stretched slide while keeping its width', () => { - render() - expect(StyleSheet.flatten(screen.root.props.style)).toMatchObject({ - flexGrow: 1, - width: 320, - }) - }) - - it('renders the primary link and the call to action', () => { - render() - - expect(links()).toHaveLength(linkCount) - for (const link of links()) { - expect(link.props.accessibilityValue).toEqual({ - text: 'https://example.com/pub', - }) - } - expect(screen.getByTestId('logo').props.children).toBe( - 'https://example.com/logo.png', - ) - expect(screen.getByText('A description')).toBeTruthy() - }) - - it.each([0, -1, undefined] as const)( - 'gives both links tabIndex %s and only the primary link the ref', - tabIndex => { - const focus = focusProps(tabIndex) - render() - - for (const link of links()) { - expect(link.props.tabIndex).toBe(tabIndex) - } - expect(focus.focusRef).toHaveBeenCalledTimes(1) - expect(focus.focusRef).toHaveBeenCalledWith(expect.anything()) - }, - ) - - it('composes focus on both links with the gallery callback', () => { - const focus = focusProps(-1) - render() - - for (const link of links()) fireEvent(link, 'focus') - - expect(focus.onFocus).toHaveBeenCalledTimes(linkCount) - }) - - it('renders without gallery focus props', () => { - render() - - for (const link of links()) { - expect(link.props.tabIndex).toBeUndefined() - expect(() => fireEvent(link, 'focus')).not.toThrow() - } - }) - - it('does not render a raw text node for an empty description', () => { - render( - , - ) - - /* - * Inspect the supplied children: the native test renderer can drop empty - * strings from its output, while React Native Web checks props directly. - */ - const rawTextNodes = screen - .UNSAFE_getAllByType(View) - .flatMap(view => Children.toArray(view.props.children)) - .filter(child => typeof child === 'string' || typeof child === 'number') - expect(rawTextNodes).toEqual([]) - }) - - it('falls back to an initial when there is no logo or theme', () => { - const {source, ...view} = publication.view - render( - , - ) - - expect(screen.queryByTestId('logo')).toBeNull() - expect(screen.getByText('T')).toBeTruthy() - expect(links()).toHaveLength(linkCount) - }) -}) diff --git a/src/screens/Atmosphere/components/__tests__/galleryFocus.test.tsx b/src/screens/Atmosphere/components/__tests__/galleryFocus.test.tsx index 15ccfcc17..fe8492bd1 100644 --- a/src/screens/Atmosphere/components/__tests__/galleryFocus.test.tsx +++ b/src/screens/Atmosphere/components/__tests__/galleryFocus.test.tsx @@ -1,12 +1,7 @@ -import {StyleSheet} from 'react-native' +import {StyleSheet, type ViewProps} from 'react-native' import {fireEvent, render, screen} from '@testing-library/react-native' -import { - type AtmosphereArticleCardData, - type AtmosphereLivestreamCardData, - type AtmospherePhotoCardData, -} from '#/screens/Atmosphere/data/exploreData' -import {ArticleCard} from '../ArticleCard' +import {type app} from '#/lexicons' import {type ExploreGalleryFocusProps} from '../ExploreGallery' import {LivestreamCard} from '../LivestreamCard' import {PhotoCard} from '../PhotoCard' @@ -18,10 +13,14 @@ jest.mock('@lingui/react', () => ({ }), })) jest.mock('#/alf', () => { - const atoms = new Proxy( - {}, - {get: (_, name) => (name === 'flex_grow' ? {flexGrow: 1} : {})}, - ) + const knownAtoms = { + flex_grow: {flexGrow: 1}, + absolute: {position: 'absolute'}, + z_10: {zIndex: 10}, + } + const atoms = new Proxy(knownAtoms, { + get: (target, name) => target[name as keyof typeof target] ?? {}, + }) const themeAtoms = new Proxy( { bg: {backgroundColor: '#ffffff'}, @@ -65,6 +64,59 @@ jest.mock('#/components/icons/Play', () => ({ Play_Filled_Corner2_Rounded: () => null, })) +const mockTriggerOnFocus = jest.fn() +jest.mock('@react-navigation/native', () => ({ + useNavigation: () => ({navigate: jest.fn()}), +})) +jest.mock('#/lib/hooks/useOpenLink', () => ({useOpenLink: () => jest.fn()})) +jest.mock('#/components/Button', () => { + const {Pressable} = + jest.requireActual('react-native') + return { + Button: ({ + label, + tabIndex, + onFocus, + testID, + children, + }: { + label: string + tabIndex?: number + onFocus?: () => void + testID?: string + children: React.ReactNode + }) => ( + + {children} + + ), + ButtonIcon: () => null, + } +}) +jest.mock('#/components/Menu', () => ({ + Root: ({children}: {children: React.ReactNode}) => children, + Trigger: ({ + children, + }: { + children: (state: {props: {onFocus: () => void}}) => React.ReactNode + }) => children({props: {onFocus: mockTriggerOnFocus}}), + Outer: () => null, +})) +jest.mock('#/components/moderation/ReportDialog', () => ({ + getAssociatedReportSubjects: () => [], + useGetCopyForSubject: () => () => ({title: '', subtitle: ''}), + useGlobalReportDialogControl: () => ({open: jest.fn()}), +})) +jest.mock('#/components/icons/DotGrid', () => ({ + DotGrid3x1_Stroke2_Corner0_Rounded: () => null, +})) + /* * The real Link is the only interactive element in each card. This stand-in * keeps the props the cards give it and renders them on a single host element. @@ -114,41 +166,49 @@ jest.mock('#/components/Link', () => { } }) -const authorProfile = { - did: 'did:plc:author', +const authorProfile: app.bsky.actor.defs.ProfileViewBasic = { + did: 'did:plc:6ayddqghxhciedbaofoxkcbs', handle: 'author.test', displayName: 'Author', -} as AtmospherePhotoCardData['authorProfile'] - -const article: AtmosphereArticleCardData = { - id: 'article', - href: '/article', - title: 'An article', } -const livestream: AtmosphereLivestreamCardData = { - id: 'livestream', - href: '/livestream', + +const livestream: app.bsky.embed.external.ViewLivestream = { + uri: 'https://example.com/livestream', + description: '', title: 'A livestream', active: false, - authorProfile, + associatedProfiles: [authorProfile], } -const photo: AtmospherePhotoCardData = { - id: 'photo', - href: '/photo', +const photo: app.bsky.embed.external.ViewGallery = { + uri: 'https://example.com/photo', + description: '', title: 'A photo', - image: 'https://example.com/photo.jpg', + items: [ + { + $type: 'app.bsky.embed.external#viewGalleryImage', + thumbnail: 'https://example.com/photo.jpg', + fullsize: 'https://example.com/photo-fullsize.jpg', + }, + ], likeCount: 0, - authorProfile, + associatedProfiles: [authorProfile], } -const cards: [ +const triggerCards: [ string, (focus?: ExploreGalleryFocusProps) => React.ReactElement, ][] = [ + ['PhotoCard', focus => ], [ - 'ArticleCard', - focus => , + 'LivestreamCard', + focus => , ], +] + +const cards: [ + string, + (focus?: ExploreGalleryFocusProps) => React.ReactElement, +][] = [ [ 'LivestreamCard', focus => , @@ -157,13 +217,6 @@ const cards: [ ] describe.each(cards)('%s gallery focus', (_name, renderCard) => { - it('lets the card root fill a stretched slide', () => { - render(renderCard()) - expect(StyleSheet.flatten(screen.root.props.style)).toMatchObject({ - flexGrow: 1, - }) - }) - it('attaches the focus props to its single Link', () => { const galleryFocus = { focusRef: jest.fn(), @@ -202,30 +255,6 @@ const interactions = [ ['focus', 'focus', 'blur'], ] -it.each(interactions)( - 'highlights the article background and border on %s', - (_name, enter, leave) => { - render() - const link = screen.getByTestId('link') - const card = screen.root - - expect(card).toHaveStyle({ - backgroundColor: '#ffffff', - borderColor: '#dddddd', - }) - fireEvent(link, enter) - expect(card).toHaveStyle({ - backgroundColor: '#f8f8f8', - borderColor: '#555555', - }) - fireEvent(link, leave) - expect(card).toHaveStyle({ - backgroundColor: '#ffffff', - borderColor: '#dddddd', - }) - }, -) - it.each(interactions)( 'dims the photo image on %s without intercepting interactions', (_name, enter, leave) => { @@ -235,7 +264,6 @@ it.each(interactions)( expect(screen.queryByTestId('atmospherePhotoHoverOverlay')).toBeNull() fireEvent(link, enter) const overlay = screen.getByTestId('atmospherePhotoHoverOverlay') - expect(overlay).toHaveStyle({backgroundColor: 'rgba(0, 0, 0, 0.1)'}) expect(overlay.props.pointerEvents).toBe('none') expect(overlay.props.accessible).toBe(false) expect(screen.getByText(photo.title)).toBeTruthy() @@ -244,3 +272,58 @@ it.each(interactions)( expect(screen.queryByTestId('atmospherePhotoHoverOverlay')).toBeNull() }, ) + +describe.each(triggerCards)('%s menu trigger', (_name, renderCard) => { + const getTrigger = () => screen.getByTestId('atmosphereCardMenuTrigger') + + it('mirrors the roving tabIndex but not the focus ref', () => { + const galleryFocus = { + focusRef: jest.fn(), + tabIndex: 0 as const, + onFocus: jest.fn(), + } + const {rerender} = render(renderCard(galleryFocus)) + + expect(getTrigger().props.tabIndex).toBe(0) + expect(galleryFocus.focusRef).toHaveBeenCalledTimes(1) + expect(screen.getByTestId('link').props.tabIndex).toBe(0) + + rerender(renderCard({...galleryFocus, tabIndex: -1})) + expect(getTrigger().props.tabIndex).toBe(-1) + + rerender(renderCard()) + expect(getTrigger().props.tabIndex).toBeUndefined() + }) + + it('calls both the menu and gallery focus callbacks', () => { + mockTriggerOnFocus.mockClear() + const galleryFocus = { + focusRef: jest.fn(), + tabIndex: 0 as const, + onFocus: jest.fn(), + } + render(renderCard(galleryFocus)) + + fireEvent(getTrigger(), 'focus') + expect(mockTriggerOnFocus).toHaveBeenCalledTimes(1) + expect(galleryFocus.onFocus).toHaveBeenCalledTimes(1) + }) + + it('does not throw on focus without gallery focus props', () => { + render(renderCard()) + expect(() => fireEvent(getTrigger(), 'focus')).not.toThrow() + }) + + it('is reachable: outside the link and any pointer-disabled ancestor', () => { + render(renderCard()) + + const link = screen.getByTestId('link') + let node = getTrigger().parent + while (node) { + expect(node).not.toBe(link) + const style = StyleSheet.flatten((node.props as ViewProps).style) + expect(style?.pointerEvents).not.toBe('none') + node = node.parent + } + }) +}) diff --git a/src/screens/Atmosphere/components/appCategories.ts b/src/screens/Atmosphere/components/appCategories.ts new file mode 100644 index 000000000..0eafa7da9 --- /dev/null +++ b/src/screens/Atmosphere/components/appCategories.ts @@ -0,0 +1,20 @@ +import {useLingui} from '@lingui/react/macro' + +/** + * Keys are the category values sent by the backend, in display order. + */ +export function useAtmosphereAppCategories(): {key: string; label: string}[] { + const {t: l} = useLingui() + return [ + {key: 'writing', label: l`Blogging`}, + {key: 'photography', label: l`Photo`}, + {key: 'video', label: l`Video`}, + {key: 'games', label: l`Games`}, + {key: 'feeds', label: l`Feeds`}, + {key: 'social', label: l`Social`}, + {key: 'dev', label: l`Dev`}, + {key: 'audio', label: l`Audio`}, + {key: 'events', label: l`Events`}, + {key: 'utils', label: l`Utils`}, + ] +} diff --git a/src/screens/Atmosphere/const.ts b/src/screens/Atmosphere/const.ts new file mode 100644 index 000000000..a444c5b71 --- /dev/null +++ b/src/screens/Atmosphere/const.ts @@ -0,0 +1,7 @@ +import {atoms as a} from '#/alf' + +/** + * Horizontal inset owned by each Explore section. Derived from the ALF atom so + * it stays in sync with `a.p_lg`. + */ +export const EXPLORE_SECTION_PADDING = a.p_lg.padding diff --git a/src/screens/Atmosphere/data/__tests__/exploreData.test.ts b/src/screens/Atmosphere/data/__tests__/exploreData.test.ts index a105dbe95..cd5017b32 100644 --- a/src/screens/Atmosphere/data/__tests__/exploreData.test.ts +++ b/src/screens/Atmosphere/data/__tests__/exploreData.test.ts @@ -1,24 +1,25 @@ import {exploreResponseFixture} from '#/screens/Atmosphere/__tests__/fixtures/exploreResponse' import {livestreamPreviewFixture} from '#/screens/Atmosphere/__tests__/fixtures/livestreamPreview' import { - type AtmosphereAppsData, - type AtmosphereData, getAtmosphereAnnouncementBanner, getAtmosphereApps, getAtmosphereArticles, + getAtmosphereExploreApps, getAtmosphereLivestreams, getAtmospherePhotos, getAtmospherePublications, } from '#/screens/Atmosphere/data/exploreData' import {app} from '#/lexicons' -function parseData(data: unknown): AtmosphereData { +function parseData( + data: unknown, +): app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody { return app.bsky.unspecced.getAtmosphereExploreTab.$output.schema.parse(data) } const fixtureData = parseData(exploreResponseFixture) -const emptyData: AtmosphereData = { +const emptyData: app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody = { articles: {items: []}, publications: {items: []}, photos: {items: []}, @@ -26,7 +27,9 @@ const emptyData: AtmosphereData = { apps: [], } -const emptyAppsData: AtmosphereAppsData = {apps: []} +const emptyAppsData: app.bsky.unspecced.getAtmosphereApps.$OutputBody = { + apps: [], +} const testProfile = { $type: 'app.bsky.actor.defs#profileViewBasic', @@ -34,6 +37,12 @@ const testProfile = { handle: 'test.bsky.social', } +const testPublisher = { + uri: 'https://example.com/publication', + title: 'Test publication', + description: '', +} + const image = { $type: 'app.bsky.embed.external#viewGalleryImage', thumbnail: 'https://example.com/thumbnail.jpg', @@ -89,10 +98,9 @@ describe('Atmosphere Explore response fixtures', () => { }) expect(data.articles.recIdStr).toBe('18446744073709551615') - expect(getAtmosphereArticles(data).map(article => article.href)).toEqual([ - 'https://example.com/first-article', - 'https://example.com/second-article', - ]) + expect(getAtmosphereArticles(data).map(article => article.uri)).toEqual( + items.map(item => item.view.uri), + ) expect(data.articles.items.map(item => item.featured)).toEqual([ false, true, @@ -124,7 +132,7 @@ describe('Atmosphere Explore response fixtures', () => { ).toThrow() }) - it('validates gallery images and skips malformed images at the adapter boundary', () => { + it('validates gallery images and skips malformed images during selection', () => { expect(app.bsky.embed.external.viewGalleryImage.parse(image)).toMatchObject( image, ) @@ -154,7 +162,7 @@ describe('Atmosphere Explore response fixtures', () => { }) it.each(['articles', 'publications'] as const)( - 'sorts %s by description length without mutating the response', + 'selects at most five %s without mutating the response', section => { const item = fixtureData[section].items[0] const descriptions = [ @@ -189,15 +197,17 @@ describe('Atmosphere Explore response fixtures', () => { ? getAtmosphereArticles(data) : getAtmospherePublications(data) - expect(cards.map(card => card.id)).toEqual( - [3, 1, 4, 5, 0, 2, 6].map(index => `https://example.com/${index}`), + const expectedOrder = + section === 'publications' ? [3, 1, 4, 5, 0] : [0, 1, 2, 3, 4] + expect(cards.map(card => card.uri)).toEqual( + expectedOrder.map(index => `https://example.com/${index}`), ) expect(JSON.stringify(data)).toBe(before) expect(data[section].recIdStr).toBe('42') }, ) - it('sorts articles with images first, then by description length', () => { + it('keeps the first five articles in server order regardless of images', () => { const item = fixtureData.articles.items[0] const entries = [ {description: 'The longest description. '.repeat(10)}, @@ -227,62 +237,49 @@ describe('Atmosphere Explore response fixtures', () => { const before = JSON.stringify(data) Object.freeze(data.articles.items) - expect(getAtmosphereArticles(data).map(article => article.id)).toEqual( - [3, 5, 1, 2, 0, 4].map(index => `https://example.com/${index}`), + expect(getAtmosphereArticles(data).map(article => article.uri)).toEqual( + [0, 1, 2, 3, 4].map(index => `https://example.com/${index}`), ) expect(JSON.stringify(data)).toBe(before) }) - it('maps populated card fields and prioritizes article images', () => { + it('returns the original lexicon views without flattening fields or dropping metadata', () => { const articles = getAtmosphereArticles(fixtureData) - expect( - articles.map(({title, publisher, description}) => ({ - title, - publisher, - description, - })), - ).toEqual([ - { - title: 'First article', - publisher: 'Test publication', - description: undefined, - }, - { - title: 'Second article', - publisher: 'Test publication', - description: 'An article description', - }, - ]) - expect(articles[0]).toMatchObject({ - id: 'https://example.com/first-article', - href: 'https://example.com/first-article', - image: 'https://example.com/article.jpg', - publisherAvatar: 'https://example.com/logo.jpg', - }) + expect(articles[0]).toBe(fixtureData.articles.items[0].view) + expect(articles[1]).toBe(fixtureData.articles.items[1].view) + expect(articles[0].publisher?.logo).toBe('https://example.com/logo.jpg') const photos = getAtmospherePhotos(fixtureData) - expect(photos.map(({title}) => title)).toEqual([ - 'First photo', - 'Second photo', - ]) - expect(photos[0]).toMatchObject({ - id: 'https://example.com/gallery-0', - href: 'https://example.com/gallery-0', - image: 'https://example.com/thumbnail.jpg', - imageAlt: 'A test photo', - likeCount: 2, - authorProfile: {handle: 'author.test'}, - }) + expect(photos[0]).toBe(fixtureData.photos.items[0].view) + expect(photos[1]).toBe(fixtureData.photos.items[1].view) + expect(photos[0].associatedProfiles?.[0].handle).toBe('author.test') + expect(getAtmosphereAnnouncementBanner(fixtureData)).toBe( + fixtureData.announcementBanner, + ) + }) - expect(getAtmosphereAnnouncementBanner(fixtureData)).toEqual({ - id: 'banner', - title: 'Test announcement', - description: 'An announcement description', - image: 'https://example.com/banner.jpg', - overlayColor: '#000000', - textColor: '#ffffff', - href: 'https://example.com/announcement', + it('caps articles after deduplication, keeping original views and response metadata', () => { + const items = Array.from({length: 6}, (_, index) => ({ + ...fixtureData.articles.items[0], + view: { + ...fixtureData.articles.items[0].view, + uri: `https://example.com/article-${index}`, + }, + })) + const data = parseData({ + ...emptyData, + articles: { + items: [items[0], items[0], ...items.slice(1)], + recIdStr: '42', + }, }) + const before = JSON.stringify(data) + Object.freeze(data.articles.items) + + expect(getAtmosphereArticles(data)).toEqual( + [0, 2, 3, 4, 5].map(index => data.articles.items[index].view), + ) + expect(JSON.stringify(data)).toBe(before) }) describe('getAtmospherePublications', () => { @@ -302,42 +299,22 @@ describe('Atmosphere Explore response fixtures', () => { {featured: false, view: {...publicationView, uri: 'https://c.test/'}}, ]) - expect(getAtmospherePublications(data).map(p => p.id)).toEqual([ + expect(getAtmospherePublications(data).map(p => p.uri)).toEqual([ 'https://a.test/', 'https://b.test/', 'https://c.test/', ]) }) - it('builds the legacy view the shared card renders', () => { - const [card] = getAtmospherePublications(fixtureData) - - expect(card).toMatchObject({ - id: publicationView.uri, - title: publicationView.title, - view: { - uri: publicationView.uri, - title: publicationView.title, - description: publicationView.description, - associatedProfiles: publicationView.associatedProfiles, - source: { - uri: publicationView.uri, - title: publicationView.title, - icon: publicationView.logo, - theme: { - backgroundRGB: {r: 255, g: 255, b: 255}, - foregroundRGB: {r: 0, g: 0, b: 0}, - accentRGB: {r: 0x12, g: 0x34, b: 0x56}, - accentForegroundRGB: {r: 255, g: 255, b: 255}, - }, - }, - }, - }) + it('preserves the original publication view, including subscription metadata', () => { + const [publication] = getAtmospherePublications(fixtureData) + expect(publication).toBe(publicationView) + expect(publication.subscriptionCount).toBe(1) }) it('copies associated metadata and does not mutate the response', () => { /* Built without parsing: only the shape of the refs matters here. */ - const data: AtmosphereData = { + const data: app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody = { ...emptyData, publications: { recIdStr: '1', @@ -360,53 +337,26 @@ describe('Atmosphere Explore response fixtures', () => { const before = JSON.stringify(data) const [card] = getAtmospherePublications(data) - expect(card.view.associatedRefs).toEqual( + expect(card.associatedRefs).toEqual( data.publications.items[0].view.associatedRefs, ) expect(JSON.stringify(data)).toBe(before) expect(data.publications.recIdStr).toBe('1') }) - it.each([ - { - name: 'partial', - theme: {accent: '#fff'}, - expected: {accentRGB: {r: 255, g: 255, b: 255}}, - }, - { - name: 'invalid', - theme: {accent: 'red', background: '#12'}, - expected: {}, - }, - ])('converts $name theme colors', ({theme, expected}) => { - const data = withPublications([ - {featured: true, view: {...publicationView, theme}}, - ]) - const source = getAtmospherePublications(data)[0].view.source - - expect(source?.theme).toMatchObject(expected) - for (const key of [ - 'backgroundRGB', - 'foregroundRGB', - 'accentRGB', - 'accentForegroundRGB', - ] as const) { - if (!(key in expected)) expect(source?.theme?.[key]).toBeUndefined() - } - }) - it('keeps publications without a logo, theme, or profiles', () => { const {logo, theme, subscribers, ...bare} = publicationView const data = withPublications([{featured: false, view: bare}]) const [card] = getAtmospherePublications(data) - expect(card.view.source?.icon).toBeUndefined() - expect(card.view.source?.theme).toBeUndefined() - expect(card.view.associatedProfiles).toBeUndefined() + expect(card).toBe(data.publications.items[0].view) + expect(card.logo).toBeUndefined() + expect(card.theme).toBeUndefined() + expect(card.associatedProfiles).toBeUndefined() }) }) - describe('dedupes items by id', () => { + describe('dedupes views by URI and apps by id', () => { const [article] = fixtureData.articles.items const [photo] = fixtureData.photos.items const [livestream] = parseData({ @@ -446,7 +396,7 @@ describe('Atmosphere Explore response fixtures', () => { const result = adapt(data) expect(result).toHaveLength(2) - expect(result.map(r => r.id).sort()).toEqual( + expect(result.map(r => r.uri).sort()).toEqual( [first.view.uri, second.view.uri].sort(), ) expect(result.map(r => r.title)).not.toContain('duplicate') @@ -459,7 +409,7 @@ describe('Atmosphere Explore response fixtures', () => { {...firstApp, id: 'other'}, {...firstApp, title: 'dupe'}, ], - } satisfies AtmosphereAppsData + } satisfies app.bsky.unspecced.getAtmosphereApps.$OutputBody const result = getAtmosphereApps(data) @@ -469,7 +419,9 @@ describe('Atmosphere Explore response fixtures', () => { }) describe('getAtmosphereApps', () => { - const parseApps = (data: unknown): AtmosphereAppsData => + const parseApps = ( + data: unknown, + ): app.bsky.unspecced.getAtmosphereApps.$OutputBody => app.bsky.unspecced.getAtmosphereApps.$output.schema.parse(data) it('preserves the hydrated profile, logo and banner', () => { @@ -501,7 +453,8 @@ describe('Atmosphere Explore response fixtures', () => { description: 'An app description', logo: 'https://example.com/app-logo.jpg', banner: 'https://example.com/app-banner.jpg', - href: 'https://example.com/app', + url: 'https://example.com/app', + category: 'social', profile, }) }) @@ -520,11 +473,7 @@ describe('Atmosphere Explore response fixtures', () => { { id: 'sparse', title: 'Sparse app', - description: undefined, - logo: undefined, - banner: undefined, - href: 'https://example.com', - profile: undefined, + url: 'https://example.com', }, ]) }) @@ -553,7 +502,7 @@ describe('Atmosphere Explore response fixtures', () => { {id: 'invalid', title: '', url, category: 'writing'}, {id: 'writing', title: 'Duplicate', url, category: 'writing'}, ], - } satisfies AtmosphereAppsData + } satisfies app.bsky.unspecced.getAtmosphereApps.$OutputBody it('returns every valid app, including unknown and missing categories, without a category', () => { expect(getAtmosphereApps(data).map(app => app.id)).toEqual([ @@ -594,7 +543,7 @@ describe('Atmosphere Explore response fixtures', () => { ) }) - it('adapts the active and ended local livestream previews', () => { + it('selects the active and ended local livestream previews', () => { const previewData = parseData({ ...emptyData, livestreams: {items: livestreamPreviewFixture}, @@ -602,26 +551,26 @@ describe('Atmosphere Explore response fixtures', () => { const livestreams = getAtmosphereLivestreams(previewData) expect( - livestreams.map(({title, active, href}) => ({ + livestreams.map(({title, active, uri}) => ({ title, active, - href, + uri, })), ).toEqual([ { title: 'A look at open publishing', active: true, - href: 'https://example.com/livestreams/open-publishing', + uri: 'https://example.com/livestreams/open-publishing', }, { title: 'Community Q&A', active: false, - href: 'https://example.com/livestreams/community-q-and-a', + uri: 'https://example.com/livestreams/community-q-and-a', }, { title: 'Creative coding session', active: true, - href: 'https://example.com/livestreams/creative-coding', + uri: 'https://example.com/livestreams/creative-coding', }, ]) expect( @@ -634,6 +583,31 @@ describe('Atmosphere Explore response fixtures', () => { expect(livestreams[0].image).toBe(livestreamPreviewFixture[0].view.image) }) + it('drops articles without a publisher before limiting to five', () => { + const data = parseData({ + ...emptyData, + articles: { + items: ['a', 'b', 'c', 'd', 'e', 'f', 'g'].map(id => ({ + featured: false, + view: { + uri: `https://example.com/${id}`, + title: id, + description: '', + publisher: id === 'b' ? undefined : testPublisher, + }, + })), + }, + }) + + expect(getAtmosphereArticles(data).map(article => article.title)).toEqual([ + 'a', + 'c', + 'd', + 'e', + 'f', + ]) + }) + it('safely handles absent optional data, empty arrays, and gallery variants', () => { expect(getAtmosphereAnnouncementBanner(emptyData)).toBeUndefined() expect( @@ -645,13 +619,8 @@ describe('Atmosphere Explore response fixtures', () => { }, }), ).toEqual({ - id: undefined, title: 'Title only', - description: undefined, - image: undefined, - overlayColor: undefined, - textColor: undefined, - href: 'https://example.com/announcement', + url: 'https://example.com/announcement', }) expect(getAtmosphereArticles(emptyData)).toEqual([]) expect(getAtmosphereLivestreams(emptyData)).toEqual([]) @@ -671,6 +640,7 @@ describe('Atmosphere Explore response fixtures', () => { uri: 'https://example.com/article', title: 'Sparse article', description: 'No optional card fields', + publisher: testPublisher, }, }, ], @@ -726,22 +696,11 @@ describe('Atmosphere Explore response fixtures', () => { }, }) - expect(getAtmosphereArticles(sparseData)[0]).toMatchObject({ - title: 'Sparse article', - image: undefined, - publisher: undefined, - publisherAvatar: undefined, - }) + expect(getAtmosphereArticles(sparseData)[0]).toBe( + sparseData.articles.items[0].view, + ) expect(getAtmospherePhotos(sparseData)).toEqual([ - { - id: 'https://example.com/gallery', - href: 'https://example.com/gallery', - title: 'Sparse gallery', - image: image.thumbnail, - imageAlt: undefined, - likeCount: 0, - authorProfile: testProfile, - }, + sparseData.photos.items[0].view, ]) expect(getAtmosphereLivestreams(sparseData)).toEqual([]) }) @@ -817,3 +776,39 @@ describe('Atmosphere Explore response fixtures', () => { ).toThrow() }) }) + +describe('getAtmosphereExploreApps', () => { + const valid = { + id: 'app', + title: 'Test app', + url: 'https://example.com/app' as const, + backgroundImage: 'https://example.com/bg.jpg' as const, + } + + it.each(['id', 'title', 'url', 'backgroundImage'] as const)( + 'drops apps missing %s', + field => { + const data = parseData({ + ...exploreResponseFixture, + apps: [ + {...valid, id: 'kept'}, + {...valid, [field]: undefined}, + ], + }) + + expect(getAtmosphereExploreApps(data).map(a => a.id)).toEqual(['kept']) + }, + ) + + it('dedupes by id, keeping the first in server order', () => { + const data = parseData({ + ...exploreResponseFixture, + apps: [valid, {...valid, id: 'other'}, {...valid, title: 'dupe'}], + }) + + const result = getAtmosphereExploreApps(data) + + expect(result.map(a => a.id)).toEqual(['app', 'other']) + expect(result[0].title).toBe('Test app') + }) +}) diff --git a/src/screens/Atmosphere/data/__tests__/useAtmosphereExploreQuery.test.tsx b/src/screens/Atmosphere/data/__tests__/useAtmosphereExploreQuery.test.tsx index 97841fa5a..6665b9b8a 100644 --- a/src/screens/Atmosphere/data/__tests__/useAtmosphereExploreQuery.test.tsx +++ b/src/screens/Atmosphere/data/__tests__/useAtmosphereExploreQuery.test.tsx @@ -1,20 +1,35 @@ import {type PropsWithChildren} from 'react' +import {Platform} from 'react-native' import {QueryClient, QueryClientProvider} from '@tanstack/react-query' import {act, renderHook, waitFor} from '@testing-library/react-native' import {useLanguagePrefs} from '#/state/preferences/languages' +import {usePreferencesQuery} from '#/state/queries/preferences' import {useAppviewClient} from '#/state/session' import {useAtmosphereExploreQuery} from '#/screens/Atmosphere/data/useAtmosphereExploreQuery' import {app} from '#/lexicons' +import {device} from '#/storage' jest.mock('#/state/preferences/languages', () => ({ useLanguagePrefs: jest.fn(), })) +jest.mock('#/state/queries/preferences', () => ({ + usePreferencesQuery: jest.fn(), +})) + jest.mock('#/state/session', () => ({ useAppviewClient: jest.fn(), })) +jest.mock('#/env', () => ({IS_WEB: false})) +jest.mock('#/storage', () => ({device: {get: jest.fn()}})) + +const defaultHeaders = { + 'x-atproto-bsky-platform': Platform.OS, + 'x-atproto-bsky-topics': '', +} + const data: app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody = { articles: {items: []}, publications: {items: []}, @@ -29,6 +44,12 @@ function setLanguages(contentLanguages: string[]) { .mockReturnValue({contentLanguages} as ReturnType) } +function setInterests(tags: string[], updatedAt?: string) { + jest.mocked(usePreferencesQuery).mockReturnValue({ + data: {interests: {tags, updatedAt}}, + } as ReturnType) +} + function setup( did: string | undefined = 'did:plc:viewer', queryClient = new QueryClient({ @@ -48,6 +69,10 @@ function setup( beforeEach(() => { jest.clearAllMocks() + jest.mocked(device.get).mockReset() + jest.mocked(usePreferencesQuery).mockReturnValue({ + data: undefined, + } as ReturnType) }) describe('useAtmosphereExploreQuery', () => { @@ -65,7 +90,7 @@ describe('useAtmosphereExploreQuery', () => { {langs: ['en']}, { signal: expect.any(AbortSignal), - headers: {'Accept-Language': 'en'}, + headers: {...defaultHeaders, 'Accept-Language': 'en'}, }, ) }) @@ -89,7 +114,7 @@ describe('useAtmosphereExploreQuery', () => { languages.length ? {langs: languages} : {}, { signal: expect.any(AbortSignal), - headers: {'Accept-Language': header}, + headers: {...defaultHeaders, 'Accept-Language': header}, }, ) }, @@ -114,7 +139,106 @@ describe('useAtmosphereExploreQuery', () => { {langs: ['fr', 'en']}, { signal: expect.any(AbortSignal), - headers: {'Accept-Language': 'fr,en'}, + headers: {...defaultHeaders, 'Accept-Language': 'fr,en'}, + }, + ) + expect(queryClient.getQueryCache().getAll()).toHaveLength(2) + }) + + it('sends the Discover platform, service geo, and timestamped topics headers', async () => { + const {client, wrapper} = setup() + client.call.mockResolvedValue(data) + setLanguages(['en', 'fr']) + setInterests(['animals', 'music'], '2026-09-03T17:00:00.000Z') + jest.mocked(device.get).mockReturnValue({ + countryCode: 'JP', + regionCode: '13', + city: '東京', + ip: '2001:db8::1', + }) + + const {result} = renderHook(() => useAtmosphereExploreQuery(), {wrapper}) + await waitFor(() => expect(result.current.isSuccess).toBe(true)) + + expect(client.call).toHaveBeenCalledWith( + app.bsky.unspecced.getAtmosphereExploreTab, + {langs: ['en', 'fr']}, + { + signal: expect.any(AbortSignal), + headers: { + 'Accept-Language': 'en,fr', + 'x-atproto-bsky-platform': Platform.OS, + 'x-atproto-bsky-topics': 'animals,music;2026-09-03T17:00:00.000Z', + 'x-atproto-bsky-geo-country': 'JP', + 'x-atproto-bsky-geo-region': '13', + 'x-atproto-bsky-geo-city': '%E6%9D%B1%E4%BA%AC', + 'x-atproto-bsky-geo-ip': '2001:db8::1', + }, + }, + ) + expect(device.get).toHaveBeenCalledWith(['geolocationServiceResponse']) + }) + + it('reads updated service geolocation on refetch, including when logged out', async () => { + const {client, wrapper} = setup() + jest + .mocked(useAppviewClient) + .mockReturnValue({...client, did: undefined} as never) + client.call.mockResolvedValue(data) + jest + .mocked(device.get) + .mockReturnValue({countryCode: 'JP', regionCode: '13'}) + + const {result} = renderHook(() => useAtmosphereExploreQuery(), {wrapper}) + await waitFor(() => expect(result.current.isSuccess).toBe(true)) + + jest + .mocked(device.get) + .mockReturnValue({countryCode: 'US', regionCode: undefined}) + await act(async () => { + await result.current.refetch() + }) + + expect(client.call).toHaveBeenCalledTimes(2) + expect(client.call).toHaveBeenLastCalledWith( + app.bsky.unspecced.getAtmosphereExploreTab, + {langs: ['en']}, + { + signal: expect.any(AbortSignal), + headers: { + ...defaultHeaders, + 'Accept-Language': 'en', + 'x-atproto-bsky-geo-country': 'US', + }, + }, + ) + }) + + it('refetches with an interests-specific key when preferences change', async () => { + const {client, queryClient, wrapper} = setup() + client.call.mockResolvedValue(data) + setInterests(['music']) + + const {result, rerender} = renderHook(() => useAtmosphereExploreQuery(), { + wrapper, + }) + await waitFor(() => expect(result.current.isSuccess).toBe(true)) + + setInterests(['animals'], '2026-09-03T17:00:00.000Z') + rerender({}) + + await waitFor(() => expect(client.call).toHaveBeenCalledTimes(2)) + await waitFor(() => expect(result.current.isSuccess).toBe(true)) + expect(client.call).toHaveBeenLastCalledWith( + app.bsky.unspecced.getAtmosphereExploreTab, + {langs: ['en']}, + { + signal: expect.any(AbortSignal), + headers: { + ...defaultHeaders, + 'Accept-Language': 'en', + 'x-atproto-bsky-topics': 'animals;2026-09-03T17:00:00.000Z', + }, }, ) expect(queryClient.getQueryCache().getAll()).toHaveLength(2) diff --git a/src/screens/Atmosphere/data/exploreData.ts b/src/screens/Atmosphere/data/exploreData.ts index de949d500..49e907eff 100644 --- a/src/screens/Atmosphere/data/exploreData.ts +++ b/src/screens/Atmosphere/data/exploreData.ts @@ -1,88 +1,21 @@ -import {type $Typed, type l} from '@atproto/lex' +import {type $Typed, type UriString} from '@atproto/lex' -import {hexToRgb} from '#/alf/util/colorGeneration' import {app} from '#/lexicons' import * as bsky from '#/types/bsky' -export type AtmosphereData = - app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody -export type AtmosphereAppsData = - app.bsky.unspecced.getAtmosphereApps.$OutputBody - -type AtmosphereProfileView = l.InferOutput< - typeof app.bsky.actor.defs.profileViewBasic -> -type AtmosphereViewGalleryImage = - $Typed - -export type AtmosphereArticleCardData = { - id: string - href: string - title: string - description?: string - image?: string - publisher?: string - publisherAvatar?: string -} - -export type AtmospherePublicationCardData = { - id: string - title: string - view: app.bsky.embed.external.ViewExternal -} - -export type AtmosphereAppCardData = { - id: string - title: string - description?: string - logo?: string - banner?: string - href: string - profile?: app.bsky.actor.defs.ProfileViewDetailed -} - -export type AtmosphereAnnouncementBannerData = { - id?: string - title: string - description?: string - image?: string - overlayColor?: string - textColor?: string - href: string -} - -export type AtmospherePhotoCardData = { - id: string - href: string - title: string - image: string - imageAlt?: string - likeCount: number - authorProfile: app.bsky.actor.defs.ProfileViewBasic -} - -export type AtmosphereLivestreamCardData = { - id: string - href: string - title: string - active: boolean - activeCount?: number - image?: string - authorProfile: app.bsky.actor.defs.ProfileViewBasic -} - -/** Keeps the first item for each id, preserving order. */ -function dedupeById(items: T[]): T[] { - const seen = new Set() +/** Keeps the first item for each key, preserving order. */ +function dedupeBy(items: T[], getKey: (item: T) => string | undefined): T[] { + const seen = new Set() return items.filter(item => { - if (seen.has(item.id)) return false - seen.add(item.id) + const key = getKey(item) + if (seen.has(key)) return false + seen.add(key) return true }) } -function getProfile( - profiles?: AtmosphereProfileView[], +export function getAssociatedProfile( + profiles?: app.bsky.actor.defs.ProfileViewBasic[], ): app.bsky.actor.defs.ProfileViewBasic | undefined { const profile = profiles?.[0] /* @@ -95,79 +28,36 @@ function getProfile( : undefined } -function isGalleryImage(item: unknown): item is AtmosphereViewGalleryImage { - return ( - bsky.isType(app.bsky.embed.external.viewGalleryImage, item) && - bsky.matches(app.bsky.embed.external.viewGalleryImage, item) +export function getGalleryImage( + gallery: app.bsky.embed.external.ViewGallery, +): $Typed | undefined { + return gallery.items.find( + (item): item is $Typed => + bsky.isType(app.bsky.embed.external.viewGalleryImage, item) && + bsky.matches(app.bsky.embed.external.viewGalleryImage, item), ) } export function getAtmosphereArticles( - data: AtmosphereData, -): AtmosphereArticleCardData[] { - return dedupeById( - data.articles.items.map(({view: article}) => ({ - id: article.uri, - href: article.uri, - title: article.title.trim(), - description: article.description || undefined, - image: article.image, - publisher: article.publisher?.title, - publisherAvatar: article.publisher?.logo, - })), - ).sort( - (a, b) => - Number(Boolean(b.image)) - Number(Boolean(a.image)) || - (b.description?.trim().length ?? 0) - (a.description?.trim().length ?? 0), - ) + data: app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody, +): app.bsky.embed.external.ViewArticle[] { + return dedupeBy( + data.articles.items + .map(({view}) => view) + .filter(article => article.publisher), + article => article.uri, + ).slice(0, 5) } -function toColorRgb( - hex?: string, -): app.bsky.embed.external.ColorRgb | undefined { - const rgb = hex ? hexToRgb(hex) : null - return rgb ?? undefined -} - -/** - * The shared publication card renders the legacy external view, so adapt the - * publication view to it instead of reimplementing the card. - */ export function getAtmospherePublications( - data: AtmosphereData, -): AtmospherePublicationCardData[] { - return dedupeById( - data.publications.items.map(({view: publication}) => ({ - id: publication.uri, - title: publication.title, - view: { - uri: publication.uri, - title: publication.title, - description: publication.description, - thumb: publication.image, - createdAt: publication.createdAt, - updatedAt: publication.updatedAt, - labels: publication.labels, - associatedRefs: publication.associatedRefs, - associatedProfiles: publication.associatedProfiles, - source: { - uri: publication.uri, - title: publication.title, - description: publication.description, - icon: publication.logo, - theme: publication.theme && { - backgroundRGB: toColorRgb(publication.theme.background), - foregroundRGB: toColorRgb(publication.theme.foreground), - accentRGB: toColorRgb(publication.theme.accent), - accentForegroundRGB: toColorRgb(publication.theme.accentForeground), - }, - }, - }, - })), - ).sort( - (a, b) => - b.view.description.trim().length - a.view.description.trim().length, + data: app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody, +): app.bsky.embed.external.ViewArticlePublication[] { + return dedupeBy( + data.publications.items.map(({view}) => view), + publication => publication.uri, ) + .sort((a, b) => b.description.trim().length - a.description.trim().length) + .slice(0, 5) } /** @@ -176,88 +66,79 @@ export function getAtmospherePublications( * category. */ export function getAtmosphereApps( - data: AtmosphereAppsData, + data: app.bsky.unspecced.getAtmosphereApps.$OutputBody, category?: string, -): AtmosphereAppCardData[] { - return dedupeById( - data.apps.flatMap(app => { - if (!app.id || !app.title || !app.url) return [] - if (category !== undefined && app.category !== category) return [] +): app.bsky.unspecced.getAtmosphereApps.AppCard[] { + return dedupeBy( + data.apps.filter( + app => + app.id && + app.title && + app.url && + (category === undefined || app.category === category), + ), + app => app.id, + ) +} + +/** An explore app with the fields the featured card can't render without. */ +export type FeaturedApp = app.bsky.unspecced.getAtmosphereExploreTab.AppCard & { + id: string + title: string + url: UriString + backgroundImage: UriString +} - return [ - { - id: app.id, - title: app.title, - description: app.description || undefined, - logo: app.logo, - banner: app.banner, - href: app.url, - profile: app.profile, - }, - ] - }), +/** + * Returns the valid apps for the featured gallery. Unlike the Apps tab, these + * need a banner image because the card is built around it. + */ +export function getAtmosphereExploreApps( + data: app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody, +): FeaturedApp[] { + return dedupeBy( + data.apps.filter( + (app): app is FeaturedApp => + !!(app.id && app.title && app.url && app.backgroundImage), + ), + app => app.id, ) } export function getAtmosphereAnnouncementBanner( - data: AtmosphereData, -): AtmosphereAnnouncementBannerData | undefined { + data: app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody, +): app.bsky.unspecced.getAtmosphereExploreTab.AnnouncementBanner | undefined { const banner = data.announcementBanner - if (!banner?.title || !banner.url) return undefined - - return { - id: banner.id, - title: banner.title, - description: banner.description || undefined, - image: banner.image, - overlayColor: banner.overlayColor, - textColor: banner.textColor, - href: banner.url, - } + return banner?.title && banner.url ? banner : undefined } export function getAtmosphereLivestreams( - data: Pick, -): AtmosphereLivestreamCardData[] { - return dedupeById( - data.livestreams.items.flatMap(({view: livestream}) => { - const authorProfile = getProfile(livestream.associatedProfiles) - if (!authorProfile) return [] - - return [ - { - id: livestream.uri, - href: livestream.uri, - title: livestream.title.trim(), - active: livestream.active, - image: livestream.image, - authorProfile, - }, - ] - }), + data: Pick< + app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody, + 'livestreams' + >, +): app.bsky.embed.external.ViewLivestream[] { + return dedupeBy( + data.livestreams.items + .map(({view}) => view) + .filter(livestream => + getAssociatedProfile(livestream.associatedProfiles), + ), + livestream => livestream.uri, ) } export function getAtmospherePhotos( - data: AtmosphereData, -): AtmospherePhotoCardData[] { - return dedupeById( - data.photos.items.flatMap(({view: photo}) => { - const image = photo.items.find(isGalleryImage) - const authorProfile = getProfile(photo.associatedProfiles) - if (!image || !authorProfile) return [] - - return [ - { - id: photo.uri, - href: photo.uri, - title: photo.title, - image: image.thumbnail, - imageAlt: image.alt || undefined, - likeCount: photo.likeCount ?? 0, - authorProfile, - }, - ] - }), + data: app.bsky.unspecced.getAtmosphereExploreTab.$OutputBody, +): app.bsky.embed.external.ViewGallery[] { + return dedupeBy( + data.photos.items + .map(({view}) => view) + .filter( + photo => + getGalleryImage(photo) && + getAssociatedProfile(photo.associatedProfiles), + ), + photo => photo.uri, ) } diff --git a/src/screens/Atmosphere/data/useAtmosphereExploreQuery.ts b/src/screens/Atmosphere/data/useAtmosphereExploreQuery.ts index 3c09deb5d..87c9f3356 100644 --- a/src/screens/Atmosphere/data/useAtmosphereExploreQuery.ts +++ b/src/screens/Atmosphere/data/useAtmosphereExploreQuery.ts @@ -1,6 +1,12 @@ import {useQuery} from '@tanstack/react-query' +import { + aggregateUserInterests, + createBskyAppviewHeaders, + createBskyTopicsHeader, +} from '#/lib/api/feed/utils' import {useLanguagePrefs} from '#/state/preferences/languages' +import {usePreferencesQuery} from '#/state/queries/preferences' import {createQueryKey} from '#/state/queries/util' import {useAppviewClient} from '#/state/session' import {app} from '#/lexicons' @@ -10,19 +16,29 @@ export const useAtmosphereExploreQueryRoot = 'useAtmosphereExploreQuery' export function useAtmosphereExploreQuery() { const client = useAppviewClient() const {contentLanguages} = useLanguagePrefs() + const {data: preferences} = usePreferencesQuery() const acceptLanguage = contentLanguages.join(',') + const userInterests = aggregateUserInterests(preferences) return useQuery({ queryKey: createQueryKey(useAtmosphereExploreQueryRoot, { did: client.did, acceptLanguage, + userInterests, }), retry: 1, queryFn: ({signal}) => client.call( app.bsky.unspecced.getAtmosphereExploreTab, contentLanguages.length ? {langs: contentLanguages} : {}, - {signal, headers: {'Accept-Language': acceptLanguage}}, + { + signal, + headers: { + ...createBskyAppviewHeaders(), + ...createBskyTopicsHeader(userInterests), + 'Accept-Language': acceptLanguage, + }, + }, ), }) } diff --git a/src/screens/Atmosphere/index.tsx b/src/screens/Atmosphere/index.tsx index 4c208d3bd..a9eef6f45 100644 --- a/src/screens/Atmosphere/index.tsx +++ b/src/screens/Atmosphere/index.tsx @@ -1,7 +1,8 @@ +import {useRef} from 'react' import {View} from 'react-native' import {Trans, useLingui} from '@lingui/react/macro' -import {Pager} from '#/view/com/pager/Pager' +import {Pager, type PagerRef} from '#/view/com/pager/Pager' import {TabBar} from '#/view/com/pager/TabBar' import {NotFoundScreen} from '#/view/screens/NotFound' import {atoms as a, web} from '#/alf' @@ -12,10 +13,14 @@ import {AtmosphereActivityTab} from './ActivityTab' import {AtmosphereAppsTab} from './AppsTab' import {AtmosphereExploreTab} from './ExploreTab' +/** Matches the Apps position in the tab bar items below. */ +const APPS_TAB_INDEX = 2 + export function AtmosphereScreen() { const {t: l} = useLingui() const ax = useAnalytics() const isEnabled = ax.features.enabled(ax.features.AtmosphereScreenEnable) + const pagerRef = useRef(null) if (!isEnabled) { return @@ -38,6 +43,7 @@ export function AtmosphereScreen() { ( @@ -45,7 +51,9 @@ export function AtmosphereScreen() { )}> - + pagerRef.current?.setPage(APPS_TAB_INDEX)} + /> diff --git a/src/view/screens/Storybook/Storybook.tsx b/src/view/screens/Storybook/Storybook.tsx index 2250f630e..02f39404e 100644 --- a/src/view/screens/Storybook/Storybook.tsx +++ b/src/view/screens/Storybook/Storybook.tsx @@ -6,6 +6,7 @@ import {type NavigationProp} from '#/lib/routes/types' import {useSetThemePrefs} from '#/state/shell' import {ListContained} from '#/view/screens/Storybook/ListContained' import {atoms as a, ThemeProvider} from '#/alf' +import {SiteStandardStorybook} from '#/components/atmosphere/SiteStandard/Storybook' import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' import {GalleryStorybook} from '#/components/Gallery/Storybook' @@ -147,6 +148,7 @@ export default function Storybook() { +