feat: Groups info page and store

This commit is contained in:
2026-06-28 00:17:59 +07:00
parent aeff519ae0
commit a4f052727a
19 changed files with 529 additions and 35 deletions
+5 -1
View File
@@ -10,7 +10,7 @@ import type { FavoriteWorldFolder, World, WorldSnapshot } from "./types/world";
import type { Avatar } from "./types/avatar";
import type { RepoStats, StoredEntity } from "./types/repository";
import type { AccountSettings, ContentFilterKey, Pending2Fa, RecoveryCode } from "./types/settings";
import type { Group } from "./types/group";
import type { Group, GroupSnapshot } from "./types/group";
import type { EnhancementId, EnhancementsSnapshot } from "./types/enhancements";
import type { GallerySnapshot, Photo, ThumbCacheStats } from "./types/gallery";
import type { AppConfig } from "./types/appConfig";
@@ -51,6 +51,8 @@ export interface IpcRequests {
"group:byUser": (userId: string) => IpcResult<Group[]>;
"group:represented": (userId: string) => IpcResult<Group | null>;
"group:get": (groupId: string) => IpcResult<Group>;
"group:snapshot": () => IpcResult<GroupSnapshot>;
"social:snapshot": () => IpcResult<SocialSnapshot>;
@@ -119,6 +121,8 @@ export interface IpcEvents {
"social:upsert": UserProfile;
"world:seed": WorldSnapshot;
"world:upsert": World;
"group:seed": GroupSnapshot;
"group:upsert": Group;
"world:favoriteFolders": { userId: string; folders: FavoriteWorldFolder[]; done: boolean };
"game:changed": GameStatus;
"gallery:added": Photo;
+16
View File
@@ -1,5 +1,6 @@
export interface Group {
id: string;
detailed?: boolean;
name: string;
shortCode?: string;
description?: string;
@@ -9,4 +10,19 @@ export interface Group {
memberCount?: number;
privacy?: string;
isRepresenting?: boolean;
onlineMemberCount?: number;
joinState?: string;
isVerified?: boolean;
rules?: string;
languages?: string[];
links?: string[];
tags?: string[];
createdAt?: string;
}
export interface GroupSnapshot {
groups: Group[];
byUser: Record<string, string[]>;
representedByUser: Record<string, string>;
}