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

View File

@@ -49,9 +49,7 @@
</SidebarMenuButton>
</ContextMenuTrigger>
<ContextMenuContent>
<ContextMenuItem
v-if="hasNotifications"
@click="clearAllNotifications">
<ContextMenuItem v-if="hasNotifications" @click="clearAllNotifications">
{{ t('nav_menu.mark_all_read') }}
</ContextMenuItem>
<ContextMenuSeparator v-if="hasNotifications" />
@@ -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' });
};

View File

@@ -10,7 +10,7 @@
</SidebarMenuButton>
</DropdownMenuTrigger>
<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>
</DropdownMenuItem>
<DropdownMenuSeparator />
@@ -253,7 +253,7 @@
});
const emit = defineEmits([
'show-change-log',
'show-whats-new',
'support-link',
'toggle-theme',
'show-vrcx-update-dialog',

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 {
getLatestWhatsNewRelease,
getWhatsNewRelease,
normalizeReleaseVersion,
whatsNewReleases

View File

@@ -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,