From a05a17879c8b564cc5b150a1520a0aa67d66a83a Mon Sep 17 00:00:00 2001 From: pa Date: Mon, 23 Mar 2026 13:10:06 +0900 Subject: [PATCH] change whats new menu item to show latest whats new dialog instead of change log --- src/components/nav-menu/NavMenu.vue | 23 +++++++++++++++++------ src/components/nav-menu/NavMenuFooter.vue | 4 ++-- src/shared/constants/whatsNewReleases.js | 13 +++++++++++++ src/stores/vrcxUpdater.js | 21 +++++++++++++++++++++ 4 files changed, 53 insertions(+), 8 deletions(-) diff --git a/src/components/nav-menu/NavMenu.vue b/src/components/nav-menu/NavMenu.vue index 0bc15ec0..f400f0b6 100644 --- a/src/components/nav-menu/NavMenu.vue +++ b/src/components/nav-menu/NavMenu.vue @@ -49,9 +49,7 @@ - + {{ t('nav_menu.mark_all_read') }} @@ -133,7 +131,7 @@ :is-applying-theme-color="isApplyingThemeColor" :theme-display-name="themeDisplayName" :theme-color-display-name="themeColorDisplayName" - @show-change-log="showChangeLogDialog" + @show-whats-new="handleShowWhatsNew" @support-link="handleSupportLink" @toggle-theme="handleThemeToggle" @show-vrcx-update-dialog="showVRCXUpdateDialog" @@ -213,7 +211,7 @@ const VRCXUpdaterStore = useVRCXUpdaterStore(); const { pendingVRCXUpdate, pendingVRCXInstall, appVersion } = storeToRefs(VRCXUpdaterStore); - const { showVRCXUpdateDialog, showChangeLogDialog } = VRCXUpdaterStore; + const { showVRCXUpdateDialog, showChangeLogDialog, showLatestWhatsNewDialog } = VRCXUpdaterStore; const dashboardStore = useDashboardStore(); const { dashboards } = storeToRefs(dashboardStore); @@ -229,7 +227,13 @@ const modalStore = useModalStore(); const appearanceSettingsStore = useAppearanceSettingsStore(); - const { themeMode, tableDensity, isDarkMode, isNavCollapsed: isCollapsed, showNewDashboardButton } = storeToRefs(appearanceSettingsStore); + const { + themeMode, + tableDensity, + isDarkMode, + isNavCollapsed: isCollapsed, + showNewDashboardButton + } = storeToRefs(appearanceSettingsStore); const { themes, @@ -308,6 +312,13 @@ return false; }; + const handleShowWhatsNew = async () => { + const shown = showLatestWhatsNewDialog(); + if (!shown) { + showChangeLogDialog(); + } + }; + const handleSettingsClick = () => { router.push({ name: 'settings' }); }; diff --git a/src/components/nav-menu/NavMenuFooter.vue b/src/components/nav-menu/NavMenuFooter.vue index 8e756aa2..4850165a 100644 --- a/src/components/nav-menu/NavMenuFooter.vue +++ b/src/components/nav-menu/NavMenuFooter.vue @@ -10,7 +10,7 @@ - + {{ t('nav_menu.whats_new') }} @@ -253,7 +253,7 @@ }); const emit = defineEmits([ - 'show-change-log', + 'show-whats-new', 'support-link', 'toggle-theme', 'show-vrcx-update-dialog', diff --git a/src/shared/constants/whatsNewReleases.js b/src/shared/constants/whatsNewReleases.js index 93321ad0..10ebff18 100644 --- a/src/shared/constants/whatsNewReleases.js +++ b/src/shared/constants/whatsNewReleases.js @@ -60,7 +60,20 @@ function getWhatsNewRelease(version) { }; } +/** + * @returns {{titleKey: string, items: Array<{key: string, icon: string, titleKey: string, descriptionKey: string}>} | null} + */ +function getLatestWhatsNewRelease() { + const versions = Object.keys(whatsNewReleases); + if (versions.length === 0) { + return null; + } + const latestVersion = versions.sort().at(-1); + return getWhatsNewRelease(latestVersion); +} + export { + getLatestWhatsNewRelease, getWhatsNewRelease, normalizeReleaseVersion, whatsNewReleases diff --git a/src/stores/vrcxUpdater.js b/src/stores/vrcxUpdater.js index 505cf6ef..c7c0e308 100644 --- a/src/stores/vrcxUpdater.js +++ b/src/stores/vrcxUpdater.js @@ -6,6 +6,7 @@ import { useI18n } from 'vue-i18n'; import { logWebRequest } from '../services/appConfig'; import { branches } from '../shared/constants'; import { + getLatestWhatsNewRelease, getWhatsNewRelease, normalizeReleaseVersion } from '../shared/constants/whatsNewReleases'; @@ -204,6 +205,25 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => { return true; } + /** + * @returns {boolean} + */ + function showLatestWhatsNewDialog() { + const release = getLatestWhatsNewRelease(); + + if (!release) { + return false; + } + + whatsNewDialog.value = { + visible: true, + titleKey: release.titleKey, + items: release.items.map((item) => ({ ...item })) + }; + + return true; + } + function closeWhatsNewDialog() { whatsNewDialog.value.visible = false; } @@ -533,6 +553,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => { setBranch, showWhatsNewDialog, + showLatestWhatsNewDialog, closeWhatsNewDialog, openChangeLogDialogOnly, checkForVRCXUpdate,