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

Commit 7dfe578

Browse files
author
Dariusz Niemczyk
committed
Fix GroupFilterPanel not having proper backdrop
1 parent 92aa953 commit 7dfe578

File tree

4 files changed

+23
-41
lines changed

4 files changed

+23
-41
lines changed

res/css/structures/_GroupFilterPanel.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,21 @@ limitations under the License.
2020
}
2121
}
2222

23+
$groupFilterPanelWidth: 56px; // only applies in this file, used for calculations
24+
25+
.mx_GroupFilterPanelContainer {
26+
flex-grow: 0;
27+
flex-shrink: 0;
28+
width: $groupFilterPanelWidth;
29+
height: 100%;
30+
31+
// Create another flexbox so the GroupFilterPanel fills the container
32+
display: flex;
33+
flex-direction: column;
34+
35+
// GroupFilterPanel handles its own CSS
36+
}
37+
2338
.mx_GroupFilterPanel {
2439
background-color: $groupFilterPanel-bg-color;
2540
flex: 1;

res/css/structures/_LeftPanel.scss

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
$groupFilterPanelWidth: 56px; // only applies in this file, used for calculations
1817
$roomListCollapsedWidth: 68px;
1918

2019
.mx_MatrixChat--with-avatar {
@@ -68,19 +67,6 @@ $roomListCollapsedWidth: 68px;
6867
contain: content;
6968
position: relative;
7069

71-
.mx_LeftPanel_GroupFilterPanelContainer {
72-
flex-grow: 0;
73-
flex-shrink: 0;
74-
flex-basis: $groupFilterPanelWidth;
75-
height: 100%;
76-
77-
// Create another flexbox so the GroupFilterPanel fills the container
78-
display: flex;
79-
flex-direction: column;
80-
81-
// GroupFilterPanel handles its own CSS
82-
}
83-
8470
// Note: The 'room list' in this context is actually everything that isn't the tag
8571
// panel, such as the menu options, breadcrumbs, filtering, etc
8672
.mx_LeftPanel_roomListContainer {

src/components/structures/LeftPanel.tsx

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import { createRef } from "react";
1919
import classNames from "classnames";
2020
import { Room } from "matrix-js-sdk/src/models/room";
2121

22-
import GroupFilterPanel from "./GroupFilterPanel";
23-
import CustomRoomTagPanel from "./CustomRoomTagPanel";
2422
import dis from "../../dispatcher/dispatcher";
2523
import { _t } from "../../languageHandler";
2624
import RoomList from "../views/rooms/RoomList";
@@ -33,7 +31,6 @@ import RoomBreadcrumbs from "../views/rooms/RoomBreadcrumbs";
3331
import { BreadcrumbsStore } from "../../stores/BreadcrumbsStore";
3432
import { UPDATE_EVENT } from "../../stores/AsyncStore";
3533
import ResizeNotifier from "../../utils/ResizeNotifier";
36-
import SettingsStore from "../../settings/SettingsStore";
3734
import RoomListStore, { LISTS_UPDATE_EVENT } from "../../stores/room-list/RoomListStore";
3835
import IndicatorScrollbar from "../structures/IndicatorScrollbar";
3936
import AccessibleTooltipButton from "../views/elements/AccessibleTooltipButton";
@@ -51,7 +48,6 @@ interface IProps {
5148

5249
interface IState {
5350
showBreadcrumbs: boolean;
54-
showGroupFilterPanel: boolean;
5551
activeSpace?: Room;
5652
}
5753

@@ -68,9 +64,6 @@ const cssClasses = [
6864
export default class LeftPanel extends React.Component<IProps, IState> {
6965
private ref: React.RefObject<HTMLDivElement> = createRef();
7066
private listContainerRef: React.RefObject<HTMLDivElement> = createRef();
71-
private groupFilterPanelWatcherRef: string;
72-
private groupFilterPanelContainer = createRef<HTMLDivElement>();
73-
private bgImageWatcherRef: string;
7467
private focusedElement = null;
7568
private isDoingStickyHeaders = false;
7669

@@ -79,33 +72,24 @@ export default class LeftPanel extends React.Component<IProps, IState> {
7972

8073
this.state = {
8174
showBreadcrumbs: BreadcrumbsStore.instance.visible,
82-
showGroupFilterPanel: SettingsStore.getValue('TagPanel.enableTagPanel'),
8375
activeSpace: SpaceStore.instance.activeSpace,
8476
};
8577

8678
BreadcrumbsStore.instance.on(UPDATE_EVENT, this.onBreadcrumbsUpdate);
8779
RoomListStore.instance.on(LISTS_UPDATE_EVENT, this.onBreadcrumbsUpdate);
8880
SpaceStore.instance.on(UPDATE_SELECTED_SPACE, this.updateActiveSpace);
89-
this.groupFilterPanelWatcherRef = SettingsStore.watchSetting("TagPanel.enableTagPanel", null, () => {
90-
this.setState({ showGroupFilterPanel: SettingsStore.getValue("TagPanel.enableTagPanel") });
91-
});
9281
}
9382

9483
public componentDidMount() {
9584
UIStore.instance.trackElementDimensions("LeftPanel", this.ref.current);
9685
UIStore.instance.trackElementDimensions("ListContainer", this.listContainerRef.current);
97-
if (this.groupFilterPanelContainer.current) {
98-
const componentName = "GroupFilterPanelContainer";
99-
UIStore.instance.trackElementDimensions(componentName, this.groupFilterPanelContainer.current);
100-
}
10186
UIStore.instance.on("ListContainer", this.refreshStickyHeaders);
10287
// Using the passive option to not block the main thread
10388
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners
10489
this.listContainerRef.current?.addEventListener("scroll", this.onScroll, { passive: true });
10590
}
10691

10792
public componentWillUnmount() {
108-
SettingsStore.unwatchSetting(this.groupFilterPanelWatcherRef);
10993
BreadcrumbsStore.instance.off(UPDATE_EVENT, this.onBreadcrumbsUpdate);
11094
RoomListStore.instance.off(LISTS_UPDATE_EVENT, this.onBreadcrumbsUpdate);
11195
SpaceStore.instance.off(UPDATE_SELECTED_SPACE, this.updateActiveSpace);
@@ -422,16 +406,6 @@ export default class LeftPanel extends React.Component<IProps, IState> {
422406
}
423407

424408
public render(): React.ReactNode {
425-
let leftLeftPanel;
426-
if (this.state.showGroupFilterPanel) {
427-
leftLeftPanel = (
428-
<div className="mx_LeftPanel_GroupFilterPanelContainer" ref={this.groupFilterPanelContainer}>
429-
<GroupFilterPanel />
430-
{ SettingsStore.getValue("feature_custom_tags") ? <CustomRoomTagPanel /> : null }
431-
</div>
432-
);
433-
}
434-
435409
const roomList = <RoomList
436410
onKeyDown={this.onKeyDown}
437411
resizeNotifier={this.props.resizeNotifier}
@@ -455,7 +429,6 @@ export default class LeftPanel extends React.Component<IProps, IState> {
455429

456430
return (
457431
<div className={containerClasses} ref={this.ref}>
458-
{ leftLeftPanel }
459432
<aside className="mx_LeftPanel_roomListContainer">
460433
{ this.renderHeader() }
461434
{ this.renderSearchDialExplore() }

src/components/structures/LoggedInView.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ import GroupView from "./GroupView";
6868
import BackdropPanel from "./BackdropPanel";
6969
import SpaceStore from "../../stores/SpaceStore";
7070
import classNames from 'classnames';
71+
import GroupFilterPanel from './GroupFilterPanel';
72+
import CustomRoomTagPanel from './CustomRoomTagPanel';
7173

7274
// We need to fetch each pinned message individually (if we don't already have it)
7375
// so each pinned message may trigger a request. Limit the number per room for sanity.
@@ -649,6 +651,12 @@ class LoggedInView extends React.Component<IProps, IState> {
649651
<BackdropPanel
650652
backgroundImage={this.state.backgroundImage}
651653
/>
654+
{ SettingsStore.getValue('TagPanel.enableTagPanel') &&
655+
(<div className="mx_GroupFilterPanelContainer">
656+
<GroupFilterPanel />
657+
{ SettingsStore.getValue("feature_custom_tags") ? <CustomRoomTagPanel /> : null }
658+
</div>)
659+
}
652660
{ SpaceStore.spacesEnabled ? <SpacePanel /> : null }
653661
<div
654662
ref={this._resizeContainer}

0 commit comments

Comments
 (0)