From 672f08af71bf3ac92d4a7339287da2b81f9694f3 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Mon, 20 Feb 2023 17:40:55 +0900 Subject: [PATCH 1/3] Initialize line-height for room name on IRC layout Signed-off-by: Suguru Hirahara --- res/css/views/rooms/_IRCLayout.pcss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/res/css/views/rooms/_IRCLayout.pcss b/res/css/views/rooms/_IRCLayout.pcss index b3a98b571ef..61a7c5e090f 100644 --- a/res/css/views/rooms/_IRCLayout.pcss +++ b/res/css/views/rooms/_IRCLayout.pcss @@ -23,6 +23,12 @@ $irc-line-height: $font-18px; line-height: $irc-line-height !important; + .mx_NewRoomIntro { + > h2 { + line-height: initial; /* Cancel $irc-line-height */ + } + } + .mx_EventTile { --EventTile_irc_line-padding-block: 1px; From 1e45c229a62791bb7aff8f3dd8b149b9de794cb2 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 11 Mar 2023 00:11:44 +0900 Subject: [PATCH 2/3] Check room name line-height Signed-off-by: Suguru Hirahara --- cypress/e2e/timeline/timeline.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/timeline/timeline.spec.ts b/cypress/e2e/timeline/timeline.spec.ts index 18bbaa04c78..afb02477fb5 100644 --- a/cypress/e2e/timeline/timeline.spec.ts +++ b/cypress/e2e/timeline/timeline.spec.ts @@ -735,8 +735,11 @@ describe("Timeline", () => { // Exclude timestamp and read marker from snapshots const percyCSS = ".mx_MessageTimestamp, .mx_RoomView_myReadMarker { visibility: hidden !important; }"; - // Make sure the strings do not overflow on IRC layout + // Make sure the strings do not overflow and check room name line-height on IRC layout cy.setSettingValue("layout", null, SettingLevel.DEVICE, Layout.IRC); + cy.get(".mx_IRCLayout .mx_NewRoomIntro h2") + .should("have.text", LONG_STRING) + .should("have.css", "line-height", "normal"); // Check room name line-height is reset cy.get(".mx_MainSplit").percySnapshotElement("Long strings with a reply on IRC layout", { percyCSS }); // Make sure the strings do not overflow on modern layout From 61df8d9305111c903df3e256a13abb23ee365977 Mon Sep 17 00:00:00 2001 From: Suguru Hirahara Date: Sat, 11 Mar 2023 00:25:16 +0900 Subject: [PATCH 3/3] Test with the default layout Signed-off-by: Suguru Hirahara --- cypress/e2e/timeline/timeline.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/e2e/timeline/timeline.spec.ts b/cypress/e2e/timeline/timeline.spec.ts index afb02477fb5..537b796f346 100644 --- a/cypress/e2e/timeline/timeline.spec.ts +++ b/cypress/e2e/timeline/timeline.spec.ts @@ -161,6 +161,9 @@ describe("Timeline", () => { "created and configured the room.", ).should("exist"); + // Check room name line-height is reset + cy.get(".mx_IRCLayout .mx_NewRoomIntro h2").should("have.css", "line-height", "normal"); + cy.get(".mx_MainSplit").percySnapshotElement("Configured room on IRC layout"); }); @@ -735,11 +738,8 @@ describe("Timeline", () => { // Exclude timestamp and read marker from snapshots const percyCSS = ".mx_MessageTimestamp, .mx_RoomView_myReadMarker { visibility: hidden !important; }"; - // Make sure the strings do not overflow and check room name line-height on IRC layout + // Make sure the strings do not overflow on IRC layout cy.setSettingValue("layout", null, SettingLevel.DEVICE, Layout.IRC); - cy.get(".mx_IRCLayout .mx_NewRoomIntro h2") - .should("have.text", LONG_STRING) - .should("have.css", "line-height", "normal"); // Check room name line-height is reset cy.get(".mx_MainSplit").percySnapshotElement("Long strings with a reply on IRC layout", { percyCSS }); // Make sure the strings do not overflow on modern layout