// 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 {
NotificationActor,
NotificationSummary
} from "#lib/components/notifications/types.ts";
const minutes = (n: number) => n * 60_000;
// anchored on import so the date buckets stay populated whenever this runs
const base = Date.now();
const ago = (mins: number) => new Date(base - minutes(mins)).toISOString();
const alice = {
did: "did:plc:oky5czdrnfjpqslsw2a5iclo",
handle: "alice.tngl.sh"
} satisfies NotificationActor;
const bob = {
did: "did:plc:3p7ejjxnufohsygt5vbyxb2i",
handle: "bob.tngl.sh"
} satisfies NotificationActor;
const charlie = {
did: "did:plc:7hbfxfxqxcbszrfhbvlnvxzq",
handle: "charlie.tngl.sh"
} satisfies NotificationActor;
const dave = {
did: "did:plc:kx4mzvhqrjpwqmvlbdxdlbnn",
handle: "dave.tngl.sh"
} satisfies NotificationActor;
const core = { ownerHandle: "tangled.org", name: "core" };
const knot = { ownerHandle: "tangled.org", name: "knot" };
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: charlie,
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/${8}`,
id: 8,
type: "followed",
read: true,
createdAt: ago(60 * 40),
actor: charlie
},
{
uri: `at://mock/notif/${9}`,
id: 9,
type: "issue_created",
read: false,
createdAt: ago(60 * 55),
actor: charlie,
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: charlie,
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_erin", handle: "erin.tngl.sh" }
},
{
uri: `at://mock/notif/21`,
id: 21,
type: "followed",
read: true,
createdAt: ago(60 * 24 * 7),
actor: { did: "did:plc:mock_frank", handle: "frank.tngl.sh" }
},
{
uri: `at://mock/notif/22`,
id: 22,
type: "repo_starred",
read: true,
createdAt: ago(60 * 24 * 14),
actor: { did: "did:plc:mock_grace", handle: "grace.tngl.sh" },
repo: { ownerHandle: "heidi.tngl.sh", name: "hydrant" }
}
];