summaryrefslogtreecommitdiff
path: root/packages/frontend
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-03-12 21:12:08 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-03-12 21:12:08 +0900
commit4a73feb041a554e813e490cc5cd63c105e142623 (patch)
tree199b4fc9d345a3372adc5d6edb941c2925933eb8 /packages/frontend
parentenhance(frontend): suppress needless confirmation when turn on pref sync (diff)
downloadmisskey-4a73feb041a554e813e490cc5cd63c105e142623.tar.gz
misskey-4a73feb041a554e813e490cc5cd63c105e142623.tar.bz2
misskey-4a73feb041a554e813e490cc5cd63c105e142623.zip
enhance(frontend): make deck profiles syncable
Diffstat (limited to 'packages/frontend')
-rw-r--r--packages/frontend/src/pages/settings/deck.vue40
-rw-r--r--packages/frontend/src/utility/autogen/settings-search-index.ts7
2 files changed, 36 insertions, 11 deletions
diff --git a/packages/frontend/src/pages/settings/deck.vue b/packages/frontend/src/pages/settings/deck.vue
index e7c5c942e9..2c4ec01344 100644
--- a/packages/frontend/src/pages/settings/deck.vue
+++ b/packages/frontend/src/pages/settings/deck.vue
@@ -4,23 +4,27 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
-<div class="_gaps_m">
- <MkSwitch v-model="useSimpleUiForNonRootPages">{{ i18n.ts._deck.useSimpleUiForNonRootPages }}</MkSwitch>
+<SearchMarker path="/settings/deck" :label="i18n.ts.deck" :keywords="['deck', 'ui']" icon="ti ti-columns">
+ <div class="_gaps_m">
+ <MkSwitch :modelValue="profilesSyncEnabled" @update:modelValue="changeProfilesSyncEnabled">{{ i18n.ts._deck.enableSyncBetweenDevicesForProfiles }}</MkSwitch>
- <MkSwitch v-model="navWindow">{{ i18n.ts.defaultNavigationBehaviour }}: {{ i18n.ts.openInWindow }}</MkSwitch>
+ <MkSwitch v-model="useSimpleUiForNonRootPages">{{ i18n.ts._deck.useSimpleUiForNonRootPages }}</MkSwitch>
- <MkSwitch v-model="alwaysShowMainColumn">{{ i18n.ts._deck.alwaysShowMainColumn }}</MkSwitch>
+ <MkSwitch v-model="navWindow">{{ i18n.ts.defaultNavigationBehaviour }}: {{ i18n.ts.openInWindow }}</MkSwitch>
- <MkRadios v-model="columnAlign">
- <template #label>{{ i18n.ts._deck.columnAlign }}</template>
- <option value="left">{{ i18n.ts.left }}</option>
- <option value="center">{{ i18n.ts.center }}</option>
- </MkRadios>
-</div>
+ <MkSwitch v-model="alwaysShowMainColumn">{{ i18n.ts._deck.alwaysShowMainColumn }}</MkSwitch>
+
+ <MkRadios v-model="columnAlign">
+ <template #label>{{ i18n.ts._deck.columnAlign }}</template>
+ <option value="left">{{ i18n.ts.left }}</option>
+ <option value="center">{{ i18n.ts.center }}</option>
+ </MkRadios>
+ </div>
+</SearchMarker>
</template>
<script lang="ts" setup>
-import { computed } from 'vue';
+import { computed, ref } from 'vue';
import MkSwitch from '@/components/MkSwitch.vue';
import MkRadios from '@/components/MkRadios.vue';
import { i18n } from '@/i18n.js';
@@ -32,6 +36,20 @@ const useSimpleUiForNonRootPages = prefer.model('deck.useSimpleUiForNonRootPages
const alwaysShowMainColumn = prefer.model('deck.alwaysShowMainColumn');
const columnAlign = prefer.model('deck.columnAlign');
+const profilesSyncEnabled = ref(prefer.isSyncEnabled('deck.profiles'));
+
+function changeProfilesSyncEnabled(value: boolean) {
+ if (value) {
+ prefer.enableSync('deck.profiles').then((res) => {
+ if (res == null) return;
+ if (res.enabled) profilesSyncEnabled.value = true;
+ });
+ } else {
+ prefer.disableSync('deck.profiles');
+ profilesSyncEnabled.value = false;
+ }
+}
+
const headerActions = computed(() => []);
const headerTabs = computed(() => []);
diff --git a/packages/frontend/src/utility/autogen/settings-search-index.ts b/packages/frontend/src/utility/autogen/settings-search-index.ts
index 79310716e0..d0bce9a522 100644
--- a/packages/frontend/src/utility/autogen/settings-search-index.ts
+++ b/packages/frontend/src/utility/autogen/settings-search-index.ts
@@ -605,6 +605,13 @@ export const searchIndexes: SearchIndexItem[] = [
icon: 'ti ti-cloud',
},
{
+ id: 'FfZdOs8y',
+ label: i18n.ts.deck,
+ keywords: ['deck', 'ui'],
+ path: '/settings/deck',
+ icon: 'ti ti-columns',
+ },
+ {
id: 'BlJ2rsw9h',
children: [
{