enhance(client): MkNoteのリアクションの表示数は16に制限 (#9841)

* enhance(client): MkNoteのリアクションの表示数は16に制限・リアクションの横の?ボタンでリアクション詳細

* info-circleにする

* - Layout Shiftが起こらないように
- 自分のリアクションは必ずつける

* https://github.com/misskey-dev/misskey/pull/9841#issuecomment-1423786235

* remove logger

* refactor

* refactor

Co-authored-by: acid-chicken <root@acid-chicken.com>

* Revert "https://github.com/misskey-dev/misskey/pull/9841#issuecomment-1423786235"

This reverts commit ec1315b1fb207e0c5b2a5f2f4a00de7379c7a29b.

* wip

* wip

* 🎨

* fix

* fix

* fix

* 🎨

* wip

* remove extras from MkNoteDetailed

* もっと!

* no v-if

* dashed

---------

Co-authored-by: acid-chicken <root@acid-chicken.com>
This commit is contained in:
tamaina 2023-02-11 13:05:36 +09:00 committed by GitHub
parent 3004fe573d
commit 6f33be6c75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 76 additions and 12 deletions

View file

@ -5,7 +5,7 @@
ref="el"
v-hotkey="keymap"
:class="$style.root"
:tabindex="!isDeleted ? '-1' : null"
:tabindex="!isDeleted ? '-1' : undefined"
>
<MkNoteSub v-if="appearNote.reply && !renoteCollapsed" :note="appearNote.reply" :class="$style.replyTo"/>
<div v-if="pinned" :class="$style.tip"><i class="ti ti-pin"></i> {{ i18n.ts.pinnedNote }}</div>
@ -77,7 +77,13 @@
<MkA v-if="appearNote.channel && !inChannel" :class="$style.channel" :to="`/channels/${appearNote.channel.id}`"><i class="ti ti-device-tv"></i> {{ appearNote.channel.name }}</MkA>
</div>
<footer :class="$style.footer">
<MkReactionsViewer :note="appearNote"/>
<MkReactionsViewer :note="appearNote" :max-number="16">
<template v-slot:more>
<button class="_button" :class="$style.reactionDetailsButton" @click="showReactions">
{{ i18n.ts.more }}
</button>
</template>
</MkReactionsViewer>
<button :class="$style.footerButton" class="_button" @click="reply()">
<i class="ti ti-arrow-back-up"></i>
<p v-if="appearNote.repliesCount > 0" :class="$style.footerButtonCount">{{ appearNote.repliesCount }}</p>
@ -120,7 +126,7 @@
</template>
<script lang="ts" setup>
import { computed, inject, onMounted, onUnmounted, reactive, ref, shallowRef, Ref } from 'vue';
import { computed, inject, onMounted, onUnmounted, reactive, ref, shallowRef, Ref, defineAsyncComponent } from 'vue';
import * as mfm from 'mfm-js';
import * as misskey from 'misskey-js';
import MkNoteSub from '@/components/MkNoteSub.vue';
@ -196,7 +202,7 @@ const isLong = (appearNote.cw == null && appearNote.text != null && (
const collapsed = ref(appearNote.cw == null && isLong);
const isDeleted = ref(false);
const muted = ref(checkWordMute(appearNote, $i, defaultStore.state.mutedWords));
const translation = ref(null);
const translation = ref<any>(null);
const translating = ref(false);
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance);
const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || appearNote.userId === $i.id);
@ -361,6 +367,12 @@ function readPromo() {
});
isDeleted.value = true;
}
function showReactions(): void {
os.popup(defineAsyncComponent(() => import('@/components/MkReactedUsersDialog.vue')), {
noteId: appearNote.id,
}, {}, 'closed');
}
</script>
<style lang="scss" module>
@ -697,4 +709,19 @@ function readPromo() {
text-align: center;
opacity: 0.7;
}
.reactionDetailsButton {
display: inline-block;
height: 32px;
margin: 2px;
padding: 0 6px;
border: dashed 1px var(--divider);
border-radius: 4px;
background: transparent;
opacity: .8;
&:hover {
background: var(--X5);
}
}
</style>