feat: add breadcrumb components and main dialog layout functionality

This commit is contained in:
pa
2026-01-20 17:30:23 +09:00
committed by Natsumi
parent 0b636df330
commit b2bd7693bb
21 changed files with 3768 additions and 3471 deletions
+27 -1
View File
@@ -18,9 +18,12 @@ import { database } from '../service/database';
import { useAdvancedSettingsStore } from './settings/advanced';
import { useAvatarProviderStore } from './avatarProvider';
import { useFavoriteStore } from './favorite';
import { useGroupStore } from './group';
import { useModalStore } from './modal';
import { useUiStore } from './ui';
import { useUserStore } from './user';
import { useVRCXUpdaterStore } from './vrcxUpdater';
import { useWorldStore } from './world';
import { watchState } from '../service/watchState';
import webApiService from '../service/webapi';
@@ -31,7 +34,10 @@ export const useAvatarStore = defineStore('Avatar', () => {
const vrcxUpdaterStore = useVRCXUpdaterStore();
const advancedSettingsStore = useAdvancedSettingsStore();
const userStore = useUserStore();
const worldStore = useWorldStore();
const groupStore = useGroupStore();
const modalStore = useModalStore();
const uiStore = useUiStore();
const { t } = useI18n();
let cachedAvatarModerations = new Map();
@@ -172,8 +178,22 @@ export const useAvatarStore = defineStore('Avatar', () => {
* @param {string} avatarId
* @returns
*/
function showAvatarDialog(avatarId) {
function showAvatarDialog(avatarId, options = {}) {
const D = avatarDialog.value;
if (
!avatarDialog.value.visible &&
!userStore.userDialog.visible &&
!worldStore.worldDialog.visible &&
!groupStore.groupDialog.visible
) {
uiStore.clearDialogCrumbs();
}
if (!options.skipBreadcrumb) {
uiStore.pushDialogCrumb('avatar', avatarId);
}
userStore.userDialog.visible = false;
worldStore.worldDialog.visible = false;
groupStore.groupDialog.visible = false;
D.visible = true;
D.loading = true;
D.id = avatarId;
@@ -201,6 +221,7 @@ export const useAvatarStore = defineStore('Avatar', () => {
const ref2 = cachedAvatars.get(avatarId);
if (typeof ref2 !== 'undefined') {
D.ref = ref2;
uiStore.setDialogCrumbLabel('avatar', D.id, D.ref?.name || D.id);
updateVRChatAvatarCache();
if (
ref2.releaseStatus !== 'public' &&
@@ -215,6 +236,11 @@ export const useAvatarStore = defineStore('Avatar', () => {
.then((args) => {
const ref = applyAvatar(args.json);
D.ref = ref;
uiStore.setDialogCrumbLabel(
'avatar',
D.id,
D.ref?.name || D.id
);
getAvatarGallery(avatarId);
updateVRChatAvatarCache();
if (/quest/.test(ref.tags)) {