change whats new menu item to show latest whats new dialog instead of change log

This commit is contained in:
pa
2026-03-23 13:10:06 +09:00
parent 3e9bff2f1b
commit a05a17879c
4 changed files with 53 additions and 8 deletions
+17 -6
View File
@@ -49,9 +49,7 @@
</SidebarMenuButton> </SidebarMenuButton>
</ContextMenuTrigger> </ContextMenuTrigger>
<ContextMenuContent> <ContextMenuContent>
<ContextMenuItem <ContextMenuItem v-if="hasNotifications" @click="clearAllNotifications">
v-if="hasNotifications"
@click="clearAllNotifications">
{{ t('nav_menu.mark_all_read') }} {{ t('nav_menu.mark_all_read') }}
</ContextMenuItem> </ContextMenuItem>
<ContextMenuSeparator v-if="hasNotifications" /> <ContextMenuSeparator v-if="hasNotifications" />
@@ -133,7 +131,7 @@
:is-applying-theme-color="isApplyingThemeColor" :is-applying-theme-color="isApplyingThemeColor"
:theme-display-name="themeDisplayName" :theme-display-name="themeDisplayName"
:theme-color-display-name="themeColorDisplayName" :theme-color-display-name="themeColorDisplayName"
@show-change-log="showChangeLogDialog" @show-whats-new="handleShowWhatsNew"
@support-link="handleSupportLink" @support-link="handleSupportLink"
@toggle-theme="handleThemeToggle" @toggle-theme="handleThemeToggle"
@show-vrcx-update-dialog="showVRCXUpdateDialog" @show-vrcx-update-dialog="showVRCXUpdateDialog"
@@ -213,7 +211,7 @@
const VRCXUpdaterStore = useVRCXUpdaterStore(); const VRCXUpdaterStore = useVRCXUpdaterStore();
const { pendingVRCXUpdate, pendingVRCXInstall, appVersion } = storeToRefs(VRCXUpdaterStore); const { pendingVRCXUpdate, pendingVRCXInstall, appVersion } = storeToRefs(VRCXUpdaterStore);
const { showVRCXUpdateDialog, showChangeLogDialog } = VRCXUpdaterStore; const { showVRCXUpdateDialog, showChangeLogDialog, showLatestWhatsNewDialog } = VRCXUpdaterStore;
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const { dashboards } = storeToRefs(dashboardStore); const { dashboards } = storeToRefs(dashboardStore);
@@ -229,7 +227,13 @@
const modalStore = useModalStore(); const modalStore = useModalStore();
const appearanceSettingsStore = useAppearanceSettingsStore(); const appearanceSettingsStore = useAppearanceSettingsStore();
const { themeMode, tableDensity, isDarkMode, isNavCollapsed: isCollapsed, showNewDashboardButton } = storeToRefs(appearanceSettingsStore); const {
themeMode,
tableDensity,
isDarkMode,
isNavCollapsed: isCollapsed,
showNewDashboardButton
} = storeToRefs(appearanceSettingsStore);
const { const {
themes, themes,
@@ -308,6 +312,13 @@
return false; return false;
}; };
const handleShowWhatsNew = async () => {
const shown = showLatestWhatsNewDialog();
if (!shown) {
showChangeLogDialog();
}
};
const handleSettingsClick = () => { const handleSettingsClick = () => {
router.push({ name: 'settings' }); router.push({ name: 'settings' });
}; };
+2 -2
View File
@@ -10,7 +10,7 @@
</SidebarMenuButton> </SidebarMenuButton>
</DropdownMenuTrigger> </DropdownMenuTrigger>
<DropdownMenuContent side="right" align="start" class="w-56"> <DropdownMenuContent side="right" align="start" class="w-56">
<DropdownMenuItem @click="emit('show-change-log')"> <DropdownMenuItem @click="emit('show-whats-new')">
<span>{{ t('nav_menu.whats_new') }}</span> <span>{{ t('nav_menu.whats_new') }}</span>
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuSeparator /> <DropdownMenuSeparator />
@@ -253,7 +253,7 @@
}); });
const emit = defineEmits([ const emit = defineEmits([
'show-change-log', 'show-whats-new',
'support-link', 'support-link',
'toggle-theme', 'toggle-theme',
'show-vrcx-update-dialog', 'show-vrcx-update-dialog',
+13
View File
@@ -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 { export {
getLatestWhatsNewRelease,
getWhatsNewRelease, getWhatsNewRelease,
normalizeReleaseVersion, normalizeReleaseVersion,
whatsNewReleases whatsNewReleases
+21
View File
@@ -6,6 +6,7 @@ import { useI18n } from 'vue-i18n';
import { logWebRequest } from '../services/appConfig'; import { logWebRequest } from '../services/appConfig';
import { branches } from '../shared/constants'; import { branches } from '../shared/constants';
import { import {
getLatestWhatsNewRelease,
getWhatsNewRelease, getWhatsNewRelease,
normalizeReleaseVersion normalizeReleaseVersion
} from '../shared/constants/whatsNewReleases'; } from '../shared/constants/whatsNewReleases';
@@ -204,6 +205,25 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
return true; 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() { function closeWhatsNewDialog() {
whatsNewDialog.value.visible = false; whatsNewDialog.value.visible = false;
} }
@@ -533,6 +553,7 @@ export const useVRCXUpdaterStore = defineStore('VRCXUpdater', () => {
setBranch, setBranch,
showWhatsNewDialog, showWhatsNewDialog,
showLatestWhatsNewDialog,
closeWhatsNewDialog, closeWhatsNewDialog,
openChangeLogDialogOnly, openChangeLogDialogOnly,
checkForVRCXUpdate, checkForVRCXUpdate,