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

Add user menu to new room list #4722

Merged
merged 25 commits into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
be3510a
Merge branch 'travis/split-left-panel' into travis/room-list/css-layout
turt2live Jun 4, 2020
02c131e
Merge branch 'travis/room-list/scrolling-resize' into travis/room-lis…
turt2live Jun 4, 2020
4c1bc50
Initial styling for new room list
turt2live Jun 4, 2020
0c15b2b
Simple structuring of the room list itself
turt2live Jun 5, 2020
b31a8d4
Merge branch 'travis/room-list/scrolling-resize' into travis/room-lis…
turt2live Jun 5, 2020
211ad66
Fix i18n
turt2live Jun 5, 2020
6752c28
Add missing var
turt2live Jun 5, 2020
475ba61
Give the show more button some real CSS
turt2live Jun 5, 2020
ea6b0a6
Merge branch 'develop' into travis/room-list/css-layout
turt2live Jun 5, 2020
1d8833e
Selected state, cleanup, and profile display
turt2live Jun 5, 2020
829bf3c
Add another TODO comment
turt2live Jun 5, 2020
2806c8c
Fix temporary class
turt2live Jun 5, 2020
021d6d6
Merge branch 'develop' into travis/room-list/css-layout
turt2live Jun 6, 2020
bb3cdd3
Merge branch 'travis/room-list/css-layout' into travis/room-list/user…
turt2live Jun 8, 2020
8e0247a
Add most of the UI for the new room list's menu button
turt2live Jun 8, 2020
8b6b117
Appease the linter
turt2live Jun 8, 2020
f05a1e5
Point buttons at the right functions
turt2live Jun 8, 2020
de18af3
Support minimum to open user settings to a particular tab
turt2live Jun 8, 2020
acf78ae
Wire up the remaining dialogs
turt2live Jun 8, 2020
94ce23a
Wire up theme changer
turt2live Jun 8, 2020
5067349
Add hosting link
turt2live Jun 8, 2020
fd8c056
Fix i18n
turt2live Jun 8, 2020
000c92a
Merge branch 'develop' into travis/room-list/css-layout
turt2live Jun 8, 2020
6002fef
Merge branch 'travis/room-list/css-layout' into travis/room-list/user…
turt2live Jun 8, 2020
de4c2fe
Use real buttons in user menu
turt2live Jun 8, 2020
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
4 changes: 4 additions & 0 deletions res/css/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@import "./structures/_HeaderButtons.scss";
@import "./structures/_HomePage.scss";
@import "./structures/_LeftPanel.scss";
@import "./structures/_LeftPanel2.scss";
@import "./structures/_MainSplit.scss";
@import "./structures/_MatrixChat.scss";
@import "./structures/_MyGroups.scss";
Expand All @@ -28,6 +29,7 @@
@import "./structures/_ToastContainer.scss";
@import "./structures/_TopLeftMenuButton.scss";
@import "./structures/_UploadBar.scss";
@import "./structures/_UserMenuButton.scss";
@import "./structures/_ViewSource.scss";
@import "./structures/auth/_CompleteSecurity.scss";
@import "./structures/auth/_Login.scss";
Expand Down Expand Up @@ -177,10 +179,12 @@
@import "./views/rooms/_RoomDropTarget.scss";
@import "./views/rooms/_RoomHeader.scss";
@import "./views/rooms/_RoomList.scss";
@import "./views/rooms/_RoomList2.scss";
@import "./views/rooms/_RoomPreviewBar.scss";
@import "./views/rooms/_RoomRecoveryReminder.scss";
@import "./views/rooms/_RoomSublist2.scss";
@import "./views/rooms/_RoomTile.scss";
@import "./views/rooms/_RoomTile2.scss";
@import "./views/rooms/_RoomUpgradeWarningBar.scss";
@import "./views/rooms/_SearchBar.scss";
@import "./views/rooms/_SendMessageComposer.scss";
Expand Down
8 changes: 0 additions & 8 deletions res/css/structures/_LeftPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ limitations under the License.
flex: 0 0 auto;
}

// TODO: Remove temporary indicator of new room list implementation.
// This border is meant to visually distinguish between the two components when the
// user has turned on the new room list implementation, at least until the designs
// themselves give it away.
.mx_LeftPanel2 .mx_LeftPanel {
border-left: 5px #e26dff solid;
}

.mx_LeftPanel_container.collapsed {
min-width: unset;
/* Collapsed LeftPanel 50px */
Expand Down
99 changes: 99 additions & 0 deletions res/css/structures/_LeftPanel2.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
Copyright 2020 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.
*/

// TODO: Rename to mx_LeftPanel during replacement of old component

// TODO: Put these variables in the right place, or namespace them.
$tagPanelWidth: 70px;
$roomListMinimizedWidth: 50px;

.mx_LeftPanel2 {
background-color: $header-panel-bg-color;
min-width: 260px;
max-width: 50%;

// Create a row-based flexbox for the TagPanel and the room list
display: flex;

.mx_LeftPanel2_tagPanelContainer {
flex-grow: 0;
flex-shrink: 0;
flex-basis: $tagPanelWidth;
height: 100%;

// Create another flexbox so the TagPanel fills the container
display: flex;

// TagPanel handles its own CSS
}

// Note: The 'room list' in this context is actually everything that isn't the tag
// panel, such as the menu options, breadcrumbs, filtering, etc
.mx_LeftPanel2_roomListContainer {
width: calc(100% - $tagPanelWidth);

// Create another flexbox (this time a column) for the room list components
display: flex;
flex-direction: column;

.mx_LeftPanel2_userHeader {
padding: 14px 12px 20px; // 14px top, 12px sides, 20px bottom

// Create another flexbox column for the rows to stack within
display: flex;
flex-direction: column;

// There's 2 rows when breadcrumbs are present: the top bit and the breadcrumbs
.mx_LeftPanel2_headerRow {
// Create yet another flexbox, this time within the row, to ensure items stay
// aligned correctly. This is also a row-based flexbox.
display: flex;
align-items: center;
}

.mx_LeftPanel2_userAvatarContainer {
position: relative; // to make default avatars work
margin-right: 8px;
}

.mx_LeftPanel2_userName {
font-weight: 600;
font-size: $font-15px;
line-height: $font-20px;
flex: 1;
}

.mx_LeftPanel2_headerButtons {
// No special styles: the rest of the layout happens to make it work.
}

.mx_LeftPanel2_breadcrumbsContainer {
// TODO: Improve CSS for breadcrumbs (currently shoved into the view rather than placed)
width: 100%;
overflow: hidden;
}
}

.mx_LeftPanel2_filterContainer {
// TODO: Improve CSS for filtering and its input
}

.mx_LeftPanel2_actualRoomListContainer {
flex-grow: 1; // fill the available space
overflow-y: auto;
}
}
}
2 changes: 1 addition & 1 deletion res/css/structures/_MatrixChat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ limitations under the License.
}

/* not the left panel, and not the resize handle, so the roomview/groupview/... */
.mx_MatrixChat > :not(.mx_LeftPanel_container):not(.mx_ResizeHandle) {
.mx_MatrixChat > :not(.mx_LeftPanel_container):not(.mx_LeftPanel2):not(.mx_ResizeHandle) {
background-color: $primary-bg-color;

flex: 1 1 0;
Expand Down
162 changes: 162 additions & 0 deletions res/css/structures/_UserMenuButton.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/*
Copyright 2020 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_UserMenuButton {
// No special styles on the button itself
}

.mx_UserMenuButton_contextMenu {
width: 231px;

// Put 20px of padding around the whole menu. We do this instead of a
// simple `padding: 20px` rule so the horizontal rules added by the
// optionLists is rendered correctly (full width).
> * {
padding-left: 20px;
padding-right: 20px;

&:first-child {
padding-top: 20px;
}

&:last-child {
padding-bottom: 20px;
}
}

.mx_UserMenuButton_contextMenu_header {
// Create a flexbox to organize the header a bit easier
display: flex;
align-items: center;

&:nth-child(n + 1) {
// The first header will have appropriate padding, subsequent ones need a margin.
margin-top: 10px;
}

.mx_UserMenuButton_contextMenu_name {
// Create another flexbox of columns to handle large user IDs
display: flex;
flex-direction: column;

// fit the container
flex: 1;
width: calc(100% - 40px); // 40px = 32px theme button + 8px margin to theme button

* {
// Automatically grow all subelements to fit the container
flex: 1;
width: 100%;

// Ellipsize any text overflow
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}

.mx_UserMenuButton_contextMenu_displayName {
font-weight: bold;
font-size: $font-15px;
line-height: $font-20px;
}

.mx_UserMenuButton_contextMenu_userId {
font-size: $font-15px;
line-height: $font-24px;
}
}

.mx_UserMenuButton_contextMenu_themeButton {
min-width: 32px;
max-width: 32px;
width: 32px;
height: 32px;
margin-left: 8px;
border-radius: 32px;
background-color: $theme-button-bg-color;
cursor: pointer;

// to make alignment easier, create flexbox for the image
display: flex;
align-items: center;
justify-content: center;
}
}

.mx_UserMenuButton_contextMenu_optionList {
margin-top: 20px;

// This is a bit of a hack when we could just use a simple border-top property,
// however we have a (kinda) good reason for doing it this way: we need opacity.
// To get the right color, we need an opacity modifier which means we have to work
// around the problem. PostCSS doesn't support the opacity() function, and if we
// use something like postcss-functions we quickly run into an issue where the
// function we would define gets passed a CSS variable for custom themes, which
// can't be converted easily even when considering https://stackoverflow.com/a/41265350/7037379
//
// Therefore, we just hack in a line and border the thing ourselves
&::before {
border-top: 1px solid $primary-fg-color;
opacity: 0.1;
content: '';

// Counteract the padding problems (width: 100% ignores the 40px padding,
// unless we position it absolutely then it does the right thing).
width: 100%;
position: absolute;
left: 0;
}

ul {
list-style: none;
margin: 0;
padding: 0;

li {
margin: 0;
padding: 20px 0 0;

.mx_AccessibleButton {
text-decoration: none;
color: $primary-fg-color;
font-size: $font-15px;
line-height: $font-24px;

// Create a flexbox to more easily define the list items
display: flex;
align-items: center;

img { // icons
width: 16px;
min-width: 16px;
max-width: 16px;
}

span { // labels
padding-left: 14px;
width: 100%;
flex: 1;

// Ellipsize any text overflow
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}
}
}
}
}
25 changes: 25 additions & 0 deletions res/css/views/rooms/_RoomList2.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
Copyright 2020 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.
*/

// TODO: Rename to mx_RoomList during replacement of old component

.mx_RoomList2 {
// Create a column-based flexbox for the sublists. That's pretty much all we have to
// worry about in this stylesheet.
display: flex;
flex-direction: column;
flex-wrap: wrap;
}
38 changes: 36 additions & 2 deletions res/css/views/rooms/_RoomSublist2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,42 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// TODO: Rename to mx_RoomSublist during replacement of old component

// TODO: Just use the 3 selectors we need from this instead of importing it.
// We're going to end up with heavy modifications anyways.
@import "../../../../node_modules/react-resizable/css/styles.css";

.mx_RoomList2 .mx_RoomSubList_labelContainer {
z-index: 12;
.mx_RoomSublist2 {
// The sublist is a column of rows, essentially
display: flex;
flex-direction: column;

margin-left: 8px;
margin-top: 12px;
margin-bottom: 12px;

.mx_RoomSublist2_headerContainer {
text-transform: uppercase;
opacity: 0.5;
line-height: $font-16px;
font-size: $font-12px;
padding-bottom: 8px;
}

.mx_RoomSublist2_resizeBox {
// Create another flexbox column for the tiles
display: flex;
flex-direction: column;
overflow: hidden;

.mx_RoomSublist2_showMoreButton {
height: 44px; // 1 room tile high
cursor: pointer;

// We create a flexbox to cheat at alignment
display: flex;
align-items: center;
}
}
}
Loading