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(frontend): 投稿フォームの設定メニューを改良 #14804

Open
wants to merge 24 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1a2f1a5
enhance(frontend): 投稿フォームの設定メニューを改良
kakkokari-gtyih Oct 20, 2024
c43c7fe
Update Changelog
kakkokari-gtyih Oct 20, 2024
97fe272
Merge branch 'develop' into enh-14794
kakkokari-gtyih Oct 20, 2024
8697779
indent
kakkokari-gtyih Oct 20, 2024
61e7b20
Merge branch 'enh-14794' of https://github.com/kakkokari-gtyih/misske…
kakkokari-gtyih Oct 20, 2024
ce36797
MkMenuのitemを切り出して共通化
kakkokari-gtyih Oct 20, 2024
19ae55d
Merge branch 'develop' into enh-14794
kakkokari-gtyih Oct 20, 2024
d432997
remove unused expose
kakkokari-gtyih Oct 20, 2024
886b003
Merge branch 'develop' into enh-14794
kakkokari-gtyih Oct 21, 2024
4f5d58c
Merge branch 'develop' into enh-14794
kakkokari-gtyih Oct 21, 2024
f722ddd
fix: ドロワーなどのOptionが当たらない問題を修正
kakkokari-gtyih Oct 21, 2024
77d5f39
他のpopupMenuの項目選択時と挙動をあわせる
kakkokari-gtyih Oct 21, 2024
dd4e372
Merge branch 'develop' into enh-14794
kakkokari-gtyih Oct 25, 2024
cf58b4d
チュートリアルで詰む問題を修正
kakkokari-gtyih Oct 25, 2024
f712e3c
Merge branch 'develop' into enh-14794
kakkokari-gtyih Oct 25, 2024
94f2d18
Merge branch 'develop' into enh-14794
kakkokari-gtyih Oct 27, 2024
d7ca816
Merge branch 'develop' into enh-14794
kakkokari-gtyih Oct 28, 2024
e4dea52
Merge branch 'develop' into enh-14794
kakkokari-gtyih Nov 2, 2024
e5828ab
Merge branch 'develop' into enh-14794
kakkokari-gtyih Nov 15, 2024
58e552a
Merge branch 'develop' into enh-14794
kakkokari-gtyih Nov 15, 2024
5f2b909
Merge branch 'develop' into enh-14794
kakkokari-gtyih Nov 18, 2024
b67eb4f
Merge branch 'develop' into enh-14794
kakkokari-gtyih Nov 19, 2024
59fce45
Merge branch 'develop' into enh-14794
kakkokari-gtyih Nov 24, 2024
a1a0dac
Merge branch 'develop' into enh-14794
kakkokari-gtyih Jan 8, 2025
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
- Enhance: Bull DashboardでRelationship Queueの状態も確認できるように
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/751)
- Enhance: ドライブでソートができるように
- Enhance: 投稿フォームの設定メニューを改良
- 投稿フォームをリセットできるように
- 文字数カウントを復活

### Server
-
Expand Down
8 changes: 8 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5190,6 +5190,14 @@ export interface Locale extends ILocale {
* 名前に禁止されている文字列が含まれています。この名前を使用したい場合は、サーバー管理者にお問い合わせください。
*/
"yourNameContainsProhibitedWordsDescription": string;
/**
* 文字数
*/
"textCount": string;
/**
* リセット
*/
"reset": string;
"_abuseUserReport": {
/**
* 転送
Expand Down
2 changes: 2 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,8 @@ prohibitedWordsForNameOfUser: "禁止ワード(ユーザーの名前)"
prohibitedWordsForNameOfUserDescription: "このリストに含まれる文字列がユーザーの名前に含まれる場合、ユーザーの名前の変更を拒否します。モデレーター権限を持つユーザーはこの制限の影響を受けません。"
yourNameContainsProhibitedWords: "変更しようとした名前に禁止された文字列が含まれています"
yourNameContainsProhibitedWordsDescription: "名前に禁止されている文字列が含まれています。この名前を使用したい場合は、サーバー管理者にお問い合わせください。"
textCount: "文字数"
reset: "リセット"

_abuseUserReport:
forward: "転送"
Expand Down
49 changes: 29 additions & 20 deletions packages/frontend/src/components/MkPostForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
<div :class="$style.headerRight">
<template v-if="!(channel != null && fixed)">
<button v-if="channel == null" ref="visibilityButton" v-click-anime v-tooltip="i18n.ts.visibility" :class="['_button', $style.headerRightItem, $style.visibility]" @click="setVisibility">
<button v-if="channel == null" ref="visibilityButton" v-tooltip="i18n.ts.visibility" :class="['_button', $style.headerRightItem, $style.visibility]" @click="setVisibility">
<span v-if="visibility === 'public'"><i class="ti ti-world"></i></span>
<span v-if="visibility === 'home'"><i class="ti ti-home"></i></span>
<span v-if="visibility === 'followers'"><i class="ti ti-lock"></i></span>
Expand All @@ -32,15 +32,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<span :class="$style.headerRightButtonText">{{ channel.name }}</span>
</button>
</template>
<button v-click-anime v-tooltip="i18n.ts._visibility.disableFederation" class="_button" :class="[$style.headerRightItem, { [$style.danger]: localOnly }]" :disabled="channel != null || visibility === 'specified'" @click="toggleLocalOnly">
<button v-tooltip="i18n.ts._visibility.disableFederation" class="_button" :class="[$style.headerRightItem, { [$style.danger]: localOnly }]" :disabled="channel != null || visibility === 'specified'" @click="toggleLocalOnly">
<span v-if="!localOnly"><i class="ti ti-rocket"></i></span>
<span v-else><i class="ti ti-rocket-off"></i></span>
</button>
<button v-click-anime v-tooltip="i18n.ts.reactionAcceptance" class="_button" :class="[$style.headerRightItem, { [$style.danger]: reactionAcceptance === 'likeOnly' }]" @click="toggleReactionAcceptance">
<span v-if="reactionAcceptance === 'likeOnly'"><i class="ti ti-heart"></i></span>
<span v-else-if="reactionAcceptance === 'likeOnlyForRemote'"><i class="ti ti-heart-plus"></i></span>
<span v-else><i class="ti ti-icons"></i></span>
</button>
<button ref="otherSettingsButton" v-tooltip="i18n.ts.other" class="_button" :class="$style.headerRightItem" @click="showOtherSettings"><i class="ti ti-dots"></i></button>
<button v-click-anime class="_button" :class="$style.submit" :disabled="!canPost" data-cy-open-post-form-submit @click="post">
<div :class="$style.submitInner">
<template v-if="posted"></template>
Expand Down Expand Up @@ -174,6 +170,7 @@ const textareaEl = shallowRef<HTMLTextAreaElement | null>(null);
const cwInputEl = shallowRef<HTMLInputElement | null>(null);
const hashtagsInputEl = shallowRef<HTMLInputElement | null>(null);
const visibilityButton = shallowRef<HTMLElement>();
const otherSettingsButton = shallowRef<HTMLElement>();

const posting = ref(false);
const posted = ref(false);
Expand Down Expand Up @@ -527,20 +524,32 @@ async function toggleLocalOnly() {
}
}

async function toggleReactionAcceptance() {
const select = await os.select({
title: i18n.ts.reactionAcceptance,
items: [
{ value: null, text: i18n.ts.all },
{ value: 'likeOnlyForRemote' as const, text: i18n.ts.likeOnlyForRemote },
{ value: 'nonSensitiveOnly' as const, text: i18n.ts.nonSensitiveOnly },
{ value: 'nonSensitiveOnlyForLocalLikeOnlyForRemote' as const, text: i18n.ts.nonSensitiveOnlyForLocalLikeOnlyForRemote },
{ value: 'likeOnly' as const, text: i18n.ts.likeOnly },
],
default: reactionAcceptance.value,
function showOtherSettings() {
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkPostFormOtherMenu.vue')), {
currentReactionAcceptance: reactionAcceptance.value,
textLength: textLength.value,
src: otherSettingsButton.value,
}, {
changeReactionAcceptance: (value: Misskey.entities.Note['reactionAcceptance']) => {
reactionAcceptance.value = value;
},
reset: () => {
reset();
},
closed: () => dispose(),
});
if (select.canceled) return;
reactionAcceptance.value = select.result;
}

function reset() {
text.value = '';
cw.value = null;
useCw.value = false;
visibility.value = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
localOnly.value = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
files.value = [];
poll.value = null;
quoteId.value = null;
reactionAcceptance.value = defaultStore.state.reactionAcceptance;
}

function pushVisibleUser(user: Misskey.entities.UserDetailed) {
Expand Down
Loading
Loading