Skip to content

Commit

Permalink
Merge pull request #83 from hideki0403/dev-kakurega
Browse files Browse the repository at this point in the history
release: v2023.10.0-kakurega.1.20.0
  • Loading branch information
hideki0403 authored Oct 11, 2023
2 parents 0701ca6 + db74924 commit d8420cb
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG_KAKUREGA.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.20.0
Release: 2023/10/11
Base: 2023.10.0

### 新機能
- 以前に設定していたソフトワードミュートを表示できるように
- 「○○が何か言いました」を表示しないようにできる機能を追加

## 1.19.3
Release: 2023/09/26
Base: 2023.9.1
Expand Down
3 changes: 3 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,9 @@ export interface Locale {
"privacyPolicy": string;
"privacyPolicyUrl": string;
"tosAndPrivacyPolicy": string;
"showOldMuteWords": string;
"showMutedInfo": string;
"showMutedInfoDescription": string;
"_announcement": {
"forExistingUsers": string;
"forExistingUsersDescription": string;
Expand Down
3 changes: 3 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,9 @@ impressumDescription: "ドイツなどの一部の国と地域では表示が義
privacyPolicy: "プライバシーポリシー"
privacyPolicyUrl: "プライバシーポリシーURL"
tosAndPrivacyPolicy: "利用規約・プライバシーポリシー"
showOldMuteWords: "ソフトワードミュートに設定していた情報を表示する"
showMutedInfo: "「○○が何か言いました」を表示する"
showMutedInfoDescription: "オンにすると以前のソフトミュートと同様の挙動になります。オフで以前のハードミュートの挙動になります。"

_announcement:
forExistingUsers: "既存ユーザーのみ"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "2023.10.0-kakurega.1.19.3",
"version": "2023.10.0-kakurega.1.20.0",
"codename": "nasubi",
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</article>
</div>
<div v-else :class="$style.muted" @click="hideNote = false">
<div v-else-if="!muted || showMutedInfo" :class="$style.muted" @click="hideNote = false">
<I18n :src="i18n.ts.userSaysSomething" tag="small">
<template #name>
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
Expand Down Expand Up @@ -221,6 +221,7 @@ const translation = ref<any>(null);
const translating = ref(false);
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance);
const tickerStyle = defaultStore.state.instanceTickerStyle;
const showMutedInfo = defaultStore.state.showMutedInfo;
const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || (appearNote.visibility === 'followers' && appearNote.userId === $i.id));
let renoteCollapsed = $ref(isRenote && checkCollapseRenote(appearNote, note, $i));
Expand Down
39 changes: 32 additions & 7 deletions packages/frontend/src/pages/settings/mute-block.word-mute.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,33 @@ SPDX-License-Identifier: AGPL-3.0-only

<template>
<div class="_gaps_m">
<MkButton v-if="oldMutedWords" inline rounded @click="showOldMuteWords()">{{ i18n.ts.showOldMuteWords }}</MkButton>
<div>
<MkTextarea v-model="mutedWords">
<span>{{ i18n.ts._wordMute.muteWords }}</span>
<template #caption>{{ i18n.ts._wordMute.muteWordsDescription }}<br>{{ i18n.ts._wordMute.muteWordsDescription2 }}</template>
</MkTextarea>
</div>
<MkButton primary inline :disabled="!changed" @click="save()"><i class="ti ti-device-floppy"></i> {{ i18n.ts.save }}</MkButton>
<MkSwitch v-model="showMutedInfo">
<template #label>{{ i18n.ts.showMutedInfo }}</template>
<template #caption>{{ i18n.ts.showMutedInfoDescription }}</template>
</MkSwitch>
</div>
</template>

<script lang="ts" setup>
import { ref, watch } from 'vue';
import { computed, ref, watch } from 'vue';
import MkTextarea from '@/components/MkTextarea.vue';
import MkKeyValue from '@/components/MkKeyValue.vue';
import MkButton from '@/components/MkButton.vue';
import MkInfo from '@/components/MkInfo.vue';
import MkTab from '@/components/MkTab.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import { unisonReload } from '@/scripts/unison-reload.js';
import * as os from '@/os.js';
import number from '@/filters/number.js';
import { defaultStore } from '@/store.js';
import { $i } from '@/account.js';
import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js';
const render = (mutedWords) => mutedWords.map(x => {
const render = (mutedWords: string[][]) => mutedWords.map(x => {
if (Array.isArray(x)) {
return x.join(' ');
} else {
Expand All @@ -39,12 +41,18 @@ const render = (mutedWords) => mutedWords.map(x => {
const tab = ref('soft');
const mutedWords = ref(render($i!.mutedWords));
const oldMutedWords = ref(render(defaultStore.state.mutedWords));
const changed = ref(false);
const showMutedInfo = computed(defaultStore.makeGetterSetter('showMutedInfo'));
watch(mutedWords, () => {
changed.value = true;
});
watch(showMutedInfo, async () => {
await apply();
});
async function save() {
const parseMutes = (mutes) => {
// split into lines, remove empty lines and unnecessary whitespace
Expand Down Expand Up @@ -91,4 +99,21 @@ async function save() {
changed.value = false;
}
async function showOldMuteWords() {
os.alert({
type: 'info',
text: oldMutedWords.value,
});
}
async function apply() {
const { canceled } = await os.confirm({
type: 'info',
text: i18n.ts.reloadToApplySetting,
});
if (canceled) return;
unisonReload();
}
</script>
8 changes: 8 additions & 0 deletions packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,18 @@ export const defaultStore = markRaw(new Storage('base', {
userList: null as Misskey.entities.UserList | null,
},
},
mutedWords: {
where: 'account',
default: [],
},
mutedInstancesGtl: {
where: 'account',
default: [] as string[],
},
showMutedInfo: {
where: 'account',
default: true,
},
pinnedUserLists: {
where: 'deviceAccount',
default: [] as Misskey.entities.UserList[],
Expand Down

0 comments on commit d8420cb

Please sign in to comment.