merge: feat: add an option to collapse replies (!545)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/545 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <marie@kaifa.ch>
This commit is contained in:
commit
a22450d4f3
6 changed files with 81 additions and 10 deletions
|
|
@ -12,7 +12,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
:class="[$style.root, { [$style.showActionsOnlyHover]: defaultStore.state.showNoteActionsOnlyHover }]"
|
||||
:tabindex="!isDeleted ? '-1' : undefined"
|
||||
>
|
||||
<MkNoteSub v-if="appearNote.reply && !renoteCollapsed" :note="appearNote.reply" :class="$style.replyTo"/>
|
||||
<div v-if="appearNote.reply && inReplyToCollapsed" :class="$style.collapsedInReplyTo">
|
||||
<MkAvatar :class="$style.collapsedInReplyToAvatar" :user="appearNote.reply.user" link preview/>
|
||||
<MkA v-user-preview="note.user.id" :class="$style.name" :to="userPage(note.user)">
|
||||
<MkAcct :user="appearNote.reply.user"/>
|
||||
</MkA>:
|
||||
<Mfm :text="getNoteSummary(appearNote.reply)" :plain="true" :nowrap="true" :author="appearNote.reply.user" :nyaize="'respect'" :class="$style.collapsedInReplyToText" @click="inReplyToCollapsed = false"/>
|
||||
</div>
|
||||
<MkNoteSub v-if="appearNote.reply && !renoteCollapsed && !inReplyToCollapsed" :note="appearNote.reply" :class="$style.replyTo"/>
|
||||
<div v-if="pinned" :class="$style.tip"><i class="ph-push-pin ph-bold ph-lg"></i> {{ i18n.ts.pinnedNote }}</div>
|
||||
<!--<div v-if="appearNote._prId_" class="tip"><i class="ph-megaphone ph-bold ph-lg"></i> {{ i18n.ts.promotion }}<button class="_textButton hide" @click="readPromo()">{{ i18n.ts.hideThisNote }} <i class="ph-x ph-bold ph-lg"></i></button></div>-->
|
||||
<!--<div v-if="appearNote._featuredId_" class="tip"><i class="ph-lightning ph-bold ph-lg"></i> {{ i18n.ts.featured }}</div>-->
|
||||
|
|
@ -44,7 +51,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</div>
|
||||
<div v-if="renoteCollapsed" :class="$style.collapsedRenoteTarget">
|
||||
<MkAvatar :class="$style.collapsedRenoteTargetAvatar" :user="appearNote.user" link preview/>
|
||||
<Mfm :text="getNoteSummary(appearNote)" :isBlock="true" :plain="true" :nowrap="true" :author="appearNote.user" :nyaize="'respect'" :class="$style.collapsedRenoteTargetText" @click="renoteCollapsed = false"/>
|
||||
<Mfm :text="getNoteSummary(appearNote)" :isBlock="true" :plain="true" :nowrap="true" :author="appearNote.user" :nyaize="'respect'" :class="$style.collapsedRenoteTargetText" @click="renoteCollapsed = false; inReplyToCollapsed = false"/>
|
||||
</div>
|
||||
<article v-else :class="$style.article" @contextmenu.stop="onContextmenu">
|
||||
<div v-if="appearNote.channel" :class="$style.colorBar" :style="{ background: appearNote.channel.color }"></div>
|
||||
|
|
@ -310,6 +317,7 @@ const renoteCollapsed = ref(
|
|||
(appearNote.value.myReaction != null)
|
||||
)
|
||||
);
|
||||
const inReplyToCollapsed = ref(defaultStore.state.collapseNotesRepliedTo);
|
||||
const defaultLike = computed(() => defaultStore.state.like ? defaultStore.state.like : null);
|
||||
const animated = computed(() => parsed.value ? checkAnimationFromMfm(parsed.value) : null);
|
||||
const allowAnim = ref(defaultStore.state.advancedMfm && defaultStore.state.animatedMfm ? true : false);
|
||||
|
|
@ -923,7 +931,7 @@ function emitUpdReaction(emoji: string, delta: number) {
|
|||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.collapsedRenoteTarget {
|
||||
.collapsedRenoteTarget, .collapsedInReplyTo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 28px;
|
||||
|
|
@ -931,7 +939,12 @@ function emitUpdReaction(emoji: string, delta: number) {
|
|||
padding: 0 32px 18px;
|
||||
}
|
||||
|
||||
.collapsedRenoteTargetAvatar {
|
||||
.collapsedInReplyTo {
|
||||
padding: 28px 32px 0;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.collapsedRenoteTargetAvatar, .collapsedInReplyToAvatar {
|
||||
flex-shrink: 0;
|
||||
display: inline-block;
|
||||
width: 28px;
|
||||
|
|
@ -940,12 +953,15 @@ function emitUpdReaction(emoji: string, delta: number) {
|
|||
}
|
||||
|
||||
.collapsedRenoteTargetText {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.collapsedRenoteTargetText, .collapsedInReplyToText {
|
||||
overflow: hidden;
|
||||
flex-shrink: 1;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 90%;
|
||||
opacity: 0.7;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
|
|
@ -1158,6 +1174,10 @@ function emitUpdReaction(emoji: string, delta: number) {
|
|||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.collapsedInReplyTo {
|
||||
padding: 14px 16px 0;
|
||||
}
|
||||
|
||||
.article {
|
||||
padding: 14px 16px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue