Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 0fc1c53

Browse files
authored
Iterate design of right panel empty state (#12796)
* Add reusable empty state for the right panel Signed-off-by: Michael Telatynski <[email protected]> * Update tests Signed-off-by: Michael Telatynski <[email protected]> * Improve coverage Signed-off-by: Michael Telatynski <[email protected]> --------- Signed-off-by: Michael Telatynski <[email protected]>
1 parent d202295 commit 0fc1c53

File tree

21 files changed

+266
-280
lines changed

21 files changed

+266
-280
lines changed

playwright/e2e/right-panel/file-panel.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ test.describe("FilePanel", () => {
5050
test.describe("render", () => {
5151
test("should render empty state", async ({ page }) => {
5252
// Wait until the information about the empty state is rendered
53-
await expect(page.locator(".mx_FilePanel_empty")).toBeVisible();
53+
await expect(page.locator(".mx_EmptyState")).toBeVisible();
5454

5555
// Take a snapshot of RightPanel - fix https://github.com/vector-im/element-web/issues/25332
5656
await expect(page.locator(".mx_RightPanel")).toMatchScreenshot("empty.png");

playwright/e2e/right-panel/notification-panel.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test.describe("NotificationPanel", () => {
3535
await page.getByRole("button", { name: "Notifications" }).click();
3636

3737
// Wait until the information about the empty state is rendered
38-
await expect(page.locator(".mx_NotificationPanel_empty")).toBeVisible();
38+
await expect(page.locator(".mx_EmptyState")).toBeVisible();
3939

4040
// Take a snapshot of RightPanel
4141
await expect(page.locator(".mx_RightPanel")).toMatchScreenshot("empty.png");

playwright/e2e/right-panel/right-panel.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ test.describe("RightPanel", () => {
104104

105105
await page.getByRole("menuitem", { name: "Files" }).click();
106106
await expect(page.locator(".mx_FilePanel")).toBeVisible();
107-
await expect(page.locator(".mx_FilePanel_empty")).toBeVisible();
107+
await expect(page.locator(".mx_EmptyState")).toBeVisible();
108108

109109
await page.getByTestId("base-card-back-button").click();
110110
await checkRoomSummaryCard(page, ROOM_NAME);
61.6 KB
Loading
60.7 KB
Loading

res/css/_components.pcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
@import "./structures/_MatrixChat.pcss";
7474
@import "./structures/_MessagePanel.pcss";
7575
@import "./structures/_NonUrgentToastContainer.pcss";
76-
@import "./structures/_NotificationPanel.pcss";
7776
@import "./structures/_QuickSettingsButton.pcss";
7877
@import "./structures/_RightPanel.pcss";
7978
@import "./structures/_RoomSearch.pcss";
@@ -259,6 +258,7 @@
259258
@import "./views/polls/pollHistory/_PollHistory.pcss";
260259
@import "./views/polls/pollHistory/_PollHistoryList.pcss";
261260
@import "./views/right_panel/_BaseCard.pcss";
261+
@import "./views/right_panel/_EmptyState.pcss";
262262
@import "./views/right_panel/_EncryptionInfo.pcss";
263263
@import "./views/right_panel/_PinnedMessagesCard.pcss";
264264
@import "./views/right_panel/_RightPanelTabs.pcss";

res/css/structures/_FilePanel.pcss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,3 @@ limitations under the License.
102102
padding-inline-start: 0;
103103
}
104104
}
105-
106-
.mx_FilePanel_empty::before {
107-
--maskImage: url("$(res)/img/element-icons/room/files.svg"); /* See: _RightPanel.pcss */
108-
}

res/css/structures/_NotificationPanel.pcss

Lines changed: 0 additions & 19 deletions
This file was deleted.

res/css/structures/_RightPanel.pcss

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -72,30 +72,3 @@ limitations under the License.
7272
order: 2;
7373
margin: auto;
7474
}
75-
76-
.mx_RightPanel_empty {
77-
margin-right: -28px;
78-
79-
h2 {
80-
font-weight: 700;
81-
margin: 16px 0;
82-
}
83-
84-
h2,
85-
p {
86-
font: var(--cpd-font-body-md-regular);
87-
}
88-
89-
&::before {
90-
content: "";
91-
display: block;
92-
margin: 11px auto 29px auto;
93-
height: 42px;
94-
width: 42px;
95-
background-color: $header-panel-text-primary-color;
96-
mask-image: var(--maskImage);
97-
mask-repeat: no-repeat;
98-
mask-size: contain;
99-
mask-position: center;
100-
}
101-
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
Copyright 2024 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
.mx_EmptyState {
18+
height: 100%;
19+
box-sizing: border-box;
20+
padding: var(--cpd-space-4x);
21+
text-align: center;
22+
23+
svg {
24+
width: 56px;
25+
height: 56px;
26+
box-sizing: border-box;
27+
border-radius: 8px;
28+
padding: var(--cpd-space-3x);
29+
background-color: $panel-actions;
30+
}
31+
32+
&::before {
33+
/* Bloom using magic numbers directly out of Figma */
34+
content: "";
35+
position: absolute;
36+
z-index: -1;
37+
width: 642px;
38+
height: 775px;
39+
right: -253.77px;
40+
top: 0;
41+
background: radial-gradient(49.95% 49.95% at 50% 50%, rgba(13, 189, 139, 0.12) 0%, rgba(18, 115, 235, 0) 100%);
42+
transform: rotate(-89.69deg);
43+
overflow: hidden;
44+
}
45+
}

0 commit comments

Comments
 (0)