Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
5.7 kB · 264 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265// fixture notifications for the page and the stories. the xrpc method behind// this page hands back at-uris rather than repo names and titles, so nothing// reads from it yet.
import type { DidRkey, NotificationSummary } from "$lib/components/notifications/types";
const minutes = (n: number) => n * 60_000;
// anchored on import so the date buckets stay populated whenever this runsconst base = Date.now();const ago = (mins: number) => new Date(base - minutes(mins)).toISOString();
const alice = { did: "did:plc:oky5czdrnfjpqslsw2a5iclo", handle: "alice.tngl.sh" };const bob = { did: "did:plc:3p7ejjxnufohsygt5vbyxb2i", handle: "bob.tngl.sh" };const carol = { did: "did:plc:7hbfxfxqxcbszrfhbvlnvxzq", handle: "carol.tngl.sh" };const dave = { did: "did:plc:kx4mzvhqrjpwqmvlbdxdlbnn", handle: "dave.tngl.sh" };
const core = { ownerHandle: "tangled.org", name: "core" };const knot = { ownerHandle: "tangled.org", name: "knot" };const knotUrl = new URL("https://knot.tangled.sh");
const subjectUri = (kind: "issue" | "pull", number: string) => `at://did:plc:mock/sh.tangled.repo.${kind}/${number}`;
export const notifications: NotificationSummary[] = [ { uri: `at://mock/notif/${1}`, id: 1, type: "user_mentioned", read: false, createdAt: ago(4), actor: alice, repo: core, subject: { kind: "pull", uri: subjectUri("pull", "214"), number: "214", title: "spindle: retry a workflow after a knot timeout" } }, { uri: `at://mock/notif/${2}`, id: 2, type: "pull_created", read: false, createdAt: ago(26), actor: bob, repo: core, subject: { kind: "pull", uri: subjectUri("pull", "213"), number: "213", title: "web: port the notifications page to svelte" } }, { uri: `at://mock/notif/${3}`, id: 3, type: "repo_starred", read: false, createdAt: ago(51), actor: carol, repo: core }, { uri: `at://mock/notif/${4}`, id: 4, type: "issue_commented", read: true, createdAt: ago(190), actor: dave, repo: knot, subject: { kind: "issue", uri: subjectUri("issue", "87"), number: "87", title: "packfile upload stalls on large repositories" } }, { uri: `at://mock/notif/${5}`, id: 5, type: "followed", read: false, createdAt: ago(320), actor: dave }, { uri: `at://mock/notif/${6}`, id: 6, type: "issue_assigned", read: true, createdAt: ago(60 * 26), actor: alice, repo: core, subject: { kind: "issue", uri: subjectUri("issue", "402"), number: "402", title: "settings: the email tab drops its drill-down" } }, { uri: `at://mock/notif/${7}`, id: 7, type: "pull_merged", read: true, createdAt: ago(60 * 30), actor: bob, repo: core, subject: { kind: "pull", uri: subjectUri("pull", "208"), number: "208", title: "appview: resolve handles inside the timeline feed" } }, { uri: `at://mock/notif/${17}`, id: 17, type: "collaborator_invited", read: false, createdAt: ago(60 * 36), actor: bob, repo: core, offer: { kind: "collaboration", knot: knotUrl, subject: "did:plc:2r7kkzr5xtnrxdi7fdcpbxem" as DidRkey } }, { uri: `at://mock/notif/${8}`, id: 8, type: "followed", read: true, createdAt: ago(60 * 40), actor: carol }, { uri: `at://mock/notif/${9}`, id: 9, type: "issue_created", read: false, createdAt: ago(60 * 55), actor: carol, repo: knot, subject: { kind: "issue", uri: subjectUri("issue", "91"), number: "91", title: "git hooks reject a push with no error message" } }, { uri: `at://mock/notif/${10}`, id: 10, type: "pull_closed", read: true, createdAt: ago(60 * 24 * 5), actor: dave, repo: core, subject: { kind: "pull", uri: subjectUri("pull", "199"), number: "199", title: "drop the legacy avatar worker" } }, { uri: `at://mock/notif/${11}`, id: 11, type: "repo_starred", read: true, createdAt: ago(60 * 24 * 6), actor: alice, repo: knot }, { uri: `at://mock/notif/${12}`, id: 12, type: "issue_closed", read: true, createdAt: ago(60 * 24 * 9), actor: bob, repo: core, subject: { kind: "issue", uri: subjectUri("issue", "377"), number: "377", title: "dark mode inverts the button group seam" } }, { uri: `at://mock/notif/${13}`, id: 13, type: "pull_commented", read: true, createdAt: ago(60 * 24 * 12), actor: alice, repo: knot, subject: { kind: "pull", uri: subjectUri("pull", "64"), number: "64", title: "knot: verify the owner signature before a fetch" } }, { uri: `at://mock/notif/${14}`, id: 14, type: "issue_reopen", read: true, createdAt: ago(60 * 24 * 15), actor: carol, repo: core, subject: { kind: "issue", uri: subjectUri("issue", "311"), number: "311", title: "pipelines tab shows a stale workflow status" } }, { uri: `at://mock/notif/${15}`, id: 15, type: "pull_unassigned", read: true, createdAt: ago(60 * 24 * 21), actor: bob, repo: core, subject: { kind: "pull", uri: subjectUri("pull", "180"), number: "180", title: "camo: cache remote images for a week" } }, { uri: `at://mock/notif/20`, id: 20, type: "followed", read: true, createdAt: ago(60 * 24 * 7), actor: { did: "did:plc:mock_sophie", handle: "sophies.rocks" } }, { uri: `at://mock/notif/21`, id: 21, type: "followed", read: true, createdAt: ago(60 * 24 * 7), actor: { did: "did:plc:mock_karitham", handle: "karitham.dev" } }, { uri: `at://mock/notif/22`, id: 22, type: "repo_starred", read: true, createdAt: ago(60 * 24 * 14), actor: { did: "did:plc:mock_jola", handle: "jola.dev" }, repo: { ownerHandle: "ptr.pet", name: "hydrant" } }];