Skip to content

Commit

Permalink
feat: 답글 대상 노트의 반투명 옵션을 선택할 수 있음 (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Oct 1, 2024
1 parent e4b2da4 commit 3155f3b
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_CHERRYPICK.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2024xx](CHANGE
- Feat: 사용자 메뉴에서 원격 서버를 관리할 수 있음 (kokonect-link/cherrypick#502)
- 서버 차단, 서버 사일런스, 서버 미디어 사일런스
- Feat: 노트 동작 버튼을 개인화할 수 있음 (kokonect-link/cherrypick#501)
- Feat: 답글 대상 노트의 반투명 옵션을 선택할 수 있음 (kokonect-link/cherrypick#495)
- Enhance: CherryPick 업데이트 페이지를 제어판 목록에 추가함
- Enhance: Webhook 추가 버튼을 헤더로 이동해 디자인 개선
- Enhance: 노트 번역 영역에서도 이모지를 눌러 이모지 메뉴를 열 수 있음
Expand Down
1 change: 1 addition & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
_lang_: "English"
showReplyTargetNoteInSemiTransparent: "Show reply target note in semi-transparent"
noteFooterButton: "Show action buttons in notes"
collapseReplies: "Collapse notes written in reply"
collapseRepliesDescription: "Collapse and displays notes written as replies.\nReacted notes are not affected."
Expand Down
4 changes: 4 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export interface Locale extends ILocale {
* 日本語
*/
"_lang_": string;
/**
* 返信対象ノートを半透明に表示
*/
"showReplyTargetNoteInSemiTransparent": string;
/**
* ノートにアクションボタンを表示
*/
Expand Down
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
_lang_: "日本語"

showReplyTargetNoteInSemiTransparent: "返信対象ノートを半透明に表示"
noteFooterButton: "ノートにアクションボタンを表示"
collapseReplies: "返信のリノートのスマート省略"
collapseRepliesDescription: "返信で作成されたノートをたたんで表示します。\nリアクションしたノートは影響を受けません。"
Expand Down
1 change: 1 addition & 0 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
_lang_: "한국어"
showReplyTargetNoteInSemiTransparent: "답글 대상 노트를 반투명하게 표시"
noteFooterButton: "노트 동작 버튼"
collapseReplies: "답글로 작성된 노트 간략화하기"
collapseRepliesDescription: "답글로 작성된 노트를 접어서 표시해요.\n리액션한 노트는 영향을 받지 않아요."
Expand Down
14 changes: 10 additions & 4 deletions packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
<MkNoteSub v-if="appearNote.reply && !renoteCollapsed && !replyCollapsed && notification && defaultStore.state.showReplyInNotification" :note="appearNote.reply" :class="$style.replyTo"/>
<MkNoteSub v-else-if="appearNote.reply && !renoteCollapsed && !replyCollapsed && !notification" :note="appearNote.reply" :class="$style.replyTo"/>
<MkNoteSub v-else-if="appearNote.reply && !renoteCollapsed && !replyCollapsed && !notification" :note="appearNote.reply" :class="[$style.replyTo, { [$style.showReplyTargetNoteInSemiTransparent]: defaultStore.state.showReplyTargetNoteInSemiTransparent }]"/>
<div v-if="renoteCollapsed || replyCollapsed" :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" :nyaize="'respect'" :class="$style.collapsedRenoteTargetText" @click="renoteCollapsed ? renoteCollapsed = false : replyCollapsed ? replyCollapsed = false : ''"/>
<Mfm :text="getNoteSummary(appearNote)" :plain="true" :nowrap="true" :author="appearNote.user" :nyaize="'respect'" :class="[$style.collapsedRenoteTargetText, { [$style.showReplyTargetNoteInSemiTransparent]: defaultStore.state.showReplyTargetNoteInSemiTransparent }]" @click="renoteCollapsed ? renoteCollapsed = false : replyCollapsed ? replyCollapsed = false : ''"/>
</div>
<article v-else :class="$style.article" :style="{ cursor: expandOnNoteClick ? 'pointer' : '', paddingTop: defaultStore.state.showSubNoteFooterButton && appearNote.reply && (!renoteCollapsed && !replyCollapsed) ? '14px' : '' }" @click.stop="noteClick" @dblclick.stop="noteDblClick" @contextmenu.stop="onContextmenu">
<div style="display: flex; padding-bottom: 10px;">
Expand Down Expand Up @@ -925,8 +925,11 @@ function emitUpdReaction(emoji: string, delta: number) {
}
.replyTo {
opacity: 0.7;
padding-bottom: 0;
&.showReplyTargetNoteInSemiTransparent {
opacity: 0.7;
}
}
.renote {
Expand Down Expand Up @@ -1010,12 +1013,15 @@ function emitUpdReaction(emoji: string, delta: number) {
text-overflow: ellipsis;
white-space: nowrap;
font-size: 90%;
opacity: 0.7;
cursor: pointer;
&:hover {
text-decoration: underline;
}
&.showReplyTargetNoteInSemiTransparent {
opacity: 0.7;
}
}
.article {
Expand Down
7 changes: 5 additions & 2 deletions packages/frontend/src/components/MkNoteDetailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
<template v-if="appearNote.reply && appearNote.reply.replyId"><MkNoteSub v-for="note in conversation" :key="note.id" :class="$style.replyToMore" :note="note"/></template>
<MkNoteSub v-if="appearNote.reply" :note="appearNote.reply" :class="$style.replyTo"/>
<MkNoteSub v-if="appearNote.reply" :note="appearNote.reply" :class="[$style.replyTo, { [$style.showReplyTargetNoteInSemiTransparent]: defaultStore.state.showReplyTargetNoteInSemiTransparent }]"/>
<article :class="$style.note" :style="{ paddingTop: defaultStore.state.showSubNoteFooterButton && appearNote.reply ? '14px' : '' }" @contextmenu.stop="onContextmenu">
<header :class="$style.noteHeader">
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="$style.noteHeaderAvatar" :user="appearNote.user" indicator link preview/>
Expand Down Expand Up @@ -800,8 +800,11 @@ onMounted(() => {
}
.replyTo {
opacity: 0.7;
padding-bottom: 0;
&.showReplyTargetNoteInSemiTransparent {
opacity: 0.7;
}
}
.replyToMore {
Expand Down
3 changes: 3 additions & 0 deletions packages/frontend/src/pages/settings/general.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="showFixedPostFormInReplies">{{ i18n.ts.showFixedPostFormInReplies }}<template #caption>{{ i18n.ts.showFixedPostFormInRepliesDescription }}</template> <span class="_beta">CherryPick</span></MkSwitch>
<MkSwitch v-model="allMediaNoteCollapse">{{ i18n.ts.allMediaNoteCollapse }} <span class="_beta">CherryPick</span></MkSwitch>
<MkSwitch v-model="alwaysShowCw">{{ i18n.ts.alwaysShowCw }} <span class="_beta">CherryPick</span></MkSwitch>
<MkSwitch v-model="showReplyTargetNoteInSemiTransparent">{{ i18n.ts.showReplyTargetNoteInSemiTransparent }} <span class="_beta">CherryPick</span></MkSwitch>
</div>

<div class="_gaps_s" style="margin: 0 10px;">
Expand Down Expand Up @@ -483,6 +484,7 @@ const showFixedPostFormInReplies = computed(defaultStore.makeGetterSetter('showF
const showingAnimatedImages = computed(defaultStore.makeGetterSetter('showingAnimatedImages'));
const allMediaNoteCollapse = computed(defaultStore.makeGetterSetter('allMediaNoteCollapse'));
const alwaysShowCw = computed(defaultStore.makeGetterSetter('alwaysShowCw'));
const showReplyTargetNoteInSemiTransparent = computed(defaultStore.makeGetterSetter('showReplyTargetNoteInSemiTransparent'));
const nsfwOpenBehavior = computed(defaultStore.makeGetterSetter('nsfwOpenBehavior'));
const renoteVisibilitySelection = computed(defaultStore.makeGetterSetter('renoteVisibilitySelection'));
const forceRenoteVisibilitySelection = computed(defaultStore.makeGetterSetter('forceRenoteVisibilitySelection'));
Expand Down Expand Up @@ -568,6 +570,7 @@ watch([
renoteQuoteButtonSeparation,
allMediaNoteCollapse,
alwaysShowCw,
showReplyTargetNoteInSemiTransparent,
showReplyButtonInNoteFooter,
showRenoteButtonInNoteFooter,
showLikeButtonInNoteFooter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
'showFixedPostFormInReplies',
'allMediaNoteCollapse',
'alwaysShowCw',
'showReplyTargetNoteInSemiTransparent',
'nsfwOpenBehavior',
'removeModalBgColorForBlur',
'nicknameEnabled',
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 @@ -610,6 +610,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: false,
},
showReplyTargetNoteInSemiTransparent: {
where: 'device',
default: true,
},
nsfwOpenBehavior: {
where: 'device',
default: 'click' as 'click' | 'doubleClick',
Expand Down

0 comments on commit 3155f3b

Please sign in to comment.