This repository has no description
1// real comment data pulled from tangled.org/tangled.org/core/issues/245, used across
2// the comment stories so the fixtures live in one place.
3import type { MarkupContext } from "$lib/markup";
4import type { CommentThread, CommentView } from "./comments";
5
6export const sampleMarkup: MarkupContext = {
7 repo: "tangled.org/core",
8 ref: "main",
9 host: "tangled.org"
10};
11
12export const sampleSubjectUri = "at://did:plc:xan/sh.tangled.repo.issue/245";
13export const sampleSubjectCid = "bafyreib2rxk3rh6kzwq6yhkp6bd4vjxj3xj2xj2xj2xj2xj2xj2xj2xj4";
14
15const cid = "bafyreib2rxk3rh6kzwq6yhkp6bd4vjxj3xj2xj2xj2xj2xj2xj2xj2xj2";
16
17const c = (
18 rkey: string,
19 authorDid: string,
20 authorHandle: string,
21 createdAt: string,
22 body: string,
23 bodyHtml: string
24): CommentView => ({
25 uri: `at://${authorDid}/sh.tangled.feed.comment/${rkey}`,
26 cid,
27 rkey,
28 authorDid,
29 authorHandle,
30 createdAt,
31 body,
32 bodyHtml
33});
34
35export const sampleComments = {
36 byjp: c(
37 "byjp",
38 "did:plc:byjp",
39 "byjp.me",
40 "2024-10-02T09:15:00Z",
41 `I'm on the cusp, but I reacted "👎", as:
42
43- I quite like the "@"!
44- it clearly differentiates between user stuff, and site stuff; \`tangled.org/settings\` vs. \`tangled.org/@settings.in\`
45- it feels quite "ATProto" to have an AT☺️
46
47Plus I think I'd keep the @s in the UI anyway (eg. in the header of a repo page "[@tangled.org](/tangled.org)/core") — so then the URLs would match what's displayed.`,
48 `<p>I'm on the cusp, but I reacted "👎", as:</p>
49<ul>
50<li>I quite like the "@"!</li>
51<li>it clearly differentiates between user stuff, and site stuff; <code>tangled.org/settings</code> vs. <code>tangled.org/@settings.in</code></li>
52<li>it feels quite "ATProto" to have an AT☺️</li>
53</ul>
54<p>Plus I think I'd keep the @s in the UI anyway (eg. in the header of a repo page "<a href="/tangled.org">@tangled.org</a>/core") — so then the URLs would match what's displayed.</p>`
55 ),
56 cam: c(
57 "cam",
58 "did:plc:cam",
59 "camsmith.dev",
60 "2024-10-02T11:00:00Z",
61 `I also found these two reasons convincing enough to vote in favor of removal.
62
63One small, silly side effect of this will be that the address for tangled itself will be tangled.org/tangled.org`,
64 `<p>I also found these two reasons convincing enough to vote in favor of removal.</p>
65<p>One small, silly side effect of this will be that the address for tangled itself will be tangled.org/tangled.org</p>`
66 ),
67 samuel: c(
68 "samuel",
69 "did:plc:samuel",
70 "samuel.fm",
71 "2024-10-03T08:20:00Z",
72 "I vote removing them. You can tell if it's a handle by the presence of the `.`s",
73 "<p>I vote removing them. You can tell if it's a handle by the presence of the <code>.</code>s</p>"
74 ),
75 moth: c(
76 "moth",
77 "did:plc:moth",
78 "moth11.net",
79 "2024-10-03T14:05:00Z",
80 "i vote yes, i'm probably stupid but i dont think go modules like there being @s in the url so i just use github, i'm sure theres a way around it, but its best to minimize friction",
81 "<p>i vote yes, i'm probably stupid but i dont think go modules like there being @s in the url so i just use github, i'm sure theres a way around it, but its best to minimize friction</p>"
82 ),
83 anirudh: c(
84 "anirudh",
85 "did:plc:anirudh",
86 "anirudh.fi",
87 "2024-10-04T10:00:00Z",
88 "For what it's worth, we've always supported the non-@ URL as well. We just redirect it to the @'d version—which Go seems to be content with.",
89 "<p>For what it's worth, we've always supported the non-@ URL as well. We just redirect it to the @'d version—which Go seems to be content with.</p>"
90 ),
91 knowtheory: c(
92 "knowtheory",
93 "did:plc:knowtheory",
94 "knowtheory.net",
95 "2024-10-05T16:30:00Z",
96 `So i'm a 👍 I dig the poetry of having an @ in the URI, but mostly i think it's confusing. This isn't a practice the other Apps & AppServers use. It's also confusing because an AT:// URI is something distinct and different.
97
98And just personally, it's a URL eyesore for me.`,
99 `<p>So i'm a 👍 I dig the poetry of having an @ in the URI, but mostly i think it's confusing. This isn't a practice the other Apps & AppServers use. It's also confusing because an AT:// URI is something distinct and different.</p>
100<p>And just personally, it's a URL eyesore for me.</p>`
101 ),
102 anil: c(
103 "anil",
104 "did:plc:anil",
105 "anil.recoil.org",
106 "2024-11-10T12:00:00Z",
107 "This has tripped me up quite a few times on the SSH URLs with extraneous @s, so thank you for making this change!",
108 "<p>This has tripped me up quite a few times on the SSH URLs with extraneous @s, so thank you for making this change!</p>"
109 ),
110 // authored by the story's logged-in user (MockAuthProvider = did:plc:alice), for edit cases
111 mine: c(
112 "mine",
113 "did:plc:alice",
114 "alice.pds.tngl.boltless.dev",
115 "2024-10-06T09:00:00Z",
116 "I vote removing them. You can tell if it's a handle by the presence of the `.`s",
117 "<p>I vote removing them. You can tell if it's a handle by the presence of the <code>.</code>s</p>"
118 )
119};
120
121// a top-level comment on its own
122export const soloThread: CommentThread = { self: sampleComments.byjp, replies: [] };
123
124// a thread with a couple of replies
125export const sampleThread: CommentThread = {
126 self: sampleComments.byjp,
127 replies: [sampleComments.cam, sampleComments.samuel]
128};
129
130export const sampleThreads: CommentThread[] = [
131 sampleThread,
132 { self: sampleComments.knowtheory, replies: [] }
133];
134
135// more than one reply, to show the connector line running down the replies
136export const multiReplyThread: CommentThread = {
137 self: sampleComments.byjp,
138 replies: [sampleComments.cam, sampleComments.samuel, sampleComments.moth]
139};
140
141// a long thread whose middle reply belongs to the logged-in user (for edit-in-place)
142export const longThread: CommentThread = {
143 self: sampleComments.byjp,
144 replies: [
145 sampleComments.cam,
146 sampleComments.moth,
147 sampleComments.mine,
148 sampleComments.anirudh,
149 sampleComments.anil
150 ]
151};