From 1b9d7cf437421ce745ea3712cb37da635ed36b61 Mon Sep 17 00:00:00 2001 From: Dispatch <45262335+DispatchCommit@users.noreply.github.com> Date: Wed, 23 Oct 2019 21:32:58 -0700 Subject: [PATCH] Improve Chat UX (#50) * Create ChatSettings component, overhaul chat input UI * Simplify chat component * Create ChatInput component isolate textbox input for better performance * Remove unused components from chat index * Make chat input clearable * Fix null message when input is cleared * Switch autoscroll function * Begin work on ChatMessages wrapper * Add counter back to input * Use ChatMessages container * Convert ChatMessage to functional component * Code Cleanup Remove old chat code and clean up files * Improve viewerlist scrolling * Load chat settings async * Remove vuetify components from functional component * Reduce chat message line height * Improve chat message typography * Revert line height * ViewerList scroll improvement, restore settings divider --- components/Chat/ChatInput.vue | 149 ++++++++++ components/Chat/ChatMessage.vue | 87 +++--- components/Chat/ChatMessages.vue | 113 +++++++ components/Chat/ChatSettings.vue | 217 ++++++++++++++ components/Chat/ViewerList.vue | 2 +- components/Chat/index.vue | 462 +++++++---------------------- components/Notifications/index.vue | 2 +- components/User.vue | 2 +- components/UserList.vue | 2 +- package.json | 2 +- store/chat.js | 32 ++ 11 files changed, 668 insertions(+), 402 deletions(-) create mode 100644 components/Chat/ChatInput.vue create mode 100644 components/Chat/ChatMessages.vue create mode 100644 components/Chat/ChatSettings.vue diff --git a/components/Chat/ChatInput.vue b/components/Chat/ChatInput.vue new file mode 100644 index 00000000..3687bda9 --- /dev/null +++ b/components/Chat/ChatInput.vue @@ -0,0 +1,149 @@ + + + + + this.setMessage( value )" + @keyup.enter.prevent="sendMessage" + @keyup.prevent="event => lastMessageHandler(event)" + @cut="event => lastMessageHandler(event)" + > + + + + + + + settings + + + + + + + + + send + send + + + + + + + diff --git a/components/Chat/ChatMessage.vue b/components/Chat/ChatMessage.vue index e0b80788..8e699d4e 100644 --- a/components/Chat/ChatMessage.vue +++ b/components/Chat/ChatMessage.vue @@ -1,46 +1,44 @@ - + - - + + + - - person - - - - - - - {{ timestamp }} - - - - - - {{ channel }} - - - - - - + + person + + + + + + + - + + + {{ props.timestamp }} + + + + + + + {{ props.channel }} + + + + + + + + @@ -89,6 +83,19 @@ .v-avatar { cursor: pointer; user-select: none; + + align-items: center; + border-radius: 50%; + display: inline-flex; + justify-content: center; + line-height: normal; + position: relative; + text-align: center; + vertical-align: middle; + + height: 32px; + min-width: 32px; + width: 32px; } .v-list-item__avatar { diff --git a/components/Chat/ChatMessages.vue b/components/Chat/ChatMessages.vue new file mode 100644 index 00000000..4c82c2d7 --- /dev/null +++ b/components/Chat/ChatMessages.vue @@ -0,0 +1,113 @@ + + + + + + + + + + + diff --git a/components/Chat/ChatSettings.vue b/components/Chat/ChatSettings.vue new file mode 100644 index 00000000..fb67e43c --- /dev/null +++ b/components/Chat/ChatSettings.vue @@ -0,0 +1,217 @@ + + + + + + Settings + + + + close + + + + + + + + + + + + + + + + + Text To Speech Options + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/Chat/ViewerList.vue b/components/Chat/ViewerList.vue index fb467425..07b28971 100644 --- a/components/Chat/ViewerList.vue +++ b/components/Chat/ViewerList.vue @@ -38,7 +38,7 @@ - + - - - - - - - - - - {{ page }} - - - - - - - POLL - - - - - - - - - - + + + + + + {{ page }} + + + + + - - - - settings - - - - - - - - Settings - - - - close - - - - - - - - - - - - - - - - - - - Text To Speech Options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - keyboard_arrow_down - - - - + + POLL + + + + + + + + + + keyboard_arrow_down + @@ -223,87 +71,46 @@ @end="endPoll" @destroy="destroyPoll" /> + - - - - - - - + - - - - - this.message = value" - @click:append-outer.prevent="sendMessage" - @keyup.enter.prevent="sendMessage" - @keyup.prevent="event => lastMessageHandler(event)" - @cut="event => lastMessageHandler(event)" - > - - - + +