Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate icons using Compound #28239

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions playwright/e2e/timeline/timeline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@
await expect(
page.locator(".mx_RoomView").getByText("This message has an inline emoji 👒"),
).toBeInViewport();
await expect(page.locator(".mx_MainSplit")).toMatchScreenshot(

Check failure on line 557 in playwright/e2e/timeline/timeline.spec.ts

View workflow job for this annotation

GitHub Actions / Run Tests 6/6

timeline/timeline.spec.ts:467:13 › Timeline › message displaying › should render EventTiles on IRC

2) timeline/timeline.spec.ts:467:13 › Timeline › message displaying › should render EventTiles on IRC, modern (group), and bubble layout Error: Screenshot comparison failed: 6560 pixels (ratio 0.02 of all image pixels) are different. Expected: /home/runner/work/element-web/element-web/playwright/snapshots/timeline/timeline.spec.ts/event-tiles-bubble-layout-linux.png Received: /home/runner/work/element-web/element-web/playwright/test-results/timeline-timeline-Timeline-1502b-ern-group-and-bubble-layout/event-tiles-bubble-layout-actual.png Diff: /home/runner/work/element-web/element-web/playwright/test-results/timeline-timeline-Timeline-1502b-ern-group-and-bubble-layout/event-tiles-bubble-layout-diff.png Call log: - expect.toHaveScreenshot(event-tiles-bubble-layout.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('.mx_MainSplit') - locator resolved to <div class="mx_MainSplit">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 26765 pixels (ratio 0.05 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.mx_MainSplit') - locator resolved to <div class="mx_MainSplit">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 26765 pixels (ratio 0.05 of all image pixels) are different. - waiting 250ms before taking screenshot - waiting for locator('.mx_MainSplit') - locator resolved to <div class="mx_MainSplit">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 6560 pixels (ratio 0.02 of all image pixels) are different. - waiting 500ms before taking screenshot - waiting for locator('.mx_MainSplit') - locator resolved to <div class="mx_MainSplit">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 6560 pixels (ratio 0.02 of all image pixels) are different. 555 | page.locator(".mx_RoomView").getByText("This message has an inline emoji 👒"), 556 | ).toBeInViewport(); > 557 | await expect(page.locator(".mx_MainSplit")).toMatchScreenshot( | ^ 558 | "event-tiles-bubble-layout.png", 559 | screenshotOptions, 560 | ); at /home/runner/work/element-web/element-web/playwright/e2e/timeline/timeline.spec.ts:557:57
"event-tiles-bubble-layout.png",
screenshotOptions,
);
Expand Down Expand Up @@ -653,7 +653,7 @@
const toggleEventButton = viewSourceEventExpanded.getByRole("button", { name: "toggle event" });
// Check size and position of toggle on expanded view source event
// See: _ViewSourceEvent.pcss
await expect(toggleEventButton).toHaveCSS("height", "12px"); // --ViewSourceEvent_toggle-size
await expect(toggleEventButton).toHaveCSS("height", "16px"); // --ViewSourceEvent_toggle-size
await expect(toggleEventButton).toHaveCSS("align-self", "flex-end");
// Click again to collapse the source
await toggleEventButton.click({ position: { x: 0, y: 0 } });
Expand All @@ -679,7 +679,7 @@
);

// Click view source event toggle
await viewSourceEventIrc.getByRole("button", { name: "toggle event" }).click({ position: { x: 0, y: 0 } });
await viewSourceEventIrc.getByRole("button", { name: "toggle event" }).click({ position: { x: 8, y: 8 } });

// Make sure the expand toggle worked
await expect(page.locator(".mx_EventTile[data-layout=irc] .mx_ViewSourceEvent_expanded")).toBeVisible();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion res/css/components/views/location/_ZoomButtons.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Please see LICENSE files in the repository root for full details.
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.25);

.mx_ZoomButtons_icon {
$ZoomButtons_icon-size: 10px;
$ZoomButtons_icon-size: 12px;

height: $ZoomButtons_icon-size;
width: $ZoomButtons_icon-size;
Expand Down
4 changes: 2 additions & 2 deletions res/css/structures/_SpacePanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Please see LICENSE files in the repository root for full details.
&.mx_SpaceButton_new .mx_SpaceButton_icon {
&::before {
background-color: $primary-content;
mask-image: url("$(res)/img/element-icons/plus.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/plus.svg");
transition: all 0.2s ease-in-out; /* TODO transition */
}
}
Expand Down Expand Up @@ -434,7 +434,7 @@ Please see LICENSE files in the repository root for full details.
}

.mx_SpacePanel_iconPlus::before {
mask-image: url("$(res)/img/element-icons/plus.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/plus.svg");
}

.mx_SpacePanel_iconExplore::before {
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/context_menus/_MessageContextMenu.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Please see LICENSE files in the repository root for full details.
}

.mx_MessageContextMenu_iconCollapse::before {
mask-image: url("$(res)/img/element-icons/message/chevron-up.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/chevron-up.svg");
}

.mx_MessageContextMenu_iconReport::before {
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/elements/_InviteReason.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Please see LICENSE files in the repository root for full details.
content: "";
margin-right: 8px;
background-color: $secondary-content;
mask-image: url("$(res)/img/feather-customised/eye.svg");
mask-image: url("$(res)/img/element-icons/eye.svg");
display: inline-block;
width: 18px;
height: 14px;
Expand Down
2 changes: 1 addition & 1 deletion res/css/views/messages/_MImageBody.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Please see LICENSE files in the repository root for full details.
margin-right: 8px;

background-color: $accent;
mask-image: url("$(res)/img/feather-customised/eye.svg");
mask-image: url("$(res)/img/element-icons/eye.svg");
display: inline-block;
width: 18px;
height: 14px;
Expand Down
18 changes: 7 additions & 11 deletions res/css/views/messages/_ViewSourceEvent.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ Please see LICENSE files in the repository root for full details.
}

.mx_ViewSourceEvent_toggle {
--ViewSourceEvent_toggle-size: 12px;
--ViewSourceEvent_toggle-size: 16px;

visibility: hidden;
/* override styles from AccessibleButton */
border-radius: 0;
/* icon */
mask-repeat: no-repeat;
mask-position: 0 center;
mask-size: auto var(--ViewSourceEvent_toggle-size);
width: var(--ViewSourceEvent_toggle-size);
min-width: var(--ViewSourceEvent_toggle-size);
background-color: $accent;
mask-image: url("$(res)/img/element-icons/maximise-expand.svg");

svg {
color: $accent;
width: var(--ViewSourceEvent_toggle-size);
height: var(--ViewSourceEvent_toggle-size);
}

.mx_EventTile:hover & {
visibility: visible;
Expand All @@ -47,8 +46,5 @@ Please see LICENSE files in the repository root for full details.
&.mx_ViewSourceEvent_expanded .mx_ViewSourceEvent_toggle {
align-self: flex-end;
height: var(--ViewSourceEvent_toggle-size);
mask-position: 0 bottom;
margin-bottom: 5px;
mask-image: url("$(res)/img/element-icons/minimise-collapse.svg");
}
}
2 changes: 1 addition & 1 deletion res/css/views/right_panel/_BaseCard.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Please see LICENSE files in the repository root for full details.
width: 100%;
mask-repeat: no-repeat;
mask-position: center;
mask-image: url("$(res)/img/element-icons/message/overflow-large.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/overflow-horizontal.svg");
background-color: $secondary-content;
}

Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_EventTile.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -982,11 +982,11 @@ $left-gutter: 64px;
}

.mx_EventTile_collapseButton {
mask-image: url("$(res)/img/element-icons/minimise-collapse.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/collapse.svg");
}

.mx_EventTile_expandButton {
mask-image: url("$(res)/img/element-icons/maximise-expand.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/expand.svg");
}

.mx_EventTile_tileError {
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_JumpToBottomButton.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ Please see LICENSE files in the repository root for full details.
content: "";
position: absolute;
inset: 0;
mask-image: url("$(res)/img/element-icons/message/chevron-up.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/chevron-up.svg");
mask-repeat: no-repeat;
mask-size: 20px;
mask-size: 24px;
mask-position: center 6px;
transform: rotate(180deg);
background: var(--cpd-color-icon-tertiary);
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_RoomListHeader.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Please see LICENSE files in the repository root for full details.
mask-size: contain;
mask-repeat: no-repeat;
background-color: $secondary-content;
mask-image: url("$(res)/img/element-icons/roomlist/plus.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/plus.svg");
}

&:hover {
Expand Down Expand Up @@ -104,5 +104,5 @@ Please see LICENSE files in the repository root for full details.
mask-image: url("$(res)/img/element-icons/roomlist/hash-search.svg");
}
.mx_RoomListHeader_iconPlus::before {
mask-image: url("$(res)/img/element-icons/plus.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/plus.svg");
}
2 changes: 1 addition & 1 deletion res/css/views/rooms/_RoomSublist.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Please see LICENSE files in the repository root for full details.
}

.mx_RoomSublist_auxButton::before {
mask-image: url("$(res)/img/element-icons/roomlist/plus.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/plus.svg");
}

.mx_RoomSublist_menuButton::before {
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_TopUnreadMessagesBar.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Please see LICENSE files in the repository root for full details.
position: absolute;
width: 36px;
height: 36px;
mask-image: url("$(res)/img/element-icons/message/chevron-up.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/chevron-up.svg");
mask-repeat: no-repeat;
mask-size: 20px;
mask-size: 24px;
mask-position: center;
background: var(--cpd-color-icon-tertiary);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ Please see LICENSE files in the repository root for full details.
bottom: 0;

&::before {
width: 14px;
height: 14px;
mask-image: url("$(res)/img/element-icons/message/chevron-up.svg");
width: 16px;
height: 16px;
mask-image: url("@vector-im/compound-design-tokens/icons/chevron-up.svg");
}

&.mx_LegacyCallViewButtons_dropdownButton_collapsed::before {
Expand Down
5 changes: 0 additions & 5 deletions res/img/element-icons/add-photo.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/element-icons/community-rooms.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/element-icons/maximise-expand.svg

This file was deleted.

1 change: 0 additions & 1 deletion res/img/element-icons/message/chevron-up.svg

This file was deleted.

5 changes: 0 additions & 5 deletions res/img/element-icons/message/overflow-large.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/element-icons/minimise-collapse.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/element-icons/minus-button.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/element-icons/plus-button.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/element-icons/plus.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/element-icons/roomlist/archived.svg

This file was deleted.

3 changes: 0 additions & 3 deletions res/img/element-icons/roomlist/plus.svg

This file was deleted.

5 changes: 0 additions & 5 deletions res/img/feather-customised/alert-triangle.svg

This file was deleted.

6 changes: 0 additions & 6 deletions res/img/feather-customised/eye.svg

This file was deleted.

4 changes: 0 additions & 4 deletions res/img/feather-customised/plus.svg

This file was deleted.

5 changes: 0 additions & 5 deletions res/img/feather-customised/widget/external-link.svg

This file was deleted.

15 changes: 0 additions & 15 deletions res/img/icon-address-delete.svg

This file was deleted.

Loading
Loading