v3: added content slugs, fixed real-time updates in client, added @mentions across the app, added new file selector and drop zone

This commit is contained in:
khannurien
2026-03-22 16:06:26 +00:00
parent 39a0cc397e
commit 34e908d1bc
42 changed files with 2170 additions and 628 deletions

View File

@@ -140,6 +140,18 @@ export function WSProvider({ children, token }: WSProviderProps) {
case "dump_updated": {
const dump = deserializeDump(msg.dump as RawDump);
setLastDumpEvent(dump);
// Un-delete if this dump was previously removed from the feed
// (e.g. it was made private, and is now public again).
setDeletedDumpIds((prev) => {
if (!prev.has(dump.id)) return prev;
const next = new Set(prev);
next.delete(dump.id);
return next;
});
// Add to live feed if not already present (private→public).
setRecentDumps((prev) =>
prev.some((d) => d.id === dump.id) ? prev : [dump, ...prev]
);
break;
}
@@ -227,6 +239,16 @@ export function WSProvider({ children, token }: WSProviderProps) {
break;
}
case "comment_updated": {
const comment = deserializeComment(msg.comment as RawComment);
setLastCommentEvent({
type: "updated",
dumpId: comment.dumpId,
comment,
});
break;
}
case "notification_created": {
const notification = deserializeNotification(
msg.notification as RawNotification,