Skip to content

Commit

Permalink
Try fix room opening regression, add unfocus of room when going back,…
Browse files Browse the repository at this point in the history
… UI tweaks
  • Loading branch information
octospacc committed Dec 28, 2023
1 parent 4e11ec5 commit 5b7606e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions matrix-react-sdk/res/css/structures/_ContextualMenu.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.
.mx_ContextualMenu_wrapper {
position: fixed;
z-index: 5000;
max-width: 100%;
}

.mx_ContextualMenu_background {
Expand Down
1 change: 1 addition & 0 deletions matrix-react-sdk/res/css/structures/_SpaceRoomView.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ limitations under the License.
position: relative;
padding: 16px 32px 16px 72px;
width: 432px;
max-width: 100%;
box-sizing: border-box;
border-radius: 8px;
border: 1px solid $input-border-color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ limitations under the License.
.mx_ContextualMenu {
padding: 24px;
width: 480px;
max-width: 100%;
box-sizing: border-box;
background-color: $background;
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,10 @@ export default class RoomHeader extends React.Component<IProps, IState> {
>
<AccessibleButton
className="mx_LegacyRoomHeader_button mx_BaseCard_back"
style={{ marginLeft: "4px" }}
onClick={()=>{
defaultDispatcher.dispatch<ViewRoomPayload>({
action: Action.ViewHomePage,
action: Action.GoBackFromRoom,
});
}}
/>
Expand Down
25 changes: 23 additions & 2 deletions matrix-react-sdk/src/stores/RoomViewStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,25 @@ export class RoomViewStore extends EventEmitter {
wasContextSwitch: false,
viewingCall: false,
});
document.getElementsByClassName('mx_LeftPanel_outerWrapper')[0].style.display = "";
doClearCurrentVoiceBroadcastPlaybackIfStopped(this.stores.voiceBroadcastPlaybacksStore);
break;
case Action.GoBackFromRoom:
const currentSpaceElem = document.querySelector('.mx_SpaceItem[aria-selected="true"]');
this.setState({
roomId: null,
roomAlias: null,
viaServers: [],
wasContextSwitch: false,
viewingCall: false,
});
// go to space if was there before, else go home
if (currentSpaceElem?.dataset?.rbdDraggableId) {
location.hash = `#/room/${currentSpaceElem.dataset.rbdDraggableId}`;
} else {
location.hash = `#/home`;
}
const leftPanelOuterElems = document.getElementsByClassName('mx_LeftPanel_outerWrapper');
if (leftPanelOuterElems.length > 0) leftPanelOuterElems[0].style.display = "";
doClearCurrentVoiceBroadcastPlaybackIfStopped(this.stores.voiceBroadcastPlaybacksStore);
break;
case "MatrixActions.RoomState.events":
Expand Down Expand Up @@ -410,7 +428,10 @@ export class RoomViewStore extends EventEmitter {
});
}

document.getElementsByClassName('mx_LeftPanel_outerWrapper')[0].style.display = "none";
if (!room?.isSpaceRoom()) {
const leftPanelOuterElems = document.getElementsByClassName('mx_LeftPanel_outerWrapper');
if (leftPanelOuterElems.length > 0) leftPanelOuterElems[0].style.display = "none";
};

if (SettingsStore.getValue("feature_sliding_sync") && this.state.roomId !== payload.room_id) {
if (this.state.subscribingRoomId && this.state.subscribingRoomId !== payload.room_id) {
Expand Down

0 comments on commit 5b7606e

Please sign in to comment.