Skip to content

Commit

Permalink
feat: Reaction popover and messages padding (#16833)
Browse files Browse the repository at this point in the history
  • Loading branch information
przemvs committed Feb 14, 2024
1 parent 9e7bad0 commit d9a74fe
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/script/components/Conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ export const Conversation = ({
isLastReceivedMessage={isLastReceivedMessage}
isMsgElementsFocusable={isMsgElementsFocusable}
setMsgElementsFocusable={setMsgElementsFocusable}
isRightSidebarOpen={isRightSidebarOpen}
/>

{isConversationLoaded &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const messageBodyActions: CSSObject = {
minWidth: '40px',
position: 'absolute',
right: '16px',
top: '-30px',
top: '-34px',
userSelect: 'none',
'@media (max-width: @screen-md-min)': {
height: '45px',
Expand Down Expand Up @@ -103,5 +103,5 @@ export const getActionsMenuCSS = (isActive?: boolean): CSSObject => {
};

export const messageWithHeaderTop: CSSObject = {
top: '-63px',
top: '-58px',
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {CSSObject} from '@emotion/react';

export const messageReactionWrapper: CSSObject = {
display: 'flex',
paddingBlock: '0.5rem',
paddingTop: '6px',
gap: '0.5rem',
paddingInline: 'var(--conversation-message-sender-width)',
flexWrap: 'wrap',
Expand Down
6 changes: 5 additions & 1 deletion src/script/components/MessagesList/Message/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ export const Message: React.FC<MessageParams & {scrollTo?: ScrollToElement}> = p

return (
<div
className={cx('message', {'message-marked': isHighlighted})}
className={cx('message', {
'message-marked': isHighlighted,
'content-message': message.isContent(),
'system-message': !message.isContent(),
})}
ref={messageElementRef}
data-uie-uid={message.id}
data-uie-value={message.super_type}
Expand Down
9 changes: 8 additions & 1 deletion src/script/components/MessagesList/MessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ interface MessagesListParams {
isLastReceivedMessage: (messageEntity: MessageEntity, conversationEntity: ConversationEntity) => boolean;
isMsgElementsFocusable: boolean;
setMsgElementsFocusable: (isMsgElementsFocusable: boolean) => void;
isRightSidebarOpen?: boolean;
}

export const MessagesList: FC<MessagesListParams> = ({
Expand All @@ -95,6 +96,7 @@ export const MessagesList: FC<MessagesListParams> = ({
isLastReceivedMessage,
isMsgElementsFocusable,
setMsgElementsFocusable,
isRightSidebarOpen = false,
}) => {
const {
messages: allMessages,
Expand Down Expand Up @@ -267,7 +269,12 @@ export const MessagesList: FC<MessagesListParams> = ({
};

return (
<FadingScrollbar ref={messageListRef} id="message-list" className="message-list" tabIndex={TabIndex.UNFOCUSABLE}>
<FadingScrollbar
ref={messageListRef}
id="message-list"
className={cx('message-list', {'is-right-panel-open': isRightSidebarOpen})}
tabIndex={TabIndex.UNFOCUSABLE}
>
<div ref={setMessageContainer} className={cx('messages', {'flex-center': verticallyCenterMessage()})}>
{groupedMessages.map(group => {
if (isMarker(group)) {
Expand Down
4 changes: 0 additions & 4 deletions src/style/components/asset/common/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
& + & {
margin-top: 1px;
}

&:first-of-type {
margin-bottom: 4px;
}
}

.asset-placeholder {
Expand Down
30 changes: 24 additions & 6 deletions src/style/content/conversation/message-list.less
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,29 @@
}
}

.content-message {
&:has(.message-header) {
padding-top: 6px;
}
}

.system-message {
padding-block: 8px;

&:has(.message-timestamp) + .system-message {
padding-top: 0;
}
}

@keyframes marked-animation {
to {
background-color: inherit;
}
}

.content-message-wrapper {
padding-block: 6px;

&:hover,
&:focus-visible {
background-color: #fff;
Expand Down Expand Up @@ -124,8 +140,6 @@
position: relative;
display: flex;
width: 100%;
padding-top: 6px;
margin-bottom: 2px;
line-height: @avatar-diameter-xs;

& > .message-body-actions {
Expand All @@ -135,11 +149,15 @@
+ .message-services-warning {
margin-left: 72px;
}

+ .message-body .message-asset {
padding-top: 6px;
}
}

.message-header-icon {
.flex-center;
width: @conversation-message-sender-width;
width: var(--conversation-message-sender-width);
max-height: @avatar-diameter-xs;

align-self: center;
Expand All @@ -157,6 +175,7 @@
.message-header-label {
display: flex;
min-width: 0; // fixes ellipsis not working with flexbox (FF)
flex: 1;
align-items: center;
font-size: @font-size-small;
font-weight: @font-weight-regular;
Expand Down Expand Up @@ -259,7 +278,6 @@
max-width: @conversation-max-width;
justify-content: space-between;
padding-left: @conversation-message-sender-width;
padding-block: 4px;

&-content {
width: 100%;
Expand Down Expand Up @@ -513,7 +531,7 @@
.message-group-creation-header,
.message-member-footer {
padding-top: 16px;
margin-left: 54px;
margin-left: var(--conversation-message-sender-width);
font-size: @font-size-small;
font-weight: @font-weight-regular;
}
Expand Down Expand Up @@ -673,7 +691,7 @@
.message-asset {
display: flex;
align-items: flex-start;
margin-bottom: 4px;
padding-block: 6px;
}

.message-call,
Expand Down
3 changes: 2 additions & 1 deletion src/style/foundation/framework.less
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
}

#conversation-input-bar,
#conversation-title-bar {
#conversation-title-bar,
#message-list {
width: 100%;
transition: width @animation-timing-fast @ease-out-quart;

Expand Down
2 changes: 1 addition & 1 deletion src/style/foundation/warnings.less
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
position: absolute;
top: 50%;
right: 24px;
margin-top: -@button-medium-sm-height / 2;
margin-top: calc(-@button-medium-sm-height / 2);
}

.warning-bar-icon {
Expand Down

0 comments on commit d9a74fe

Please sign in to comment.