Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion playwright/pages/ElementAppPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export class ElementAppPage {
*/
public async inviteUserToCurrentRoom(userId: string): Promise<void> {
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);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 2 additions & 18 deletions src/components/structures/RightPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -65,7 +64,6 @@ interface IState {
export default class RightPanel extends React.Component<Props, IState> {
public static contextType = MatrixClientContext;
declare public context: React.ContextType<typeof MatrixClientContext>;
private ref = React.createRef<HTMLDivElement>();

public constructor(props: Props) {
super(props);
Expand All @@ -84,7 +82,6 @@ export default class RightPanel extends React.Component<Props, IState> {
public componentDidMount(): void {
this.context.on(RoomStateEvent.Members, this.onRoomStateMember);
RightPanelStore.instance.on(UPDATE_EVENT, this.onRightPanelStoreUpdate);
this.ref.current?.focus();
}

public componentWillUnmount(): void {
Expand Down Expand Up @@ -122,13 +119,7 @@ export default class RightPanel extends React.Component<Props, IState> {
};

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 => {
Expand Down Expand Up @@ -289,14 +280,7 @@ export default class RightPanel extends React.Component<Props, IState> {
}

return (
<aside
aria-label={_t("right_panel|title")}
ref={this.ref}
className="mx_RightPanel"
id="mx_RightPanel"
data-testid="right-panel"
tabIndex={-1}
>
<aside className="mx_RightPanel" id="mx_RightPanel" data-testid="right-panel">
{card}
</aside>
);
Expand Down
1 change: 0 additions & 1 deletion src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,6 @@
"thread_list": {
"context_menu_label": "Thread options"
},
"title": "Right panel",
"video_room_chat": {
"title": "Chat"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1958,11 +1958,9 @@ exports[`RoomView video rooms should render joined video room view 1`] = `
style="position: relative; user-select: auto; width: 420px; height: 100%; max-width: 50%; min-width: 320px; box-sizing: border-box; flex-shrink: 0;"
>
<aside
aria-label="Right panel"
class="mx_RightPanel"
data-testid="right-panel"
id="mx_RightPanel"
tabindex="-1"
>
<div
class="mx_BaseCard mx_ThreadPanel mx_TimelineCard"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
exports[`AppTile destroys non-persisted right panel widget on room change 1`] = `
<DocumentFragment>
<aside
aria-label="Right panel"
class="mx_RightPanel"
data-testid="right-panel"
id="mx_RightPanel"
tabindex="-1"
>
<div
class="mx_BaseCard mx_WidgetCard"
Expand Down
Loading