summaryrefslogtreecommitdiff
path: root/packages/frontend/src/pages/note.vue
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-05-09 17:40:08 +0900
committerGitHub <noreply@github.com>2025-05-09 17:40:08 +0900
commit8c2ab25e5f2040fcbc81bc2a02a279fed40e1c11 (patch)
treeae0d3573bd5a3175bc6174d33129dc64205a1436 /packages/frontend/src/pages/note.vue
parentrefactor (diff)
downloadmisskey-8c2ab25e5f2040fcbc81bc2a02a279fed40e1c11.tar.gz
misskey-8c2ab25e5f2040fcbc81bc2a02a279fed40e1c11.tar.bz2
misskey-8c2ab25e5f2040fcbc81bc2a02a279fed40e1c11.zip
Feat: No websocket mode (#15851)
* wip * wip * wip * wip * Update MkTimeline.vue * wip * wip * wip * Update MkTimeline.vue * Update use-pagination.ts * wip * wip * Update MkTimeline.vue * Update MkTimeline.vue * wip * wip * Update MkTimeline.vue * Update MkTimeline.vue * Update MkTimeline.vue * wip * Update use-pagination.ts * wip * Update use-pagination.ts * Update MkNotifications.vue * Update MkNotifications.vue * wip * wip * wip * Update use-note-capture.ts * Update use-note-capture.ts * Update use-note-capture.ts * wip * wip * wip * wip * Update MkNoteDetailed.vue * wip * wip * Update MkTimeline.vue * wip * fix * Update MkTimeline.vue * wip * test * Revert "test" This reverts commit 3375619396c54dcda5e564eb1da444c2391208c9. * Update use-pagination.ts * test * Revert "test" This reverts commit 42c53c830e28485d2fb49061fa7cdeee31bc6a22. * test * Revert "test" This reverts commit c4f8cda4aa1cec9d1eb97557145f3ad3d2d0e469. * Update style.scss * Update MkTimeline.vue * Update MkTimeline.vue * Update MkTimeline.vue * ✌️ * Update MkTimeline.vue * wip * wip * test * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * Update MkTimeline.vue * wip * tweak navbar * wip * wip * wip * wip * wip * wip * wip * Update home.vue * wip * refactor * wip * wip * Update note.vue * Update navbar.vue * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * wip * Update MkStreamingNotificationsTimeline.vue * Update use-pagination.ts * wip * improve perf * wip * Update MkNotesTimeline.vue * wip * megre * Update use-pagination.ts * Update use-pagination.ts * Update MkStreamingNotesTimeline.vue * Update use-pagination.ts * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md
Diffstat (limited to 'packages/frontend/src/pages/note.vue')
-rw-r--r--packages/frontend/src/pages/note.vue79
1 files changed, 39 insertions, 40 deletions
diff --git a/packages/frontend/src/pages/note.vue b/packages/frontend/src/pages/note.vue
index 0f1dbc4432..68a009f648 100644
--- a/packages/frontend/src/pages/note.vue
+++ b/packages/frontend/src/pages/note.vue
@@ -6,42 +6,40 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<PageWithHeader :actions="headerActions" :tabs="headerTabs">
<div class="_spacer" style="--MI_SPACER-w: 800px;">
- <div>
- <Transition :name="prefer.s.animation ? 'fade' : ''" mode="out-in">
- <div v-if="note">
- <div v-if="showNext" class="_margin">
- <MkNotes class="" :pagination="showNext === 'channel' ? nextChannelPagination : nextUserPagination" :noGap="true" :disableAutoLoad="true"/>
- </div>
+ <Transition :name="prefer.s.animation ? 'fade' : ''" mode="out-in">
+ <div v-if="note">
+ <div v-if="showNext" class="_margin">
+ <MkNotesTimeline :pullToRefresh="false" class="" :pagination="showNext === 'channel' ? nextChannelPagination : nextUserPagination" :noGap="true" :disableAutoLoad="true"/>
+ </div>
- <div class="_margin">
- <div v-if="!showNext" class="_buttons" :class="$style.loadNext">
- <MkButton v-if="note.channelId" rounded :class="$style.loadButton" @click="showNext = 'channel'"><i class="ti ti-chevron-up"></i> <i class="ti ti-device-tv"></i></MkButton>
- <MkButton rounded :class="$style.loadButton" @click="showNext = 'user'"><i class="ti ti-chevron-up"></i> <i class="ti ti-user"></i></MkButton>
- </div>
- <div class="_margin _gaps_s">
- <MkRemoteCaution v-if="note.user.host != null" :href="note.url ?? note.uri"/>
- <MkNoteDetailed :key="note.id" v-model:note="note" :initialTab="initialTab" :class="$style.note"/>
- </div>
- <div v-if="clips && clips.length > 0" class="_margin">
- <div style="font-weight: bold; padding: 12px;">{{ i18n.ts.clip }}</div>
- <div class="_gaps">
- <MkClipPreview v-for="item in clips" :key="item.id" :clip="item"/>
- </div>
- </div>
- <div v-if="!showPrev" class="_buttons" :class="$style.loadPrev">
- <MkButton v-if="note.channelId" rounded :class="$style.loadButton" @click="showPrev = 'channel'"><i class="ti ti-chevron-down"></i> <i class="ti ti-device-tv"></i></MkButton>
- <MkButton rounded :class="$style.loadButton" @click="showPrev = 'user'"><i class="ti ti-chevron-down"></i> <i class="ti ti-user"></i></MkButton>
+ <div class="_margin">
+ <div v-if="!showNext" class="_buttons" :class="$style.loadNext">
+ <MkButton v-if="note.channelId" rounded :class="$style.loadButton" @click="showNext = 'channel'"><i class="ti ti-chevron-up"></i> <i class="ti ti-device-tv"></i></MkButton>
+ <MkButton rounded :class="$style.loadButton" @click="showNext = 'user'"><i class="ti ti-chevron-up"></i> <i class="ti ti-user"></i></MkButton>
+ </div>
+ <div class="_margin _gaps_s">
+ <MkRemoteCaution v-if="note.user.host != null" :href="note.url ?? note.uri"/>
+ <MkNoteDetailed :key="note.id" v-model:note="note" :initialTab="initialTab" :class="$style.note"/>
+ </div>
+ <div v-if="clips && clips.length > 0" class="_margin">
+ <div style="font-weight: bold; padding: 12px;">{{ i18n.ts.clip }}</div>
+ <div class="_gaps">
+ <MkClipPreview v-for="item in clips" :key="item.id" :clip="item"/>
</div>
</div>
-
- <div v-if="showPrev" class="_margin">
- <MkNotes class="" :pagination="showPrev === 'channel' ? prevChannelPagination : prevUserPagination" :noGap="true"/>
+ <div v-if="!showPrev" class="_buttons" :class="$style.loadPrev">
+ <MkButton v-if="note.channelId" rounded :class="$style.loadButton" @click="showPrev = 'channel'"><i class="ti ti-chevron-down"></i> <i class="ti ti-device-tv"></i></MkButton>
+ <MkButton rounded :class="$style.loadButton" @click="showPrev = 'user'"><i class="ti ti-chevron-down"></i> <i class="ti ti-user"></i></MkButton>
</div>
</div>
- <MkError v-else-if="error" @retry="fetchNote()"/>
- <MkLoading v-else/>
- </Transition>
- </div>
+
+ <div v-if="showPrev" class="_margin">
+ <MkNotesTimeline :pullToRefresh="false" class="" :pagination="showPrev === 'channel' ? prevChannelPagination : prevUserPagination" :noGap="true"/>
+ </div>
+ </div>
+ <MkError v-else-if="error" @retry="fetchNote()"/>
+ <MkLoading v-else/>
+ </Transition>
</div>
</PageWithHeader>
</template>
@@ -50,9 +48,9 @@ SPDX-License-Identifier: AGPL-3.0-only
import { computed, watch, ref } from 'vue';
import * as Misskey from 'misskey-js';
import { host } from '@@/js/config.js';
-import type { Paging } from '@/components/MkPagination.vue';
+import type { PagingCtx } from '@/use/use-pagination.js';
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
-import MkNotes from '@/components/MkNotes.vue';
+import MkNotesTimeline from '@/components/MkNotesTimeline.vue';
import MkRemoteCaution from '@/components/MkRemoteCaution.vue';
import MkButton from '@/components/MkButton.vue';
import { misskeyApi } from '@/utility/misskey-api.js';
@@ -80,26 +78,27 @@ const showPrev = ref<'user' | 'channel' | false>(false);
const showNext = ref<'user' | 'channel' | false>(false);
const error = ref();
-const prevUserPagination: Paging = {
+const prevUserPagination: PagingCtx = {
endpoint: 'users/notes',
limit: 10,
+ baseId: props.noteId,
+ direction: 'older',
params: computed(() => note.value ? ({
userId: note.value.userId,
- untilId: note.value.id,
}) : undefined),
};
-const nextUserPagination: Paging = {
- reversed: true,
+const nextUserPagination: PagingCtx = {
endpoint: 'users/notes',
limit: 10,
+ baseId: props.noteId,
+ direction: 'newer',
params: computed(() => note.value ? ({
userId: note.value.userId,
- sinceId: note.value.id,
}) : undefined),
};
-const prevChannelPagination: Paging = {
+const prevChannelPagination: PagingCtx = {
endpoint: 'channels/timeline',
limit: 10,
params: computed(() => note.value ? ({
@@ -108,7 +107,7 @@ const prevChannelPagination: Paging = {
}) : undefined),
};
-const nextChannelPagination: Paging = {
+const nextChannelPagination: PagingCtx = {
reversed: true,
endpoint: 'channels/timeline',
limit: 10,