expand all user/instance mutes when viewing a user's profile
This commit is contained in:
parent
ca9410e4fe
commit
40695c7925
5 changed files with 20 additions and 7 deletions
|
|
@ -14,12 +14,13 @@ Displays a note with either Misskey or Sharkey style, based on user preference.
|
|||
:withHardMute="withHardMute"
|
||||
@reaction="emoji => emit('reaction', emoji)"
|
||||
@removeReaction="emoji => emit('removeReaction', emoji)"
|
||||
@expandCW="n => emit('expandCW', n)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { computed, defineAsyncComponent, useTemplateRef } from 'vue';
|
||||
import { defineAsyncComponent, useTemplateRef } from 'vue';
|
||||
import type { ComponentExposed } from 'vue-component-type-helpers';
|
||||
import type MkNote from '@/components/MkNote.vue';
|
||||
import type SkNote from '@/components/SkNote.vue';
|
||||
|
|
@ -27,9 +28,8 @@ import { prefer } from '@/preferences';
|
|||
|
||||
const XNote = defineAsyncComponent(() =>
|
||||
prefer.s.noteDesign === 'misskey'
|
||||
? import('@/components/MkNote.vue')
|
||||
: import('@/components/SkNote.vue')
|
||||
);
|
||||
? import('@/components/MkNote.vue')
|
||||
: import('@/components/SkNote.vue'));
|
||||
|
||||
const rootEl = useTemplateRef<ComponentExposed<typeof MkNote | typeof SkNote>>('rootEl');
|
||||
|
||||
|
|
@ -45,5 +45,6 @@ defineProps<{
|
|||
const emit = defineEmits<{
|
||||
(ev: 'reaction', emoji: string): void;
|
||||
(ev: 'removeReaction', emoji: string): void;
|
||||
(ev: 'expandCW', note: Misskey.entities.Note): void;
|
||||
}>();
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
:withHardMute="withHardMute"
|
||||
:class="[$style.root, { [$style.showActionsOnlyHover]: prefer.s.showNoteActionsOnlyHover, [$style.skipRender]: prefer.s.skipNoteRender }]"
|
||||
:tabindex="isDeleted ? '-1' : '0'"
|
||||
@expand="n => emit('expandCW', n)"
|
||||
>
|
||||
<div v-if="appearNote.reply && inReplyToCollapsed" :class="$style.collapsedInReplyTo">
|
||||
<MkAvatar :class="$style.collapsedInReplyToAvatar" :user="appearNote.reply.user" link preview/>
|
||||
|
|
@ -244,6 +245,7 @@ provide(DI.mock, props.mock);
|
|||
const emit = defineEmits<{
|
||||
(ev: 'reaction', emoji: string): void;
|
||||
(ev: 'removeReaction', emoji: string): void;
|
||||
(ev: 'expandCW', note: Misskey.entities.Note): void;
|
||||
}>();
|
||||
|
||||
const router = useRouter();
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ Displays a note in the Sharkey style. Used to show the "main" note in a given co
|
|||
:withHardMute="withHardMute"
|
||||
:class="[$style.root, { [$style.showActionsOnlyHover]: prefer.s.showNoteActionsOnlyHover, [$style.skipRender]: prefer.s.skipNoteRender }]"
|
||||
:tabindex="isDeleted ? '-1' : '0'"
|
||||
@expand="n => emit('expandCW', n)"
|
||||
>
|
||||
<SkNoteSub v-if="appearNote.reply" v-show="!renoteCollapsed && !inReplyToCollapsed" :note="appearNote.reply" :class="$style.replyTo"/>
|
||||
<div v-if="appearNote.reply && inReplyToCollapsed && !renoteCollapsed" :class="$style.collapsedInReplyTo">
|
||||
|
|
@ -245,6 +246,7 @@ provide(DI.mock, props.mock);
|
|||
const emit = defineEmits<{
|
||||
(ev: 'reaction', emoji: string): void;
|
||||
(ev: 'removeReaction', emoji: string): void;
|
||||
(ev: 'expandCW', note: Misskey.entities.Note): void;
|
||||
}>();
|
||||
|
||||
const router = useRouter();
|
||||
|
|
|
|||
|
|
@ -176,10 +176,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkResult type="empty" :text="i18n.ts.noNotes"/>
|
||||
</div>
|
||||
<div v-else class="_panel">
|
||||
<DynamicNote v-for="note of user.pinnedNotes" :key="note.id" class="note" :class="$style.pinnedNote" :note="note" :pinned="true"/>
|
||||
<DynamicNote v-for="note of user.pinnedNotes" :key="note.id" class="note" :class="$style.pinnedNote" :note="note" :pinned="true" @expandCW="onExpandCW"/>
|
||||
</div>
|
||||
</div>
|
||||
<MkNotes v-else :class="$style.tl" :noGap="true" :pagination="AllPagination"/>
|
||||
<MkNotes v-else :class="$style.tl" :noGap="true" :pagination="AllPagination" @expandCW="onExpandCW"/>
|
||||
</MkLazy>
|
||||
</MkStickyContainer>
|
||||
</div>
|
||||
|
|
@ -198,6 +198,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
import { defineAsyncComponent, computed, onMounted, onUnmounted, nextTick, watch, ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { getScrollPosition } from '@@/js/scroll.js';
|
||||
import { patchMuteOverrides } from '@/utility/check-word-mute.js';
|
||||
import MkTab from '@/components/MkTab.vue';
|
||||
import MkNotes from '@/components/MkNotes.vue';
|
||||
import MkFollowButton from '@/components/MkFollowButton.vue';
|
||||
|
|
@ -255,6 +256,14 @@ const emit = defineEmits<{
|
|||
(ev: 'unfoldFiles'): void;
|
||||
}>();
|
||||
|
||||
const cwOverrides = patchMuteOverrides();
|
||||
|
||||
function onExpandCW() {
|
||||
// This kills the user-level and instance-level CWs for all notes below this point
|
||||
cwOverrides.userMandatoryCW = null;
|
||||
cwOverrides.instanceMandatoryCW = null;
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const user = ref(props.user);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ export interface Mute {
|
|||
noteMuted?: boolean;
|
||||
|
||||
noteMandatoryCW?: string | null;
|
||||
// TODO show this as a single block on user timelines
|
||||
userMandatoryCW?: string | null;
|
||||
instanceMandatoryCW?: string | null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue