diff --git a/public/oauth-client-metadata.json b/public/oauth-client-metadata.json index c1e9346..c5e5174 100644 --- a/public/oauth-client-metadata.json +++ b/public/oauth-client-metadata.json @@ -3,7 +3,7 @@ "client_name": "untangled", "client_uri": "https://untangled.wisp.place", "redirect_uris": ["https://untangled.wisp.place/oauth/callback"], - "scope": "atproto repo:sh.tangled.actor.profile repo:sh.tangled.repo.issue repo:sh.tangled.repo.issue.comment repo:sh.tangled.repo.issue.state repo:sh.tangled.repo.pull repo:sh.tangled.repo.pull.comment repo:sh.tangled.repo.pull.status rpc:sh.tangled.repo.merge?aud=* rpc:sh.tangled.repo.hiddenRef?aud=* repo:sh.tangled.feed.comment blob:*/*", + "scope": "atproto repo:sh.tangled.actor.profile repo:sh.tangled.repo.issue repo:sh.tangled.repo.issue.comment repo:sh.tangled.repo.issue.state repo:sh.tangled.repo.pull repo:sh.tangled.repo.pull.comment repo:sh.tangled.repo.pull.status rpc:sh.tangled.repo.merge?aud=* rpc:sh.tangled.repo.hiddenRef?aud=* repo:sh.tangled.feed.comment repo:sh.tangled.string repo:sh.tangled.feed.star blob:*/*", "grant_types": ["authorization_code", "refresh_token"], "response_types": ["code"], "token_endpoint_auth_method": "none", diff --git a/src/components/repo.tsx b/src/components/repo.tsx index 44557d9..d61a6b2 100644 --- a/src/components/repo.tsx +++ b/src/components/repo.tsx @@ -15,7 +15,11 @@ import { Star, CircleDot, GitPullRequest, + LoaderCircle, + MessageSquarePlus, } from 'lucide-solid'; +import { useAuth } from '../lib/auth'; +import { resolveActor } from '../lib/api/identity'; import { marked } from 'marked'; import { A, useNavigate } from '@solidjs/router'; import { For, Show, createMemo, createSignal, onCleanup, onMount, type Component, type JSX } from 'solid-js'; @@ -1545,6 +1549,131 @@ export const LoadingFilePath: Component<{ export { CodeView, DiffView, PullDiffView } from './code-view'; +export interface GenericComment { + uri: string; + rkey: string; + author: { did: string; handle: string }; + value: { + body: string; + createdAt: string; + replyTo?: any; + }; +} + +export interface GenericCommentThread { + item: GenericComment; + replies: GenericComment[]; +} + +export const CommentThreadsSection: Component<{ + threads: GenericCommentThread[]; + authorDid?: string; + title?: string; +}> = (props) => { + return ( +
+ +

+ {props.title} +

+
+
+ + {(thread) => ( +
+ + 0}> +
+ + {(reply) => ( +
+ +
+ )} +
+
+
+
+ )} +
+
+
+ ); +}; + +export const CommentComposer: Component<{ + value: string; + onValueChange: (val: string) => void; + onSubmit: (event: SubmitEvent) => void; + working?: boolean; + submitLabel?: string; + placeholder?: string; + error?: string | null; +}> = (props) => { + const auth = useAuth(); + const viewerQuery = createQuery(() => ({ + queryKey: ['viewer', auth.currentDid()], + enabled: Boolean(auth.currentDid()), + queryFn: async () => resolveActor(auth.currentDid()!), + })); + + return ( +
+
+
+ }> + {(viewer) => ( + + + {viewer().handle || viewer().did} + + )} + +
+