From 10533cb858313c38820523ecb9dde64aa376813a Mon Sep 17 00:00:00 2001 From: Manan Sadana Date: Mon, 25 Sep 2023 00:31:32 +0530 Subject: [PATCH 1/4] Fix: Clicking on pile opens members list --- res/css/structures/_SpaceRoomView.pcss | 1 + src/components/views/elements/FacePile.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/res/css/structures/_SpaceRoomView.pcss b/res/css/structures/_SpaceRoomView.pcss index a4a4aa78843..000781bd97a 100644 --- a/res/css/structures/_SpaceRoomView.pcss +++ b/res/css/structures/_SpaceRoomView.pcss @@ -189,6 +189,7 @@ limitations under the License. .mx_FacePile { display: inline-block; + cursor: pointer; } .mx_SpaceRoomView_landing_inviteButton, diff --git a/src/components/views/elements/FacePile.tsx b/src/components/views/elements/FacePile.tsx index 2ade713816d..ac8ce0af8c5 100644 --- a/src/components/views/elements/FacePile.tsx +++ b/src/components/views/elements/FacePile.tsx @@ -64,7 +64,7 @@ const FacePile: FC = ({ ); const content = ( -
+
{pileContents} {children}
From 6c3291e14df75d3c85c9c7599b0c304920298339 Mon Sep 17 00:00:00 2001 From: Manan Sadana Date: Mon, 2 Oct 2023 16:40:12 +0530 Subject: [PATCH 2/4] onClick used on Accessible Component --- src/components/views/elements/FacePile.tsx | 10 +++++++--- src/components/views/elements/RoomFacePile.tsx | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/views/elements/FacePile.tsx b/src/components/views/elements/FacePile.tsx index ac8ce0af8c5..b54bd04ae65 100644 --- a/src/components/views/elements/FacePile.tsx +++ b/src/components/views/elements/FacePile.tsx @@ -19,6 +19,7 @@ import { RoomMember } from "matrix-js-sdk/src/matrix"; import { AvatarStack, Tooltip } from "@vector-im/compound-web"; import MemberAvatar from "../avatars/MemberAvatar"; +import AccessibleButton, { ButtonEvent } from "./AccessibleButton"; interface IProps extends HTMLAttributes { members: RoomMember[]; @@ -28,6 +29,7 @@ interface IProps extends HTMLAttributes { tooltipShortcut?: string; children?: ReactNode; viewUserOnClick?: boolean; + onClick?: (e: ButtonEvent) => void | Promise; } const FacePile: FC = ({ @@ -64,9 +66,11 @@ const FacePile: FC = ({ ); const content = ( -
- {pileContents} - {children} +
+ + {pileContents} + {children} +
); diff --git a/src/components/views/elements/RoomFacePile.tsx b/src/components/views/elements/RoomFacePile.tsx index f1a0ba03a49..b30aa6fb632 100644 --- a/src/components/views/elements/RoomFacePile.tsx +++ b/src/components/views/elements/RoomFacePile.tsx @@ -23,6 +23,7 @@ import DMRoomMap from "../../../utils/DMRoomMap"; import FacePile from "./FacePile"; import { useRoomMembers } from "../../../hooks/useRoomMembers"; import MatrixClientContext from "../../../contexts/MatrixClientContext"; +import { ButtonEvent } from "./AccessibleButton"; const DEFAULT_NUM_FACES = 5; @@ -32,6 +33,7 @@ interface IProps extends HTMLAttributes { room: Room; onlyKnownUsers?: boolean; numShown?: number; + onClick?: (e: ButtonEvent) => void | Promise; } const RoomFacePile: FC = ({ room, onlyKnownUsers = true, numShown = DEFAULT_NUM_FACES, ...props }) => { From fd165fc532aa55a374ead0f2ee1e509f6a4aea58 Mon Sep 17 00:00:00 2001 From: Manan Sadana Date: Mon, 2 Oct 2023 19:51:54 +0530 Subject: [PATCH 3/4] Updated snapshots for testing --- .../__snapshots__/FacePile-test.tsx.snap | 26 ++++++++++++------- .../__snapshots__/RoomFacePile-test.tsx.snap | 26 ++++++++++++------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/test/components/views/elements/__snapshots__/FacePile-test.tsx.snap b/test/components/views/elements/__snapshots__/FacePile-test.tsx.snap index 9da61cd6575..df3dda43361 100644 --- a/test/components/views/elements/__snapshots__/FacePile-test.tsx.snap +++ b/test/components/views/elements/__snapshots__/FacePile-test.tsx.snap @@ -7,18 +7,24 @@ exports[` renders with a tooltip 1`] = ` data-state="closed" >
- - 4 - + + 4 + +
diff --git a/test/components/views/elements/__snapshots__/RoomFacePile-test.tsx.snap b/test/components/views/elements/__snapshots__/RoomFacePile-test.tsx.snap index 7ddcb5128f4..3b75d6f8439 100644 --- a/test/components/views/elements/__snapshots__/RoomFacePile-test.tsx.snap +++ b/test/components/views/elements/__snapshots__/RoomFacePile-test.tsx.snap @@ -7,18 +7,24 @@ exports[` renders 1`] = ` data-state="closed" >
- - b - + + b + +
From 8d21379edaab1a12c594d9eed60609585b7e0587 Mon Sep 17 00:00:00 2001 From: manancodes Date: Wed, 4 Oct 2023 15:43:18 +0530 Subject: [PATCH 4/4] Snapshots updated after merging --- .../views/elements/__snapshots__/FacePile-test.tsx.snap | 4 ++-- .../views/elements/__snapshots__/RoomFacePile-test.tsx.snap | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/components/views/elements/__snapshots__/FacePile-test.tsx.snap b/test/components/views/elements/__snapshots__/FacePile-test.tsx.snap index df3dda43361..6c2b64cc155 100644 --- a/test/components/views/elements/__snapshots__/FacePile-test.tsx.snap +++ b/test/components/views/elements/__snapshots__/FacePile-test.tsx.snap @@ -12,10 +12,10 @@ exports[` renders with a tooltip 1`] = ` tabindex="0" >
renders 1`] = ` tabindex="0" >