Skip to content

Commit

Permalink
feat: 通知で返信があるノートの親ノートを表示しないようにする設定を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Sep 22, 2023
1 parent 3339391 commit 887a6d5
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_CHERRYPICK.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
- 이미지를 업로드할 때 손실 압축으로 변경할 수 있음
- Feat: Scratchpad에서 Async: 계열 함수나 버튼 콜백 등의 오류에도 대화창을 띄우도록(시험적이라 Play 등에는 미구현) (misskey-dev/misskey#11850)
- Feat: 민감한 미디어를 돋보이게 하는 설정 추가 (misskey-dev/misskey#11851)
- Feat: 알림에서 답글이 달린 노트의 상위 노트를 표시하지 않도록 하는 설정 추가
- Spec: 사용자 정의 이모티콘 라이센스를 여러 항목으로 추가할 수 있도록 (MisskeyIO/misskey#130)
- Enhance: 새로운 신고가 있는 경우, 네비게이션 바의 제어판 아이콘과 제어판 페이지의 신고 섹션에 점을 표시
- Enhance: 스크롤 시 요소 표시 기능을 Friendly 이외의 UI에도 대응
Expand Down
1 change: 1 addition & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@ _cherrypick:
mobileTimelineHeaderChange: "Timeline header design change in mobile environment"
renameTheButtonInPostFormToNya: "Change the \"Note\" button on the note-posting form to \"Nyan!\""
renameTheButtonInPostFormToNyaDescription: "Outside of the note-posting form, they are still as \"Note\"."
showReplyInNotification: "Show parent note of notes with replies in notifications"
_displayHeaderNavBarWhenScroll:
all: "Display all"
hideHeaderOnly: "Hide header only"
Expand Down
1 change: 1 addition & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,7 @@ export interface Locale {
"mobileTimelineHeaderChange": string;
"renameTheButtonInPostFormToNya": string;
"renameTheButtonInPostFormToNyaDescription": string;
"showReplyInNotification": string;
};
"_displayHeaderNavBarWhenScroll": {
"all": string;
Expand Down
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,7 @@ _cherrypick:
mobileTimelineHeaderChange: "モバイル環境でタイムラインのヘッダーデザインを変更"
renameTheButtonInPostFormToNya: "ノート作成画面の「ノート」ボタンを「にゃ!」に変更する"
renameTheButtonInPostFormToNyaDescription: "にゃあにゃんにゃんにゃんにゃにゃん?"
showReplyInNotification: "通知で返信があるノートの親ノートを表示する"

_displayHeaderNavBarWhenScroll:
all: "全て表示"
Expand Down
1 change: 1 addition & 0 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ _cherrypick:
mobileTimelineHeaderChange: "모바일 환경에서 타임라인의 헤더 디자인을 변경"
renameTheButtonInPostFormToNya: "노트 작성 화면의 \"노트\" 버튼을 \"냥!\"으로 변경"
renameTheButtonInPostFormToNyaDescription: "냐앙냥냥냥냐냥?"
showReplyInNotification: "알림에서 답글이 달린 노트의 상위 노트 표시하기"
_displayHeaderNavBarWhenScroll:
all: "모두 표시"
hideHeaderOnly: "헤더만 숨기기"
Expand Down
10 changes: 7 additions & 3 deletions packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ SPDX-License-Identifier: AGPL-3.0-only
</span>
</div>
</div>
<MkNoteSub v-if="appearNote.reply && !renoteCollapsed" :note="appearNote.reply" :class="$style.replyTo"/>
<MkNoteSub v-if="appearNote.reply && !renoteCollapsed && notification && defaultStore.state.showReplyInNotification" :note="appearNote.reply" :class="$style.replyTo"/>
<MkNoteSub v-else-if="appearNote.reply && !renoteCollapsed && !notification" :note="appearNote.reply" :class="$style.replyTo"/>
<div v-if="renoteCollapsed" :class="$style.collapsedRenoteTarget">
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="$style.collapsedRenoteTargetAvatar" :user="appearNote.user" link preview/>
<Mfm :text="getNoteSummary(appearNote)" :plain="true" :nowrap="true" :author="appearNote.user" :class="$style.collapsedRenoteTargetText" @click="renoteCollapsed = false"/>
Expand Down Expand Up @@ -210,10 +211,13 @@ import { instance } from '@/instance.js';

let showEl = $ref(false);

const props = defineProps<{
const props = withDefaults(defineProps<{
note: Misskey.entities.Note;
pinned?: boolean;
}>();
notification?: boolean;
}>(), {
notification: false,
});

const inChannel = inject('inChannel', null);
const currentClip = inject<Ref<Misskey.entities.Clip> | null>('currentClip', null);
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkNotifications.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only

<template #default="{ items: notifications }">
<MkDateSeparatedList v-slot="{ item: notification }" :class="$style.list" :items="notifications" :noGap="!defaultStore.state.showGapBetweenNotesInTimeline || mainRouter.currentRoute.value.name !== 'my-notifications'">
<MkNote v-if="['reply', 'quote', 'mention'].includes(notification.type)" :key="notification.id" :note="notification.note"/>
<MkNote v-if="['reply', 'quote', 'mention'].includes(notification.type)" :key="notification.id" :note="notification.note" :notification="true"/>
<XNotification v-else :key="notification.id" :notification="notification" :withTime="true" :full="true" class="_panel notification"/>
</MkDateSeparatedList>
</template>
Expand Down
3 changes: 3 additions & 0 deletions packages/frontend/src/pages/settings/cherrypick.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts._cherrypick.renameTheButtonInPostFormToNya }}
<template #caption>{{ i18n.ts._cherrypick.renameTheButtonInPostFormToNyaDescription }}</template>
</MkSwitch>
<MkSwitch v-model="showReplyInNotification">{{ i18n.ts._cherrypick.showReplyInNotification }}</MkSwitch>
</div>
</FormSection>
</div>
Expand Down Expand Up @@ -94,11 +95,13 @@ const showFollowingMessageInsteadOfButtonEnabled = computed(defaultStore.makeGet
const mobileTimelineHeaderChange = computed(defaultStore.makeGetterSetter('mobileTimelineHeaderChange'));
const displayHeaderNavBarWhenScroll = computed(defaultStore.makeGetterSetter('displayHeaderNavBarWhenScroll'));
const renameTheButtonInPostFormToNya = computed(defaultStore.makeGetterSetter('renameTheButtonInPostFormToNya'));
const showReplyInNotification = computed(defaultStore.makeGetterSetter('showReplyInNotification'));

watch([
infoButtonForNoteActionsEnabled,
reactableRemoteReactionEnabled,
renameTheButtonInPostFormToNya,
showReplyInNotification,
], async () => {
await reloadAsk();
});
Expand Down
29 changes: 15 additions & 14 deletions packages/frontend/src/pages/settings/preferences-backups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,23 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
'showSubNoteFooterButton',
'enableHomeTimeline',
'enableLocalTimeline',
'enableMediaTimeline',
'enableSocialTimeline',
'enableCatTimeline',
'enableGlobalTimeline',
'enableListTimeline',
'enableAntennaTimeline',
'enableChannelTimeline',
'enableMediaTimeline',
'enableSocialTimeline',
'enableCatTimeline',
'enableGlobalTimeline',
'enableListTimeline',
'enableAntennaTimeline',
'enableChannelTimeline',
'useEnterToSend',
'postFormVisibilityHotkey',
'showRenoteConfirmPopup',
'displayHeaderNavBarWhenScroll',
'infoButtonForNoteActionsEnabled',
'reactableRemoteReactionEnabled',
'showFollowingMessageInsteadOfButtonEnabled',
'mobileTimelineHeaderChange',
'renameTheButtonInPostFormToNya',
'showRenoteConfirmPopup',
'displayHeaderNavBarWhenScroll',
'infoButtonForNoteActionsEnabled',
'reactableRemoteReactionEnabled',
'showFollowingMessageInsteadOfButtonEnabled',
'mobileTimelineHeaderChange',
'renameTheButtonInPostFormToNya',
'showReplyInNotification',
];
const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [
'lightTheme',
Expand Down
4 changes: 4 additions & 0 deletions packages/frontend/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'account',
default: false,
},
showReplyInNotification: {
where: 'device',
default: false,
},

// - etc
friendlyEnableNotifications: {
Expand Down

0 comments on commit 887a6d5

Please sign in to comment.