diff --git a/playwright/pages/ElementAppPage.ts b/playwright/pages/ElementAppPage.ts index 82497317c31..d7689230e1c 100644 --- a/playwright/pages/ElementAppPage.ts +++ b/playwright/pages/ElementAppPage.ts @@ -218,7 +218,7 @@ export class ElementAppPage { */ public async inviteUserToCurrentRoom(userId: string): Promise { await this.toggleRoomInfoPanel(); // TODO skip this if the room info panel is already open - await this.page.getByLabel("Right panel").getByRole("menuitem", { name: "Invite" }).click(); + await this.page.getByTestId("right-panel").getByRole("menuitem", { name: "Invite" }).click(); const input = this.page.getByRole("dialog").getByTestId("invite-dialog-input"); await input.fill(userId); diff --git a/playwright/snapshots/user-view/user-view.spec.ts/user-info-linux.png b/playwright/snapshots/user-view/user-view.spec.ts/user-info-linux.png index df1a991e9a4..a4f6a476f66 100644 Binary files a/playwright/snapshots/user-view/user-view.spec.ts/user-info-linux.png and b/playwright/snapshots/user-view/user-view.spec.ts/user-info-linux.png differ diff --git a/src/components/structures/RightPanel.tsx b/src/components/structures/RightPanel.tsx index e006b1d92aa..24c16554554 100644 --- a/src/components/structures/RightPanel.tsx +++ b/src/components/structures/RightPanel.tsx @@ -34,7 +34,6 @@ import { Action } from "../../dispatcher/actions"; import { type XOR } from "../../@types/common"; import ExtensionsCard from "../views/right_panel/ExtensionsCard"; import MemberListView from "../views/rooms/MemberList/MemberListView"; -import { _t } from "../../languageHandler"; interface BaseProps { overwriteCard?: IRightPanelCard; // used to display a custom card and ignoring the RightPanelStore (used for UserView) @@ -65,7 +64,6 @@ interface IState { export default class RightPanel extends React.Component { public static contextType = MatrixClientContext; declare public context: React.ContextType; - private ref = React.createRef(); public constructor(props: Props) { super(props); @@ -84,7 +82,6 @@ export default class RightPanel extends React.Component { public componentDidMount(): void { this.context.on(RoomStateEvent.Members, this.onRoomStateMember); RightPanelStore.instance.on(UPDATE_EVENT, this.onRightPanelStoreUpdate); - this.ref.current?.focus(); } public componentWillUnmount(): void { @@ -122,13 +119,7 @@ export default class RightPanel extends React.Component { }; private onRightPanelStoreUpdate = (): void => { - const oldPhase = this.state.phase; - const newState = RightPanel.getDerivedStateFromProps(this.props) as IState; - this.setState({ ...newState }); - - if (oldPhase !== newState.phase) { - this.ref.current?.focus(); - } + this.setState({ ...(RightPanel.getDerivedStateFromProps(this.props) as IState) }); }; private onClose = (): void => { @@ -289,14 +280,7 @@ export default class RightPanel extends React.Component { } return ( -