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

Replace breadcrumbs with recently viewed menu #7073

Merged
merged 98 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
64d53d5
Move user avatar to Space panel
t3chguy Oct 28, 2021
f86e063
Add room list header for 'Home' or 'Space Name' to room list
t3chguy Oct 28, 2021
f1f32b7
Re-add pending room join spinner
t3chguy Oct 29, 2021
e3424ba
Iterate RoomListHeader plus context menu
t3chguy Oct 29, 2021
37941a5
Iterate space context menu
t3chguy Oct 29, 2021
e4f4e22
Iterate room list + interactions
t3chguy Oct 29, 2021
6b083d6
Move DND to new iA model
t3chguy Oct 29, 2021
1158737
Replace composer custom status management with usermenu one
t3chguy Nov 1, 2021
61b3326
Cull Quick Actions
t3chguy Nov 1, 2021
5d8fecd
Iterate minimized room list state
t3chguy Nov 1, 2021
b1bd780
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 1, 2021
26bcf10
delint
t3chguy Nov 1, 2021
48f2418
Initial implementation of breadcrumb replacement
t3chguy Nov 2, 2021
2edd329
Merge the RoomListNumResults into the RoomListHeader
t3chguy Nov 2, 2021
1e6c56a
Make the search shortcut prompt semi-bold
t3chguy Nov 2, 2021
650bdd2
Iterate RoomListHeader based on design review
t3chguy Nov 2, 2021
5dd370f
Iterate UserMenu based on feedback
t3chguy Nov 3, 2021
8570a20
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 3, 2021
0ba4beb
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 3, 2021
d589ec9
Wire up recently viewed entry space names properly
t3chguy Nov 4, 2021
0bff975
Add missing hover style for button and modify context menu position
t3chguy Nov 4, 2021
4a7ccbc
Add hover effect on context menu
t3chguy Nov 4, 2021
391d89d
Make the recently viewed run on hover and move it to the right
t3chguy Nov 5, 2021
9903005
Add name to expanded spacepanel usermenu button
t3chguy Nov 8, 2021
123d804
i18n
t3chguy Nov 8, 2021
bd3de28
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 9, 2021
a09269a
Make room sub list aux button components more generic
t3chguy Nov 9, 2021
e961958
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 9, 2021
2ce6e18
fix tests and remove debug logging
t3chguy Nov 9, 2021
db0864f
Change left panel explore button to only refer to room directory
t3chguy Nov 9, 2021
828337b
Iterate RoomListHeader
t3chguy Nov 9, 2021
4b3bc9b
Fix custom user status input field width in Chrome
t3chguy Nov 9, 2021
95ea95a
Bring back Notification settings button
t3chguy Nov 9, 2021
74cac1f
delint
t3chguy Nov 9, 2021
be4256c
Iterate Recently viewed interactive tooltip based on design
t3chguy Nov 9, 2021
c5059f3
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 11, 2021
b573d84
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 11, 2021
f1d263c
i18n
t3chguy Nov 11, 2021
9e87fcb
post-merge fix
t3chguy Nov 11, 2021
f83b9b6
iterate pr
t3chguy Nov 11, 2021
0367103
Remove unused state
t3chguy Nov 11, 2021
d8d7fc5
update copy
t3chguy Nov 11, 2021
58f260a
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 11, 2021
ea2d434
Put new breadcrumbs behind labs
t3chguy Nov 11, 2021
5553e37
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 11, 2021
91e83af
Apply suggestions from PR review
t3chguy Nov 15, 2021
d8e5217
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 15, 2021
6b7e6f4
delint
t3chguy Nov 15, 2021
2086525
Update invite iconography
t3chguy Nov 17, 2021
cde0080
Iterate Space context menu to match Figma
t3chguy Nov 17, 2021
1b683d2
Fix chevron alignment
t3chguy Nov 17, 2021
b03e562
Fix edge case for RoomListHeader on metaspaces
t3chguy Nov 17, 2021
223be9e
Wire up general rageshake-driven feedback mechanism
t3chguy Nov 17, 2021
385d8eb
Add IA1.1 info toast
t3chguy Nov 17, 2021
3a3f417
add missing alt attribute
t3chguy Nov 17, 2021
b108c20
delint
t3chguy Nov 17, 2021
53ab409
delint
t3chguy Nov 17, 2021
8e76eb8
tweak ia toast priority
t3chguy Nov 17, 2021
e209852
e2e test account for new toast
t3chguy Nov 17, 2021
eb0c41a
autofocus feedback field and remove old subheading
t3chguy Nov 18, 2021
7550ae9
tweak copy
t3chguy Nov 18, 2021
1289bc1
DRY room context details text
t3chguy Nov 19, 2021
85959d7
test InteractiveTooltip.tsx
t3chguy Nov 19, 2021
6bfeacb
fix tests and behaviour
t3chguy Nov 19, 2021
6879f23
move method into a more appropriate file
t3chguy Nov 19, 2021
a1055ed
Iterate space panel colours to match Figma
t3chguy Nov 22, 2021
c6c9df2
Iterate PR
t3chguy Nov 22, 2021
28d7a40
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 22, 2021
3a9e9b3
delint
t3chguy Nov 22, 2021
24f7cb7
Fix feedback submission with object setting values
t3chguy Nov 23, 2021
58d1abc
tweak scroll bar
t3chguy Nov 23, 2021
b10ef12
Merge branch 't3chguy/fix/19526' of github.com:matrix-org/matrix-reac…
t3chguy Nov 23, 2021
10f0cc3
fix uneven margins in recently viewed ctx menu
t3chguy Nov 23, 2021
b9419ad
delint
t3chguy Nov 23, 2021
4aa54ac
iterate based on review
t3chguy Nov 24, 2021
99c3a11
Tweak colours and update splash image
t3chguy Nov 24, 2021
08653b9
Tweaks based on review
t3chguy Nov 25, 2021
7df1d59
Merge branch 't3chguy/fix/19526' of github.com:matrix-org/matrix-reac…
t3chguy Nov 25, 2021
4f2f0d8
Remove room list prompt, made redundant by the big fat `+`
t3chguy Nov 25, 2021
205769b
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 26, 2021
3065850
Fix edge cases around User Menu positioning and dnd
t3chguy Nov 26, 2021
ef0c19f
Add missing import, bad merge?
t3chguy Nov 26, 2021
30b5a84
Update aria label in e2e test
t3chguy Nov 26, 2021
b7dd6f6
Fix room list space rooms context menu explore button behaviour
t3chguy Nov 26, 2021
d20bc45
Tweak copy
t3chguy Nov 26, 2021
c0d89ba
Revert order of options in the UserMenu
t3chguy Nov 26, 2021
99342fe
Tweak copy
t3chguy Nov 29, 2021
ba999e5
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 29, 2021
f1f1c16
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 29, 2021
04db477
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 30, 2021
12a1fcf
Merge branch 't3chguy/fix/19526' of github.com:matrix-org/matrix-reac…
t3chguy Nov 30, 2021
dcd6117
Add lab group
t3chguy Nov 30, 2021
e9dde17
i18n
t3chguy Nov 30, 2021
9d699e2
Close Recently viewed interactive tooltip when selecting an item
t3chguy Nov 30, 2021
ba89ed3
Merge branch 't3chguy/fix/19526' of github.com:matrix-org/matrix-reac…
t3chguy Nov 30, 2021
b294d9f
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Nov 30, 2021
2124b21
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into…
t3chguy Dec 1, 2021
1f183a0
i18n
t3chguy Dec 1, 2021
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: 2 additions & 0 deletions res/css/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
@import "./views/elements/_ImageView.scss";
@import "./views/elements/_InfoTooltip.scss";
@import "./views/elements/_InlineSpinner.scss";
@import "./views/elements/_InteractiveTooltip.scss";
@import "./views/elements/_InviteReason.scss";
@import "./views/elements/_ManageIntegsButton.scss";
@import "./views/elements/_MiniAvatarUploader.scss";
Expand Down Expand Up @@ -230,6 +231,7 @@
@import "./views/rooms/_NotificationBadge.scss";
@import "./views/rooms/_PinnedEventTile.scss";
@import "./views/rooms/_PresenceLabel.scss";
@import "./views/rooms/_RecentlyViewedButton.scss";
@import "./views/rooms/_ReplyPreview.scss";
@import "./views/rooms/_ReplyTile.scss";
@import "./views/rooms/_RoomBreadcrumbs.scss";
Expand Down
1 change: 1 addition & 0 deletions res/css/structures/_ContextualMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ limitations under the License.
position: absolute;
font-size: $font-14px;
z-index: 5001;
width: max-content;
}

.mx_ContextualMenu_right {
Expand Down
22 changes: 16 additions & 6 deletions res/css/structures/_LeftPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ $roomListCollapsedWidth: 68px;
display: none;
}

& + .mx_LeftPanel_exploreButton {
& + .mx_LeftPanel_exploreButton,
& + .mx_LeftPanel_recentsButton {
// Cheaty way to return the occupied space to the filter input
flex-basis: 0;
margin: 0;
Expand Down Expand Up @@ -166,11 +167,12 @@ $roomListCollapsedWidth: 68px;
mask-position: center;
mask-size: contain;
mask-repeat: no-repeat;
background: $secondary-content;
background-color: $secondary-content;
}
}

.mx_LeftPanel_exploreButton {
.mx_LeftPanel_exploreButton,
.mx_LeftPanel_recentsButton {
width: 32px;
height: 32px;
border-radius: 8px;
Expand All @@ -185,11 +187,10 @@ $roomListCollapsedWidth: 68px;
left: 8px;
width: 16px;
height: 16px;
mask-image: url('$(res)/img/element-icons/roomlist/explore.svg');
mask-position: center;
mask-size: contain;
mask-repeat: no-repeat;
background: $secondary-content;
background-color: $secondary-content;
}

&:hover {
Expand All @@ -200,6 +201,14 @@ $roomListCollapsedWidth: 68px;
}
}
}

.mx_LeftPanel_exploreButton::before {
mask-image: url('$(res)/img/element-icons/roomlist/explore.svg');
}

.mx_LeftPanel_recentsButton::before {
mask-image: url('$(res)/img/element-icons/clock.svg');
}
}

.mx_LeftPanel_roomListFilterCount {
Expand Down Expand Up @@ -257,7 +266,8 @@ $roomListCollapsedWidth: 68px;
background-color: transparent;
}

.mx_LeftPanel_exploreButton {
.mx_LeftPanel_exploreButton,
.mx_LeftPanel_recentsButton {
margin-left: 0;
margin-top: 8px;
}
Expand Down
8 changes: 7 additions & 1 deletion res/css/views/avatars/_BaseAvatar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ limitations under the License.
// https://bugzilla.mozilla.org/show_bug.cgi?id=255139
display: inline-block;
user-select: none;

&.mx_RoomAvatar_isSpaceRoom {
&.mx_BaseAvatar_image, .mx_BaseAvatar_image {
border-radius: 8px;
}
}
}

.mx_BaseAvatar_initial {
position: absolute;
left: 0px;
left: 0;
color: $avatar-initial-color;
text-align: center;
speak: none;
Expand Down
97 changes: 97 additions & 0 deletions res/css/views/elements/_InteractiveTooltip.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
Copyright 2019 - 2021 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_InteractiveTooltip_wrapper {
position: fixed;
z-index: 5000;
}

.mx_InteractiveTooltip {
border-radius: 8px;
background-color: $background;
color: $primary-content;
position: absolute;
z-index: 5001;
box-shadow: 0 24px 8px rgb(17 17 26 / 4%), 0 8px 32px rgb(17 17 26 / 4%);
}

.mx_InteractiveTooltip.mx_InteractiveTooltip_withChevron_top {
top: 10px; // 8px chevron + 2px spacing
}

.mx_InteractiveTooltip.mx_InteractiveTooltip_withChevron_left {
left: 10px; // 8px chevron + 2px spacing
}

.mx_InteractiveTooltip.mx_InteractiveTooltip_withChevron_right {
right: 10px; // 8px chevron + 2px spacing
}

.mx_InteractiveTooltip.mx_InteractiveTooltip_withChevron_bottom {
bottom: 10px; // 8px chevron + 2px spacing
}

.mx_InteractiveTooltip_chevron_top {
position: absolute;
left: calc(50% - 8px);
top: -8px;
width: 0;
height: 0;
border-left: 8px solid transparent;
border-bottom: 8px solid $background;
border-right: 8px solid transparent;
}

// Adapted from https://codyhouse.co/blog/post/css-rounded-triangles-with-clip-path
// by Sebastiano Guerriero (@guerriero_se)
@supports (clip-path: polygon(0% 0%, 100% 100%, 0% 100%)) {
.mx_InteractiveTooltip_chevron_top {
height: 16px;
width: 16px;
background-color: inherit;
border: none;
clip-path: polygon(0% 0%, 100% 100%, 0% 100%);
transform: rotate(135deg);
border-radius: 0 0 0 3px;
top: calc(-8px / 1.414); // sqrt(2) because of rotation
}
}

.mx_InteractiveTooltip_chevron_bottom {
position: absolute;
left: calc(50% - 8px);
bottom: -8px;
width: 0;
height: 0;
border-left: 8px solid transparent;
border-top: 8px solid $background;
border-right: 8px solid transparent;
}

// Adapted from https://codyhouse.co/blog/post/css-rounded-triangles-with-clip-path
// by Sebastiano Guerriero (@guerriero_se)
@supports (clip-path: polygon(0% 0%, 100% 100%, 0% 100%)) {
.mx_InteractiveTooltip_chevron_bottom {
height: 16px;
width: 16px;
background-color: inherit;
border: none;
clip-path: polygon(0% 0%, 100% 100%, 0% 100%);
transform: rotate(-45deg);
border-radius: 0 0 0 3px;
bottom: calc(-8px / 1.414); // sqrt(2) because of rotation
}
}
73 changes: 73 additions & 0 deletions res/css/views/rooms/_RecentlyViewedButton.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
Copyright 2021 The Matrix.org Foundation C.I.C.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.mx_RecentlyViewedButton_ContextMenu {
padding: 16px 8px 16px 16px;
width: max-content;
max-width: 240px;
max-height: 400px;
border: 1px solid rgba($primary-content, .1);
border-radius: 8px;
box-shadow: 0 8px 4px rgba(0, 0, 0, 0.08);
display: flex;
flex-direction: column;

> h4 {
margin: 0 0 12px 0;
}

> div {
overflow-y: auto;

* {
margin-right: 4px;
}
}

.mx_AccessibleButton {
margin-top: 2px;
padding: 4px;
display: flex;
align-items: center;
border-radius: 8px;
min-height: 34px;

&:hover {
background-color: $panel-actions;
}

.mx_BaseAvatar {
margin-right: 8px;
width: 24px;
}

.mx_RecentlyViewedButton_entry_label {
display: grid;

> div {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}

.mx_RecentlyViewedButton_entry_spaces {
font-size: $font-12px;
line-height: $font-15px;
color: $secondary-content;
}
}
}
4 changes: 4 additions & 0 deletions res/img/element-icons/clock.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 34 additions & 15 deletions src/components/structures/LeftPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ import CallHandler from "../../CallHandler";
import { HEADER_HEIGHT } from "../views/rooms/RoomSublist";
import { Action } from "../../dispatcher/actions";
import RoomSearch from "./RoomSearch";
import RoomBreadcrumbs from "../views/rooms/RoomBreadcrumbs";
import { BreadcrumbsStore } from "../../stores/BreadcrumbsStore";
import { UPDATE_EVENT } from "../../stores/AsyncStore";
import ResizeNotifier from "../../utils/ResizeNotifier";
import RoomListStore, { LISTS_UPDATE_EVENT } from "../../stores/room-list/RoomListStore";
import IndicatorScrollbar from "../structures/IndicatorScrollbar";
import AccessibleTooltipButton from "../views/elements/AccessibleTooltipButton";
import LeftPanelWidget from "./LeftPanelWidget";
import { replaceableComponent } from "../../utils/replaceableComponent";
Expand All @@ -41,14 +36,27 @@ import UIStore from "../../stores/UIStore";
import { findSiblingElement, IState as IRovingTabIndexState } from "../../accessibility/RovingTabIndex";
import RoomListHeader from "../views/rooms/RoomListHeader";
import { Key } from "../../Keyboard";
import RecentlyViewedButton from "../views/rooms/RecentlyViewedButton";
import { BreadcrumbsStore } from "../../stores/BreadcrumbsStore";
import RoomListStore, { LISTS_UPDATE_EVENT } from "../../stores/room-list/RoomListStore";
import { UPDATE_EVENT } from "../../stores/AsyncStore";
import IndicatorScrollbar from "./IndicatorScrollbar";
import RoomBreadcrumbs from "../views/rooms/RoomBreadcrumbs";
import SettingsStore from "../../settings/SettingsStore";

interface IProps {
isMinimized: boolean;
resizeNotifier: ResizeNotifier;
}

enum BreadcrumbsMode {
Disabled,
Legacy,
Labs,
}

interface IState {
showBreadcrumbs: boolean;
showBreadcrumbs: BreadcrumbsMode;
activeSpace: SpaceKey;
}

Expand All @@ -65,15 +73,20 @@ export default class LeftPanel extends React.Component<IProps, IState> {
super(props);

this.state = {
showBreadcrumbs: BreadcrumbsStore.instance.visible,
activeSpace: SpaceStore.instance.activeSpace,
showBreadcrumbs: LeftPanel.breadcrumbsMode,
};

BreadcrumbsStore.instance.on(UPDATE_EVENT, this.onBreadcrumbsUpdate);
RoomListStore.instance.on(LISTS_UPDATE_EVENT, this.onBreadcrumbsUpdate);
SpaceStore.instance.on(UPDATE_SELECTED_SPACE, this.updateActiveSpace);
}

private static get breadcrumbsMode(): BreadcrumbsMode {
if (!SettingsStore.getValue("breadcrumbs")) return BreadcrumbsMode.Disabled;
return SettingsStore.getValue("feature_breadcrumbs_v2") ? BreadcrumbsMode.Labs : BreadcrumbsMode.Legacy;
}

public componentDidMount() {
UIStore.instance.trackElementDimensions("LeftPanel", this.ref.current);
UIStore.instance.trackElementDimensions("ListContainer", this.listContainerRef.current);
Expand Down Expand Up @@ -116,7 +129,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
};

private onBreadcrumbsUpdate = () => {
const newVal = BreadcrumbsStore.instance.visible;
const newVal = LeftPanel.breadcrumbsMode;
if (newVal !== this.state.showBreadcrumbs) {
this.setState({ showBreadcrumbs: newVal });

Expand Down Expand Up @@ -323,7 +336,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
};

private renderBreadcrumbs(): React.ReactNode {
if (this.state.showBreadcrumbs && !this.props.isMinimized) {
if (this.state.showBreadcrumbs === BreadcrumbsMode.Legacy && !this.props.isMinimized) {
return (
<IndicatorScrollbar
className="mx_LeftPanel_breadcrumbsContainer mx_AutoHideScrollbar"
Expand All @@ -349,6 +362,17 @@ export default class LeftPanel extends React.Component<IProps, IState> {
/>;
}

let rightButton: JSX.Element;
if (this.state.showBreadcrumbs === BreadcrumbsMode.Labs) {
rightButton = <RecentlyViewedButton />;
} else if (this.state.activeSpace === MetaSpace.Home) {
rightButton = <AccessibleTooltipButton
className="mx_LeftPanel_exploreButton"
onClick={this.onExplore}
title={_t("Explore rooms")}
/>;
}

return (
<div
className="mx_LeftPanel_filterContainer"
Expand All @@ -363,12 +387,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
/>

{ dialPadButton }

{ this.state.activeSpace === MetaSpace.Home && <AccessibleTooltipButton
className="mx_LeftPanel_exploreButton"
onClick={this.onExplore}
title={_t("Explore rooms")}
/> }
{ rightButton }
</div>
);
}
Expand Down
Loading