personal web client for Bluesky
typescript solidjs bluesky atcute
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: move everything to makeAtUri

mary.my.id fe1c7a4d 867fbfd8

verified
+43 -20
+2 -2
src/api/queries/feed.ts
··· 3 3 4 4 import { useAgent } from '~/lib/states/agent'; 5 5 6 - import { isDid, parseAtUri } from '../utils/strings'; 6 + import { isDid, makeAtUri, parseAtUri } from '../utils/strings'; 7 7 8 8 import { resolveHandle } from './handle'; 9 9 ··· 28 28 const { data } = await rpc.get('app.bsky.feed.getFeedGenerator', { 29 29 signal: ctx.signal, 30 30 params: { 31 - feed: `at://${did}/${uri.collection}/${uri.rkey}`, 31 + feed: makeAtUri(did, uri.collection, uri.rkey), 32 32 }, 33 33 }); 34 34
+2 -2
src/api/queries/list.ts
··· 3 3 4 4 import { useAgent } from '~/lib/states/agent'; 5 5 6 - import { isDid, parseAtUri } from '../utils/strings'; 6 + import { isDid, makeAtUri, parseAtUri } from '../utils/strings'; 7 7 8 8 import { resolveHandle } from './handle'; 9 9 ··· 28 28 const { data } = await rpc.get('app.bsky.graph.getList', { 29 29 signal: ctx.signal, 30 30 params: { 31 - list: `at://${did}/${uri.collection}/${uri.rkey}`, 31 + list: makeAtUri(did, uri.collection, uri.rkey), 32 32 limit: 1, 33 33 }, 34 34 });
+2 -2
src/api/queries/post.ts
··· 4 4 import { useAgent } from '~/lib/states/agent'; 5 5 6 6 import { findPostsInCache } from '../cache/post-shadow'; 7 - import { isDid, parseAtUri } from '../utils/strings'; 7 + import { isDid, makeAtUri, parseAtUri } from '../utils/strings'; 8 8 9 9 import { resolveHandle } from './handle'; 10 10 ··· 29 29 const { data } = await rpc.get('app.bsky.feed.getPosts', { 30 30 signal: ctx.signal, 31 31 params: { 32 - uris: [`at://${did}/${uri.collection}/${uri.rkey}`], 32 + uris: [makeAtUri(did, uri.collection, uri.rkey)], 33 33 }, 34 34 }); 35 35
+2 -1
src/components/composer/lib/api.ts
··· 23 23 import { getUtf8Length } from '~/api/richtext/intl'; 24 24 import { type PreliminaryRichText, parseRt } from '~/api/richtext/parser/parse'; 25 25 import { getRecord } from '~/api/utils/records'; 26 + import { makeAtUri } from '~/api/utils/strings'; 26 27 27 28 import { compressPostImage } from '~/lib/bsky/image'; 28 29 import type { AgentContext } from '~/lib/states/agent'; ··· 82 83 rkey = TID.now(); 83 84 84 85 const post = state.posts[idx]; 85 - const uri = `at://${did}/app.bsky.feed.post/${rkey}`; 86 + const uri = makeAtUri(did, 'app.bsky.feed.post', rkey); 86 87 87 88 // Resolve rich text 88 89 const rt = await resolveRichtext(parseRt(post.text, true));
+17 -3
src/views/feed.tsx
··· 1 - import { Match, Switch } from 'solid-js'; 1 + import { Match, Show, Switch } from 'solid-js'; 2 2 3 3 import { useQueryClient } from '@mary/solid-query'; 4 4 5 5 import { createFeedMetaQuery } from '~/api/queries/feed'; 6 - import { isDid } from '~/api/utils/strings'; 6 + import { isDid, makeAtUri } from '~/api/utils/strings'; 7 7 8 8 import { history } from '~/globals/navigation'; 9 9 ··· 11 11 12 12 import CircularProgressView from '~/components/circular-progress-view'; 13 13 import ErrorView from '~/components/error-view'; 14 + import IconButton from '~/components/icon-button'; 15 + import CircleInfoOutlinedIcon from '~/components/icons-central/circle-info-outline'; 14 16 import * as Page from '~/components/page'; 15 17 import TimelineList from '~/components/timeline/timeline-list'; 16 18 ··· 19 21 20 22 const queryClient = useQueryClient(); 21 23 22 - const uri = `at://${didOrHandle}/app.bsky.feed.generator/${rkey}`; 24 + const uri = makeAtUri(didOrHandle, 'app.bsky.feed.generator', rkey); 23 25 const meta = createFeedMetaQuery(() => uri); 24 26 25 27 return ( ··· 39 41 return `Feed`; 40 42 })()} 41 43 /> 44 + 45 + <Show when={meta.data}> 46 + <Page.HeaderAccessory> 47 + <IconButton 48 + title="Feed information" 49 + icon={CircleInfoOutlinedIcon} 50 + onClick={() => { 51 + history.navigate(`/${didOrHandle}/feeds/${rkey}/info`); 52 + }} 53 + /> 54 + </Page.HeaderAccessory> 55 + </Show> 42 56 </Page.Header> 43 57 44 58 <Switch>
+3 -1
src/views/post-likes.tsx
··· 1 1 import { createSubjectLikersQuery } from '~/api/queries/subject-likers'; 2 + import { makeAtUri } from '~/api/utils/strings'; 2 3 3 4 import { useParams } from '~/lib/navigation/router'; 4 5 ··· 11 12 const PostLikesPage = () => { 12 13 const { did, rkey } = useParams(); 13 14 14 - const likers = createSubjectLikersQuery(() => `at://${did}/app.bsky.feed.post/${rkey}`); 15 + const uri = makeAtUri(did, 'app.bsky.feed.post', rkey); 16 + const likers = createSubjectLikersQuery(() => uri); 15 17 16 18 return ( 17 19 <>
+3 -1
src/views/post-quotes.tsx
··· 1 1 import { createPostQuotesQuery } from '~/api/queries/post-quotes'; 2 + import { makeAtUri } from '~/api/utils/strings'; 2 3 3 4 import { useParams } from '~/lib/navigation/router'; 4 5 ··· 10 11 const PostQuotesPage = () => { 11 12 const { did, rkey } = useParams(); 12 13 13 - const quotes = createPostQuotesQuery(() => `at://${did}/app.bsky.feed.post/${rkey}`); 14 + const uri = makeAtUri(did, 'app.bsky.feed.post', rkey); 15 + const quotes = createPostQuotesQuery(() => uri); 14 16 15 17 return ( 16 18 <>
+3 -1
src/views/post-reposts.tsx
··· 1 1 import { createSubjectRepostersQuery } from '~/api/queries/subject-reposters'; 2 + import { makeAtUri } from '~/api/utils/strings'; 2 3 3 4 import { useParams } from '~/lib/navigation/router'; 4 5 ··· 11 12 const PostLikesPage = () => { 12 13 const { did, rkey } = useParams(); 13 14 14 - const reposters = createSubjectRepostersQuery(() => `at://${did}/app.bsky.feed.post/${rkey}`); 15 + const uri = makeAtUri(did, 'app.bsky.feed.post', rkey); 16 + const reposters = createSubjectRepostersQuery(() => uri); 15 17 16 18 return ( 17 19 <>
+5 -3
src/views/post-thread.tsx
··· 10 10 createThreadData, 11 11 } from '~/api/models/post-thread'; 12 12 import { usePostThreadQuery } from '~/api/queries/post-thread'; 13 - import { isDid } from '~/api/utils/strings'; 13 + import { isDid, makeAtUri } from '~/api/utils/strings'; 14 14 15 15 import { history } from '~/globals/navigation'; 16 16 ··· 36 36 const { didOrHandle, rkey } = useParams(); 37 37 38 38 const queryClient = useQueryClient(); 39 - const query = usePostThreadQuery(() => `at://${didOrHandle}/app.bsky.feed.post/${rkey}`); 39 + 40 + const uri = makeAtUri(didOrHandle, 'app.bsky.feed.post', rkey); 41 + const query = usePostThreadQuery(() => uri); 40 42 41 43 return ( 42 44 <> ··· 93 95 keyed 94 96 > 95 97 {({ data, did }) => { 96 - queryClient.setQueryData(['post-thread', `at://${did}/app.bsky.feed.post/${rkey}`], data); 98 + queryClient.setQueryData(['post-thread', makeAtUri(did, 'app.bsky.feed.post', rkey)], data); 97 99 history.navigate(`/${did}/${rkey}`, { replace: true }); 98 100 return null; 99 101 }}