Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance(tms): /tms/settings -> /tms/features #306

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 8 additions & 46 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10485,29 +10485,25 @@ export interface Locale extends ILocale {
*/
readonly "aboutTaiyme": string;
/**
* taiyme拡張機能
* taiyme限定機能
*/
readonly "taiymeSettings": string;
readonly "taiymeFeatures": string;
/**
* taiyme実験的機能
* これらの機能はtaiymeで独自実装したものです。
*/
readonly "taiymeFlags": string;
readonly "taiymeFeaturesDescription": string;
/**
* {name}は、Misskeyの派生であるtaiymeを使用したサーバーのひとつです。
*/
readonly "poweredByTaiyme": ParameterizedString<"name">;
/**
* {name}を支援
* taiyを支援する
*/
readonly "supportX": ParameterizedString<"name">;
readonly "supportTaiy": string;
/**
* コミットハッシュ
*/
readonly "commitHash": string;
/**
* 問題の報告や要望はGitHubで受け付けています。
*/
readonly "reportIssuesToGithub": string;
/**
* センシティブな画像
*/
Expand Down Expand Up @@ -10573,14 +10569,10 @@ export interface Locale extends ILocale {
*/
readonly "updatedX": ParameterizedString<"x">;
readonly "_about": {
/**
* taiymeについて
*/
readonly "title": string;
/**
* taiymeは、Misskeyから派生したオープンソースのソフトウェアです。
*/
readonly "description": string;
readonly "taiymeIsOSS": string;
/**
* プロジェクトメンバー
*/
Expand All @@ -10594,15 +10586,7 @@ export interface Locale extends ILocale {
*/
readonly "patrons": string;
};
readonly "_settings": {
/**
* taiyme拡張機能
*/
readonly "title": string;
/**
* これらの機能はtaiymeで独自実装したものです。
*/
readonly "description": string;
readonly "_features": {
readonly "_tickerPosition": {
/**
* ノートのサーバー情報の表示位置
Expand Down Expand Up @@ -10683,28 +10667,6 @@ export interface Locale extends ILocale {
*/
readonly "caption": string;
};
};
readonly "_flags": {
/**
* taiyme実験的機能
*/
readonly "title": string;
/**
* これらの機能はtaiymeで独自実装したものです。
*/
readonly "description": string;
/**
* これらの設定を有効にすると、ページの表示や挙動に深刻な影響を及ぼし、{name}が正常に利用できなくなる可能性があります。
*/
readonly "warning": ParameterizedString<"name">;
/**
* {x}を強制取得
*/
readonly "forceFetchX": ParameterizedString<"x">;
/**
* {x}を開く
*/
readonly "openX": ParameterizedString<"x">;
readonly "_preventLongPressContextMenu": {
/**
* 長押しによるコンテキストメニューイベントの発行を防ぐ
Expand Down
20 changes: 5 additions & 15 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2794,12 +2794,11 @@ _tms:
taiy: "taiy"
taiyme: "taiyme"
aboutTaiyme: "taiymeについて"
taiymeSettings: "taiyme拡張機能"
taiymeFlags: "taiyme実験的機能"
taiymeFeatures: "taiyme限定機能"
taiymeFeaturesDescription: "これらの機能はtaiymeで独自実装したものです。"
poweredByTaiyme: "{name}は、Misskeyの派生であるtaiymeを使用したサーバーのひとつです。"
supportX: "{name}を支援"
supportTaiy: "taiyを支援する"
commitHash: "コミットハッシュ"
reportIssuesToGithub: "問題の報告や要望はGitHubで受け付けています。"
sensitiveImage: "センシティブな画像"
sensitiveVideo: "センシティブな動画"
sensitiveAudio: "センシティブな音声"
Expand All @@ -2817,14 +2816,11 @@ _tms:
taiymeUpdated: "taiymeが更新されました!"
updatedX: "{x}が更新されました!"
_about:
title: "taiymeについて"
description: "taiymeは、Misskeyから派生したオープンソースのソフトウェアです。"
taiymeIsOSS: "taiymeは、Misskeyから派生したオープンソースのソフトウェアです。"
projectMembers: "プロジェクトメンバー"
contributors: "コントリビューター"
patrons: "支援者"
_settings:
title: "taiyme拡張機能"
description: "これらの機能はtaiymeで独自実装したものです。"
_features:
_tickerPosition:
label: "ノートのサーバー情報の表示位置"
default: "デフォルト"
Expand All @@ -2847,12 +2843,6 @@ _tms:
_pullToRefreshAllReload:
label: "「引っ張ってリロード」でページ全体を再読み込みする"
caption: "構成しているページ全体を再読み込みする動作に置き換えます。"
_flags:
title: "taiyme実験的機能"
description: "これらの機能はtaiymeで独自実装したものです。"
warning: "これらの設定を有効にすると、ページの表示や挙動に深刻な影響を及ぼし、{name}が正常に利用できなくなる可能性があります。"
forceFetchX: "{x}を強制取得"
openX: "{x}を開く"
_preventLongPressContextMenu:
label: "長押しによるコンテキストメニューイベントの発行を防ぐ"
caption: "長押しを含む操作が中断される問題を解消します。"
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/TmsSoftwareDonation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<FormLink to="https://u.taiy.me/donate" external>
<template #icon><i class="ti ti-pig-money"></i></template>
<template #default>{{ i18n.tsx._tms.supportX({ name: i18n.ts._tms.taiy }) }}</template>
<template #default>{{ i18n.ts._tms.supportTaiy }}</template>
<template #suffix>Donation</template>
</FormLink>
</template>
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/pages/tms/about.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSpacer :contentMax="600" :marginMin="20">
<div class="_gaps_m">
<TmsNoCache><TmsSoftwareBanner/></TmsNoCache>
<div style="text-align: center;">{{ i18n.ts._tms._about.description }}</div>
<div style="text-align: center;">{{ i18n.ts._tms._about.taiymeIsOSS }}</div>
<FormSection>
<div class="_gaps_s">
<TmsSoftwareRepository/>
Expand Down Expand Up @@ -61,7 +61,7 @@ import TmsSoftwareDonation from '@/components/TmsSoftwareDonation.vue';
import TmsSoftwareRepository from '@/components/TmsSoftwareRepository.vue';

definePageMetadata(() => ({
title: i18n.ts._tms._about.title,
title: i18n.ts._tms.aboutTaiyme,
icon: 'ti ti-info-circle',
}));
</script>
106 changes: 106 additions & 0 deletions packages/frontend/src/pages/tms/features.form.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<div class="_gaps_m">
<div class="_gaps_s">
<MkInfo>{{ i18n.ts._tms.taiymeFeaturesDescription }} <MkA to="/tms/about" class="_link">{{ i18n.ts.learnMore }}</MkA></MkInfo>
</div>
<MkFolder defaultOpen>
<template #icon><i class="ti ti-palette"></i></template>
<template #label>{{ i18n.ts.appearance }}</template>
<template v-if="appearancesForm.modified.value" #footer>
<MkFormFooter :form="appearancesForm"/>
</template>
<div class="_gaps">
<MkSelect v-model="appearancesForm.state.tickerPosition">
<template #label>
<span>{{ i18n.ts._tms._features._tickerPosition.label }}</span>
<span v-if="appearancesForm.modifiedStates.tickerPosition" class="_modified">{{ i18n.ts.modified }}</span>
</template>
<option value="default">{{ i18n.ts._tms._features._tickerPosition.default }}</option>
<option value="leftVerticalBar">{{ i18n.ts._tms._features._tickerPosition.leftVerticalBar }}</option>
<option value="rightVerticalBar">{{ i18n.ts._tms._features._tickerPosition.rightVerticalBar }}</option>
<option value="leftWatermark">{{ i18n.ts._tms._features._tickerPosition.leftWatermark }}</option>
<option value="rightWatermark">{{ i18n.ts._tms._features._tickerPosition.rightWatermark }}</option>
</MkSelect>
<MkSelect v-model="appearancesForm.state.superMenuDisplayMode">
<template #label>
<span>{{ i18n.ts._tms._features._superMenuDisplayMode.label }}</span>
<span v-if="appearancesForm.modifiedStates.superMenuDisplayMode" class="_modified">{{ i18n.ts.modified }}</span>
</template>
<template #caption>{{ i18n.ts._tms._features._superMenuDisplayMode.caption }}</template>
<option value="default">{{ i18n.ts._tms._features._superMenuDisplayMode.default }}</option>
<option value="classic">{{ i18n.ts._tms._features._superMenuDisplayMode.classic }}</option>
<option value="forceList">{{ i18n.ts._tms._features._superMenuDisplayMode.forceList }}</option>
</MkSelect>
</div>
</MkFolder>
<MkFolder defaultOpen>
<template #icon><i class="ti ti-hand-click"></i></template>
<template #label>{{ i18n.ts.operations }}</template>
<template v-if="operationsForm.modified.value" #footer>
<MkFormFooter :form="operationsForm"/>
</template>
<div class="_gaps">
<MkSelect v-model="operationsForm.state.pullToRefreshSensitivity">
<template #label>
<span>{{ i18n.ts._tms._features._pullToRefreshSensitivity.label }}</span>
<span v-if="operationsForm.modifiedStates.pullToRefreshSensitivity" class="_modified">{{ i18n.ts.modified }}</span>
</template>
<template #caption>{{ i18n.ts._tms._features._pullToRefreshSensitivity.caption }}</template>
<option value="low">{{ i18n.ts._tms._features._pullToRefreshSensitivity.low }}</option>
<option value="middle">{{ i18n.ts._tms._features._pullToRefreshSensitivity.middle }}</option>
<option value="high">{{ i18n.ts._tms._features._pullToRefreshSensitivity.high }}</option>
</MkSelect>
<MkSwitch v-model="operationsForm.state.pullToRefreshAllReload">
<template #label>
<span>{{ i18n.ts._tms._features._pullToRefreshAllReload.label }}</span>
<span v-if="operationsForm.modifiedStates.pullToRefreshAllReload" class="_modified">{{ i18n.ts.modified }}</span>
</template>
<template #caption>{{ i18n.ts._tms._features._pullToRefreshAllReload.caption }}</template>
</MkSwitch>
<MkSwitch v-model="operationsForm.state.preventLongPressContextMenu">
<template #label>
<span>{{ i18n.ts._tms._features._preventLongPressContextMenu.label }}</span>
<span class="_beta">{{ i18n.ts.experimentalFeatures }}</span>
<span v-if="operationsForm.modifiedStates.preventLongPressContextMenu" class="_modified">{{ i18n.ts.modified }}</span>
</template>
<template #caption>{{ i18n.ts._tms._features._preventLongPressContextMenu.caption }}</template>
</MkSwitch>
</div>
</MkFolder>
</div>
</template>

<script lang="ts" setup>
import { i18n } from '@/i18n.js';
import { useForm } from '@/scripts/use-form.js';
import { tmsFlaskStore } from '@/tms/flask-store.js';
import { tmsStore } from '@/tms/store.js';
import MkFolder from '@/components/MkFolder.vue';
import MkFormFooter from '@/components/MkFormFooter.vue';
import MkInfo from '@/components/MkInfo.vue';
import MkSelect from '@/components/MkSelect.vue';
import MkSwitch from '@/components/MkSwitch.vue';

const appearancesForm = useForm({
tickerPosition: tmsStore.state.tickerPosition,
superMenuDisplayMode: tmsStore.state.superMenuDisplayMode,
}, async (state) => {
tmsStore.set('tickerPosition', state.tickerPosition);
tmsStore.set('superMenuDisplayMode', state.superMenuDisplayMode);
});

const operationsForm = useForm({
pullToRefreshSensitivity: tmsStore.state.pullToRefreshSensitivity,
pullToRefreshAllReload: tmsStore.state.pullToRefreshAllReload,
preventLongPressContextMenu: tmsFlaskStore.state.preventLongPressContextMenu,
}, async (state) => {
tmsStore.set('pullToRefreshSensitivity', state.pullToRefreshSensitivity);
tmsStore.set('pullToRefreshAllReload', state.pullToRefreshAllReload);
tmsFlaskStore.set('preventLongPressContextMenu', state.preventLongPressContextMenu);
});
</script>
38 changes: 38 additions & 0 deletions packages/frontend/src/pages/tms/features.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<MkStickyContainer>
<template #header><MkPageHeader/></template>
<template #default>
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="32">
<FormSuspense :p="ready">
<XFeaturesForm/>
</FormSuspense>
</MkSpacer>
</template>
</MkStickyContainer>
</template>

<script lang="ts" setup>
import { defineAsyncComponent } from 'vue';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
import { tmsFlaskStore } from '@/tms/flask-store.js';
import { tmsStore } from '@/tms/store.js';
import FormSuspense from '@/components/form/suspense.vue';

const ready = async () => {
await tmsStore.loaded;
await tmsFlaskStore.loaded;
};

const XFeaturesForm = defineAsyncComponent(() => import('@/pages/tms/features.form.vue'));

definePageMetadata(() => ({
title: i18n.ts._tms.taiymeFeatures,
icon: 'ti ti-settings',
}));
</script>
Loading
Loading