ユーザー名の突き抜けの修正 (#5261)

* 突き抜け deck フォロリク/vote

* 突き抜け desktop

* notification reactionで絵文字の縦がずれないように

* Fix: ユーザーページの名前が突き抜ける

* Fix: デッキカラムでユーザー名が長いと閉じれなくなる

* デッキのカウントの位置が右になってしまってたのを修正

* デッキヘッダーのellipsis
This commit is contained in:
MeiMei 2019-08-11 19:48:54 +09:00 committed by syuilo
parent 73bb119119
commit 96cf244be1
9 changed files with 97 additions and 55 deletions

View file

@ -1,5 +1,5 @@
<template> <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> </template>
<script lang="ts"> <script lang="ts">
@ -10,7 +10,11 @@ export default Vue.extend({
user: { user: {
type: Object, type: Object,
required: true required: true
} },
nowrap: {
type: Boolean,
default: true
},
} }
}); });
</script> </script>

View file

@ -14,7 +14,7 @@
<template v-if="active"><fa icon="angle-up"/></template> <template v-if="active"><fa icon="angle-up"/></template>
<template v-else><fa icon="angle-down"/></template> <template v-else><fa icon="angle-down"/></template>
</button> </button>
<span><slot name="header"></slot></span> <span class="header"><slot name="header"></slot></span>
<span class="count" v-if="count > 0">({{ count }})</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-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> <button v-else class="close" @click.stop="close"><fa icon="times"/></button>
@ -395,13 +395,22 @@ export default Vue.extend({
&.indicate &.indicate
box-shadow 0 3px 0 0 var(--primary) 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] [data-icon]
margin-right 8px margin-right 8px
> .count > .count
margin-left 4px margin-left 4px
opacity 0.5 opacity 0.5
> span:only-of-type
width 100%
> .toggleActive > .toggleActive
> .menu > .menu

View file

@ -54,8 +54,8 @@
<div> <div>
<header> <header>
<fa icon="user-clock" class="icon"/> <fa icon="user-clock" class="icon"/>
<router-link :to="notification.user | userPage"> <router-link :to="notification.user | userPage" class="name">
<mk-user-name :user="notification.user" class="name"/> <mk-user-name :user="notification.user"/>
</router-link> </router-link>
<mk-time :time="notification.createdAt"/> <mk-time :time="notification.createdAt"/>
</header> </header>
@ -67,8 +67,8 @@
<div> <div>
<header> <header>
<fa icon="chart-pie" class="icon"/> <fa icon="chart-pie" class="icon"/>
<router-link :to="notification.user | userPage"> <router-link :to="notification.user | userPage" class="name">
<mk-user-name :user="notification.user" class="name"/> <mk-user-name :user="notification.user"/>
</router-link> </router-link>
<mk-time :time="notification.createdAt"/> <mk-time :time="notification.createdAt"/>
</header> </header>
@ -167,6 +167,10 @@ export default Vue.extend({
display inline-block display inline-block
margin-right 3px margin-right 3px
&.reaction
> div > header
align-items normal
&.renote &.renote
> div > header [data-icon] > div > header [data-icon]
color #77B255 color #77B255

View file

@ -17,7 +17,7 @@
<mk-follow-button v-if="$store.getters.isSignedIn && user.id != $store.state.i.id" :user="user" class="follow" mini/> <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"/> <mk-avatar class="avatar" :user="user" :disable-preview="true" :key="user.id"/>
<router-link class="name" :to="user | userPage()"> <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> </router-link>
<span class="acct">@{{ user | acct }} <fa v-if="user.isLocked == true" class="locked" icon="lock" fixed-width/></span> <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> <span class="followed" v-if="user.isFollowed">{{ $t('follows-you') }}</span>

View file

@ -11,17 +11,16 @@
<component :is="!$store.state.device.reduceMotion ? 'transition-group' : 'div'" name="mk-notifications" class="transition" tag="div"> <component :is="!$store.state.device.reduceMotion ? 'transition-group' : 'div'" name="mk-notifications" class="transition" tag="div">
<template v-for="(notification, i) in _notifications"> <template v-for="(notification, i) in _notifications">
<div class="notification" :class="notification.type" :key="notification.id"> <div class="notification" :class="notification.type" :key="notification.id">
<mk-time :time="notification.createdAt"/>
<template v-if="notification.type == 'reaction'"> <template v-if="notification.type == 'reaction'">
<mk-avatar class="avatar" :user="notification.user"/> <mk-avatar class="avatar" :user="notification.user"/>
<div class="text"> <div class="text">
<p> <header>
<mk-reaction-icon :reaction="notification.reaction"/> <mk-reaction-icon :reaction="notification.reaction" class="icon"/>
<router-link :to="notification.user | userPage" v-user-preview="notification.user.id"> <router-link :to="notification.user | userPage" v-user-preview="notification.user.id" class="name">
<mk-user-name :user="notification.user"/> <mk-user-name :user="notification.user"/>
</router-link> </router-link>
</p> <mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note)"> <router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note)">
<fa icon="quote-left"/> <fa icon="quote-left"/>
<mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="true" :custom-emojis="notification.note.emojis"/> <mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="true" :custom-emojis="notification.note.emojis"/>
@ -33,11 +32,13 @@
<template v-if="notification.type == 'renote'"> <template v-if="notification.type == 'renote'">
<mk-avatar class="avatar" :user="notification.note.user"/> <mk-avatar class="avatar" :user="notification.note.user"/>
<div class="text"> <div class="text">
<p><fa icon="retweet"/> <header>
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId"> <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"/> <mk-user-name :user="notification.note.user"/>
</router-link> </router-link>
</p> <mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note.renote)"> <router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note.renote)">
<fa icon="quote-left"/> <fa icon="quote-left"/>
<mfm :text="getNoteSummary(notification.note.renote)" :plain="true" :nowrap="true" :custom-emojis="notification.note.renote.emojis"/> <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'"> <template v-if="notification.type == 'quote'">
<mk-avatar class="avatar" :user="notification.note.user"/> <mk-avatar class="avatar" :user="notification.note.user"/>
<div class="text"> <div class="text">
<p><fa icon="quote-left"/> <header>
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId"> <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"/> <mk-user-name :user="notification.note.user"/>
</router-link> </router-link>
</p> <mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-preview" :to="notification.note | notePage" :title="getNoteSummary(notification.note)"> <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"/> <mfm :text="getNoteSummary(notification.note)" :plain="true" :custom-emojis="notification.note.emojis"/>
</router-link> </router-link>
@ -63,33 +66,39 @@
<template v-if="notification.type == 'follow'"> <template v-if="notification.type == 'follow'">
<mk-avatar class="avatar" :user="notification.user"/> <mk-avatar class="avatar" :user="notification.user"/>
<div class="text"> <div class="text">
<p><fa icon="user-plus"/> <header>
<router-link :to="notification.user | userPage" v-user-preview="notification.user.id"> <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"/> <mk-user-name :user="notification.user"/>
</router-link> </router-link>
</p> <mk-time :time="notification.createdAt"/>
</header>
</div> </div>
</template> </template>
<template v-if="notification.type == 'receiveFollowRequest'"> <template v-if="notification.type == 'receiveFollowRequest'">
<mk-avatar class="avatar" :user="notification.user"/> <mk-avatar class="avatar" :user="notification.user"/>
<div class="text"> <div class="text">
<p><fa icon="user-clock"/> <header>
<router-link :to="notification.user | userPage" v-user-preview="notification.user.id"> <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"/> <mk-user-name :user="notification.user"/>
</router-link> </router-link>
</p> <mk-time :time="notification.createdAt"/>
</header>
</div> </div>
</template> </template>
<template v-if="notification.type == 'reply'"> <template v-if="notification.type == 'reply'">
<mk-avatar class="avatar" :user="notification.note.user"/> <mk-avatar class="avatar" :user="notification.note.user"/>
<div class="text"> <div class="text">
<p><fa icon="reply"/> <header>
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId"> <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"/> <mk-user-name :user="notification.note.user"/>
</router-link> </router-link>
</p> <mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-preview" :to="notification.note | notePage" :title="getNoteSummary(notification.note)"> <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"/> <mfm :text="getNoteSummary(notification.note)" :plain="true" :custom-emojis="notification.note.emojis"/>
</router-link> </router-link>
@ -99,11 +108,13 @@
<template v-if="notification.type == 'mention'"> <template v-if="notification.type == 'mention'">
<mk-avatar class="avatar" :user="notification.note.user"/> <mk-avatar class="avatar" :user="notification.note.user"/>
<div class="text"> <div class="text">
<p><fa icon="at"/> <header>
<router-link :to="notification.note.user | userPage" v-user-preview="notification.note.userId"> <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"/> <mk-user-name :user="notification.note.user"/>
</router-link> </router-link>
</p> <mk-time :time="notification.createdAt"/>
</header>
<router-link class="note-preview" :to="notification.note | notePage" :title="getNoteSummary(notification.note)"> <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"/> <mfm :text="getNoteSummary(notification.note)" :plain="true" :custom-emojis="notification.note.emojis"/>
</router-link> </router-link>
@ -113,9 +124,13 @@
<template v-if="notification.type == 'pollVote'"> <template v-if="notification.type == 'pollVote'">
<mk-avatar class="avatar" :user="notification.user"/> <mk-avatar class="avatar" :user="notification.user"/>
<div class="text"> <div class="text">
<p><fa icon="chart-pie"/><router-link :to="notification.user | userPage" v-user-preview="notification.user.id"> <header>
<mk-user-name :user="notification.user"/> <fa icon="chart-pie" class="icon"/>
</router-link></p> <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)"> <router-link class="note-ref" :to="notification.note | notePage" :title="getNoteSummary(notification.note)">
<fa icon="quote-left"/> <fa icon="quote-left"/>
<mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="true" :custom-emojis="notification.note.emojis"/> <mfm :text="getNoteSummary(notification.note)" :plain="true" :nowrap="true" :custom-emojis="notification.note.emojis"/>
@ -241,15 +256,6 @@ export default Vue.extend({
&:last-child &:last-child
border-bottom none border-bottom none
> .mk-time
display inline
position absolute
top 16px
right 12px
vertical-align top
color var(--noteHeaderInfo)
font-size small
&:after &:after
content "" content ""
display block display block
@ -270,12 +276,23 @@ export default Vue.extend({
width calc(100% - 36px) width calc(100% - 36px)
padding-left 8px padding-left 8px
p > header
margin 0 display flex
align-items baseline
white-space nowrap
[data-icon], .mk-reaction-icon > .icon
margin-right 4px margin-right 4px
> .name
overflow hidden
text-overflow ellipsis
> .mk-time
margin-left auto
color var(--noteHeaderInfo)
font-size 0.9em
.note-preview .note-preview
color var(--noteText) color var(--noteText)
display inline-block display inline-block
@ -296,20 +313,24 @@ export default Vue.extend({
display inline-block display inline-block
margin-right 3px margin-right 3px
&.reaction
.text header
align-items normal
&.renote, &.quote &.renote, &.quote
.text p [data-icon] .text header [data-icon]
color #77B255 color #77B255
&.follow &.follow
.text p [data-icon] .text header [data-icon]
color #53c7ce color #53c7ce
&.receiveFollowRequest &.receiveFollowRequest
.text p [data-icon] .text header [data-icon]
color #888 color #888
&.reply, &.mention &.reply, &.mention
.text p [data-icon] .text header [data-icon]
color #555 color #555
> .date > .date

View file

@ -4,7 +4,7 @@
<div class="banner" :style="u.bannerUrl ? `background-image: url(${u.bannerUrl})` : ''"></div> <div class="banner" :style="u.bannerUrl ? `background-image: url(${u.bannerUrl})` : ''"></div>
<mk-avatar class="avatar" :user="u" :disable-preview="true"/> <mk-avatar class="avatar" :user="u" :disable-preview="true"/>
<div class="title"> <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> <p class="username"><mk-acct :user="u"/></p>
</div> </div>
<div class="description"> <div class="description">

View file

@ -5,7 +5,7 @@
<div class="fade"></div> <div class="fade"></div>
<div class="title"> <div class="title">
<p class="name"> <p class="name">
<mk-user-name :user="user"/> <mk-user-name :user="user" :nowrap="false"/>
</p> </p>
<div> <div>
<span class="username"><mk-acct :user="user" :detail="true" /></span> <span class="username"><mk-acct :user="user" :detail="true" /></span>

View file

@ -180,6 +180,10 @@ export default Vue.extend({
display inline-block display inline-block
margin-right 3px margin-right 3px
&.reaction
> div > header
align-items normal
&.renote &.renote
> div > header [data-icon] > div > header [data-icon]
color #77B255 color #77B255

View file

@ -17,7 +17,7 @@
<mk-follow-button v-if="$store.getters.isSignedIn && $store.state.i.id != user.id" :user="user"/> <mk-follow-button v-if="$store.getters.isSignedIn && $store.state.i.id != user.id" :user="user"/>
</div> </div>
<div class="title"> <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="username"><mk-acct :user="user" :detail="true" :key="user.id"/></span>
<span class="followed" v-if="user.isFollowed">{{ $t('follows-you') }}</span> <span class="followed" v-if="user.isFollowed">{{ $t('follows-you') }}</span>
</div> </div>