From 01d018510cce5677d84af2186abd805cf0212b41 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sun, 11 Aug 2019 19:48:54 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A6=E3=83=BC=E3=82=B6=E3=83=BC=E5=90=8D?= =?UTF-8?q?=E3=81=AE=E7=AA=81=E3=81=8D=E6=8A=9C=E3=81=91=E3=81=AE=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#5261)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 突き抜け deck フォロリク/vote * 突き抜け desktop * notification reactionで絵文字の縦がずれないように * Fix: ユーザーページの名前が突き抜ける * Fix: デッキカラムでユーザー名が長いと閉じれなくなる * デッキのカウントの位置が右になってしまってたのを修正 * デッキヘッダーのellipsis --- .../app/common/views/components/user-name.vue | 8 +- .../app/common/views/deck/deck.column.vue | 13 ++- .../common/views/deck/deck.notification.vue | 12 +- .../common/views/deck/deck.user-column.vue | 2 +- .../views/components/notifications.vue | 107 +++++++++++------- .../desktop/views/components/user-preview.vue | 2 +- .../desktop/views/home/user/user.header.vue | 2 +- .../mobile/views/components/notification.vue | 4 + .../app/mobile/views/pages/user/index.vue | 2 +- 9 files changed, 97 insertions(+), 55 deletions(-) diff --git a/src/client/app/common/views/components/user-name.vue b/src/client/app/common/views/components/user-name.vue index 6aca36acbd..425cb587c4 100644 --- a/src/client/app/common/views/components/user-name.vue +++ b/src/client/app/common/views/components/user-name.vue @@ -1,5 +1,5 @@ <template> -<mfm :text="user.name || user.username" :plain="true" :nowrap="true" :custom-emojis="user.emojis"/> +<mfm :text="user.name || user.username" :plain="true" :nowrap="nowrap" :custom-emojis="user.emojis"/> </template> <script lang="ts"> @@ -10,7 +10,11 @@ export default Vue.extend({ user: { type: Object, required: true - } + }, + nowrap: { + type: Boolean, + default: true + }, } }); </script> diff --git a/src/client/app/common/views/deck/deck.column.vue b/src/client/app/common/views/deck/deck.column.vue index b5c0896bba..ac69a97df5 100644 --- a/src/client/app/common/views/deck/deck.column.vue +++ b/src/client/app/common/views/deck/deck.column.vue @@ -14,7 +14,7 @@ <template v-if="active"><fa icon="angle-up"/></template> <template v-else><fa icon="angle-down"/></template> </button> - <span><slot name="header"></slot></span> + <span class="header"><slot name="header"></slot></span> <span class="count" v-if="count > 0">({{ count }})</span> <button v-if="!isTemporaryColumn" class="menu" ref="menu" @click.stop="showMenu"><fa icon="caret-down"/></button> <button v-else class="close" @click.stop="close"><fa icon="times"/></button> @@ -395,13 +395,22 @@ export default Vue.extend({ &.indicate box-shadow 0 3px 0 0 var(--primary) - > span + > .header + display inline-block + align-items center + overflow hidden + text-overflow ellipsis + white-space nowrap + [data-icon] margin-right 8px > .count margin-left 4px opacity 0.5 + + > span:only-of-type + width 100% > .toggleActive > .menu diff --git a/src/client/app/common/views/deck/deck.notification.vue b/src/client/app/common/views/deck/deck.notification.vue index e1d9669002..da122ff4db 100644 --- a/src/client/app/common/views/deck/deck.notification.vue +++ b/src/client/app/common/views/deck/deck.notification.vue @@ -54,8 +54,8 @@ <div> <header> <fa icon="user-clock" class="icon"/> - <router-link :to="notification.user | userPage"> - <mk-user-name :user="notification.user" class="name"/> + <router-link :to="notification.user | userPage" class="name"> + <mk-user-name :user="notification.user"/> </router-link> <mk-time :time="notification.createdAt"/> </header> @@ -67,8 +67,8 @@ <div> <header> <fa icon="chart-pie" class="icon"/> - <router-link :to="notification.user | userPage"> - <mk-user-name :user="notification.user" class="name"/> + <router-link :to="notification.user | userPage" class="name"> + <mk-user-name :user="notification.user"/> </router-link> <mk-time :time="notification.createdAt"/> </header> @@ -167,6 +167,10 @@ export default Vue.extend({ display inline-block margin-right 3px + &.reaction + > div > header + align-items normal + &.renote > div > header [data-icon] color #77B255 diff --git a/src/client/app/common/views/deck/deck.user-column.vue b/src/client/app/common/views/deck/deck.user-column.vue index 8ab61f2047..1383ff5aef 100644 --- a/src/client/app/common/views/deck/deck.user-column.vue +++ b/src/client/app/common/views/deck/deck.user-column.vue @@ -17,7 +17,7 @@ <mk-follow-button v-if="$store.getters.isSignedIn && user.id != $store.state.i.id" :user="user" class="follow" mini/> <mk-avatar class="avatar" :user="user" :disable-preview="true" :key="user.id"/> <router-link class="name" :to="user | userPage()"> - <mk-user-name :user="user" :key="user.id"/> + <mk-user-name :user="user" :key="user.id" :nowrap="false"/> </router-link> <span class="acct">@{{ user | acct }} <fa v-if="user.isLocked == true" class="locked" icon="lock" fixed-width/></span> <span class="followed" v-if="user.isFollowed">{{ $t('follows-you') }}</span> diff --git a/src/client/app/desktop/views/components/notifications.vue b/src/client/app/desktop/views/components/notifications.vue index 0238587034..f6f4a5ae5b 100644 --- a/src/client/app/desktop/views/components/notifications.vue +++ b/src/client/app/desktop/views/components/notifications.vue @@ -11,17 +11,16 @@ <component :is="!$store.state.device.reduceMotion ? 'transition-group' : 'div'" name="mk-notifications" class="transition" tag="div"> <template v-for="(notification, i) in _notifications"> <div class="notification" :class="notification.type" :key="notification.id"> - <mk-time :time="notification.createdAt"/> - <template v-if="notification.type == 'reaction'"> <mk-avatar class="avatar" :user="notification.user"/> <div class="text"> - <p> - <mk-reaction-icon :reaction="notification.reaction"/> - <router-link :to="notification.user | userPage" v-user-preview="notification.user.id"> + <header> + <mk-reaction-icon :reaction="notification.reaction" class="icon"/> + <router-link :to="notification.user | userPage" v-user-preview="notification.user.id" class="name"> <mk-user-name :user="notification.user"/> </router-link> - </p> + <mk-time :time="notification.createdAt"/> + </header> <router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note)"> <fa icon="quote-left"/> <mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="true" :custom-emojis="notification.note.emojis"/> @@ -33,11 +32,13 @@ <template v-if="notification.type == 'renote'"> <mk-avatar class="avatar" :user="notification.note.user"/> <div class="text"> - <p><fa icon="retweet"/> - <router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId"> + <header> + <fa icon="retweet" class="icon"/> + <router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId" class="name"> <mk-user-name :user="notification.note.user"/> </router-link> - </p> + <mk-time :time="notification.createdAt"/> + </header> <router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note.renote)"> <fa icon="quote-left"/> <mfm :text="getNoteSummary(notification.note.renote)" :plain="true" :nowrap="true" :custom-emojis="notification.note.renote.emojis"/> @@ -49,11 +50,13 @@ <template v-if="notification.type == 'quote'"> <mk-avatar class="avatar" :user="notification.note.user"/> <div class="text"> - <p><fa icon="quote-left"/> - <router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId"> + <header> + <fa icon="quote-left" class="icon"/> + <router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId" class="name"> <mk-user-name :user="notification.note.user"/> </router-link> - </p> + <mk-time :time="notification.createdAt"/> + </header> <router-link class="note-preview" :to="notification.note | notePage" :title="getNoteSummary(notification.note)"> <mfm :text="getNoteSummary(notification.note)" :plain="true" :custom-emojis="notification.note.emojis"/> </router-link> @@ -63,33 +66,39 @@ <template v-if="notification.type == 'follow'"> <mk-avatar class="avatar" :user="notification.user"/> <div class="text"> - <p><fa icon="user-plus"/> - <router-link :to="notification.user | userPage" v-user-preview="notification.user.id"> + <header> + <fa icon="user-plus" class="icon"/> + <router-link :to="notification.user | userPage" v-user-preview="notification.user.id" class="name"> <mk-user-name :user="notification.user"/> </router-link> - </p> + <mk-time :time="notification.createdAt"/> + </header> </div> </template> <template v-if="notification.type == 'receiveFollowRequest'"> <mk-avatar class="avatar" :user="notification.user"/> <div class="text"> - <p><fa icon="user-clock"/> - <router-link :to="notification.user | userPage" v-user-preview="notification.user.id"> + <header> + <fa icon="user-clock" class="icon"/> + <router-link :to="notification.user | userPage" v-user-preview="notification.user.id" class="name"> <mk-user-name :user="notification.user"/> </router-link> - </p> + <mk-time :time="notification.createdAt"/> + </header> </div> </template> <template v-if="notification.type == 'reply'"> <mk-avatar class="avatar" :user="notification.note.user"/> <div class="text"> - <p><fa icon="reply"/> - <router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId"> + <header> + <fa icon="reply" class="icon"/> + <router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId" class="name"> <mk-user-name :user="notification.note.user"/> </router-link> - </p> + <mk-time :time="notification.createdAt"/> + </header> <router-link class="note-preview" :to="notification.note | notePage" :title="getNoteSummary(notification.note)"> <mfm :text="getNoteSummary(notification.note)" :plain="true" :custom-emojis="notification.note.emojis"/> </router-link> @@ -99,11 +108,13 @@ <template v-if="notification.type == 'mention'"> <mk-avatar class="avatar" :user="notification.note.user"/> <div class="text"> - <p><fa icon="at"/> - <router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId"> + <header> + <fa icon="at" class="icon"/> + <router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId" class="name"> <mk-user-name :user="notification.note.user"/> </router-link> - </p> + <mk-time :time="notification.createdAt"/> + </header> <router-link class="note-preview" :to="notification.note | notePage" :title="getNoteSummary(notification.note)"> <mfm :text="getNoteSummary(notification.note)" :plain="true" :custom-emojis="notification.note.emojis"/> </router-link> @@ -113,9 +124,13 @@ <template v-if="notification.type == 'pollVote'"> <mk-avatar class="avatar" :user="notification.user"/> <div class="text"> - <p><fa icon="chart-pie"/><router-link :to="notification.user | userPage" v-user-preview="notification.user.id"> - <mk-user-name :user="notification.user"/> - </router-link></p> + <header> + <fa icon="chart-pie" class="icon"/> + <router-link :to="notification.user | userPage" v-user-preview="notification.user.id" class="name"> + <mk-user-name :user="notification.user"/> + </router-link> + <mk-time :time="notification.createdAt"/> + </header> <router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note)"> <fa icon="quote-left"/> <mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="true" :custom-emojis="notification.note.emojis"/> @@ -241,15 +256,6 @@ export default Vue.extend({ &:last-child border-bottom none - > .mk-time - display inline - position absolute - top 16px - right 12px - vertical-align top - color var(--noteHeaderInfo) - font-size small - &:after content "" display block @@ -270,12 +276,23 @@ export default Vue.extend({ width calc(100% - 36px) padding-left 8px - p - margin 0 + > header + display flex + align-items baseline + white-space nowrap - [data-icon], .mk-reaction-icon + > .icon margin-right 4px + > .name + overflow hidden + text-overflow ellipsis + + > .mk-time + margin-left auto + color var(--noteHeaderInfo) + font-size 0.9em + .note-preview color var(--noteText) display inline-block @@ -296,20 +313,24 @@ export default Vue.extend({ display inline-block margin-right 3px + &.reaction + .text header + align-items normal + &.renote, &.quote - .text p [data-icon] + .text header [data-icon] color #77B255 &.follow - .text p [data-icon] + .text header [data-icon] color #53c7ce &.receiveFollowRequest - .text p [data-icon] + .text header [data-icon] color #888 &.reply, &.mention - .text p [data-icon] + .text header [data-icon] color #555 > .date diff --git a/src/client/app/desktop/views/components/user-preview.vue b/src/client/app/desktop/views/components/user-preview.vue index b8ca2e6966..9d9021c184 100644 --- a/src/client/app/desktop/views/components/user-preview.vue +++ b/src/client/app/desktop/views/components/user-preview.vue @@ -4,7 +4,7 @@ <div class="banner" :style="u.bannerUrl ? `background-image: url(${u.bannerUrl})` : ''"></div> <mk-avatar class="avatar" :user="u" :disable-preview="true"/> <div class="title"> - <router-link class="name" :to="u | userPage"><mk-user-name :user="u"/></router-link> + <router-link class="name" :to="u | userPage"><mk-user-name :user="u" :nowrap="false"/></router-link> <p class="username"><mk-acct :user="u"/></p> </div> <div class="description"> diff --git a/src/client/app/desktop/views/home/user/user.header.vue b/src/client/app/desktop/views/home/user/user.header.vue index ca4ad0802c..7172803ba7 100644 --- a/src/client/app/desktop/views/home/user/user.header.vue +++ b/src/client/app/desktop/views/home/user/user.header.vue @@ -5,7 +5,7 @@ <div class="fade"></div> <div class="title"> <p class="name"> - <mk-user-name :user="user"/> + <mk-user-name :user="user" :nowrap="false"/> </p> <div> <span class="username"><mk-acct :user="user" :detail="true" /></span> diff --git a/src/client/app/mobile/views/components/notification.vue b/src/client/app/mobile/views/components/notification.vue index 300a46e52a..2defef4777 100644 --- a/src/client/app/mobile/views/components/notification.vue +++ b/src/client/app/mobile/views/components/notification.vue @@ -180,6 +180,10 @@ export default Vue.extend({ display inline-block margin-right 3px + &.reaction + > div > header + align-items normal + &.renote > div > header [data-icon] color #77B255 diff --git a/src/client/app/mobile/views/pages/user/index.vue b/src/client/app/mobile/views/pages/user/index.vue index 2e4998178f..3ae543dd93 100644 --- a/src/client/app/mobile/views/pages/user/index.vue +++ b/src/client/app/mobile/views/pages/user/index.vue @@ -17,7 +17,7 @@ <mk-follow-button v-if="$store.getters.isSignedIn && $store.state.i.id != user.id" :user="user"/> </div> <div class="title"> - <h1><mk-user-name :user="user" :key="user.id"/></h1> + <h1><mk-user-name :user="user" :key="user.id" :nowrap="false"/></h1> <span class="username"><mk-acct :user="user" :detail="true" :key="user.id"/></span> <span class="followed" v-if="user.isFollowed">{{ $t('follows-you') }}</span> </div>