From c239058624dcd880ec1c5f3c436f3a2a06fc22c3 Mon Sep 17 00:00:00 2001 From: _ Date: Mon, 30 Oct 2023 09:12:20 +0900 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E3=82=B9=E3=83=AF=E3=82=A4?= =?UTF-8?q?=E3=83=97=E3=82=84=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=A7=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=A0=E3=83=A9=E3=82=A4=E3=83=B3=E3=82=92=E5=86=8D?= =?UTF-8?q?=E8=AA=AD=E8=BE=BC=E3=81=99=E3=82=8B=E6=A9=9F=E8=83=BD=20(#1211?= =?UTF-8?q?3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * pc reloading * add: disable TL websocket option * fix: stream disconnect when reload * add: pull to refresh * fix: pull to refresh * add changelog * fact: change to disableStreamingTimeline * lint * remove: en-US text * refactor * refactor * add license identifier * tweak * Update MkPullToRefresh.vue * Update MkPullToRefresh.vue * change name timeoutHeartBeat * tweak * :art: --------- Co-authored-by: syuilo --- CHANGELOG.md | 3 + locales/index.d.ts | 4 + locales/ja-JP.yml | 4 + packages/frontend/src/boot/main-boot.ts | 3 +- .../frontend/src/components/MkPageWindow.vue | 2 + .../frontend/src/components/MkPagination.vue | 6 + .../src/components/MkPullToRefresh.vue | 238 ++++++++++++++++++ .../frontend/src/components/MkTimeline.vue | 136 ++++++---- .../frontend/src/pages/settings/general.vue | 3 + packages/frontend/src/pages/timeline.vue | 52 ++-- packages/frontend/src/store.ts | 4 + packages/frontend/src/stream.ts | 20 +- .../src/ui/_common_/stream-indicator.vue | 3 +- packages/frontend/src/ui/universal.vue | 2 +- 14 files changed, 400 insertions(+), 80 deletions(-) create mode 100644 packages/frontend/src/components/MkPullToRefresh.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index abfb0692bd..c46d1c78bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,9 @@ - Feat: プラグイン・テーマを外部サイトから直接インストールできるようになりました - 外部サイトでの実装が必要です。詳細は Misskey Hub をご覧ください https://misskey-hub.net/docs/advanced/publish-on-your-website.html +- Enhance: スワイプしてタイムラインを再読込できるように + - PCの場合は右上のボタンからでも再読込できます +- Enhance: タイムラインの自動更新を無効にできるように - Enhance: コードのシンタックスハイライトエンジンをShikiに変更 - AiScriptのシンタックスハイライトに対応 - MFMでAiScriptをハイライトする場合、コードブロックの開始部分を ` ```is ` もしくは ` ```aiscript ` としてください diff --git a/locales/index.d.ts b/locales/index.d.ts index 5f156b617a..e99b278c8c 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1152,6 +1152,10 @@ export interface Locale { "angle": string; "flip": string; "showAvatarDecorations": string; + "releaseToRefresh": string; + "refreshing": string; + "pullDownToRefresh": string; + "disableStreamingTimeline": string; "_announcement": { "forExistingUsers": string; "forExistingUsersDescription": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index f7e73042b7..32877b806a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1149,6 +1149,10 @@ detach: "外す" angle: "角度" flip: "反転" showAvatarDecorations: "アイコンのデコレーションを表示" +releaseToRefresh: "離してリロード" +refreshing: "リロード中" +pullDownToRefresh: "引っ張ってリロード" +disableStreamingTimeline: "タイムラインのリアルタイム更新を無効にする" _announcement: forExistingUsers: "既存ユーザーのみ" diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index f2af951d63..800a3b079f 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -8,7 +8,7 @@ import { common } from './common.js'; import { version, ui, lang, updateLocale } from '@/config.js'; import { i18n, updateI18n } from '@/i18n.js'; import { confirm, alert, post, popup, toast } from '@/os.js'; -import { useStream } from '@/stream.js'; +import { useStream, isReloading } from '@/stream.js'; import * as sound from '@/scripts/sound.js'; import { $i, refreshAccount, login, updateAccount, signout } from '@/account.js'; import { defaultStore, ColdDeviceStorage } from '@/store.js'; @@ -39,6 +39,7 @@ export async function mainBoot() { let reloadDialogShowing = false; stream.on('_disconnected_', async () => { + if (isReloading) return; if (defaultStore.state.serverDisconnectedBehavior === 'reload') { location.reload(); } else if (defaultStore.state.serverDisconnectedBehavior === 'dialog') { diff --git a/packages/frontend/src/components/MkPageWindow.vue b/packages/frontend/src/components/MkPageWindow.vue index 3b273ac545..5edae1bc3c 100644 --- a/packages/frontend/src/components/MkPageWindow.vue +++ b/packages/frontend/src/components/MkPageWindow.vue @@ -166,6 +166,8 @@ defineExpose({ diff --git a/packages/frontend/src/components/MkTimeline.vue b/packages/frontend/src/components/MkTimeline.vue index cdd72febd1..a2ada35f91 100644 --- a/packages/frontend/src/components/MkTimeline.vue +++ b/packages/frontend/src/components/MkTimeline.vue @@ -4,13 +4,16 @@ SPDX-License-Identifier: AGPL-3.0-only -->