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

Commit 161a333

Browse files
authored
Improve clickability of "collapse" link button on bubble layout (#9037)
1 parent 48552c2 commit 161a333

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

cypress/e2e/14-timeline/timeline.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import type { EventType } from "matrix-js-sdk/src/@types/event";
2323
import type { MatrixClient } from "matrix-js-sdk/src/client";
2424
import { SynapseInstance } from "../../plugins/synapsedocker";
2525
import { SettingLevel } from "../../../src/settings/SettingLevel";
26+
import { Layout } from "../../../src/settings/enums/Layout";
2627
import Chainable = Cypress.Chainable;
2728

2829
// The avatar size used in the timeline
@@ -141,5 +142,22 @@ describe("Timeline", () => {
141142
expectAvatar(e, newAvatarUrl);
142143
});
143144
});
145+
146+
it("should click 'collapse' link button on the first hovered info event line on bubble layout", () => {
147+
cy.visit("/#/room/" + roomId);
148+
cy.setSettingValue("layout", null, SettingLevel.DEVICE, Layout.Bubble);
149+
cy.contains(".mx_RoomView_body .mx_GenericEventListSummary[data-layout=bubble] " +
150+
".mx_GenericEventListSummary_summary", "created and configured the room.");
151+
152+
// Click "expand" link button
153+
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]").click();
154+
155+
// Click "collapse" link button on the first hovered info event line
156+
cy.get(".mx_GenericEventListSummary_unstyledList .mx_EventTile_info:first-of-type").realHover()
157+
.get(".mx_GenericEventListSummary_toggle[aria-expanded=true]").click({ force: false });
158+
159+
// Make sure "collapse" link button worked
160+
cy.get(".mx_GenericEventListSummary_toggle[aria-expanded=false]");
161+
});
144162
});
145163
});

res/css/views/messages/_MessageActionBar.pcss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ limitations under the License.
5454
left: -58px;
5555
z-index: -1;
5656
cursor: initial;
57+
58+
/* stylelint-disable-next-line max-line-length */
59+
.mx_GenericEventListSummary[data-layout="bubble"] .mx_GenericEventListSummary_toggle ~ .mx_GenericEventListSummary_unstyledList .mx_EventTile_info:first-of-type & {
60+
// improve clickability of "collapse" link button on bubble layout by reducing width and height values
61+
// mx_GenericEventListSummary_toggle ~: to apply rules to action bar when "collapse" button is available
62+
// mx_EventTile_info:first-of-type: to apply rules to the info event tile just under "collapse" button
63+
// TODO: use a new class name instead
64+
width: 100%;
65+
height: 100%;
66+
top: 0;
67+
left: 0;
68+
}
5769
}
5870

5971
>* {

0 commit comments

Comments
 (0)