feat: Avatars tab

This commit is contained in:
2026-06-30 01:36:23 +07:00
parent e575f99116
commit 5d983fdbd1
25 changed files with 1183 additions and 27 deletions
+10 -2
View File
@@ -9,7 +9,7 @@ import type { SocialSnapshot, UserProfile, UserStatus } from "./types/user";
import type { DiscoverCategory, FavoriteWorldFolder, World, WorldSnapshot } from "./types/world";
import type { CreateInstanceInput, Instance, InstanceRegion } from "./types/instance";
import type { UnityStatus } from "./types/unity";
import type { Avatar } from "./types/avatar";
import type { Avatar, AvatarEdit, AvatarSnapshot } from "./types/avatar";
import type { RepoStats, StoredEntity } from "./types/repository";
import type { AccountSettings, ContentFilterKey, Pending2Fa, RecoveryCode } from "./types/settings";
import type { Group, GroupSnapshot } from "./types/group";
@@ -58,7 +58,13 @@ export interface IpcRequests {
"instance:inviteSelf": (p: { worldId: string; instanceId: string }) => IpcResult<void>;
"avatar:get": (avatarId: string) => IpcResult<Avatar>;
"avatar:favorites": () => IpcResult<Avatar[]>;
"avatar:snapshot": () => IpcResult<AvatarSnapshot>;
"avatar:loadMine": () => IpcResult<void>;
"avatar:loadFavorites": () => IpcResult<void>;
"avatar:select": (avatarId: string) => IpcResult<void>;
"avatar:update": (p: { avatarId: string; edit: AvatarEdit }) => IpcResult<Avatar>;
"avatar:delete": (avatarId: string) => IpcResult<void>;
"avatar:setFavorited": (p: { avatarId: string; favorited: boolean }) => IpcResult<void>;
"group:byUser": (userId: string) => IpcResult<Group[]>;
"group:represented": (userId: string) => IpcResult<Group | null>;
@@ -142,6 +148,8 @@ export interface IpcEvents {
"world:upsert": World;
"group:seed": GroupSnapshot;
"group:upsert": Group;
"avatar:seed": AvatarSnapshot;
"avatar:upsert": Avatar;
"world:favoriteFolders": { userId: string; folders: FavoriteWorldFolder[]; done: boolean };
"game:changed": GameStatus;
"instance:open": { worldId: string; instanceId: string; location: string };
+28
View File
@@ -1,3 +1,10 @@
import type { WorldPlatforms } from "./world";
export interface AvatarPerformance {
pc?: string;
android?: string;
}
export interface Avatar {
id: string;
name: string;
@@ -9,6 +16,27 @@ export interface Avatar {
releaseStatus: string;
tags: string[];
favorites: number;
featured?: boolean;
platforms?: WorldPlatforms;
performance?: AvatarPerformance;
createdAt?: string;
updatedAt?: string;
}
export interface AvatarEdit {
name?: string;
description?: string;
releaseStatus?: string;
}
export interface FavoriteAvatarFolder {
name: string;
displayName: string;
avatarIds: string[];
}
export interface AvatarSnapshot {
avatars: Avatar[];
mineIds: string[];
favorites: FavoriteAvatarFolder[];
}
+1
View File
@@ -51,6 +51,7 @@ export interface UserProfile {
userIcon: string;
profilePicOverride: string;
profilePicOverrideThumbnail: string;
currentAvatarId?: string;
currentAvatarImageUrl: string;
currentAvatarThumbnailImageUrl: string;
currentAvatarTags: string[];