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

Set expected value of line-height to expanded generic event list summary (GELS) spacer on IRC layout #10211

Merged
merged 22 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d617422
Set expected line height to an expanded GELS line on IRC layout, add …
luixxiul Feb 21, 2023
fa627f4
Add a test for compact modern/group layout
luixxiul Feb 21, 2023
be353ce
Create a new test category on timeline.spec.ts
luixxiul Feb 21, 2023
03f0837
Rename the class name as 'spacer'
luixxiul Feb 21, 2023
3c0f7dd
Add a test for GELS' spacer on bubble layout
luixxiul Feb 21, 2023
6ba9e2b
Remove a percySnapshot
luixxiul Feb 21, 2023
f00176b
Improve a test
luixxiul Feb 22, 2023
fde3515
Merge branch 'develop' into fix-gels-line-height-IRClayout
luixxiul Feb 23, 2023
8253ae1
Add percySnapshotElement
luixxiul Feb 23, 2023
42f0912
lint
luixxiul Feb 23, 2023
bc507c7
Add percy tests
luixxiul Mar 1, 2023
0894543
Fix typos
luixxiul Mar 1, 2023
d37fad9
Merge branch 'develop' into fix-gels-line-height-IRClayout
luixxiul Mar 1, 2023
22ec165
Merge branch 'develop' into fix-gels-line-height-IRClayout
luixxiul Mar 1, 2023
cc3939d
Fix percyCSS for timestamps on normal event tiles
luixxiul Mar 1, 2023
c27d394
lint
luixxiul Mar 1, 2023
a45c9cc
Merge branch 'develop' into fix-gels-line-height-IRClayout
luixxiul Mar 1, 2023
53a0f6e
Edit a test
luixxiul Mar 7, 2023
914b4ee
Merge branch 'develop' into fix-gels-line-height-IRClayout
luixxiul Mar 8, 2023
13e100d
Merge branch 'develop' into fix-gels-line-height-IRClayout
luixxiul Mar 15, 2023
02ae060
Merge branch 'develop' into fix-gels-line-height-IRClayout
luixxiul Mar 19, 2023
7b0268d
Merge branch 'develop' into fix-gels-line-height-IRClayout
luixxiul Mar 24, 2023
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
72 changes: 71 additions & 1 deletion cypress/e2e/timeline/timeline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe("Timeline", () => {
});
});

describe("message displaying", () => {
describe("configure room", () => {
beforeEach(() => {
cy.injectAxe();
});
Expand All @@ -163,6 +163,60 @@ describe("Timeline", () => {
cy.percySnapshot("Configured room on IRC layout");
});

it("should have an expanded generic event list summary (GELS) on IRC layout", () => {
cy.visit("/#/room/" + roomId);
cy.setSettingValue("layout", null, SettingLevel.DEVICE, Layout.IRC);

// Wait until configuration is finished
cy.contains(
".mx_RoomView_body .mx_GenericEventListSummary .mx_GenericEventListSummary_summary",
"created and configured the room.",
).should("exist");

// Click "expand" link button
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]").click();
// Make sure the "expand" link button worked
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=true]").should("exist");

// Check the height of expanded GELS line
cy.get(".mx_GenericEventListSummary[data-layout=irc] .mx_GenericEventListSummary_spacer").should(
"have.css",
"line-height",
"18px", // $irc-line-height: $font-18px (See: _IRCLayout.pcss)
);

cy.get(".mx_Spinner").should("not.exist");
});

it("should have an expanded generic event list summary (GELS) on compact modern/group layout", () => {
sendEvent(roomId);
cy.visit("/#/room/" + roomId);
cy.setSettingValue("layout", null, SettingLevel.DEVICE, Layout.Group).setSettingValue(
"useCompactLayout",
null,
SettingLevel.DEVICE,
true,
);
cy.contains(
".mx_RoomView_body .mx_GenericEventListSummary .mx_GenericEventListSummary_summary",
"created and configured the room.",
).should("exist");

// Click "expand" link button
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]").click();
// Make sure the "expand" link button worked
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=true]").should("exist");

// Check the height of expanded GELS line
cy.get(".mx_GenericEventListSummary[data-layout=group] .mx_GenericEventListSummary_spacer").should(
"have.css",
"line-height",
"22px", // $font-22px (See: _GenericEventListSummary.pcss)
);

cy.get(".mx_Spinner").should("not.exist");
});

it("should add inline start margin to an event line on IRC layout", () => {
cy.visit("/#/room/" + roomId);
cy.setSettingValue("layout", null, SettingLevel.DEVICE, Layout.IRC);
Expand Down Expand Up @@ -192,6 +246,12 @@ describe("Timeline", () => {
cy.percySnapshot("Event line with inline start margin on IRC layout", { percyCSS });
cy.checkA11y();
});
});

describe("message displaying", () => {
beforeEach(() => {
cy.injectAxe();
});

it("should set inline start padding to a hidden event line", () => {
sendEvent(roomId);
Expand Down Expand Up @@ -273,6 +333,16 @@ describe("Timeline", () => {
// Click "expand" link button
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]").click();

// Make sure the "expand" link button worked
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=true]").should("exist");

// Make sure spacer is not displayed on bubble layout
cy.get(".mx_GenericEventListSummary[data-layout=bubble] .mx_GenericEventListSummary_spacer").should(
"have.css",
"display",
"none", // See: _GenericEventListSummary.pcss
);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding a percy test here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added with bc507c7 along with another one.

// Click "collapse" link button on the first hovered info event line
cy.get(".mx_GenericEventListSummary_unstyledList .mx_EventTile_info:first-of-type").realHover();
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=true]").click({ force: false });
Expand Down
20 changes: 12 additions & 8 deletions res/css/views/elements/_GenericEventListSummary.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ limitations under the License.
margin-right: $spacing-8;
}

.mx_GenericEventListSummary_spacer {
border-bottom: 1px solid $primary-hairline-color;
margin-left: 63px; /* TODO: Use a varilable */
line-height: $font-30px; /* TODO: Use a varilable */
luixxiul marked this conversation as resolved.
Show resolved Hide resolved

.mx_IRCLayout & {
line-height: var(--line-height);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This declaration has the expected line-height applied to the spacer line against line-height: $font-30px;.

}
}

&[data-layout="irc"],
&[data-layout="group"] {
.mx_GenericEventListSummary_toggle {
Expand Down Expand Up @@ -51,7 +61,7 @@ limitations under the License.
}
}

.mx_GenericEventListSummary_line {
.mx_GenericEventListSummary_spacer {
display: none;
}

Expand Down Expand Up @@ -88,7 +98,7 @@ limitations under the License.
line-height: $font-20px;
}

.mx_GenericEventListSummary_line {
.mx_GenericEventListSummary_spacer {
line-height: $font-22px;
}

Expand Down Expand Up @@ -117,9 +127,3 @@ limitations under the License.
cursor: pointer;
}
}

.mx_GenericEventListSummary_line {
border-bottom: 1px solid $primary-hairline-color;
margin-left: 63px;
line-height: $font-30px;
}
3 changes: 2 additions & 1 deletion res/css/views/rooms/_IRCLayout.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ $irc-line-height: $font-18px;
--name-width: 70px;
--icon-width: 14px;
--right-padding: 5px;
--line-height: $irc-line-height;

line-height: $irc-line-height !important;
line-height: var(--line-height) !important;

.mx_EventTile {
--EventTile_irc_line-padding-block: 1px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const GenericEventListSummary: React.FC<IProps> = ({
if (expanded) {
body = (
<React.Fragment>
<div className="mx_GenericEventListSummary_line">&nbsp;</div>
<div className="mx_GenericEventListSummary_spacer">&nbsp;</div>
<ol className="mx_GenericEventListSummary_unstyledList">{children}</ol>
</React.Fragment>
);
Expand Down