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

Commit 38a9134

Browse files
authored
Improve clickability of view source event toggle button (#9068)
* Improve clickability of view source event toggle button Signed-off-by: Suguru Hirahara <[email protected]> * Fix compression Signed-off-by: Suguru Hirahara <[email protected]> * Make it easy to select subsequent events Signed-off-by: Suguru Hirahara <[email protected]>
1 parent b90ea87 commit 38a9134

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,28 @@ describe("Timeline", () => {
151151
cy.percySnapshot("Configured room on IRC layout");
152152
});
153153

154+
it("should click top left of view source event toggle", () => {
155+
sendEvent(roomId);
156+
cy.visit("/#/room/" + roomId);
157+
cy.setSettingValue("showHiddenEventsInTimeline", null, SettingLevel.DEVICE, true);
158+
cy.contains(".mx_RoomView_body .mx_GenericEventListSummary " +
159+
".mx_GenericEventListSummary_summary", "created and configured the room.");
160+
161+
// Edit message
162+
cy.get(".mx_RoomView_body .mx_EventTile").contains(".mx_EventTile_line", "Message").within(() => {
163+
cy.get('[aria-label="Edit"]').click({ force: true }); // Cypress has no ability to hover
164+
cy.get(".mx_BasicMessageComposer_input").type("Edit{enter}");
165+
});
166+
cy.get(".mx_RoomView_body .mx_EventTile").contains(".mx_EventTile[data-scroll-tokens]", "MessageEdit");
167+
168+
// Click top left of the event toggle, which should not be covered by MessageActionBar's safe area
169+
cy.get(".mx_EventTile .mx_ViewSourceEvent").realHover()
170+
.get(".mx_EventTile .mx_ViewSourceEvent .mx_ViewSourceEvent_toggle").click('topLeft', { force: false });
171+
172+
// Make sure the expand toggle worked
173+
cy.get(".mx_EventTile .mx_ViewSourceEvent_expanded .mx_ViewSourceEvent_toggle").should("be.visible");
174+
});
175+
154176
it("should click 'collapse' link button on the first hovered info event line on bubble layout", () => {
155177
cy.visit("/#/room/" + roomId);
156178
cy.setSettingValue("layout", null, SettingLevel.DEVICE, Layout.Bubble);

res/css/views/messages/_MessageActionBar.pcss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ limitations under the License.
6666
top: 0;
6767
left: 0;
6868
}
69+
70+
.mx_EventTile_info .mx_ViewSourceEvent ~ & {
71+
// improve clickability of view source event toggle button by removing vertical safe area
72+
width: 100%;
73+
height: 100%;
74+
top: 0;
75+
left: 0;
76+
}
6977
}
7078

7179
>* {

res/css/views/messages/_ViewSourceEvent.pcss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ limitations under the License.
4141
mask-position: 0 center;
4242
mask-size: auto 12px;
4343
width: 12px;
44+
min-width: 12px;
4445
background-color: $accent;
4546
mask-image: url("$(res)/img/element-icons/maximise-expand.svg");
4647
}

0 commit comments

Comments
 (0)