From 43abbce2af609797fb45bdad9dbfbc653bec201b Mon Sep 17 00:00:00 2001
From: syuilo <4439005+syuilo@users.noreply.github.com>
Date: Wed, 25 Jun 2025 10:08:44 +0900
Subject: enhance(frontend):
 全てのページネーションにおいてコンテキストメニューからリロードできるように
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 packages/frontend/src/components/MkPagination.vue | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

(limited to 'packages/frontend/src/components/MkPagination.vue')

diff --git a/packages/frontend/src/components/MkPagination.vue b/packages/frontend/src/components/MkPagination.vue
index 681abd2eff..aded18f220 100644
--- a/packages/frontend/src/components/MkPagination.vue
+++ b/packages/frontend/src/components/MkPagination.vue
@@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 -->
 
 <template>
-<component :is="prefer.s.enablePullToRefresh && pullToRefresh ? MkPullToRefresh : 'div'" :refresher="() => paginator.reload()">
+<component :is="prefer.s.enablePullToRefresh && pullToRefresh ? MkPullToRefresh : 'div'" :refresher="() => paginator.reload()" @contextmenu.prevent.stop="onContextmenu">
 	<!-- :css="prefer.s.animation" にしたいけどバグる(おそらくvueのバグ) https://github.com/misskey-dev/misskey/issues/16078 -->
 	<Transition
 		:enterActiveClass="prefer.s.animation ? $style.transition_fade_enterActive : ''"
@@ -41,6 +41,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 </template>
 
 <script lang="ts" setup generic="T extends PagingCtx">
+import { isLink } from '@@/js/is-link.js';
 import type { PagingCtx } from '@/composables/use-pagination.js';
 import type { UnwrapRef } from 'vue';
 import MkButton from '@/components/MkButton.vue';
@@ -48,6 +49,7 @@ import { i18n } from '@/i18n.js';
 import { prefer } from '@/preferences.js';
 import { usePagination } from '@/composables/use-pagination.js';
 import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
+import * as os from '@/os.js';
 
 type Paginator = ReturnType<typeof usePagination<T['endpoint']>>;
 
@@ -73,6 +75,19 @@ function appearFetchMore() {
 	paginator.fetchOlder();
 }
 
+function onContextmenu(ev: MouseEvent) {
+	if (ev.target && isLink(ev.target as HTMLElement)) return;
+	if (window.getSelection()?.toString() !== '') return;
+
+	os.contextMenu([{
+		icon: 'ti ti-refresh',
+		text: i18n.ts.reload,
+		action: () => {
+			paginator.reload();
+		},
+	}], ev);
+}
+
 defineSlots<{
 	empty: () => void;
 	default: (props: { items: UnwrapRef<Paginator['items']> }) => void;
-- 
cgit v1.2.3-freya

