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

Improve composer visiblity #8578

Merged
merged 20 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from 16 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
1 change: 1 addition & 0 deletions res/css/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
@import "./views/avatars/_DecoratedRoomAvatar.scss";
@import "./views/avatars/_WidgetAvatar.scss";
@import "./views/beta/_BetaCard.scss";
@import "./views/buttons/_Cancel.scss";
@import "./views/context_menus/_CallContextMenu.scss";
@import "./views/context_menus/_DeviceContextMenu.scss";
@import "./views/context_menus/_IconizedContextMenu.scss";
Expand Down
5 changes: 5 additions & 0 deletions res/css/structures/_RightPanel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ limitations under the License.
.mx_RoomView_MessageList {
padding: 14px 18px; // top and bottom is 4px smaller to balance with the padding set above
}

.mx_MessageComposer_wrapper {
margin-top: $spacing-8;
margin-bottom: $spacing-8;
}
}

.mx_RightPanel_header {
Expand Down
8 changes: 7 additions & 1 deletion res/css/structures/_RoomView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ limitations under the License.
position: relative;
}

.mx_MainSplit_timeline {
.mx_MessageComposer_wrapper {
margin: $spacing-16;
}
}

.mx_RoomView_auxPanel {
min-width: 0px;
width: 100%;
Expand Down Expand Up @@ -155,7 +161,7 @@ limitations under the License.
.mx_RoomView_messageListWrapper {
justify-content: flex-start;

>.mx_RoomView_MessageList > li > ol {
> .mx_RoomView_MessageList > li > ol {
list-style-type: none;
}
}
Expand Down
32 changes: 32 additions & 0 deletions res/css/views/buttons/_Cancel.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Copyright 2022 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_CancelButton {
width: var(--size);
height: var(--size);

box-sizing: border-box;
padding: calc(var(--size) / 4);
border-radius: 50%;

line-height: 0;
background: $quinary-content;

svg {
width: calc(var(--size) / 2);
color: $secondary-content;
}
}
107 changes: 82 additions & 25 deletions res/css/views/rooms/_MessageComposer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,44 @@ limitations under the License.
margin: auto;
border-top: 1px solid $primary-hairline-color;
position: relative;
padding-left: 42px;
padding-right: 16px;

display: grid;
grid-template:
"reply reply" auto
"composer controls" auto
/ 1fr auto;

.mx_ReplyPreview {
grid-area: reply;
}

.mx_MessageComposer_row {
grid-area: composer;
}

.mx_MessageComposer_controls {
grid-area: controls;
display: flex;
align-items: flex-end;
margin-bottom: 2px;
}

>[role=button] {
margin-bottom: 7px;
}

.mx_VoiceRecordComposerTile_delete {
margin-bottom: 9px;
}
t3chguy marked this conversation as resolved.
Show resolved Hide resolved

.mx_VoiceRecordComposerTile_stop,
.mx_MessageComposer_sendMessage {
margin-bottom: $spacing-4;
}

.mx_VoiceMessagePrimaryContainer {
margin-right: $spacing-8;
}
}

.mx_MessageComposer_replaced_wrapper {
Expand Down Expand Up @@ -56,7 +92,16 @@ limitations under the License.
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
border: 1px solid $quaternary-content;
border-radius: 8px;
padding: $spacing-12 $spacing-8;
margin-right: $spacing-16;

transition: border-color var(--transition-short);

&:focus-within {
border-color: $tertiary-content;
}
}

.mx_MessageComposer .mx_MessageComposer_avatar {
Expand All @@ -73,12 +118,10 @@ limitations under the License.
}

.mx_MessageComposer_e2eIcon.mx_E2EIcon {
position: absolute;
left: 20px;
margin-right: 0; // Counteract the E2EIcon class
margin-left: 3px; // Counteract the E2EIcon class
margin: 0 0 2px;
width: 12px;
height: 12px;
align-self: end;
}

.mx_MessageComposer_noperm_error {
Expand Down Expand Up @@ -124,13 +167,19 @@ limitations under the License.
.mx_MessageComposer_editor > :first-child {
margin-top: 0 !important;
}

.mx_MessageComposer_editor > :last-child {
margin-bottom: 0 !important;
}

@keyframes visualbell {
from { background-color: $visual-bell-bg-color; }
to { background-color: $background; }
from {
background-color: $visual-bell-bg-color;
}

to {
background-color: $background;
}
}

.mx_MessageComposer_input_error {
Expand Down Expand Up @@ -166,12 +215,14 @@ limitations under the License.
color: $accent;
opacity: 1.0;
}

.mx_MessageComposer_input textarea::-webkit-input-placeholder {
color: $accent;
}

.mx_MessageComposer_button_highlight {
background: rgba($accent, 0.25);

// make the icon the accent color too
&::before {
background-color: $accent !important;
Expand All @@ -188,6 +239,7 @@ limitations under the License.
padding-left: var(--size);
border-radius: 50%;
margin-right: 6px;
margin-bottom: 7px;

&:last-child {
margin-right: auto;
Expand Down Expand Up @@ -261,11 +313,30 @@ limitations under the License.
mask-image: url('$(res)/img/image-view/more.svg');
}

.mx_MessageComposer_sendMessageWrapper {
--sendMessageSize: 32px;
transition: all var(--transition-short);
}

.mx_MessageComposer_sendMessageWrapper,
.mx_MessageComposer_sendMessageWrapper-enter,
.mx_MessageComposer_sendMessageWrapper-exit {
width: 0;
transform: scale(.6);
opacity: 0;
}

.mx_MessageComposer_sendMessageWrapper-enter-active {
width: var(--sendMessageSize);
transform: scale(1);
opacity: 1;
}

.mx_MessageComposer_sendMessage {
cursor: pointer;
position: relative;
width: 32px;
height: 32px;
width: var(--sendMessageSize);
height: var(--sendMessageSize);
border-radius: 100%;
background-color: $accent;

Expand Down Expand Up @@ -371,21 +442,7 @@ limitations under the License.
.mx_MessageComposer.mx_MessageComposer--compact {
margin-right: 0;

.mx_MessageComposer_wrapper {
padding: 0 0 0 25px;
}

&:not(.mx_MessageComposer_e2eStatus) {
.mx_MessageComposer_wrapper {
padding: 0;
}
}

.mx_MessageComposer_button:last-child {
margin-right: 0;
}

.mx_MessageComposer_e2eIcon {
left: 0;
}
}
59 changes: 24 additions & 35 deletions res/css/views/rooms/_ReplyPreview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,32 @@ limitations under the License.
background: $background;
max-height: 50vh;
overflow: auto;
padding: $spacing-8;
}

.mx_ReplyPreview_header {
display: flex;
font-size: $font-12px;
color: $secondary-content;
position: relative;

.mx_ReplyPreview_section {
border-bottom: 1px solid $primary-hairline-color;
display: flex;
flex-flow: column;
row-gap: $spacing-8;
padding: $spacing-8 $spacing-8 0 $spacing-8;

.mx_ReplyPreview_header {
display: flex;
justify-content: space-between;
column-gap: 8px;

color: $primary-content;
font-weight: 400;
opacity: 0.4;

.mx_ReplyPreview_header_cancel {
background-color: $primary-content;
mask: url('$(res)/img/cancel.svg');
mask-repeat: no-repeat;
mask-position: center;
mask-size: 18px;
width: 18px;
height: 18px;
min-width: 18px;
min-height: 18px;
}
}
> svg {
width: 1em;
vertical-align: middle;
margin-right: $spacing-8;
}
}

.mx_RoomView_body {
.mx_ReplyPreview {
// Add box-shadow to the reply preview on the main (left) panel only.
// It is not added to the preview on the (right) panel for threads and a chat with a maximized widget.
box-shadow: 0px -16px 32px $composer-shadow-color;
border-radius: 8px 8px 0 0;
.mx_CancelButton {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
}
}

.mx_ReplyPreview_header_cancel {
position: absolute;
right: 0;
color: $primary-content;
width: 18px;
}
6 changes: 0 additions & 6 deletions res/css/views/rooms/_SendMessageComposer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,8 @@ limitations under the License.
flex: 1;
display: flex;
flex-direction: column;
// min-height at this level so the mx_BasicMessageComposer_input
// still stays vertically centered when less than 55px.
// We also set this to ensure the voice message recording widget
// doesn't cause a jump.
min-height: 55px;

.mx_BasicMessageComposer_input {
padding: 3px 0;
// this will center the contenteditable
// in it's parent vertically
// while keeping the autocomplete at the top
Expand Down
4 changes: 2 additions & 2 deletions res/img/cancel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions res/img/element-icons/room/message-bar/reply.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions res/img/element-icons/x-8px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading