From ddf92c3e2c5bdfc89e5c223a3cc2794f6a023400 Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 29 May 2020 22:36:01 +0900 Subject: [PATCH 1/6] chore(src/docs): Fix miauth check url Fix #6418 --- src/docs/api.ja-JP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/api.ja-JP.md b/src/docs/api.ja-JP.md index d30e2a2db5..7171664f1b 100644 --- a/src/docs/api.ja-JP.md +++ b/src/docs/api.ja-JP.md @@ -48,7 +48,7 @@ UUIDを生成する。以後これをセッションIDと呼びます。 * どのような権限があるかは[APIリファレンス](/api-doc)で確認できます #### Step 3 -ユーザーが連携を許可した後、`{_URL_}/miauth/{session}/check`にPOSTリクエストすると、レスポンスとしてアクセストークンを含むJSONが返ります。 +ユーザーが連携を許可した後、`{_URL_}/api/miauth/{session}/check`にPOSTリクエストすると、レスポンスとしてアクセストークンを含むJSONが返ります。 レスポンスに含まれるプロパティ: * `token` ... ユーザーのアクセストークン From eda7d60c26c2bc6b6659498f47074528c126ef2c Mon Sep 17 00:00:00 2001 From: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> Date: Sat, 30 May 2020 08:00:02 +0900 Subject: [PATCH 2/6] Resolve #6412 (#6416) --- locales/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/locales/index.js b/locales/index.js index df8f118428..ee260f269d 100644 --- a/locales/index.js +++ b/locales/index.js @@ -14,6 +14,7 @@ const merge = (...args) => args.reduce((a, c) => ({ }), {}); const languages = [ + 'ar-SA', //'cs-CZ', //'da-DK', 'de-DE', From a1e0c866aafec521b6aca1e8bb3099c82ba925f5 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 31 May 2020 12:53:06 +0900 Subject: [PATCH 3/6] =?UTF-8?q?feat(client):=20=E8=87=AA=E5=8B=95=E3=81=A7?= =?UTF-8?q?=E3=82=82=E3=81=A3=E3=81=A8=E8=A6=8B=E3=82=8B=E3=82=AA=E3=83=97?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=20(#6403)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip * ugokanai * wip * implement setting subscribing * fix lint * :v: * Update notifications.vue Co-authored-by: syuilo --- locales/ja-JP.yml | 1 + src/client/components/drive.vue | 30 +++++++++++++++--- src/client/components/notes.vue | 8 ++--- src/client/components/notifications.vue | 2 +- src/client/components/ui/pagination.vue | 4 +-- src/client/components/user-list.vue | 2 +- src/client/components/users-dialog.vue | 3 +- src/client/pages/messaging/messaging-room.vue | 21 +++++++++++-- src/client/pages/preferences/index.vue | 6 ++++ src/client/scripts/paging.ts | 31 +++++++++++++++++++ src/client/store.ts | 5 +++ 11 files changed, 96 insertions(+), 17 deletions(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 3c7dc6640b..38827ea35a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -509,6 +509,7 @@ addedRelays: "追加済みのリレー" serviceworkerInfo: "プッシュ通知を行うには有効する必要があります。" deletedNote: "削除された投稿" invisibleNote: "非公開の投稿" +enableInfiniteScroll: "自動でもっと見る" _theme: explore: "テーマを探す" diff --git a/src/client/components/drive.vue b/src/client/components/drive.vue index 65eb1cb816..3e7b7d04ae 100644 --- a/src/client/components/drive.vue +++ b/src/client/components/drive.vue @@ -19,17 +19,17 @@ @drop.prevent.stop="onDrop" >
-
+
- {{ $t('loadMore') }} + {{ $t('loadMore') }}
-
+
- {{ $t('loadMore') }} + {{ $t('loadMore') }}

{{ $t('empty-draghover') }}

@@ -116,6 +116,13 @@ export default Vue.extend({ fetching: true, + ilFilesObserver: new IntersectionObserver( + (entries) => entries.some((entry) => entry.isIntersecting) + && !this.fetching && this.moreFiles && + this.fetchMoreFiles() + ), + moreFilesElement: null as Element, + faAngleRight }; }, @@ -127,6 +134,12 @@ export default Vue.extend({ }, mounted() { + if (this.$store.state.device.enableInfiniteScroll && this.$refs.loadMoreFiles) { + this.$nextTick(() => { + this.ilFilesObserver.observe((this.$refs.loadMoreFiles as Vue).$el) + }); + } + this.connection = this.$root.stream.useSharedConnection('drive'); this.connection.on('fileCreated', this.onStreamDriveFileCreated); @@ -143,8 +156,17 @@ export default Vue.extend({ } }, + activated() { + if (this.$store.state.device.enableInfiniteScroll) { + this.$nextTick(() => { + this.ilFilesObserver.observe((this.$refs.loadMoreFiles as Vue).$el) + }); + } + }, + beforeDestroy() { this.connection.dispose(); + this.ilFilesObserver.disconnect(); }, methods: { diff --git a/src/client/components/notes.vue b/src/client/components/notes.vue index 515bc58e2e..c83cbd1aa1 100644 --- a/src/client/components/notes.vue +++ b/src/client/components/notes.vue @@ -7,8 +7,8 @@ -
- @@ -18,8 +18,8 @@ -
- diff --git a/src/client/components/notifications.vue b/src/client/components/notifications.vue index 3ed198a04c..36464a3096 100644 --- a/src/client/components/notifications.vue +++ b/src/client/components/notifications.vue @@ -5,7 +5,7 @@ - diff --git a/src/client/components/ui/pagination.vue b/src/client/components/ui/pagination.vue index e888b7420c..79d322bbc4 100644 --- a/src/client/components/ui/pagination.vue +++ b/src/client/components/ui/pagination.vue @@ -4,8 +4,8 @@
-
- +
+ diff --git a/src/client/components/user-list.vue b/src/client/components/user-list.vue index 7a9cd58a48..0204cf9d06 100644 --- a/src/client/components/user-list.vue +++ b/src/client/components/user-list.vue @@ -22,7 +22,7 @@
-
diff --git a/src/client/components/users-dialog.vue b/src/client/components/users-dialog.vue index 0e0cc36c2a..575d031182 100644 --- a/src/client/components/users-dialog.vue +++ b/src/client/components/users-dialog.vue @@ -15,8 +15,7 @@
- - diff --git a/src/client/pages/messaging/messaging-room.vue b/src/client/pages/messaging/messaging-room.vue index e97d5532ac..a95305caba 100644 --- a/src/client/pages/messaging/messaging-room.vue +++ b/src/client/pages/messaging/messaging-room.vue @@ -16,7 +16,7 @@

{{ $t('noMessagesYet') }}

{{ $t('noMoreHistory') }}

- @@ -40,7 +40,6 @@ import { faArrowCircleDown, faFlag, faUsers, faInfoCircle } from '@fortawesome/f import XList from '../../components/date-separated-list.vue'; import XMessage from './messaging-room.message.vue'; import XForm from './messaging-room.form.vue'; -import { url } from '../../config'; import parseAcct from '../../../misc/acct/parse'; export default Vue.extend({ @@ -61,6 +60,13 @@ export default Vue.extend({ connection: null, showIndicator: false, timer: null, + ilObserver: new IntersectionObserver( + (entries) => entries.some((entry) => entry.isIntersecting) + && !this.fetching + && !this.fetchingMoreMessages + && this.existMoreMessages + && this.fetchMoreMessages() + ), faArrowCircleDown, faFlag, faUsers, faInfoCircle }; }, @@ -77,6 +83,9 @@ export default Vue.extend({ mounted() { this.fetch(); + if (this.$store.state.device.enableInfiniteScroll) { + this.$nextTick(() => this.ilObserver.observe(this.$refs.loadMore as Element)); + } }, beforeDestroy() { @@ -85,6 +94,8 @@ export default Vue.extend({ window.removeEventListener('scroll', this.onScroll); document.removeEventListener('visibilitychange', this.onVisibilitychange); + + this.ilObserver.disconnect(); }, methods: { @@ -112,8 +123,12 @@ export default Vue.extend({ document.addEventListener('visibilitychange', this.onVisibilitychange); this.fetchMessages().then(() => { - this.fetching = false; this.scrollToBottom(); + + // もっと見るの交差検知を発火させないためにfetchは + // スクロールが終わるまでfalseにしておく + // scrollendのようなイベントはないのでsetTimeoutで + setTimeout(() => this.fetching = false, 300); }); }, diff --git a/src/client/pages/preferences/index.vue b/src/client/pages/preferences/index.vue index 14d22bf02d..148b4a97b8 100644 --- a/src/client/pages/preferences/index.vue +++ b/src/client/pages/preferences/index.vue @@ -67,6 +67,7 @@ {{ $t('showFixedPostForm') }} + {{ $t('enableInfiniteScroll') }} {{ $t('disablePagesScript') }}
@@ -182,6 +183,11 @@ export default Vue.extend({ set(value) { this.$store.commit('device/set', { key: 'showFixedPostForm', value }); } }, + enableInfiniteScroll: { + get() { return this.$store.state.device.enableInfiniteScroll; }, + set(value) { this.$store.commit('device/setInfiniteScrollEnabling', value); } + }, + sfxVolume: { get() { return this.$store.state.device.sfxVolume; }, set(value) { this.$store.commit('device/set', { key: 'sfxVolume', value: parseFloat(value, 10) }); } diff --git a/src/client/scripts/paging.ts b/src/client/scripts/paging.ts index 048c797753..1f302753e1 100644 --- a/src/client/scripts/paging.ts +++ b/src/client/scripts/paging.ts @@ -15,6 +15,14 @@ export default (opts) => ({ more: false, backed: false, isBackTop: false, + ilObserver: new IntersectionObserver( + (entries) => entries.some((entry) => entry.isIntersecting) + && !this.moreFetching + && !this.fetching + && this.fetchMore() + ), + loadMoreElement: null as Element, + unsubscribeInfiniteScrollMutation: null as any, }; }, @@ -51,6 +59,29 @@ export default (opts) => ({ }); }, + mounted() { + this.$nextTick(() => { + if (this.$refs.loadMore) { + this.loadMoreElement = this.$refs.loadMore instanceof Element ? this.$refs.loadMore : this.$refs.loadMore.$el; + if (this.$store.state.device.enableInfiniteScroll) this.ilObserver.observe(this.loadMoreElement); + this.loadMoreElement.addEventListener('click', this.fetchMore); + + this.unsubscribeInfiniteScrollMutation = this.$store.subscribe(mutation => { + if (mutation.type !== 'device/setInfiniteScrollEnabling') return; + + if (mutation.payload) return this.ilObserver.observe(this.loadMoreElement); + return this.ilObserver.unobserve(this.loadMoreElement); + }); + } + }); + }, + + beforeDestroy() { + this.ilObserver.disconnect(); + if (this.$refs.loadMore) this.loadMoreElement.removeEventListener('click', this.fetchMore); + if (this.unsubscribeInfiniteScrollMutation) this.unsubscribeInfiniteScrollMutation(); + }, + methods: { updateItem(i, item) { Vue.set((this as any).items, i, item); diff --git a/src/client/store.ts b/src/client/store.ts index c1d7d39910..3eb221b5c9 100644 --- a/src/client/store.ts +++ b/src/client/store.ts @@ -56,6 +56,7 @@ export const defaultDeviceSettings = { imageNewTab: false, showFixedPostForm: false, disablePagesScript: true, + enableInfiniteScroll: true, roomGraphicsQuality: 'medium', roomUseOrthographicCamera: true, sfxVolume: 0.3, @@ -333,6 +334,10 @@ export default () => new Vuex.Store({ setUserData(state, x: { userId: string; data: any }) { state.userData[x.userId] = copy(x.data); }, + + setInfiniteScrollEnabling(state, x: boolean) { + state.enableInfiniteScroll = x; + }, } }, From 8d48e4c76e39f5f3bdcd255bdb0418e6b3573533 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 31 May 2020 12:57:21 +0900 Subject: [PATCH 4/6] feat(client): Convert text mfm node to text (v)dom node instead of span tag (#6399) * Convert text mfm node to text (v)dom node instead of span tag * Update mfm.ts Co-authored-by: syuilo --- src/client/components/mfm.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/components/mfm.ts b/src/client/components/mfm.ts index bfef80f232..122368f74b 100644 --- a/src/client/components/mfm.ts +++ b/src/client/components/mfm.ts @@ -1,5 +1,5 @@ import Vue, { VNode } from 'vue'; -import { MfmForest } from '../../mfm/types'; +import { MfmForest } from '../../mfm/prelude'; import { parse, parsePlain } from '../../mfm/parse'; import MkUrl from './url.vue'; import MkLink from './link.vue'; @@ -53,11 +53,11 @@ export default Vue.component('misskey-flavored-markdown', { if (!this.plain) { const x = text.split('\n') - .map(t => t == '' ? [createElement('br')] : [createElement('span', t), createElement('br')]); + .map(t => t == '' ? [createElement('br')] : [this._v(t), createElement('br')]); // NOTE: this._vはHACK SEE: https://github.com/syuilo/misskey/pull/6399#issuecomment-632820283 x[x.length - 1].pop(); return x; } else { - return [createElement('span', text.replace(/\n/g, ' '))]; + return [this._v(text.replace(/\n/g, ' '))]; } } From 83d9a4b6d9292122f52c35758d365b31e855f55d Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 31 May 2020 14:46:50 +0900 Subject: [PATCH 5/6] =?UTF-8?q?chore(client):=F0=9F=8E=A8=20Make=20font-si?= =?UTF-8?q?ze=20of=20note-preview=20em=20(#6414)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/components/note-preview.vue | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/client/components/note-preview.vue b/src/client/components/note-preview.vue index f58ab5fa50..14314889a3 100644 --- a/src/client/components/note-preview.vue +++ b/src/client/components/note-preview.vue @@ -50,15 +50,7 @@ export default Vue.extend({ margin: 0; padding: 0; overflow: hidden; - font-size: 10px; - - @media (min-width: 350px) { - font-size: 12px; - } - - @media (min-width: 500px) { - font-size: 14px; - } + font-size: 0.95em; > .avatar { From ffc7f42efcf64749f8a02d659f799e4427daa5d5 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 31 May 2020 15:48:37 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix(client):=20=E5=85=A8=E6=97=A2=E8=AA=AD?= =?UTF-8?q?=E7=B3=BB=E3=83=9C=E3=82=BF=E3=83=B3=E3=81=AEAPI=E3=81=AE?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E3=81=8C=E9=96=93=E9=81=95=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=20(#6424?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/pages/my-settings/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/pages/my-settings/index.vue b/src/client/pages/my-settings/index.vue index c3080e0f81..3af896d78e 100644 --- a/src/client/pages/my-settings/index.vue +++ b/src/client/pages/my-settings/index.vue @@ -96,15 +96,15 @@ export default Vue.extend({ }, readAllUnreadNotes() { - this.$root.api('i/read_all_unread_notes'); + this.$root.api('i/read-all-unread-notes'); }, readAllMessagingMessages() { - this.$root.api('i/read_all_messaging_messages'); + this.$root.api('i/read-all-messaging-messages'); }, readAllNotifications() { - this.$root.api('notifications/mark_all_as_read'); + this.$root.api('notifications/mark-all-as-read'); }, } });