From c34c67e4dfdfe71040e088d3d7e6e39276f93f6b Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 22 Apr 2025 21:01:28 +0300 Subject: [PATCH 01/12] add demo storage --- src/screens/Settings/AboutSettings.tsx | 31 ++++++++++++++++++++++++-- src/storage/hooks/demo-mode.ts | 7 ++++++ src/storage/schema.ts | 1 + 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/storage/hooks/demo-mode.ts diff --git a/src/screens/Settings/AboutSettings.tsx b/src/screens/Settings/AboutSettings.tsx index 199d12e63d..0ce127ff3f 100644 --- a/src/screens/Settings/AboutSettings.tsx +++ b/src/screens/Settings/AboutSettings.tsx @@ -12,9 +12,10 @@ import {Statsig} from 'statsig-react-native-expo' import {appVersion, BUNDLE_DATE, bundleInfo} from '#/lib/app-info' import {STATUS_PAGE_URL} from '#/lib/constants' import {type CommonNavigatorParams} from '#/lib/routes/types' -import {isAndroid, isNative} from '#/platform/detection' +import {isAndroid, isIOS, isNative} from '#/platform/detection' import * as Toast from '#/view/com/util/Toast' import * as SettingsList from '#/screens/Settings/components/SettingsList' +import {Atom_Stroke2_Corner0_Rounded as AtomIcon} from '#/components/icons/Atom' import {BroomSparkle_Stroke2_Corner2_Rounded as BroomSparkleIcon} from '#/components/icons/BroomSparkle' import {CodeLines_Stroke2_Corner2_Rounded as CodeLinesIcon} from '#/components/icons/CodeLines' import {Globe_Stroke2_Corner0_Rounded as GlobeIcon} from '#/components/icons/Globe' @@ -22,6 +23,7 @@ import {Newspaper_Stroke2_Corner2_Rounded as NewspaperIcon} from '#/components/i import {Wrench_Stroke2_Corner2_Rounded as WrenchIcon} from '#/components/icons/Wrench' import * as Layout from '#/components/Layout' import {Loader} from '#/components/Loader' +import {useDemoMode} from '#/storage/hooks/demo-mode' import {useDevMode} from '#/storage/hooks/dev-mode' import {OTAInfo} from './components/OTAInfo' @@ -29,6 +31,7 @@ type Props = NativeStackScreenProps export function AboutSettingsScreen({}: Props) { const {_, i18n} = useLingui() const [devModeEnabled, setDevModeEnabled] = useDevMode() + const [demoModeEnabled, setDemoModeEnabled] = useDemoMode() const stableID = useMemo(() => Statsig.getStableID(), []) const {mutate: onClearImageCache, isPending: isClearingImageCache} = @@ -153,7 +156,31 @@ export function AboutSettingsScreen({}: Props) { {bundleInfo} - {devModeEnabled && } + {devModeEnabled && ( + <> + + {isIOS && ( + { + const newDemoModeEnabled = !demoModeEnabled + setDemoModeEnabled(newDemoModeEnabled) + Toast.show( + 'Demo mode ' + + (newDemoModeEnabled ? 'enabled' : 'disabled'), + ) + }} + label={ + demoModeEnabled ? 'Disable demo mode' : 'Enable demo mode' + } + disabled={isClearingImageCache}> + + + {demoModeEnabled ? 'Disable demo mode' : 'Enable demo mode'} + + + )} + + )} diff --git a/src/storage/hooks/demo-mode.ts b/src/storage/hooks/demo-mode.ts new file mode 100644 index 0000000000..b65dd147e2 --- /dev/null +++ b/src/storage/hooks/demo-mode.ts @@ -0,0 +1,7 @@ +import {device, useStorage} from '#/storage' + +export function useDemoMode() { + const [demoMode = false, setDemoMode] = useStorage(device, ['demoMode']) + + return [demoMode, setDemoMode] as const +} diff --git a/src/storage/schema.ts b/src/storage/schema.ts index 0e9b1985cb..7430532a96 100644 --- a/src/storage/schema.ts +++ b/src/storage/schema.ts @@ -10,6 +10,7 @@ export type Device = { } trendingBetaEnabled: boolean devMode: boolean + demoMode: boolean } export type Account = { From 91f9bc7ccbfcfb07434a707e43fb3244e7722d6f Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 22 Apr 2025 21:29:27 +0300 Subject: [PATCH 02/12] demo mode --- src/lib/api/feed/demo.ts | 20 + src/lib/demo.ts | 516 ++++++++++++++++++++++++ src/state/queries/post-feed.ts | 22 +- src/view/screens/Home.tsx | 65 ++- src/view/shell/bottom-bar/BottomBar.tsx | 14 +- 5 files changed, 616 insertions(+), 21 deletions(-) create mode 100644 src/lib/api/feed/demo.ts create mode 100644 src/lib/demo.ts diff --git a/src/lib/api/feed/demo.ts b/src/lib/api/feed/demo.ts new file mode 100644 index 0000000000..049e0f116e --- /dev/null +++ b/src/lib/api/feed/demo.ts @@ -0,0 +1,20 @@ +import {type AppBskyFeedDefs, type BskyAgent} from '@atproto/api' + +import {DEMO_FEED} from '#/lib/demo' +import {type FeedAPI, type FeedAPIResponse} from './types' + +export class DemoFeedAPI implements FeedAPI { + agent: BskyAgent + + constructor({agent}: {agent: BskyAgent}) { + this.agent = agent + } + + async peekLatest(): Promise { + return DEMO_FEED.feed[0] + } + + async fetch(): Promise { + return DEMO_FEED + } +} diff --git a/src/lib/demo.ts b/src/lib/demo.ts new file mode 100644 index 0000000000..96bb7f9b14 --- /dev/null +++ b/src/lib/demo.ts @@ -0,0 +1,516 @@ +import {type AppBskyFeedGetFeed} from '@atproto/api' + +export const DEMO_FEED = { + feed: [ + { + post: { + uri: 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.feed.post/3lng6kvb6uc2a', + cid: 'bafyreifqyej7jivzucaagu22f7jj7rvjcpbzv2kxo27wt47ktduwwdpdae', + author: { + did: 'did:plc:vwzwgnygau7ed7b7wt5ux7y2', + handle: 'someoneelse.bsky.social', + displayName: 'Not David', + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:vwzwgnygau7ed7b7wt5ux7y2/bafkreifrtz3ngpzz5qmhjliv5toj4nvyjovijxs5e2la67wddhmdhro5he@jpeg', + associated: { + chat: { + allowIncoming: 'following', + }, + }, + viewer: { + muted: false, + blockedBy: false, + following: + 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3kcvvfzq6o32a', + followedBy: + 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.graph.follow/3jwawchotz22h', + }, + labels: [], + createdAt: '2023-04-27T09:23:54.423Z', + verification: { + verifications: [ + { + issuer: 'did:plc:z72i7hdynmk6r22z27h6tvur', + uri: 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.verification/3lndpxt7ur22f', + isValid: true, + createdAt: '2025-04-21T10:48:58.775Z', + }, + ], + verifiedStatus: 'valid', + trustedVerifierStatus: 'none', + }, + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: '2025-04-22T17:15:30.525Z', + langs: ['en'], + reply: { + parent: { + cid: 'bafyreic7wmhywvu5fi4lupswxpmyydqn2gl5kwnt4n4jxvb3lpej2l72ku', + uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lng66dkzu222', + }, + root: { + cid: 'bafyreic7wmhywvu5fi4lupswxpmyydqn2gl5kwnt4n4jxvb3lpej2l72ku', + uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lng66dkzu222', + }, + }, + text: 'sometimes I go to the apple store just to look at them', + }, + replyCount: 0, + repostCount: 0, + likeCount: 6, + quoteCount: 0, + indexedAt: '2025-04-22T17:15:31.251Z', + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + }, + reply: { + root: { + uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lng66dkzu222', + cid: 'bafyreic7wmhywvu5fi4lupswxpmyydqn2gl5kwnt4n4jxvb3lpej2l72ku', + author: { + did: 'did:plc:vc7f4oafdgxsihk4cry2xpze', + handle: 'jasalterego.bsky.social', + displayName: 'Jerry Appleseed', + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:vc7f4oafdgxsihk4cry2xpze/bafkreicwxwecqiko2rwwln5y3fqqb2zx6wfg5rxf5r7lukakkq2slqy5hy@jpeg', + associated: { + chat: { + allowIncoming: 'following', + }, + }, + viewer: { + muted: false, + blockedBy: false, + following: + 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3jx4rnvlnhl25', + followedBy: + 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.graph.follow/3jx4siiniuc2e', + }, + labels: [ + { + cts: '2024-05-17T21:53:59.049Z', + src: 'did:plc:skibpmllbhxvbvwgtjxl3uao', + uri: 'did:plc:vc7f4oafdgxsihk4cry2xpze', + val: 'cringe', + ver: 1, + }, + { + cts: '2024-05-17T21:53:59.049Z', + src: 'did:plc:skibpmllbhxvbvwgtjxl3uao', + uri: 'did:plc:vc7f4oafdgxsihk4cry2xpze', + val: 'elder-watch', + ver: 1, + }, + { + src: 'did:plc:vc7f4oafdgxsihk4cry2xpze', + uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.actor.profile/self', + cid: 'bafyreidfiuv3c22vliyu2onazf23zrp35rr7i3upsqa2dsn5cqimmlgugm', + val: '!no-unauthenticated', + cts: '1970-01-01T00:00:00.000Z', + }, + ], + createdAt: '2023-04-23T20:11:04.375Z', + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: '2025-04-22T17:08:29.321Z', + langs: ['en'], + text: "(studying the blade) ow that's the sharp side", + }, + replyCount: 8, + repostCount: 37, + likeCount: 252, + quoteCount: 1, + indexedAt: '2025-04-22T17:08:29.458Z', + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + $type: 'app.bsky.feed.defs#postView', + }, + parent: { + uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lng66dkzu222', + cid: 'bafyreic7wmhywvu5fi4lupswxpmyydqn2gl5kwnt4n4jxvb3lpej2l72ku', + author: { + did: 'did:plc:vc7f4oafdgxsihk4cry2xpze', + handle: 'jasalterego.bsky.social', + displayName: 'Jerry Appleseed', + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:vc7f4oafdgxsihk4cry2xpze/bafkreicwxwecqiko2rwwln5y3fqqb2zx6wfg5rxf5r7lukakkq2slqy5hy@jpeg', + associated: { + chat: { + allowIncoming: 'following', + }, + }, + viewer: { + muted: false, + blockedBy: false, + following: + 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3jx4rnvlnhl25', + followedBy: + 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.graph.follow/3jx4siiniuc2e', + }, + labels: [ + { + cts: '2024-05-17T21:53:59.049Z', + src: 'did:plc:skibpmllbhxvbvwgtjxl3uao', + uri: 'did:plc:vc7f4oafdgxsihk4cry2xpze', + val: 'cringe', + ver: 1, + }, + { + cts: '2024-05-17T21:53:59.049Z', + src: 'did:plc:skibpmllbhxvbvwgtjxl3uao', + uri: 'did:plc:vc7f4oafdgxsihk4cry2xpze', + val: 'elder-watch', + ver: 1, + }, + { + src: 'did:plc:vc7f4oafdgxsihk4cry2xpze', + uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.actor.profile/self', + cid: 'bafyreidfiuv3c22vliyu2onazf23zrp35rr7i3upsqa2dsn5cqimmlgugm', + val: '!no-unauthenticated', + cts: '1970-01-01T00:00:00.000Z', + }, + ], + createdAt: '2023-04-23T20:11:04.375Z', + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: '2025-04-22T17:08:29.321Z', + langs: ['en'], + text: '*sees the studio display* i think i hauve covid', + }, + replyCount: 8, + repostCount: 37, + likeCount: 252, + quoteCount: 1, + indexedAt: '2025-04-22T17:08:29.458Z', + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + $type: 'app.bsky.feed.defs#postView', + }, + }, + }, + { + post: { + uri: 'at://did:plc:qvzn322kmcvd7xtnips5xaun/app.bsky.feed.post/3lnehbwkvzk2z', + cid: 'bafyreidshyla4xoolb7fexhtlqcjjbn6ts7z4xja7gnlinroms5cuqg3fq', + author: { + did: 'did:plc:qvzn322kmcvd7xtnips5xaun', + handle: 'scalzi.com', + displayName: 'John Scalzi', + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:qvzn322kmcvd7xtnips5xaun/bafkreih4dn5gllculyzb6wlqcqparkax35zloe3bzn2nufeqeilz4sutsu@jpeg', + associated: { + chat: { + allowIncoming: 'following', + }, + }, + + viewer: { + muted: false, + blockedBy: false, + following: + 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3kcvvfzq6o32a', + followedBy: + 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.graph.follow/3jwawchotz22h', + }, + labels: [], + createdAt: '2023-04-27T16:05:17.859Z', + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: '2025-04-22T00:46:14.095Z', + embed: { + $type: 'app.bsky.embed.images', + images: [ + { + alt: 'Smudge napping on the Eames chair, which is covered in a blanket to avoid getting cat hair on it. ', + aspectRatio: { + height: 2000, + width: 1505, + }, + image: { + $type: 'blob', + ref: { + $link: + 'bafkreigkfbcmttc4r4avknp4y2mlcjlws3sdcat6jcyd2mjr7yvz6sje4q', + }, + mimeType: 'image/jpeg', + size: 833834, + }, + }, + ], + }, + langs: ['en'], + text: 'Smudge found the Eames chair', + }, + embed: { + $type: 'app.bsky.embed.images#view', + images: [ + { + thumb: + 'https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:qvzn322kmcvd7xtnips5xaun/bafkreigkfbcmttc4r4avknp4y2mlcjlws3sdcat6jcyd2mjr7yvz6sje4q@jpeg', + fullsize: + 'https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:qvzn322kmcvd7xtnips5xaun/bafkreigkfbcmttc4r4avknp4y2mlcjlws3sdcat6jcyd2mjr7yvz6sje4q@jpeg', + alt: 'Smudge napping on the Eames chair, which is covered in a blanket to avoid getting cat hair on it. ', + aspectRatio: { + height: 2000, + width: 1505, + }, + }, + ], + }, + replyCount: 47, + repostCount: 31, + likeCount: 1543, + quoteCount: 0, + indexedAt: '2025-04-22T00:46:17.457Z', + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + }, + }, + { + post: { + uri: 'at://did:plc:jb2q4yqmgpmefxd4xx66gepm/app.bsky.feed.post/3lng4m2memc2k', + cid: 'bafyreicvgwkd5xkbtu3eh756yodnynqbxoegzzqhhees5ou45t3gq3j6um', + author: { + did: 'did:plc:jb2q4yqmgpmefxd4xx66gepm', + handle: 'visionprofan.bsky.social', + displayName: 'Visionary', + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:jb2q4yqmgpmefxd4xx66gepm/bafkreibqdpwilgj43m37ksjilzcnzqx2g3njcyiyifvazdar23rs5hlokm@jpeg', + associated: { + chat: { + allowIncoming: 'following', + }, + }, + + viewer: { + muted: false, + blockedBy: false, + following: + 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3kcvvfzq6o32a', + followedBy: + 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.graph.follow/3jwawchotz22h', + }, + labels: [ + { + cts: '2024-07-14T04:31:55.599Z', + src: 'did:plc:skibpmllbhxvbvwgtjxl3uao', + uri: 'did:plc:jb2q4yqmgpmefxd4xx66gepm', + val: 'cringe', + ver: 1, + }, + ], + createdAt: '2023-04-13T05:48:48.827Z', + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: '2025-04-22T16:40:22.205Z', + embed: { + $type: 'app.bsky.embed.record', + record: { + cid: 'bafyreif6ks7dhjrgrio5guztdhf3byoygbwebbvehi4al2c5kmkevlqdky', + uri: 'at://did:plc:4llrhdclvdlmmynkwsmg5tdc/app.bsky.feed.post/3lnfspxzdd42p', + }, + }, + langs: ['en'], + text: 'Just got my Vision Pro! 🤯\n\nAny recommendations for apps to try out?', + }, + embed: { + $type: 'app.bsky.embed.record#view', + record: { + $type: 'app.bsky.embed.record#viewRecord', + uri: 'at://did:plc:4llrhdclvdlmmynkwsmg5tdc/app.bsky.feed.post/3lnfspxzdd42p', + cid: 'bafyreif6ks7dhjrgrio5guztdhf3byoygbwebbvehi4al2c5kmkevlqdky', + author: { + did: 'did:plc:4llrhdclvdlmmynkwsmg5tdc', + handle: 'atrupar.com', + displayName: 'Aaron Rupar', + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:4llrhdclvdlmmynkwsmg5tdc/bafkreibmhm3h6ar52pogvolisrzjdhwa2myras5vkxzj67twxn2l6pogwu@jpeg', + associated: { + chat: { + allowIncoming: 'following', + }, + }, + viewer: { + muted: false, + blockedBy: false, + following: + 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3l7eals2t4g2k', + }, + labels: [], + createdAt: '2023-04-28T00:47:57.437Z', + }, + value: { + $type: 'app.bsky.feed.post', + createdAt: '2025-04-22T13:43:36.261Z', + embed: { + $type: 'app.bsky.embed.video', + alt: '', + aspectRatio: { + height: 720, + width: 1280, + }, + captions: [ + { + $type: 'app.bsky.embed.video#caption', + file: { + $type: 'blob', + ref: { + $link: + 'bafkreihm7npnefqxqmn7d45lcbxzn4wnowc2abe5hxmd63qlob7fbszola', + }, + mimeType: 'text/vtt', + size: 1339, + }, + lang: 'en', + }, + ], + video: { + $type: 'blob', + ref: { + $link: + 'bafkreihovdkyvql2yswuimm5m35lqyo7tgsfiujm7vrxtfmi4gwej4hkpa', + }, + mimeType: 'video/mp4', + size: 6026932, + }, + }, + facets: [], + langs: ['en'], + text: 'Austin Scott previews how House Rs plan to cut Medicaid: "The federal govt is paying 90% of the Medicaid expansion. What we\'ve talked about is moving that 90% level of the expansion back... nobody would be kicked off Medicaid as long as governors decided they wanted to continue to fund the program"', + }, + labels: [], + likeCount: 880, + replyCount: 230, + repostCount: 347, + quoteCount: 145, + indexedAt: '2025-04-22T13:43:37.350Z', + embeds: [ + { + $type: 'app.bsky.embed.video#view', + cid: 'bafkreihovdkyvql2yswuimm5m35lqyo7tgsfiujm7vrxtfmi4gwej4hkpa', + playlist: + 'https://video.bsky.app/watch/did%3Aplc%3A4llrhdclvdlmmynkwsmg5tdc/bafkreihovdkyvql2yswuimm5m35lqyo7tgsfiujm7vrxtfmi4gwej4hkpa/playlist.m3u8', + thumbnail: + 'https://video.bsky.app/watch/did%3Aplc%3A4llrhdclvdlmmynkwsmg5tdc/bafkreihovdkyvql2yswuimm5m35lqyo7tgsfiujm7vrxtfmi4gwej4hkpa/thumbnail.jpg', + alt: '', + aspectRatio: { + height: 720, + width: 1280, + }, + }, + ], + }, + }, + replyCount: 11, + repostCount: 97, + likeCount: 399, + quoteCount: 3, + indexedAt: '2025-04-22T16:40:22.648Z', + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + }, + }, + { + post: { + uri: 'at://did:plc:5o6k7jvowuyaquloafzn3cfw/app.bsky.feed.post/3lng6lkuhxc2s', + cid: 'bafyreifwapmjx76kz5lkoeejfoes4ct2xhyycfyxwccmyr3mtxht5juyli', + author: { + did: 'did:plc:5o6k7jvowuyaquloafzn3cfw', + handle: 'johndoe.org', + displayName: 'John Doe', + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:5o6k7jvowuyaquloafzn3cfw/bafkreierrwtdsf5quwprs2xqmmh2lu2k7au2cibyegfpard6wqyjs7nd6i@jpeg', + + viewer: { + muted: false, + blockedBy: false, + following: + 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3kcvvfzq6o32a', + followedBy: + 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.graph.follow/3jwawchotz22h', + }, + labels: [], + createdAt: '2023-05-16T02:37:39.269Z', + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: '2025-04-22T17:15:53.178Z', + langs: ['en'], + text: "I'm running out of ideas for these fake posts. Alas, such is the demands of modern life. Do you like blueberries? Just remembered that blueberries are delicious! They're so tasty! I can't wait to try them!", + }, + replyCount: 13, + repostCount: 121, + likeCount: 345, + quoteCount: 6, + indexedAt: '2025-04-22T17:15:53.351Z', + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + }, + }, + { + post: { + uri: 'at://did:plc:5ywatwbfxoecxgb4xq6ods72/app.bsky.feed.post/3lng5w2fbvs2g', + cid: 'bafyreigi7d57fudzoybe4u6w7friw6ydz3pmzrdu3bvjwb5mvsvlprk23y', + author: { + did: 'did:plc:5ywatwbfxoecxgb4xq6ods72', + handle: 'cooking.bsky.social', + displayName: 'cooking tips', + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:5ywatwbfxoecxgb4xq6ods72/bafkreibbsuyy25elibbys5vx25cnkcs6g4ih6dozypa4bomwhkwsi6f5wa@jpeg', + + viewer: { + muted: false, + blockedBy: false, + following: + 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3kcvvfzq6o32a', + followedBy: + 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.graph.follow/3jwawchotz22h', + }, + labels: [], + createdAt: '2024-05-28T00:18:08.531Z', + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: '2025-04-22T17:03:51.259Z', + langs: ['en'], + text: 'and another thing. I have more things to say. I think. I forget :/', + }, + replyCount: 1, + repostCount: 4, + likeCount: 20, + quoteCount: 0, + indexedAt: '2025-04-22T17:03:52.050Z', + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + }, + }, + ], +} satisfies AppBskyFeedGetFeed.OutputSchema + +export const BOTTOM_BAR_AVI = 'https://bsky.social/about/hero-social-card.webp' diff --git a/src/state/queries/post-feed.ts b/src/state/queries/post-feed.ts index 82a118ec2c..f3fa13cfba 100644 --- a/src/state/queries/post-feed.ts +++ b/src/state/queries/post-feed.ts @@ -1,31 +1,32 @@ import React, {useCallback, useEffect, useRef} from 'react' import {AppState} from 'react-native' import { - AppBskyActorDefs, + type AppBskyActorDefs, AppBskyFeedDefs, - AppBskyFeedPost, + type AppBskyFeedPost, AtUri, - BskyAgent, + type BskyAgent, moderatePost, - ModerationDecision, + type ModerationDecision, } from '@atproto/api' import { - InfiniteData, - QueryClient, - QueryKey, + type InfiniteData, + type QueryClient, + type QueryKey, useInfiniteQuery, } from '@tanstack/react-query' import {AuthorFeedAPI} from '#/lib/api/feed/author' import {CustomFeedAPI} from '#/lib/api/feed/custom' +import {DemoFeedAPI} from '#/lib/api/feed/demo' import {FollowingFeedAPI} from '#/lib/api/feed/following' import {HomeFeedAPI} from '#/lib/api/feed/home' import {LikesFeedAPI} from '#/lib/api/feed/likes' import {ListFeedAPI} from '#/lib/api/feed/list' import {MergeFeedAPI} from '#/lib/api/feed/merge' -import {FeedAPI, ReasonFeedSource} from '#/lib/api/feed/types' +import {type FeedAPI, type ReasonFeedSource} from '#/lib/api/feed/types' import {aggregateUserInterests} from '#/lib/api/feed/utils' -import {FeedTuner, FeedTunerFn} from '#/lib/api/feed-manip' +import {FeedTuner, type FeedTunerFn} from '#/lib/api/feed-manip' import {DISCOVER_FEED_URI} from '#/lib/constants' import {BSKY_FEED_OWNER_DIDS} from '#/lib/constants' import {logger} from '#/logger' @@ -59,6 +60,7 @@ export type FeedDescriptor = | `feedgen|${FeedUri}` | `likes|${ActorDid}` | `list|${ListUri}` + | 'demo' export interface FeedParams { mergeFeedEnabled?: boolean mergeFeedSources?: string[] @@ -483,6 +485,8 @@ function createApi({ } else if (feedDesc.startsWith('list')) { const [_, list] = feedDesc.split('|') return new ListFeedAPI({agent, feedParams: {list}}) + } else if (feedDesc === 'demo') { + return new DemoFeedAPI({agent}) } else { // shouldnt happen return new FollowingFeedAPI({agent}) diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index a6e2595eec..e058e28831 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -8,28 +8,36 @@ import {useOTAUpdates} from '#/lib/hooks/useOTAUpdates' import {useSetTitle} from '#/lib/hooks/useSetTitle' import {useRequestNotificationsPermission} from '#/lib/notifications/notifications' import { - HomeTabNavigatorParams, - NativeStackScreenProps, + type HomeTabNavigatorParams, + type NativeStackScreenProps, } from '#/lib/routes/types' import {logEvent} from '#/lib/statsig/statsig' import {isWeb} from '#/platform/detection' import {emitSoftReset} from '#/state/events' -import {SavedFeedSourceInfo, usePinnedFeedsInfos} from '#/state/queries/feed' -import {FeedDescriptor, FeedParams} from '#/state/queries/post-feed' +import { + type SavedFeedSourceInfo, + usePinnedFeedsInfos, +} from '#/state/queries/feed' +import {type FeedDescriptor, type FeedParams} from '#/state/queries/post-feed' import {usePreferencesQuery} from '#/state/queries/preferences' -import {UsePreferencesQueryResponse} from '#/state/queries/preferences/types' +import {type UsePreferencesQueryResponse} from '#/state/queries/preferences/types' import {useSession} from '#/state/session' import {useSetMinimalShellMode} from '#/state/shell' import {useLoggedOutViewControls} from '#/state/shell/logged-out' import {useSelectedFeed, useSetSelectedFeed} from '#/state/shell/selected-feed' import {FeedPage} from '#/view/com/feeds/FeedPage' import {HomeHeader} from '#/view/com/home/HomeHeader' -import {Pager, PagerRef, RenderTabBarFnProps} from '#/view/com/pager/Pager' +import { + Pager, + type PagerRef, + type RenderTabBarFnProps, +} from '#/view/com/pager/Pager' import {CustomFeedEmptyState} from '#/view/com/posts/CustomFeedEmptyState' import {FollowingEmptyState} from '#/view/com/posts/FollowingEmptyState' import {FollowingEndOfFeed} from '#/view/com/posts/FollowingEndOfFeed' import {NoFeedsPinned} from '#/screens/Home/NoFeedsPinned' import * as Layout from '#/components/Layout' +import {useDemoMode} from '#/storage/hooks/demo-mode' type Props = NativeStackScreenProps export function HomeScreen(props: Props) { @@ -184,8 +192,22 @@ function HomeScreenReady({ [setMinimalShellMode], ) + const [demoMode] = useDemoMode() + const renderTabBar = React.useCallback( (props: RenderTabBarFnProps) => { + if (demoMode) { + return ( + + ) + } return ( ) }, - [onPressSelected, pinnedFeedInfos], + [onPressSelected, pinnedFeedInfos, demoMode], ) const renderFollowingEmptyState = React.useCallback(() => { @@ -218,6 +240,35 @@ function HomeScreenReady({ } }, [preferences]) + if (demoMode) { + return ( + + + + + ) + } + return hasSession ? ( @@ -259,7 +263,7 @@ export function BottomBar({navigation}: BottomTabBarProps) { {borderColor: pal.text.color}, ]}> Date: Tue, 22 Apr 2025 21:35:31 +0300 Subject: [PATCH 03/12] add more posts --- src/lib/demo.ts | 119 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/src/lib/demo.ts b/src/lib/demo.ts index 96bb7f9b14..ce0f594279 100644 --- a/src/lib/demo.ts +++ b/src/lib/demo.ts @@ -510,6 +510,125 @@ export const DEMO_FEED = { labels: [], }, }, + { + post: { + uri: 'at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/app.bsky.feed.post/3lng5izl7kc2c', + cid: 'bafyreicsich65s4rq526rek5jmvd6djtcmr7kdavw26rrnf424awgvia7i', + author: { + did: 'did:plc:fpruhuo22xkm5o7ttr2ktxdo', + handle: 'danabra.mov', + displayName: 'dan', + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:fpruhuo22xkm5o7ttr2ktxdo/bafkreif43mhqajnbnl62u3ezf37g6x22nd762im54thxbil4ga46eugcga@jpeg', + associated: { + chat: { + allowIncoming: 'all', + }, + }, + viewer: { + muted: false, + blockedBy: false, + following: + 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3jtdzgbbysa2y', + followedBy: + 'at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/app.bsky.graph.follow/3k7ht6lwu6t2a', + }, + labels: [], + createdAt: '2023-04-08T20:19:22.589Z', + verification: { + verifications: [ + { + issuer: 'did:plc:z72i7hdynmk6r22z27h6tvur', + uri: 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.verification/3lndpxompy32z', + isValid: true, + createdAt: '2025-04-21T10:48:53.876Z', + }, + ], + verifiedStatus: 'valid', + trustedVerifierStatus: 'none', + }, + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: '2025-04-22T16:56:34.198Z', + langs: ['en'], + text: 'maybe i should write something about vercel at some point', + }, + replyCount: 10, + repostCount: 1, + likeCount: 84, + quoteCount: 1, + indexedAt: '2025-04-22T16:56:34.356Z', + viewer: { + threadMuted: false, + replyDisabled: false, + embeddingDisabled: false, + }, + labels: [], + threadgate: { + uri: 'at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/app.bsky.feed.threadgate/3lng5izl7kc2c', + cid: 'bafyreic4wpsh5wrmjvbngt7som5436xzjhdnld3mxnkzyhj2i4vh6lpefa', + record: { + $type: 'app.bsky.feed.threadgate', + allow: [ + { + $type: 'app.bsky.feed.threadgate#followerRule', + }, + { + $type: 'app.bsky.feed.threadgate#followingRule', + }, + { + $type: 'app.bsky.feed.threadgate#mentionRule', + }, + ], + createdAt: '2025-04-22T16:56:34.200Z', + hiddenReplies: [], + post: 'at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/app.bsky.feed.post/3lng5izl7kc2c', + }, + lists: [], + }, + }, + }, + { + post: { + uri: 'at://did:plc:77tdak46psveqneyegsdyc7l/app.bsky.feed.post/3lnft75ivlc27', + cid: 'bafyreic24reeweaymcfe6hdsuhmffazdpa5hoqyculxrdp2sr7xkoehgay', + author: { + did: 'did:plc:77tdak46psveqneyegsdyc7l', + handle: 'werd.io', + displayName: 'Ben Werdmuller', + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:77tdak46psveqneyegsdyc7l/bafkreicoqtayuefjlw73nrx4c7sioc3ujq74uisgbh4ddmuamevjwzt4fu@jpeg', + associated: { + chat: { + allowIncoming: 'following', + }, + }, + viewer: { + muted: false, + blockedBy: false, + }, + labels: [], + createdAt: '2023-03-07T15:40:54.229Z', + }, + record: { + $type: 'app.bsky.feed.post', + createdAt: '2025-04-22T13:52:05.353Z', + langs: ['en'], + text: 'This is obvious, but if people broadly rely on a black box to give them answers that help them understand the world, whoever controls the black box controls those answers and therefore the understanding that comes from them.\n\nOpenness is safety.', + }, + replyCount: 10, + repostCount: 84, + likeCount: 432, + quoteCount: 2, + indexedAt: '2025-04-22T13:52:05.755Z', + viewer: { + threadMuted: false, + embeddingDisabled: false, + }, + labels: [], + }, + }, ], } satisfies AppBskyFeedGetFeed.OutputSchema From eb2008cd8e300927d5f76276fd6a528183c87eeb Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 23 Apr 2025 14:50:10 -0500 Subject: [PATCH 04/12] Update data --- src/lib/demo.ts | 403 +++++++++--------------------------------------- 1 file changed, 72 insertions(+), 331 deletions(-) diff --git a/src/lib/demo.ts b/src/lib/demo.ts index ce0f594279..688be6c6c4 100644 --- a/src/lib/demo.ts +++ b/src/lib/demo.ts @@ -1,17 +1,23 @@ import {type AppBskyFeedGetFeed} from '@atproto/api' +import {subDays,subMinutes} from 'date-fns' + +const DID = `did:plc:z72i7hdynmk6r22z27h6tvur` +const NOW = new Date() +const POST_1_DATE = subMinutes(NOW, 2).toISOString() +const POST_2_DATE = subMinutes(NOW, 4).toISOString() +const POST_3_DATE = subMinutes(NOW, 5).toISOString() export const DEMO_FEED = { feed: [ { post: { - uri: 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.feed.post/3lng6kvb6uc2a', - cid: 'bafyreifqyej7jivzucaagu22f7jj7rvjcpbzv2kxo27wt47ktduwwdpdae', + uri: `at://${DID}/app.bsky.feed.post/post1`, + cid: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', author: { - did: 'did:plc:vwzwgnygau7ed7b7wt5ux7y2', - handle: 'someoneelse.bsky.social', - displayName: 'Not David', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:vwzwgnygau7ed7b7wt5ux7y2/bafkreifrtz3ngpzz5qmhjliv5toj4nvyjovijxs5e2la67wddhmdhro5he@jpeg', + did: DID, + handle: 'forkedriver.blsky', + displayName: 'Forked River Band', + avatar: 'https://bsky.social/about/adi/post_1_avi.jpg', associated: { chat: { allowIncoming: 'following', @@ -20,261 +26,102 @@ export const DEMO_FEED = { viewer: { muted: false, blockedBy: false, - following: - 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3kcvvfzq6o32a', - followedBy: - 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.graph.follow/3jwawchotz22h', + following: `at://${DID}/app.bsky.graph.follow/post1`, }, labels: [], - createdAt: '2023-04-27T09:23:54.423Z', + createdAt: POST_1_DATE, verification: { verifications: [ { - issuer: 'did:plc:z72i7hdynmk6r22z27h6tvur', - uri: 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.verification/3lndpxt7ur22f', + issuer: DID, + uri: `at://${DID}/app.bsky.graph.verification/post1`, isValid: true, - createdAt: '2025-04-21T10:48:58.775Z', + createdAt: subDays(NOW, 11).toISOString(), }, ], verifiedStatus: 'valid', trustedVerifierStatus: 'none', }, }, + embed: { + $type: 'app.bsky.embed.images#view', + images: [ + { + thumb: 'https://bsky.social/about/adi/post_1_image.jpg', + fullsize: 'https://bsky.social/about/adi/post_1_image.jpg', + alt: '', + aspectRatio: { + height: 1350, + width: 900, + }, + }, + ], + }, record: { $type: 'app.bsky.feed.post', - createdAt: '2025-04-22T17:15:30.525Z', + createdAt: POST_1_DATE, langs: ['en'], - reply: { - parent: { - cid: 'bafyreic7wmhywvu5fi4lupswxpmyydqn2gl5kwnt4n4jxvb3lpej2l72ku', - uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lng66dkzu222', - }, - root: { - cid: 'bafyreic7wmhywvu5fi4lupswxpmyydqn2gl5kwnt4n4jxvb3lpej2l72ku', - uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lng66dkzu222', - }, - }, - text: 'sometimes I go to the apple store just to look at them', + text: 'Sonoma County folks: Come tip your hats our way and see us play new and old tunes at Sebastopol Bluegrass Fest on June 14th.', }, - replyCount: 0, - repostCount: 0, - likeCount: 6, + replyCount: 1, + repostCount: 4, + likeCount: 18, quoteCount: 0, - indexedAt: '2025-04-22T17:15:31.251Z', + indexedAt: POST_1_DATE, viewer: { threadMuted: false, embeddingDisabled: false, }, labels: [], }, - reply: { - root: { - uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lng66dkzu222', - cid: 'bafyreic7wmhywvu5fi4lupswxpmyydqn2gl5kwnt4n4jxvb3lpej2l72ku', - author: { - did: 'did:plc:vc7f4oafdgxsihk4cry2xpze', - handle: 'jasalterego.bsky.social', - displayName: 'Jerry Appleseed', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:vc7f4oafdgxsihk4cry2xpze/bafkreicwxwecqiko2rwwln5y3fqqb2zx6wfg5rxf5r7lukakkq2slqy5hy@jpeg', - associated: { - chat: { - allowIncoming: 'following', - }, - }, - viewer: { - muted: false, - blockedBy: false, - following: - 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3jx4rnvlnhl25', - followedBy: - 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.graph.follow/3jx4siiniuc2e', - }, - labels: [ - { - cts: '2024-05-17T21:53:59.049Z', - src: 'did:plc:skibpmllbhxvbvwgtjxl3uao', - uri: 'did:plc:vc7f4oafdgxsihk4cry2xpze', - val: 'cringe', - ver: 1, - }, - { - cts: '2024-05-17T21:53:59.049Z', - src: 'did:plc:skibpmllbhxvbvwgtjxl3uao', - uri: 'did:plc:vc7f4oafdgxsihk4cry2xpze', - val: 'elder-watch', - ver: 1, - }, - { - src: 'did:plc:vc7f4oafdgxsihk4cry2xpze', - uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.actor.profile/self', - cid: 'bafyreidfiuv3c22vliyu2onazf23zrp35rr7i3upsqa2dsn5cqimmlgugm', - val: '!no-unauthenticated', - cts: '1970-01-01T00:00:00.000Z', - }, - ], - createdAt: '2023-04-23T20:11:04.375Z', - }, - record: { - $type: 'app.bsky.feed.post', - createdAt: '2025-04-22T17:08:29.321Z', - langs: ['en'], - text: "(studying the blade) ow that's the sharp side", - }, - replyCount: 8, - repostCount: 37, - likeCount: 252, - quoteCount: 1, - indexedAt: '2025-04-22T17:08:29.458Z', - viewer: { - threadMuted: false, - embeddingDisabled: false, - }, - labels: [], - $type: 'app.bsky.feed.defs#postView', - }, - parent: { - uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.feed.post/3lng66dkzu222', - cid: 'bafyreic7wmhywvu5fi4lupswxpmyydqn2gl5kwnt4n4jxvb3lpej2l72ku', - author: { - did: 'did:plc:vc7f4oafdgxsihk4cry2xpze', - handle: 'jasalterego.bsky.social', - displayName: 'Jerry Appleseed', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:vc7f4oafdgxsihk4cry2xpze/bafkreicwxwecqiko2rwwln5y3fqqb2zx6wfg5rxf5r7lukakkq2slqy5hy@jpeg', - associated: { - chat: { - allowIncoming: 'following', - }, - }, - viewer: { - muted: false, - blockedBy: false, - following: - 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3jx4rnvlnhl25', - followedBy: - 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.graph.follow/3jx4siiniuc2e', - }, - labels: [ - { - cts: '2024-05-17T21:53:59.049Z', - src: 'did:plc:skibpmllbhxvbvwgtjxl3uao', - uri: 'did:plc:vc7f4oafdgxsihk4cry2xpze', - val: 'cringe', - ver: 1, - }, - { - cts: '2024-05-17T21:53:59.049Z', - src: 'did:plc:skibpmllbhxvbvwgtjxl3uao', - uri: 'did:plc:vc7f4oafdgxsihk4cry2xpze', - val: 'elder-watch', - ver: 1, - }, - { - src: 'did:plc:vc7f4oafdgxsihk4cry2xpze', - uri: 'at://did:plc:vc7f4oafdgxsihk4cry2xpze/app.bsky.actor.profile/self', - cid: 'bafyreidfiuv3c22vliyu2onazf23zrp35rr7i3upsqa2dsn5cqimmlgugm', - val: '!no-unauthenticated', - cts: '1970-01-01T00:00:00.000Z', - }, - ], - createdAt: '2023-04-23T20:11:04.375Z', - }, - record: { - $type: 'app.bsky.feed.post', - createdAt: '2025-04-22T17:08:29.321Z', - langs: ['en'], - text: '*sees the studio display* i think i hauve covid', - }, - replyCount: 8, - repostCount: 37, - likeCount: 252, - quoteCount: 1, - indexedAt: '2025-04-22T17:08:29.458Z', - viewer: { - threadMuted: false, - embeddingDisabled: false, - }, - labels: [], - $type: 'app.bsky.feed.defs#postView', - }, - }, }, { post: { - uri: 'at://did:plc:qvzn322kmcvd7xtnips5xaun/app.bsky.feed.post/3lnehbwkvzk2z', - cid: 'bafyreidshyla4xoolb7fexhtlqcjjbn6ts7z4xja7gnlinroms5cuqg3fq', + uri: `at://${DID}/app.bsky.feed.post/post2`, + cid: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', author: { - did: 'did:plc:qvzn322kmcvd7xtnips5xaun', - handle: 'scalzi.com', - displayName: 'John Scalzi', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:qvzn322kmcvd7xtnips5xaun/bafkreih4dn5gllculyzb6wlqcqparkax35zloe3bzn2nufeqeilz4sutsu@jpeg', + did: DID, + handle: 'dinh-designs.blsky', + displayName: 'Dinh Designs', + avatar: 'https://bsky.social/about/adi/post_2_avi.jpg', associated: { chat: { allowIncoming: 'following', }, }, - viewer: { muted: false, blockedBy: false, - following: - 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3kcvvfzq6o32a', - followedBy: - 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.graph.follow/3jwawchotz22h', + following: `at://${DID}/app.bsky.graph.follow/post2`, }, labels: [], - createdAt: '2023-04-27T16:05:17.859Z', - }, - record: { - $type: 'app.bsky.feed.post', - createdAt: '2025-04-22T00:46:14.095Z', - embed: { - $type: 'app.bsky.embed.images', - images: [ - { - alt: 'Smudge napping on the Eames chair, which is covered in a blanket to avoid getting cat hair on it. ', - aspectRatio: { - height: 2000, - width: 1505, - }, - image: { - $type: 'blob', - ref: { - $link: - 'bafkreigkfbcmttc4r4avknp4y2mlcjlws3sdcat6jcyd2mjr7yvz6sje4q', - }, - mimeType: 'image/jpeg', - size: 833834, - }, - }, - ], - }, - langs: ['en'], - text: 'Smudge found the Eames chair', + createdAt: POST_2_DATE, }, embed: { $type: 'app.bsky.embed.images#view', images: [ { - thumb: - 'https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:qvzn322kmcvd7xtnips5xaun/bafkreigkfbcmttc4r4avknp4y2mlcjlws3sdcat6jcyd2mjr7yvz6sje4q@jpeg', - fullsize: - 'https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:qvzn322kmcvd7xtnips5xaun/bafkreigkfbcmttc4r4avknp4y2mlcjlws3sdcat6jcyd2mjr7yvz6sje4q@jpeg', - alt: 'Smudge napping on the Eames chair, which is covered in a blanket to avoid getting cat hair on it. ', + thumb: 'https://bsky.social/about/adi/post_2_image.jpg', + fullsize: 'https://bsky.social/about/adi/post_2_image.jpg', + alt: '', aspectRatio: { - height: 2000, - width: 1505, + height: 872, + width: 598, }, }, ], }, - replyCount: 47, - repostCount: 31, - likeCount: 1543, + record: { + $type: 'app.bsky.feed.post', + createdAt: POST_2_DATE, + langs: ['en'], + text: 'Details from our install at the Lucas residence in Joshua Tree. We populated the space with rich, earthy tones and locally-sourced materials to suit the landscape.', + }, + replyCount: 3, + repostCount: 1, + likeCount: 4, quoteCount: 0, - indexedAt: '2025-04-22T00:46:17.457Z', + indexedAt: POST_2_DATE, viewer: { threadMuted: false, embeddingDisabled: false, @@ -284,145 +131,37 @@ export const DEMO_FEED = { }, { post: { - uri: 'at://did:plc:jb2q4yqmgpmefxd4xx66gepm/app.bsky.feed.post/3lng4m2memc2k', - cid: 'bafyreicvgwkd5xkbtu3eh756yodnynqbxoegzzqhhees5ou45t3gq3j6um', + uri: `at://${DID}/app.bsky.feed.post/post3`, + cid: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', author: { - did: 'did:plc:jb2q4yqmgpmefxd4xx66gepm', - handle: 'visionprofan.bsky.social', + did: DID, + handle: 'visionprofan.blsky', displayName: 'Visionary', avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:jb2q4yqmgpmefxd4xx66gepm/bafkreibqdpwilgj43m37ksjilzcnzqx2g3njcyiyifvazdar23rs5hlokm@jpeg', + 'https://cdn.bsky.app/img/avatar/plain/did:plc:p2cp5gopk7mgjegy6wadk3ep/bafkreiaqsy36o6lpbpnonb4n46cvntfs6zoxbav35raix2sxhqgopxcjge@jpeg', associated: { chat: { allowIncoming: 'following', }, }, - viewer: { muted: false, blockedBy: false, - following: - 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3kcvvfzq6o32a', - followedBy: - 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.graph.follow/3jwawchotz22h', + following: `at://${DID}/app.bsky.graph.follow/post3`, }, - labels: [ - { - cts: '2024-07-14T04:31:55.599Z', - src: 'did:plc:skibpmllbhxvbvwgtjxl3uao', - uri: 'did:plc:jb2q4yqmgpmefxd4xx66gepm', - val: 'cringe', - ver: 1, - }, - ], - createdAt: '2023-04-13T05:48:48.827Z', + createdAt: POST_3_DATE, }, record: { $type: 'app.bsky.feed.post', - createdAt: '2025-04-22T16:40:22.205Z', - embed: { - $type: 'app.bsky.embed.record', - record: { - cid: 'bafyreif6ks7dhjrgrio5guztdhf3byoygbwebbvehi4al2c5kmkevlqdky', - uri: 'at://did:plc:4llrhdclvdlmmynkwsmg5tdc/app.bsky.feed.post/3lnfspxzdd42p', - }, - }, + createdAt: POST_3_DATE, langs: ['en'], text: 'Just got my Vision Pro! 🤯\n\nAny recommendations for apps to try out?', }, - embed: { - $type: 'app.bsky.embed.record#view', - record: { - $type: 'app.bsky.embed.record#viewRecord', - uri: 'at://did:plc:4llrhdclvdlmmynkwsmg5tdc/app.bsky.feed.post/3lnfspxzdd42p', - cid: 'bafyreif6ks7dhjrgrio5guztdhf3byoygbwebbvehi4al2c5kmkevlqdky', - author: { - did: 'did:plc:4llrhdclvdlmmynkwsmg5tdc', - handle: 'atrupar.com', - displayName: 'Aaron Rupar', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:4llrhdclvdlmmynkwsmg5tdc/bafkreibmhm3h6ar52pogvolisrzjdhwa2myras5vkxzj67twxn2l6pogwu@jpeg', - associated: { - chat: { - allowIncoming: 'following', - }, - }, - viewer: { - muted: false, - blockedBy: false, - following: - 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3l7eals2t4g2k', - }, - labels: [], - createdAt: '2023-04-28T00:47:57.437Z', - }, - value: { - $type: 'app.bsky.feed.post', - createdAt: '2025-04-22T13:43:36.261Z', - embed: { - $type: 'app.bsky.embed.video', - alt: '', - aspectRatio: { - height: 720, - width: 1280, - }, - captions: [ - { - $type: 'app.bsky.embed.video#caption', - file: { - $type: 'blob', - ref: { - $link: - 'bafkreihm7npnefqxqmn7d45lcbxzn4wnowc2abe5hxmd63qlob7fbszola', - }, - mimeType: 'text/vtt', - size: 1339, - }, - lang: 'en', - }, - ], - video: { - $type: 'blob', - ref: { - $link: - 'bafkreihovdkyvql2yswuimm5m35lqyo7tgsfiujm7vrxtfmi4gwej4hkpa', - }, - mimeType: 'video/mp4', - size: 6026932, - }, - }, - facets: [], - langs: ['en'], - text: 'Austin Scott previews how House Rs plan to cut Medicaid: "The federal govt is paying 90% of the Medicaid expansion. What we\'ve talked about is moving that 90% level of the expansion back... nobody would be kicked off Medicaid as long as governors decided they wanted to continue to fund the program"', - }, - labels: [], - likeCount: 880, - replyCount: 230, - repostCount: 347, - quoteCount: 145, - indexedAt: '2025-04-22T13:43:37.350Z', - embeds: [ - { - $type: 'app.bsky.embed.video#view', - cid: 'bafkreihovdkyvql2yswuimm5m35lqyo7tgsfiujm7vrxtfmi4gwej4hkpa', - playlist: - 'https://video.bsky.app/watch/did%3Aplc%3A4llrhdclvdlmmynkwsmg5tdc/bafkreihovdkyvql2yswuimm5m35lqyo7tgsfiujm7vrxtfmi4gwej4hkpa/playlist.m3u8', - thumbnail: - 'https://video.bsky.app/watch/did%3Aplc%3A4llrhdclvdlmmynkwsmg5tdc/bafkreihovdkyvql2yswuimm5m35lqyo7tgsfiujm7vrxtfmi4gwej4hkpa/thumbnail.jpg', - alt: '', - aspectRatio: { - height: 720, - width: 1280, - }, - }, - ], - }, - }, replyCount: 11, repostCount: 97, likeCount: 399, quoteCount: 3, - indexedAt: '2025-04-22T16:40:22.648Z', + indexedAt: POST_3_DATE, viewer: { threadMuted: false, embeddingDisabled: false, @@ -430,6 +169,7 @@ export const DEMO_FEED = { labels: [], }, }, + /* { post: { uri: 'at://did:plc:5o6k7jvowuyaquloafzn3cfw/app.bsky.feed.post/3lng6lkuhxc2s', @@ -629,6 +369,7 @@ export const DEMO_FEED = { labels: [], }, }, + */ ], } satisfies AppBskyFeedGetFeed.OutputSchema From 9f66b7fe67ac5715f4b0188b76bd06ff043a5b6e Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 23 Apr 2025 15:01:19 -0500 Subject: [PATCH 05/12] Delete unused fake data, update bottom bar avi --- src/lib/demo.ts | 206 +----------------------------------------------- 1 file changed, 3 insertions(+), 203 deletions(-) diff --git a/src/lib/demo.ts b/src/lib/demo.ts index 688be6c6c4..5e09ff0aa0 100644 --- a/src/lib/demo.ts +++ b/src/lib/demo.ts @@ -1,5 +1,5 @@ import {type AppBskyFeedGetFeed} from '@atproto/api' -import {subDays,subMinutes} from 'date-fns' +import {subDays, subMinutes} from 'date-fns' const DID = `did:plc:z72i7hdynmk6r22z27h6tvur` const NOW = new Date() @@ -169,208 +169,8 @@ export const DEMO_FEED = { labels: [], }, }, - /* - { - post: { - uri: 'at://did:plc:5o6k7jvowuyaquloafzn3cfw/app.bsky.feed.post/3lng6lkuhxc2s', - cid: 'bafyreifwapmjx76kz5lkoeejfoes4ct2xhyycfyxwccmyr3mtxht5juyli', - author: { - did: 'did:plc:5o6k7jvowuyaquloafzn3cfw', - handle: 'johndoe.org', - displayName: 'John Doe', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:5o6k7jvowuyaquloafzn3cfw/bafkreierrwtdsf5quwprs2xqmmh2lu2k7au2cibyegfpard6wqyjs7nd6i@jpeg', - - viewer: { - muted: false, - blockedBy: false, - following: - 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3kcvvfzq6o32a', - followedBy: - 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.graph.follow/3jwawchotz22h', - }, - labels: [], - createdAt: '2023-05-16T02:37:39.269Z', - }, - record: { - $type: 'app.bsky.feed.post', - createdAt: '2025-04-22T17:15:53.178Z', - langs: ['en'], - text: "I'm running out of ideas for these fake posts. Alas, such is the demands of modern life. Do you like blueberries? Just remembered that blueberries are delicious! They're so tasty! I can't wait to try them!", - }, - replyCount: 13, - repostCount: 121, - likeCount: 345, - quoteCount: 6, - indexedAt: '2025-04-22T17:15:53.351Z', - viewer: { - threadMuted: false, - embeddingDisabled: false, - }, - labels: [], - }, - }, - { - post: { - uri: 'at://did:plc:5ywatwbfxoecxgb4xq6ods72/app.bsky.feed.post/3lng5w2fbvs2g', - cid: 'bafyreigi7d57fudzoybe4u6w7friw6ydz3pmzrdu3bvjwb5mvsvlprk23y', - author: { - did: 'did:plc:5ywatwbfxoecxgb4xq6ods72', - handle: 'cooking.bsky.social', - displayName: 'cooking tips', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:5ywatwbfxoecxgb4xq6ods72/bafkreibbsuyy25elibbys5vx25cnkcs6g4ih6dozypa4bomwhkwsi6f5wa@jpeg', - - viewer: { - muted: false, - blockedBy: false, - following: - 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3kcvvfzq6o32a', - followedBy: - 'at://did:plc:vwzwgnygau7ed7b7wt5ux7y2/app.bsky.graph.follow/3jwawchotz22h', - }, - labels: [], - createdAt: '2024-05-28T00:18:08.531Z', - }, - record: { - $type: 'app.bsky.feed.post', - createdAt: '2025-04-22T17:03:51.259Z', - langs: ['en'], - text: 'and another thing. I have more things to say. I think. I forget :/', - }, - replyCount: 1, - repostCount: 4, - likeCount: 20, - quoteCount: 0, - indexedAt: '2025-04-22T17:03:52.050Z', - viewer: { - threadMuted: false, - embeddingDisabled: false, - }, - labels: [], - }, - }, - { - post: { - uri: 'at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/app.bsky.feed.post/3lng5izl7kc2c', - cid: 'bafyreicsich65s4rq526rek5jmvd6djtcmr7kdavw26rrnf424awgvia7i', - author: { - did: 'did:plc:fpruhuo22xkm5o7ttr2ktxdo', - handle: 'danabra.mov', - displayName: 'dan', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:fpruhuo22xkm5o7ttr2ktxdo/bafkreif43mhqajnbnl62u3ezf37g6x22nd762im54thxbil4ga46eugcga@jpeg', - associated: { - chat: { - allowIncoming: 'all', - }, - }, - viewer: { - muted: false, - blockedBy: false, - following: - 'at://did:plc:p2cp5gopk7mgjegy6wadk3ep/app.bsky.graph.follow/3jtdzgbbysa2y', - followedBy: - 'at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/app.bsky.graph.follow/3k7ht6lwu6t2a', - }, - labels: [], - createdAt: '2023-04-08T20:19:22.589Z', - verification: { - verifications: [ - { - issuer: 'did:plc:z72i7hdynmk6r22z27h6tvur', - uri: 'at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.graph.verification/3lndpxompy32z', - isValid: true, - createdAt: '2025-04-21T10:48:53.876Z', - }, - ], - verifiedStatus: 'valid', - trustedVerifierStatus: 'none', - }, - }, - record: { - $type: 'app.bsky.feed.post', - createdAt: '2025-04-22T16:56:34.198Z', - langs: ['en'], - text: 'maybe i should write something about vercel at some point', - }, - replyCount: 10, - repostCount: 1, - likeCount: 84, - quoteCount: 1, - indexedAt: '2025-04-22T16:56:34.356Z', - viewer: { - threadMuted: false, - replyDisabled: false, - embeddingDisabled: false, - }, - labels: [], - threadgate: { - uri: 'at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/app.bsky.feed.threadgate/3lng5izl7kc2c', - cid: 'bafyreic4wpsh5wrmjvbngt7som5436xzjhdnld3mxnkzyhj2i4vh6lpefa', - record: { - $type: 'app.bsky.feed.threadgate', - allow: [ - { - $type: 'app.bsky.feed.threadgate#followerRule', - }, - { - $type: 'app.bsky.feed.threadgate#followingRule', - }, - { - $type: 'app.bsky.feed.threadgate#mentionRule', - }, - ], - createdAt: '2025-04-22T16:56:34.200Z', - hiddenReplies: [], - post: 'at://did:plc:fpruhuo22xkm5o7ttr2ktxdo/app.bsky.feed.post/3lng5izl7kc2c', - }, - lists: [], - }, - }, - }, - { - post: { - uri: 'at://did:plc:77tdak46psveqneyegsdyc7l/app.bsky.feed.post/3lnft75ivlc27', - cid: 'bafyreic24reeweaymcfe6hdsuhmffazdpa5hoqyculxrdp2sr7xkoehgay', - author: { - did: 'did:plc:77tdak46psveqneyegsdyc7l', - handle: 'werd.io', - displayName: 'Ben Werdmuller', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:77tdak46psveqneyegsdyc7l/bafkreicoqtayuefjlw73nrx4c7sioc3ujq74uisgbh4ddmuamevjwzt4fu@jpeg', - associated: { - chat: { - allowIncoming: 'following', - }, - }, - viewer: { - muted: false, - blockedBy: false, - }, - labels: [], - createdAt: '2023-03-07T15:40:54.229Z', - }, - record: { - $type: 'app.bsky.feed.post', - createdAt: '2025-04-22T13:52:05.353Z', - langs: ['en'], - text: 'This is obvious, but if people broadly rely on a black box to give them answers that help them understand the world, whoever controls the black box controls those answers and therefore the understanding that comes from them.\n\nOpenness is safety.', - }, - replyCount: 10, - repostCount: 84, - likeCount: 432, - quoteCount: 2, - indexedAt: '2025-04-22T13:52:05.755Z', - viewer: { - threadMuted: false, - embeddingDisabled: false, - }, - labels: [], - }, - }, - */ ], } satisfies AppBskyFeedGetFeed.OutputSchema -export const BOTTOM_BAR_AVI = 'https://bsky.social/about/hero-social-card.webp' +export const BOTTOM_BAR_AVI = + 'https://cdn.bsky.app/img/avatar/plain/did:plc:3jpt2mvvsumj2r7eqk4gzzjz/bafkreibrhptgequemf4anrjxgbf5lpgo6szvjobjcxyvt76ui7jtvebrfa@jpeg' From c1e090e9e3eff4235fe71d494a354c78b341eead Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 23 Apr 2025 15:29:17 -0500 Subject: [PATCH 06/12] Better data --- src/lib/demo.ts | 136 ++++++++++++++++++++++++++++++------------------ 1 file changed, 85 insertions(+), 51 deletions(-) diff --git a/src/lib/demo.ts b/src/lib/demo.ts index 5e09ff0aa0..65ba88e800 100644 --- a/src/lib/demo.ts +++ b/src/lib/demo.ts @@ -11,18 +11,14 @@ export const DEMO_FEED = { feed: [ { post: { - uri: `at://${DID}/app.bsky.feed.post/post1`, - cid: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + uri: 'at://did:plc:pvooorihapc2lf2pijehgrdf/app.bsky.feed.post/3lniysofyll2d', + cid: 'bafyreihwh3wxxme732ylbylhhdyz7ex6t4jtu6s3gjxxvnnh4feddhg3ku', author: { - did: DID, - handle: 'forkedriver.blsky', + did: 'did:plc:pvooorihapc2lf2pijehgrdf', + handle: 'forkedriverband.bsky.social', displayName: 'Forked River Band', - avatar: 'https://bsky.social/about/adi/post_1_avi.jpg', - associated: { - chat: { - allowIncoming: 'following', - }, - }, + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:pvooorihapc2lf2pijehgrdf/bafkreiarkmzr3wa6ty75qigkkbvtgbler2yiqgfdrupmimy4whcnesu4d4@jpeg', viewer: { muted: false, blockedBy: false, @@ -43,13 +39,42 @@ export const DEMO_FEED = { trustedVerifierStatus: 'none', }, }, + record: { + $type: 'app.bsky.feed.post', + createdAt: POST_1_DATE, + // embed: { + // $type: 'app.bsky.embed.images', + // images: [ + // { + // alt: 'Fake flier for Sebastapol Bluegrass Fest', + // aspectRatio: { + // height: 1350, + // width: 900, + // }, + // image: { + // $type: 'blob', + // ref: { + // $link: + // 'bafkreig7gnirmz5guhhjutf3mqbjjzxzi3w4wvs5qy2gnxma5g3brbaidi', + // }, + // mimeType: 'image/jpeg', + // size: 562871, + // }, + // }, + // ], + // }, + langs: ['en'], + text: 'Sonoma County folks: Come tip your hats our way and see us play new and old tunes at Sebastopol Bluegrass Fest on June 14th.', + }, embed: { $type: 'app.bsky.embed.images#view', images: [ { - thumb: 'https://bsky.social/about/adi/post_1_image.jpg', - fullsize: 'https://bsky.social/about/adi/post_1_image.jpg', - alt: '', + thumb: + 'https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:pvooorihapc2lf2pijehgrdf/bafkreig7gnirmz5guhhjutf3mqbjjzxzi3w4wvs5qy2gnxma5g3brbaidi@jpeg', + fullsize: + 'https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:pvooorihapc2lf2pijehgrdf/bafkreig7gnirmz5guhhjutf3mqbjjzxzi3w4wvs5qy2gnxma5g3brbaidi@jpeg', + alt: 'Fake flier for Sebastapol Bluegrass Fest', aspectRatio: { height: 1350, width: 900, @@ -57,12 +82,6 @@ export const DEMO_FEED = { }, ], }, - record: { - $type: 'app.bsky.feed.post', - createdAt: POST_1_DATE, - langs: ['en'], - text: 'Sonoma County folks: Come tip your hats our way and see us play new and old tunes at Sebastopol Bluegrass Fest on June 14th.', - }, replyCount: 1, repostCount: 4, likeCount: 18, @@ -77,18 +96,14 @@ export const DEMO_FEED = { }, { post: { - uri: `at://${DID}/app.bsky.feed.post/post2`, - cid: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + uri: 'at://did:plc:fhhqii56ppgyh5qcm2b3mokf/app.bsky.feed.post/3lnizc7fug52c', + cid: 'bafyreienuabsr55rycirdf4ewue5tjcseg5lzqompcsh2brqzag6hvxllm', author: { - did: DID, - handle: 'dinh-designs.blsky', + did: 'did:plc:fhhqii56ppgyh5qcm2b3mokf', + handle: 'dinh-designs.bsky.social', displayName: 'Dinh Designs', - avatar: 'https://bsky.social/about/adi/post_2_avi.jpg', - associated: { - chat: { - allowIncoming: 'following', - }, - }, + avatar: + 'https://cdn.bsky.app/img/avatar/plain/did:plc:fhhqii56ppgyh5qcm2b3mokf/bafkreidou2xiwmwgq4rz7jj3myyhtvvcd47v5rrmj5xpp5w3nst6tmeoxi@jpeg', viewer: { muted: false, blockedBy: false, @@ -97,13 +112,42 @@ export const DEMO_FEED = { labels: [], createdAt: POST_2_DATE, }, + record: { + $type: 'app.bsky.feed.post', + createdAt: POST_2_DATE, + // embed: { + // $type: 'app.bsky.embed.images', + // images: [ + // { + // alt: 'Placeholder image of interior design', + // aspectRatio: { + // height: 872, + // width: 598, + // }, + // image: { + // $type: 'blob', + // ref: { + // $link: + // 'bafkreidcjc6bjb4jjjejruin5cldhj5zovsuu4tydulenyprneziq5rfeu', + // }, + // mimeType: 'image/jpeg', + // size: 296003, + // }, + // }, + // ], + // }, + langs: ['en'], + text: 'Details from our install at the Lucas residence in Joshua Tree. We populated the space with rich, earthy tones and locally-sourced materials to suit the landscape.', + }, embed: { $type: 'app.bsky.embed.images#view', images: [ { - thumb: 'https://bsky.social/about/adi/post_2_image.jpg', - fullsize: 'https://bsky.social/about/adi/post_2_image.jpg', - alt: '', + thumb: + 'https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:fhhqii56ppgyh5qcm2b3mokf/bafkreidcjc6bjb4jjjejruin5cldhj5zovsuu4tydulenyprneziq5rfeu@jpeg', + fullsize: + 'https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:fhhqii56ppgyh5qcm2b3mokf/bafkreidcjc6bjb4jjjejruin5cldhj5zovsuu4tydulenyprneziq5rfeu@jpeg', + alt: 'Placeholder image of interior design', aspectRatio: { height: 872, width: 598, @@ -111,12 +155,6 @@ export const DEMO_FEED = { }, ], }, - record: { - $type: 'app.bsky.feed.post', - createdAt: POST_2_DATE, - langs: ['en'], - text: 'Details from our install at the Lucas residence in Joshua Tree. We populated the space with rich, earthy tones and locally-sourced materials to suit the landscape.', - }, replyCount: 3, repostCount: 1, likeCount: 4, @@ -131,24 +169,20 @@ export const DEMO_FEED = { }, { post: { - uri: `at://${DID}/app.bsky.feed.post/post3`, - cid: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + uri: 'at://did:plc:h7fwnfejmmifveeea5eyxgkc/app.bsky.feed.post/3lnizna3g4f2t', + cid: 'bafyreiepn7obmlshliori4j34texpaukrqkyyu7cq6nmpzk4lkis7nqeae', author: { - did: DID, - handle: 'visionprofan.blsky', - displayName: 'Visionary', + did: 'did:plc:h7fwnfejmmifveeea5eyxgkc', + handle: 'visionprofan.bsky.social', + displayName: 'Sammy', avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:p2cp5gopk7mgjegy6wadk3ep/bafkreiaqsy36o6lpbpnonb4n46cvntfs6zoxbav35raix2sxhqgopxcjge@jpeg', - associated: { - chat: { - allowIncoming: 'following', - }, - }, + 'https://cdn.bsky.app/img/avatar/plain/did:plc:h7fwnfejmmifveeea5eyxgkc/bafkreia4fxcfoiny44sc5nujs7fpqxcxustuzepovxpsrq3e5cibcmscz4@jpeg', viewer: { muted: false, blockedBy: false, following: `at://${DID}/app.bsky.graph.follow/post3`, }, + labels: [], createdAt: POST_3_DATE, }, record: { @@ -160,7 +194,7 @@ export const DEMO_FEED = { replyCount: 11, repostCount: 97, likeCount: 399, - quoteCount: 3, + quoteCount: 0, indexedAt: POST_3_DATE, viewer: { threadMuted: false, @@ -173,4 +207,4 @@ export const DEMO_FEED = { } satisfies AppBskyFeedGetFeed.OutputSchema export const BOTTOM_BAR_AVI = - 'https://cdn.bsky.app/img/avatar/plain/did:plc:3jpt2mvvsumj2r7eqk4gzzjz/bafkreibrhptgequemf4anrjxgbf5lpgo6szvjobjcxyvt76ui7jtvebrfa@jpeg' + 'https://cdn.bsky.app/img/avatar/plain/did:plc:p2cp5gopk7mgjegy6wadk3ep/bafkreiaqsy36o6lpbpnonb4n46cvntfs6zoxbav35raix2sxhqgopxcjge@jpeg' From 6a8dd353ee26b2f9f53fc5623829241c4a9a7e2a Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 23 Apr 2025 15:54:29 -0500 Subject: [PATCH 07/12] Update bottom bar avi --- src/lib/demo.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/demo.ts b/src/lib/demo.ts index 65ba88e800..ad6beec8e2 100644 --- a/src/lib/demo.ts +++ b/src/lib/demo.ts @@ -207,4 +207,4 @@ export const DEMO_FEED = { } satisfies AppBskyFeedGetFeed.OutputSchema export const BOTTOM_BAR_AVI = - 'https://cdn.bsky.app/img/avatar/plain/did:plc:p2cp5gopk7mgjegy6wadk3ep/bafkreiaqsy36o6lpbpnonb4n46cvntfs6zoxbav35raix2sxhqgopxcjge@jpeg' + 'https://cdn.bsky.app/img/avatar/plain/did:plc:nz5fbenzdvllhkgqblvuobbx/bafkreifiodbgqfmn3n36xum2qjjzfbgnvnyhk54tlul6hpa5d7p5q36jd4@jpeg' From 9a7f6ad638772e33f3a28d4bf8d2beef1a1a7501 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 23 Apr 2025 18:30:25 -0500 Subject: [PATCH 08/12] Moar demo --- src/lib/demo.ts | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/lib/demo.ts b/src/lib/demo.ts index ad6beec8e2..377d8236a5 100644 --- a/src/lib/demo.ts +++ b/src/lib/demo.ts @@ -17,8 +17,7 @@ export const DEMO_FEED = { did: 'did:plc:pvooorihapc2lf2pijehgrdf', handle: 'forkedriverband.bsky.social', displayName: 'Forked River Band', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:pvooorihapc2lf2pijehgrdf/bafkreiarkmzr3wa6ty75qigkkbvtgbler2yiqgfdrupmimy4whcnesu4d4@jpeg', + avatar: 'https://bsky.social/about/adi/post_1_avi.jpg', viewer: { muted: false, blockedBy: false, @@ -70,10 +69,8 @@ export const DEMO_FEED = { $type: 'app.bsky.embed.images#view', images: [ { - thumb: - 'https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:pvooorihapc2lf2pijehgrdf/bafkreig7gnirmz5guhhjutf3mqbjjzxzi3w4wvs5qy2gnxma5g3brbaidi@jpeg', - fullsize: - 'https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:pvooorihapc2lf2pijehgrdf/bafkreig7gnirmz5guhhjutf3mqbjjzxzi3w4wvs5qy2gnxma5g3brbaidi@jpeg', + thumb: 'https://bsky.social/about/adi/post_1_image.jpg', + fullsize: 'https://bsky.social/about/adi/post_1_image.jpg', alt: 'Fake flier for Sebastapol Bluegrass Fest', aspectRatio: { height: 1350, @@ -102,8 +99,7 @@ export const DEMO_FEED = { did: 'did:plc:fhhqii56ppgyh5qcm2b3mokf', handle: 'dinh-designs.bsky.social', displayName: 'Dinh Designs', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:fhhqii56ppgyh5qcm2b3mokf/bafkreidou2xiwmwgq4rz7jj3myyhtvvcd47v5rrmj5xpp5w3nst6tmeoxi@jpeg', + avatar: 'https://bsky.social/about/adi/post_2_avi.jpg', viewer: { muted: false, blockedBy: false, @@ -143,10 +139,8 @@ export const DEMO_FEED = { $type: 'app.bsky.embed.images#view', images: [ { - thumb: - 'https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:fhhqii56ppgyh5qcm2b3mokf/bafkreidcjc6bjb4jjjejruin5cldhj5zovsuu4tydulenyprneziq5rfeu@jpeg', - fullsize: - 'https://cdn.bsky.app/img/feed_fullsize/plain/did:plc:fhhqii56ppgyh5qcm2b3mokf/bafkreidcjc6bjb4jjjejruin5cldhj5zovsuu4tydulenyprneziq5rfeu@jpeg', + thumb: 'https://bsky.social/about/adi/post_2_image.jpg', + fullsize: 'https://bsky.social/about/adi/post_2_image.jpg', alt: 'Placeholder image of interior design', aspectRatio: { height: 872, @@ -174,9 +168,8 @@ export const DEMO_FEED = { author: { did: 'did:plc:h7fwnfejmmifveeea5eyxgkc', handle: 'visionprofan.bsky.social', - displayName: 'Sammy', - avatar: - 'https://cdn.bsky.app/img/avatar/plain/did:plc:h7fwnfejmmifveeea5eyxgkc/bafkreia4fxcfoiny44sc5nujs7fpqxcxustuzepovxpsrq3e5cibcmscz4@jpeg', + displayName: 'Sebastian', + avatar: 'https://bsky.social/about/adi/user_avi.jpg', viewer: { muted: false, blockedBy: false, @@ -206,5 +199,4 @@ export const DEMO_FEED = { ], } satisfies AppBskyFeedGetFeed.OutputSchema -export const BOTTOM_BAR_AVI = - 'https://cdn.bsky.app/img/avatar/plain/did:plc:nz5fbenzdvllhkgqblvuobbx/bafkreifiodbgqfmn3n36xum2qjjzfbgnvnyhk54tlul6hpa5d7p5q36jd4@jpeg' +export const BOTTOM_BAR_AVI = 'https://bsky.social/about/adi/user_avi.jpg' From ba002d82528993e1aff80101d63b4ae09a82141b Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Thu, 24 Apr 2025 09:31:04 -0700 Subject: [PATCH 09/12] Tune spacing for demo mode --- src/view/com/util/post-embeds/index.tsx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/view/com/util/post-embeds/index.tsx b/src/view/com/util/post-embeds/index.tsx index 6f5f9d3ab9..812ba3b600 100644 --- a/src/view/com/util/post-embeds/index.tsx +++ b/src/view/com/util/post-embeds/index.tsx @@ -1,12 +1,12 @@ import React from 'react' import { InteractionManager, - StyleProp, + type StyleProp, StyleSheet, View, - ViewStyle, + type ViewStyle, } from 'react-native' -import {MeasuredDimensions, runOnJS, runOnUI} from 'react-native-reanimated' +import {type MeasuredDimensions, runOnJS, runOnUI} from 'react-native-reanimated' import {Image} from 'expo-image' import { AppBskyEmbedExternal, @@ -18,10 +18,10 @@ import { AppBskyGraphDefs, moderateFeedGenerator, moderateUserList, - ModerationDecision, + type ModerationDecision, } from '@atproto/api' -import {HandleRef, measureHandle} from '#/lib/hooks/useHandleRef' +import {type HandleRef, measureHandle} from '#/lib/hooks/useHandleRef' import {usePalette} from '#/lib/hooks/usePalette' import {useLightboxControls} from '#/state/lightbox' import {useModerationOpts} from '#/state/preferences/moderation-opts' @@ -29,8 +29,9 @@ import {FeedSourceCard} from '#/view/com/feeds/FeedSourceCard' import {atoms as a, useTheme} from '#/alf' import * as ListCard from '#/components/ListCard' import {Embed as StarterPackCard} from '#/components/StarterPack/StarterPackCard' +import {useDemoMode} from '#/storage/hooks/demo-mode' import {ContentHider} from '../../../../components/moderation/ContentHider' -import {Dimensions} from '../../lightbox/ImageViewing/@types' +import {type Dimensions} from '../../lightbox/ImageViewing/@types' import {AutoSizedImage} from '../images/AutoSizedImage' import {ImageLayoutGrid} from '../images/ImageLayoutGrid' import {ExternalLinkEmbed} from './ExternalLinkEmbed' @@ -64,6 +65,7 @@ export function PostEmbeds({ viewContext?: PostEmbedViewContext }) { const {openLightbox} = useLightboxControls() + const [demoMode] = useDemoMode() // quote post with media // = @@ -178,7 +180,13 @@ export function PostEmbeds({ const image = images[0] return ( - + Date: Fri, 25 Apr 2025 10:42:35 -0700 Subject: [PATCH 10/12] Updated demo copy --- src/lib/demo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/demo.ts b/src/lib/demo.ts index 377d8236a5..8e3b16622d 100644 --- a/src/lib/demo.ts +++ b/src/lib/demo.ts @@ -63,7 +63,7 @@ export const DEMO_FEED = { // ], // }, langs: ['en'], - text: 'Sonoma County folks: Come tip your hats our way and see us play new and old tunes at Sebastopol Bluegrass Fest on June 14th.', + text: 'Sonoma County folks: Come tip your hats our way and see us play new and old bluegrass tunes at Sebastopol Solstice Fest on June 20th.', }, embed: { $type: 'app.bsky.embed.images#view', @@ -98,7 +98,7 @@ export const DEMO_FEED = { author: { did: 'did:plc:fhhqii56ppgyh5qcm2b3mokf', handle: 'dinh-designs.bsky.social', - displayName: 'Dinh Designs', + displayName: 'Rich Dinh Designs', avatar: 'https://bsky.social/about/adi/post_2_avi.jpg', viewer: { muted: false, From 7b245935eaa7b3ba8f051ea777ea7e5fcbc95813 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Fri, 25 Apr 2025 10:49:10 -0700 Subject: [PATCH 11/12] Remove demo-mode spacing tweak --- src/view/com/util/post-embeds/index.tsx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/view/com/util/post-embeds/index.tsx b/src/view/com/util/post-embeds/index.tsx index 812ba3b600..431baa2b22 100644 --- a/src/view/com/util/post-embeds/index.tsx +++ b/src/view/com/util/post-embeds/index.tsx @@ -6,7 +6,11 @@ import { View, type ViewStyle, } from 'react-native' -import {type MeasuredDimensions, runOnJS, runOnUI} from 'react-native-reanimated' +import { + type MeasuredDimensions, + runOnJS, + runOnUI, +} from 'react-native-reanimated' import {Image} from 'expo-image' import { AppBskyEmbedExternal, @@ -29,7 +33,6 @@ import {FeedSourceCard} from '#/view/com/feeds/FeedSourceCard' import {atoms as a, useTheme} from '#/alf' import * as ListCard from '#/components/ListCard' import {Embed as StarterPackCard} from '#/components/StarterPack/StarterPackCard' -import {useDemoMode} from '#/storage/hooks/demo-mode' import {ContentHider} from '../../../../components/moderation/ContentHider' import {type Dimensions} from '../../lightbox/ImageViewing/@types' import {AutoSizedImage} from '../images/AutoSizedImage' @@ -65,7 +68,6 @@ export function PostEmbeds({ viewContext?: PostEmbedViewContext }) { const {openLightbox} = useLightboxControls() - const [demoMode] = useDemoMode() // quote post with media // = @@ -180,13 +182,7 @@ export function PostEmbeds({ const image = images[0] return ( - + Date: Fri, 25 Apr 2025 11:51:33 -0700 Subject: [PATCH 12/12] Update third post in demo --- src/lib/demo.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/demo.ts b/src/lib/demo.ts index 8e3b16622d..5ead62c9d3 100644 --- a/src/lib/demo.ts +++ b/src/lib/demo.ts @@ -167,9 +167,9 @@ export const DEMO_FEED = { cid: 'bafyreiepn7obmlshliori4j34texpaukrqkyyu7cq6nmpzk4lkis7nqeae', author: { did: 'did:plc:h7fwnfejmmifveeea5eyxgkc', - handle: 'visionprofan.bsky.social', - displayName: 'Sebastian', - avatar: 'https://bsky.social/about/adi/user_avi.jpg', + handle: 'rodyalbuerne.bsky.social', + displayName: 'Rody Albuerne', + avatar: 'https://bsky.social/about/adi/post_3_avi.jpg', viewer: { muted: false, blockedBy: false, @@ -182,7 +182,7 @@ export const DEMO_FEED = { $type: 'app.bsky.feed.post', createdAt: POST_3_DATE, langs: ['en'], - text: 'Just got my Vision Pro! 🤯\n\nAny recommendations for apps to try out?', + text: 'Tinkering with the basics of traditional wooden joinery in my shop lately. Starting small with this ox, made using simple mortise and tenon joints.', }, replyCount: 11, repostCount: 97,