fix(frontend): PageHeaderのタイトルがはみ出る問題を修正 (#16744)

* fix(frontend): PageHeaderのタイトルがはみ出る問題を修正

* Update Changelog

* fix: remove duplicated scoped class to avoid confusion
This commit is contained in:
かっこかり 2025-11-06 09:31:55 +09:00 committed by GitHub
parent 344f50d538
commit 0abe021640
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 25 deletions

View File

@ -7,6 +7,7 @@
### Client ### Client
- Fix: 紙吹雪エフェクトがアニメーション設定を考慮せず常に表示される問題を修正 - Fix: 紙吹雪エフェクトがアニメーション設定を考慮せず常に表示される問題を修正
- Fix: ナビゲーションバーのリアルタイムモード切替ボタンの状態をよりわかりやすく表示するように - Fix: ナビゲーションバーのリアルタイムモード切替ボタンの状態をよりわかりやすく表示するように
- Fix: ページのタイトルが長いとき、はみ出る問題を修正
### Server ### Server
- -

View File

@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-if="!thin_ && narrow && props.displayMyAvatar && $i" class="_button" :class="$style.buttonsLeft" @click="openAccountMenu"> <div v-if="!thin_ && narrow && props.displayMyAvatar && $i" class="_button" :class="$style.buttonsLeft" @click="openAccountMenu">
<MkAvatar :class="$style.avatar" :user="$i"/> <MkAvatar :class="$style.avatar" :user="$i"/>
</div> </div>
<div v-else-if="!thin_ && narrow && !hideTitle" :class="$style.buttonsLeft"/> <div v-else-if="!thin_ && narrow && !hideTitle" :class="[$style.buttons, $style.buttonsLeft]"></div>
<template v-if="pageMetadata"> <template v-if="pageMetadata">
<div v-if="!hideTitle" :class="$style.titleContainer" @click="top"> <div v-if="!hideTitle" :class="$style.titleContainer" @click="top">
@ -18,9 +18,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</div> </div>
<i v-else-if="pageMetadata.icon" :class="[$style.titleIcon, pageMetadata.icon]"></i> <i v-else-if="pageMetadata.icon" :class="[$style.titleIcon, pageMetadata.icon]"></i>
<div :class="$style.title"> <div class="_nowrap" :class="$style.title">
<MkUserName v-if="pageMetadata.userName" :user="pageMetadata.userName" :nowrap="true"/> <MkUserName v-if="pageMetadata.userName" :user="pageMetadata.userName" :nowrap="true"/>
<div v-else-if="pageMetadata.title">{{ pageMetadata.title }}</div> <div v-else-if="pageMetadata.title" class="_nowrap">{{ pageMetadata.title }}</div>
<div v-if="pageMetadata.subtitle" :class="$style.subtitle"> <div v-if="pageMetadata.subtitle" :class="$style.subtitle">
{{ pageMetadata.subtitle }} {{ pageMetadata.subtitle }}
</div> </div>
@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div> </div>
<XTabs v-if="!narrow || hideTitle" :class="$style.tabs" :tab="tab" :tabs="tabs" :rootEl="el" @update:tab="key => emit('update:tab', key)" @tabClick="onTabClick"/> <XTabs v-if="!narrow || hideTitle" :class="$style.tabs" :tab="tab" :tabs="tabs" :rootEl="el" @update:tab="key => emit('update:tab', key)" @tabClick="onTabClick"/>
</template> </template>
<div v-if="(!thin_ && narrow && !hideTitle) || (actions && actions.length > 0)" :class="$style.buttonsRight"> <div v-if="(!thin_ && narrow && !hideTitle) || (actions && actions.length > 0)" :class="[$style.buttons, $style.buttonsRight]">
<template v-for="action in actions"> <template v-for="action in actions">
<button v-tooltip.noDelay="action.text" class="_button" :class="[$style.button, { [$style.highlighted]: action.highlighted }]" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button> <button v-tooltip.noDelay="action.text" class="_button" :class="[$style.button, { [$style.highlighted]: action.highlighted }]" @click.stop="action.handler" @touchstart="preventDrag"><i :class="action.icon"></i></button>
</template> </template>
@ -155,8 +155,10 @@ onUnmounted(() => {
.upper { .upper {
--height: 50px; --height: 50px;
--margin: var(--MI-margin);
display: flex; display: flex;
gap: var(--MI-margin); gap: var(--margin);
align-items: center;
height: var(--height); height: var(--height);
.tabs:first-child { .tabs:first-child {
@ -169,6 +171,7 @@ onUnmounted(() => {
&.thin { &.thin {
--height: 40px; --height: 40px;
--margin: 8px;
> .buttons { > .buttons {
> .button { > .button {
@ -179,12 +182,8 @@ onUnmounted(() => {
&.slim { &.slim {
text-align: center; text-align: center;
gap: 0;
.tabs:first-child { .titleContainer {
margin-left: 0;
}
> .titleContainer {
margin: 0 auto; margin: 0 auto;
max-width: 100%; max-width: 100%;
} }
@ -197,7 +196,7 @@ onUnmounted(() => {
} }
.buttons { .buttons {
--margin: 8px; flex-shrink: 0;
display: flex; display: flex;
align-items: center; align-items: center;
min-width: var(--height); min-width: var(--height);
@ -207,16 +206,6 @@ onUnmounted(() => {
} }
} }
.buttonsLeft {
composes: buttons;
margin: 0 var(--margin) 0 0;
}
.buttonsRight {
composes: buttons;
margin: 0 0 0 var(--margin);
}
.avatar { .avatar {
$size: 32px; $size: 32px;
display: inline-block; display: inline-block;
@ -231,7 +220,7 @@ onUnmounted(() => {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
height: var(--height); height: var(--height);
width: calc(var(--height) - (var(--margin))); width: calc(var(--height) - 8px);
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
border-radius: 5px; border-radius: 5px;
@ -254,6 +243,7 @@ onUnmounted(() => {
.titleContainer { .titleContainer {
display: flex; display: flex;
align-items: center; align-items: center;
min-width: 0;
max-width: min(30vw, 400px); max-width: min(30vw, 400px);
overflow: clip; overflow: clip;
white-space: nowrap; white-space: nowrap;
@ -287,9 +277,6 @@ onUnmounted(() => {
.title { .title {
min-width: 0; min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 1.1; line-height: 1.1;
} }