new room list: keep space name in one line in header (#29369)

* fix(new room list): keep space name in one line in header

* test(new room list): update tests
This commit is contained in:
Florian Duros
2025-02-28 09:34:06 +01:00
committed by GitHub
parent 1ad1387e05
commit 7db909a47d
4 changed files with 36 additions and 17 deletions

View File

@@ -9,9 +9,16 @@
height: 60px; height: 60px;
padding: 0 var(--cpd-space-3x); padding: 0 var(--cpd-space-3x);
h1 { .mx_RoomListHeaderView_title {
all: unset; min-width: 0;
font: var(--cpd-font-heading-sm-semibold);
h1 {
all: unset;
font: var(--cpd-font-heading-sm-semibold);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
} }
button { button {

View File

@@ -38,8 +38,8 @@ export function RoomListHeaderView(): JSX.Element {
align="center" align="center"
data-testid="room-list-header" data-testid="room-list-header"
> >
<Flex align="center" gap="var(--cpd-space-1x)"> <Flex className="mx_RoomListHeaderView_title" align="center" gap="var(--cpd-space-1x)">
<h1>{vm.title}</h1> <h1 title={vm.title}>{vm.title}</h1>
{vm.displaySpaceMenu && <SpaceMenu vm={vm} />} {vm.displaySpaceMenu && <SpaceMenu vm={vm} />}
</Flex> </Flex>
{vm.displayComposeMenu && <ComposeMenu vm={vm} />} {vm.displayComposeMenu && <ComposeMenu vm={vm} />}

View File

@@ -9,10 +9,12 @@ exports[`<RoomListHeaderView /> compose menu should display the compose menu 1`]
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;"
> >
<div <div
class="mx_Flex" class="mx_Flex mx_RoomListHeaderView_title"
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);"
> >
<h1> <h1
title="title"
>
title title
</h1> </h1>
<button <button
@@ -94,10 +96,12 @@ exports[`<RoomListHeaderView /> compose menu should not display the compose menu
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;"
> >
<div <div
class="mx_Flex" class="mx_Flex mx_RoomListHeaderView_title"
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);"
> >
<h1> <h1
title="title"
>
title title
</h1> </h1>
<button <button
@@ -144,10 +148,12 @@ exports[`<RoomListHeaderView /> space menu should display the space menu 1`] = `
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;"
> >
<div <div
class="mx_Flex" class="mx_Flex mx_RoomListHeaderView_title"
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);"
> >
<h1> <h1
title="title"
>
title title
</h1> </h1>
<button <button
@@ -229,10 +235,12 @@ exports[`<RoomListHeaderView /> space menu should not display the space menu 1`]
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;"
> >
<div <div
class="mx_Flex" class="mx_Flex mx_RoomListHeaderView_title"
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);"
> >
<h1> <h1
title="title"
>
title title
</h1> </h1>
</div> </div>

View File

@@ -13,10 +13,12 @@ exports[`<RoomListPanel /> should not render the RoomListSearch component when U
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;"
> >
<div <div
class="mx_Flex" class="mx_Flex mx_RoomListHeaderView_title"
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);"
> >
<h1> <h1
title="Home"
>
Home Home
</h1> </h1>
</div> </div>
@@ -94,10 +96,12 @@ exports[`<RoomListPanel /> should render the RoomListSearch component when UICom
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: space-between; --mx-flex-gap: 0;"
> >
<div <div
class="mx_Flex" class="mx_Flex mx_RoomListHeaderView_title"
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);" style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-1x);"
> >
<h1> <h1
title="Home"
>
Home Home
</h1> </h1>
</div> </div>