From 5d228fb0f32aca9337c8b8a9ea9544f28d981f34 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Thu, 13 Mar 2025 17:39:53 +0900 Subject: [PATCH] enhance(frontend): re-organize settings page --- locales/index.d.ts | 4 + locales/ja-JP.yml | 1 + .../src/pages/settings/accessibility.vue | 51 ++ .../src/pages/settings/appearance.vue | 325 --------- .../frontend/src/pages/settings/index.vue | 5 - .../src/pages/settings/preferences.vue | 668 ++++++++++++------ packages/frontend/src/router/definition.ts | 4 - .../utility/autogen/settings-search-index.ts | 423 ++++++----- 8 files changed, 702 insertions(+), 779 deletions(-) delete mode 100644 packages/frontend/src/pages/settings/appearance.vue diff --git a/locales/index.d.ts b/locales/index.d.ts index b814bb70e1..f579aadb5d 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -5342,6 +5342,10 @@ export interface Locale extends ILocale { * 絵文字パレット */ "emojiPalette": string; + /** + * 投稿フォーム + */ + "postForm": string; "_emojiPalette": { /** * パレット diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index b51a839715..2151a06611 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1331,6 +1331,7 @@ preferenceSyncConflictChoiceDevice: "デバイスの設定値" preferenceSyncConflictChoiceCancel: "同期の有効化をキャンセル" paste: "ペースト" emojiPalette: "絵文字パレット" +postForm: "投稿フォーム" _emojiPalette: palettes: "パレット" diff --git a/packages/frontend/src/pages/settings/accessibility.vue b/packages/frontend/src/pages/settings/accessibility.vue index 3dbb039a17..f7b1e7d2a0 100644 --- a/packages/frontend/src/pages/settings/accessibility.vue +++ b/packages/frontend/src/pages/settings/accessibility.vue @@ -60,6 +60,17 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + {{ i18n.ts.menuStyle }} + {{ i18n.ts.auto }} + {{ i18n.ts.popup }} + {{ i18n.ts.drawer }} + + + + @@ -70,6 +81,22 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + {{ i18n.ts.fontSize }} + Aa + Aa + Aa + Aa + + + + + + {{ i18n.ts.useSystemFont }} + + @@ -84,6 +111,8 @@ import { i18n } from '@/i18n.js'; import { definePage } from '@/page.js'; import MkPreferenceContainer from '@/components/MkPreferenceContainer.vue'; import MkFeatureBanner from '@/components/MkFeatureBanner.vue'; +import { miLocalStorage } from '@/local-storage.js'; +import MkRadios from '@/components/MkRadios.vue'; const reduceAnimation = prefer.model('animation', v => !v, v => !v); const animatedMfm = prefer.model('animatedMfm'); @@ -92,10 +121,32 @@ const keepScreenOn = prefer.model('keepScreenOn'); const enableHorizontalSwipe = prefer.model('enableHorizontalSwipe'); const useNativeUiForVideoAudioPlayer = prefer.model('useNativeUiForVideoAudioPlayer'); const contextMenu = prefer.model('contextMenu'); +const menuStyle = prefer.model('menuStyle'); + +const fontSize = ref(miLocalStorage.getItem('fontSize')); +const useSystemFont = ref(miLocalStorage.getItem('useSystemFont') != null); + +watch(fontSize, () => { + if (fontSize.value == null) { + miLocalStorage.removeItem('fontSize'); + } else { + miLocalStorage.setItem('fontSize', fontSize.value); + } +}); + +watch(useSystemFont, () => { + if (useSystemFont.value) { + miLocalStorage.setItem('useSystemFont', 't'); + } else { + miLocalStorage.removeItem('useSystemFont'); + } +}); watch([ keepScreenOn, contextMenu, + fontSize, + useSystemFont, ], async () => { await reloadAsk({ reason: i18n.ts.reloadToApplySetting, unison: true }); }); diff --git a/packages/frontend/src/pages/settings/appearance.vue b/packages/frontend/src/pages/settings/appearance.vue deleted file mode 100644 index 3fda5bc4c8..0000000000 --- a/packages/frontend/src/pages/settings/appearance.vue +++ /dev/null @@ -1,325 +0,0 @@ - - - - - - - {{ i18n.ts._settings.appearanceBanner }} - - - - - - - - - {{ i18n.ts.useBlurEffect }} - - - - - - - - {{ i18n.ts.useBlurEffectForModal }} - - - - - - - - {{ i18n.ts.highlightSensitiveMedia }} - - - - - - - - {{ i18n.ts.squareAvatars }} - - - - - - - - {{ i18n.ts.showAvatarDecorations }} - - - - - - - - {{ i18n.ts.showGapBetweenNotesInTimeline }} - - - - - - - - {{ i18n.ts.seasonalScreenEffect }} - - - - - - - - - {{ i18n.ts.menuStyle }} - {{ i18n.ts.auto }} - {{ i18n.ts.popup }} - {{ i18n.ts.drawer }} - - - - - - - - - {{ i18n.ts.emojiStyle }} - {{ i18n.ts.native }} - Fluent Emoji - Twemoji - - - - - - - - - {{ i18n.ts.fontSize }} - Aa - Aa - Aa - Aa - - - - - - {{ i18n.ts.useSystemFont }} - - - - - - - - {{ i18n.ts.displayOfNote }} - - - - - - {{ i18n.ts.reactionsDisplaySize }} - {{ i18n.ts.small }} - {{ i18n.ts.medium }} - {{ i18n.ts.large }} - - - - - - - - {{ i18n.ts.limitWidthOfReaction }} - - - - - - - - {{ i18n.ts.mediaListWithOneImageAppearance }} - {{ i18n.ts.default }} - {{ i18n.tsx.limitTo({ x: '16:9' }) }} - {{ i18n.tsx.limitTo({ x: '1:1' }) }} - {{ i18n.tsx.limitTo({ x: '2:3' }) }} - - - - - - - - {{ i18n.ts.instanceTicker }} - {{ i18n.ts._instanceTicker.none }} - {{ i18n.ts._instanceTicker.remote }} - {{ i18n.ts._instanceTicker.always }} - - - - - - - - {{ i18n.ts.displayOfSensitiveMedia }} - {{ i18n.ts._displayOfSensitiveMedia.respect }} - {{ i18n.ts._displayOfSensitiveMedia.ignore }} - {{ i18n.ts._displayOfSensitiveMedia.force }} - - - - - - - - - - {{ i18n.ts.notificationDisplay }} - - - - - - {{ i18n.ts.position }} - {{ i18n.ts.leftTop }} - {{ i18n.ts.rightTop }} - {{ i18n.ts.leftBottom }} - {{ i18n.ts.rightBottom }} - - - - - - - - {{ i18n.ts.stackAxis }} - {{ i18n.ts.vertical }} - {{ i18n.ts.horizontal }} - - - - - {{ i18n.ts._notification.checkNotificationBehavior }} - - - - - - {{ i18n.ts.customCss }} - - - - - - diff --git a/packages/frontend/src/pages/settings/index.vue b/packages/frontend/src/pages/settings/index.vue index debcd4bd3e..3b7c44fbfe 100644 --- a/packages/frontend/src/pages/settings/index.vue +++ b/packages/frontend/src/pages/settings/index.vue @@ -118,11 +118,6 @@ const menuDef = computed(() => [{ text: i18n.ts.emojiPalette, to: '/settings/emoji-palette', active: currentPage.value?.route.name === 'emoji-palette', - }, { - icon: 'ti ti-device-desktop', - text: i18n.ts.appearance, - to: '/settings/appearance', - active: currentPage.value?.route.name === 'appearance', }, { icon: 'ti ti-music', text: i18n.ts.sounds, diff --git a/packages/frontend/src/pages/settings/preferences.vue b/packages/frontend/src/pages/settings/preferences.vue index 374477c510..b9a596067c 100644 --- a/packages/frontend/src/pages/settings/preferences.vue +++ b/packages/frontend/src/pages/settings/preferences.vue @@ -10,121 +10,174 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts._settings.preferencesBanner }} - - - {{ i18n.ts.uiLanguage }} - {{ x[1] }} - - - - Crowdin - - - - - - - - - {{ i18n.ts.overridedDeviceKind }} - {{ i18n.ts.auto }} - {{ i18n.ts.smartphone }} - {{ i18n.ts.tablet }} - {{ i18n.ts.desktop }} - - - - - - - - - {{ i18n.ts.showFixedPostForm }} - - - - - - - - {{ i18n.ts.showFixedPostFormInChannel }} - - - - - - - {{ i18n.ts.pinnedList }} - - {{ i18n.ts.add }} - {{ i18n.ts.remove }} - - - - - - - {{ i18n.ts.enableQuickAddMfmFunction }} - - - - - - - - - - - - {{ i18n.ts.rememberNoteVisibility }} - - - - - - - - {{ i18n.ts.defaultNoteVisibility }} - {{ i18n.ts._visibility.public }} - {{ i18n.ts._visibility.home }} - {{ i18n.ts._visibility.followers }} - {{ i18n.ts._visibility.specified }} - - - - - {{ i18n.ts._visibility.public }} - {{ i18n.ts._visibility.home }} - {{ i18n.ts._visibility.followers }} - {{ i18n.ts._visibility.specified }} - - - - - {{ i18n.ts._visibility.disableFederation }} - - - - - - - - - - - {{ i18n.ts.note }} + + + {{ i18n.ts.general }} + + + {{ i18n.ts.uiLanguage }} + {{ x[1] }} + + + + Crowdin + + + + + + + + + {{ i18n.ts.overridedDeviceKind }} + {{ i18n.ts.auto }} + {{ i18n.ts.smartphone }} + {{ i18n.ts.tablet }} + {{ i18n.ts.desktop }} + + + - - - - {{ i18n.ts.collapseRenotes }} - {{ i18n.ts.collapseRenotesDescription }} + + + + {{ i18n.ts.useBlurEffect }} + + + + {{ i18n.ts.useBlurEffectForModal }} + + + + + + + + {{ i18n.ts.showAvatarDecorations }} + + + + + + + + {{ i18n.ts.alwaysConfirmFollow }} + + + + + + + + {{ i18n.ts.highlightSensitiveMedia }} + + + + + + + + {{ i18n.ts.confirmWhenRevealingSensitiveMedia }} + + + + + + + + + + {{ i18n.ts.emojiStyle }} + {{ i18n.ts.native }} + Fluent Emoji + Twemoji + + + + + + + + + {{ i18n.ts.pinnedList }} + + {{ i18n.ts.add }} + {{ i18n.ts.remove }} + + + + + + + + + {{ i18n.ts.timeline }} + + + + + + {{ i18n.ts.showFixedPostForm }} + + + + + + + + {{ i18n.ts.showFixedPostFormInChannel }} + + + + + + + + {{ i18n.ts.collapseRenotes }} + {{ i18n.ts.collapseRenotesDescription }} + + + + + + + + {{ i18n.ts.showGapBetweenNotesInTimeline }} + + + + + + + + {{ i18n.ts.enableInfiniteScroll }} + + + + + + + + {{ i18n.ts.disableStreamingTimeline }} + + + + + + + + + + {{ i18n.ts.note }} + + + @@ -157,6 +210,14 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + {{ i18n.ts.confirmOnReact }} + + + + @@ -164,40 +225,6 @@ SPDX-License-Identifier: AGPL-3.0-only - - - - - - - - {{ i18n.ts.notifications }} - - - - - - {{ i18n.ts.useGroupedNotifications }} - - - - - - - - - - {{ i18n.ts.behavior }} - - - - - - - {{ i18n.ts.openImageInNewTab }} - - - @@ -206,47 +233,70 @@ SPDX-License-Identifier: AGPL-3.0-only + - - - - {{ i18n.ts.enableInfiniteScroll }} - - - + + + + {{ i18n.ts.reactionsDisplaySize }} + {{ i18n.ts.small }} + {{ i18n.ts.medium }} + {{ i18n.ts.large }} + + + - - - - {{ i18n.ts.disableStreamingTimeline }} - - - + + + + {{ i18n.ts.limitWidthOfReaction }} + + + - - - - {{ i18n.ts.alwaysConfirmFollow }} - - - + + + + {{ i18n.ts.mediaListWithOneImageAppearance }} + {{ i18n.ts.default }} + {{ i18n.tsx.limitTo({ x: '16:9' }) }} + {{ i18n.tsx.limitTo({ x: '1:1' }) }} + {{ i18n.tsx.limitTo({ x: '2:3' }) }} + + + - - - - {{ i18n.ts.confirmWhenRevealingSensitiveMedia }} - - - + + + + {{ i18n.ts.instanceTicker }} + {{ i18n.ts._instanceTicker.none }} + {{ i18n.ts._instanceTicker.remote }} + {{ i18n.ts._instanceTicker.always }} + + + - - - - {{ i18n.ts.confirmOnReact }} - - - + + + + {{ i18n.ts.displayOfSensitiveMedia }} + {{ i18n.ts._displayOfSensitiveMedia.respect }} + {{ i18n.ts._displayOfSensitiveMedia.ignore }} + {{ i18n.ts._displayOfSensitiveMedia.force }} + + + + + + + + + {{ i18n.ts.postForm }} + + + @@ -254,6 +304,123 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + {{ i18n.ts.rememberNoteVisibility }} + + + + + + + + {{ i18n.ts.enableQuickAddMfmFunction }} + + + + + + + + + {{ i18n.ts.defaultNoteVisibility }} + {{ i18n.ts._visibility.public }} + {{ i18n.ts._visibility.home }} + {{ i18n.ts._visibility.followers }} + {{ i18n.ts._visibility.specified }} + + + + + {{ i18n.ts._visibility.public }} + {{ i18n.ts._visibility.home }} + {{ i18n.ts._visibility.followers }} + {{ i18n.ts._visibility.specified }} + + + + + {{ i18n.ts._visibility.disableFederation }} + + + + + + + + + + + + {{ i18n.ts.notifications }} + + + + + + {{ i18n.ts.useGroupedNotifications }} + + + + + + + + {{ i18n.ts.position }} + {{ i18n.ts.leftTop }} + {{ i18n.ts.rightTop }} + {{ i18n.ts.leftBottom }} + {{ i18n.ts.rightBottom }} + + + + + + + + {{ i18n.ts.stackAxis }} + {{ i18n.ts.vertical }} + {{ i18n.ts.horizontal }} + + + + + {{ i18n.ts._notification.checkNotificationBehavior }} + + + + + + + {{ i18n.ts.other }} + + + + + + + {{ i18n.ts.squareAvatars }} + + + + + + + + {{ i18n.ts.seasonalScreenEffect }} + + + + + + + + {{ i18n.ts.openImageInNewTab }} + + + @@ -276,47 +443,6 @@ SPDX-License-Identifier: AGPL-3.0-only - - - {{ i18n.ts.dataSaver }} - - - {{ i18n.ts.reloadRequiredToApplySettings }} - - - {{ i18n.ts.enableAll }} - {{ i18n.ts.disableAll }} - - - - {{ i18n.ts._dataSaver._media.title }} - {{ i18n.ts._dataSaver._media.description }} - - - {{ i18n.ts._dataSaver._avatar.title }} - {{ i18n.ts._dataSaver._avatar.description }} - - - {{ i18n.ts._dataSaver._urlPreview.title }} - {{ i18n.ts._dataSaver._urlPreview.description }} - - - {{ i18n.ts._dataSaver._code.title }} - {{ i18n.ts._dataSaver._code.description }} - - - - - - - - - - - - {{ i18n.ts.other }} - - @@ -347,18 +473,47 @@ SPDX-License-Identifier: AGPL-3.0-only - - {{ i18n.ts.navbar }} - {{ i18n.ts.statusbar }} - + - - - {{ i18n.ts.deck }} - - + + + {{ i18n.ts.dataSaver }} + + + {{ i18n.ts.reloadRequiredToApplySettings }} + + + {{ i18n.ts.enableAll }} + {{ i18n.ts.disableAll }} + + + + {{ i18n.ts._dataSaver._media.title }} + {{ i18n.ts._dataSaver._media.description }} + + + {{ i18n.ts._dataSaver._avatar.title }} + {{ i18n.ts._dataSaver._avatar.description }} + + + {{ i18n.ts._dataSaver._urlPreview.title }} + {{ i18n.ts._dataSaver._urlPreview.description }} + + + {{ i18n.ts._dataSaver._code.title }} + {{ i18n.ts._dataSaver._code.description }} + + + + + + + {{ i18n.ts.navbar }} + {{ i18n.ts.statusbar }} + {{ i18n.ts.deck }} + {{ i18n.ts.customCss }} @@ -366,6 +521,7 @@ SPDX-License-Identifier: AGPL-3.0-only