From 8668bc2609e82f64984b8a347a207668e3e4765b Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 20 Feb 2021 16:16:19 +0900 Subject: 右クリックでリアクションピッカーを開くオプション MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/components/note-detailed.vue | 8 +++++++- src/client/components/note.vue | 8 +++++++- src/client/components/ui/modal.vue | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src/client/components') diff --git a/src/client/components/note-detailed.vue b/src/client/components/note-detailed.vue index 1108bd2c27..434dd56ba3 100644 --- a/src/client/components/note-detailed.vue +++ b/src/client/components/note-detailed.vue @@ -756,7 +756,13 @@ export default defineComponent({ }; if (isLink(e.target)) return; if (window.getSelection().toString() !== '') return; - os.contextMenu(this.getMenu(), e).then(this.focus); + + if (this.$store.state.useReactionPickerForContextMenu) { + e.preventDefault(); + this.react(); + } else { + os.contextMenu(this.getMenu(), e).then(this.focus); + } }, menu(viaKeyboard = false) { diff --git a/src/client/components/note.vue b/src/client/components/note.vue index d532289857..24c374869d 100644 --- a/src/client/components/note.vue +++ b/src/client/components/note.vue @@ -731,7 +731,13 @@ export default defineComponent({ }; if (isLink(e.target)) return; if (window.getSelection().toString() !== '') return; - os.contextMenu(this.getMenu(), e).then(this.focus); + + if (this.$store.state.useReactionPickerForContextMenu) { + e.preventDefault(); + this.react(); + } else { + os.contextMenu(this.getMenu(), e).then(this.focus); + } }, menu(viaKeyboard = false) { diff --git a/src/client/components/ui/modal.vue b/src/client/components/ui/modal.vue index 69a83e002c..405fa4aaa5 100644 --- a/src/client/components/ui/modal.vue +++ b/src/client/components/ui/modal.vue @@ -70,6 +70,7 @@ export default defineComponent({ // TODO: ResizeObserver無くしたい new ResizeObserver((entries, observer) => { const rect = this.src.getBoundingClientRect(); + const width = popover.offsetWidth; const height = popover.offsetHeight; -- cgit v1.2.3-freya From 25d37302a8bfda954c7ede1e9d355db587c82228 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 20 Feb 2021 20:20:05 +0900 Subject: チャンネルで入力中ユーザーを表示するように、Chat UIでタイムラインでは投稿フォームを上に表示するように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/ja-JP.yml | 1 + src/client/components/post-form.vue | 8 +++ src/client/ui/chat/date-separated-list.vue | 2 +- src/client/ui/chat/index.vue | 23 +------ src/client/ui/chat/note.vue | 2 +- src/client/ui/chat/post-form.vue | 8 +++ src/client/ui/chat/timeline.vue | 76 ++++++++++++++++++---- src/server/api/stream/channels/channel.ts | 39 ++++++++++- .../api/stream/channels/games/reversi-game.ts | 2 +- src/server/api/stream/index.ts | 17 +++-- src/services/stream.ts | 6 ++ 11 files changed, 143 insertions(+), 41 deletions(-) (limited to 'src/client/components') diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index a927d108bb..e7057e3f89 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -706,6 +706,7 @@ receiveAnnouncementFromInstance: "インスタンスからのお知らせを受 emailNotification: "メール通知" inChannelSearch: "チャンネル内検索" useReactionPickerForContextMenu: "右クリックでリアクションピッカーを開く" +typingUsers: "{users}が入力中" _email: _follow: diff --git a/src/client/components/post-form.vue b/src/client/components/post-form.vue index fa9aeff8af..7849095ba8 100644 --- a/src/client/components/post-form.vue +++ b/src/client/components/post-form.vue @@ -70,6 +70,7 @@ import * as os from '@/os'; import { selectFile } from '@/scripts/select-file'; import { notePostInterruptors, postFormActions } from '@/store'; import { isMobile } from '@/scripts/is-mobile'; +import { throttle } from 'throttle-debounce'; export default defineComponent({ components: { @@ -144,6 +145,11 @@ export default defineComponent({ quoteId: null, recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]'), imeText: '', + typing: throttle(3000, () => { + if (this.channel) { + os.stream.send('typingOnChannel', { channel: this.channel.id }); + } + }), postFormActions, faReply, faQuoteRight, faPaperPlane, faTimes, faUpload, faPollH, faGlobe, faHome, faUnlock, faEnvelope, faEyeSlash, faLaughSquint, faPlus, faPhotoVideo, faAt, faBiohazard, faPlug }; @@ -434,10 +440,12 @@ export default defineComponent({ onKeydown(e: KeyboardEvent) { if ((e.which === 10 || e.which === 13) && (e.ctrlKey || e.metaKey) && this.canPost) this.post(); if (e.which === 27) this.$emit('esc'); + this.typing(); }, onCompositionUpdate(e: CompositionEvent) { this.imeText = e.data; + this.typing(); }, onCompositionEnd(e: CompositionEvent) { diff --git a/src/client/ui/chat/date-separated-list.vue b/src/client/ui/chat/date-separated-list.vue index b209330656..65deb9e1c2 100644 --- a/src/client/ui/chat/date-separated-list.vue +++ b/src/client/ui/chat/date-separated-list.vue @@ -32,7 +32,7 @@ export default defineComponent({ }); } - return h(TransitionGroup, { + return h(this.reversed ? 'div' : TransitionGroup, { class: 'hmjzthxl', name: this.reversed ? 'list-reversed' : 'list', tag: 'div', diff --git a/src/client/ui/chat/index.vue b/src/client/ui/chat/index.vue index dd3c82d8ba..0ee32833a8 100644 --- a/src/client/ui/chat/index.vue +++ b/src/client/ui/chat/index.vue @@ -114,14 +114,9 @@ -
- - -
-
- - -
+ + + @@ -143,7 +138,6 @@ import XWidgets from './widgets.vue'; import XCommon from '../_common_/common.vue'; import XSide from './side.vue'; import XTimeline from './timeline.vue'; -import XPostForm from './post-form.vue'; import XHeaderClock from './header-clock.vue'; import * as os from '@/os'; import { router } from '@/router'; @@ -159,7 +153,6 @@ export default defineComponent({ XWidgets, XSide, // NOTE: dynamic importするとAsyncComponentWrapperが間に入るせいでref取得できなくて面倒になる XTimeline, - XPostForm, XHeaderClock, }, @@ -584,16 +577,6 @@ export default defineComponent({ } } } - - > .footer { - padding: 0 16px 16px 16px; - } - - > .body { - flex: 1; - min-width: 0; - overflow: auto; - } } > .side { diff --git a/src/client/ui/chat/note.vue b/src/client/ui/chat/note.vue index 4e4a303c36..315f5c91e3 100644 --- a/src/client/ui/chat/note.vue +++ b/src/client/ui/chat/note.vue @@ -1010,7 +1010,7 @@ export default defineComponent({ flex-shrink: 0; display: block; position: sticky; - top: 12px; + top: 0; margin: 0 14px 0 0; width: 46px; height: 46px; diff --git a/src/client/ui/chat/post-form.vue b/src/client/ui/chat/post-form.vue index 38fe48cc62..b0a31b097d 100644 --- a/src/client/ui/chat/post-form.vue +++ b/src/client/ui/chat/post-form.vue @@ -65,6 +65,7 @@ import * as os from '@/os'; import { selectFile } from '@/scripts/select-file'; import { notePostInterruptors, postFormActions } from '@/store'; import { isMobile } from '@/scripts/is-mobile'; +import { throttle } from 'throttle-debounce'; export default defineComponent({ components: { @@ -131,6 +132,11 @@ export default defineComponent({ quoteId: null, recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]'), imeText: '', + typing: throttle(3000, () => { + if (this.channel) { + os.stream.send('typingOnChannel', { channel: this.channel }); + } + }), postFormActions, faReply, faQuoteRight, faPaperPlane, faTimes, faUpload, faPollH, faGlobe, faHome, faUnlock, faEnvelope, faEyeSlash, faLaughSquint, faPlus, faPhotoVideo, faAt, faBiohazard, faPlug }; @@ -421,10 +427,12 @@ export default defineComponent({ onKeydown(e: KeyboardEvent) { if ((e.which === 10 || e.which === 13) && (e.ctrlKey || e.metaKey) && this.canPost) this.post(); if (e.which === 27) this.$emit('esc'); + this.typing(); }, onCompositionUpdate(e: CompositionEvent) { this.imeText = e.data; + this.typing(); }, onCompositionEnd(e: CompositionEvent) { diff --git a/src/client/ui/chat/timeline.vue b/src/client/ui/chat/timeline.vue index f96a48a776..12cb7af7d2 100644 --- a/src/client/ui/chat/timeline.vue +++ b/src/client/ui/chat/timeline.vue @@ -1,8 +1,22 @@ diff --git a/src/client/ui/chat/note.vue b/src/client/ui/chat/note.vue index 315f5c91e3..9312b99d27 100644 --- a/src/client/ui/chat/note.vue +++ b/src/client/ui/chat/note.vue @@ -1091,6 +1091,7 @@ export default defineComponent({ > .poll { font-size: 80%; + max-width: 500px; } > .renote { diff --git a/src/client/ui/chat/notes.vue b/src/client/ui/chat/notes.vue index fb9f8fe260..3a169cc20a 100644 --- a/src/client/ui/chat/notes.vue +++ b/src/client/ui/chat/notes.vue @@ -8,7 +8,7 @@
- + @@ -19,7 +19,7 @@
- + diff --git a/src/server/web/boot.js b/src/server/web/boot.js index 2bd306ea94..993b770ab1 100644 --- a/src/server/web/boot.js +++ b/src/server/web/boot.js @@ -11,6 +11,10 @@ 'use strict'; +window.onerror = (e) => { + document.documentElement.innerHTML = '問題が発生しました。'; +}; + // ブロックの中に入れないと、定義した変数がブラウザのグローバルスコープに登録されてしまい邪魔なので (async () => { const v = localStorage.getItem('v') || VERSION; -- cgit v1.2.3-freya