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

IRC ui layout #4531

Merged
merged 31 commits into from
May 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a38d5eb
add useIRCLayout setting
JorikSchellekens Apr 29, 2020
e0c89f6
Add switch between layout classes
JorikSchellekens Apr 29, 2020
c1e740a
Break out group layout settings
JorikSchellekens Apr 29, 2020
10c8d25
Create irc layout
JorikSchellekens Apr 29, 2020
37e8dc0
Include new css files
JorikSchellekens Apr 29, 2020
6c3e316
Reduce padding
JorikSchellekens Apr 29, 2020
54d211a
Index file name changes
JorikSchellekens May 4, 2020
67249e1
Fix hover
JorikSchellekens May 4, 2020
027826c
Replies have the same layout as messages
JorikSchellekens May 5, 2020
0af265b
Fix replies
JorikSchellekens May 5, 2020
07c2d0c
Composer reply previews have group layout
JorikSchellekens May 6, 2020
5568e64
Fix encryption badge layout
JorikSchellekens May 6, 2020
771ae5e
Fix encryption badge layouts and replies.
JorikSchellekens May 7, 2020
5a0fdb3
Remove unused setting
JorikSchellekens May 7, 2020
bc5fc57
Lint
JorikSchellekens May 7, 2020
ac95172
tighter layout
JorikSchellekens May 7, 2020
9b7c63a
Duplicated names
JorikSchellekens May 8, 2020
8239666
Implement nitpicks
JorikSchellekens May 8, 2020
fef4d88
lint
JorikSchellekens May 8, 2020
5029c3f
Implement IRC draggable display name width
JorikSchellekens May 13, 2020
3f04f51
Implement more nitpicks
JorikSchellekens May 13, 2020
312b616
fix i18n
JorikSchellekens May 13, 2020
5c2abcf
Show username on continuations
JorikSchellekens May 13, 2020
17f535e
Fix review problems
JorikSchellekens May 18, 2020
5380e76
lint
JorikSchellekens May 18, 2020
4deeef5
Remove ability to remove avatars
JorikSchellekens May 18, 2020
bba6b2c
Appease i18n
JorikSchellekens May 18, 2020
7bb7f30
missed one
JorikSchellekens May 18, 2020
286828b
Disable irc mode in notifiactions panel
JorikSchellekens May 19, 2020
2e32519
Merge remote-tracking branch 'nv/develop' into joriks/irc-ui
JorikSchellekens May 19, 2020
323d076
Merge branch 'develop' of https://github.com/matrix-org/matrix-react-…
JorikSchellekens May 19, 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
124 changes: 124 additions & 0 deletions res/css/views/rooms/_IRCLayout.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
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.
*/

$name-width: 50px;
$icon-width: 14px;
$timestamp-width: 45px;
$right-padding: 5px;

.mx_IRCLayout {

line-height: $font-22px !important;

.mx_EventTile {
display: flex;
flex-direction: row;
align-items: flex-start;

> * {
margin-right: $right-padding;
}

> .mx_EventTile_msgOption {
order: 4;
flex-shrink: 0;
}

> .mx_SenderProfile {
order: 2;
flex-shrink: 0;
width: $name-width;
text-overflow: ellipsis;
text-align: right;
display: flex;
align-items: center;
}

> .mx_EventTile_line {
order: 3;
flex-grow: 1;
}

> .mx_EventTile_avatar {
order: 1;
position: relative;
top: 0;
left: 0;
flex-shrink: 0;
height: 22px;
display: flex;
align-items: center;

> .mx_BaseAvatar {
height: 1rem;
width: 1rem;
}
}

.mx_MessageTimestamp {
font-size: $font-10px;
width: $timestamp-width;
text-align: right;
}

.mx_EventTile_line, .mx_EventTile_reply {
padding: 0;
}

.mx_EventTile_e2eIcon {
position: relative;
right: unset;
left: unset;
top: -2px;
padding: 0;
}

.mx_EventTile_line > * {
display: inline-block;
}
}

.mx_EventListSummary {
> .mx_EventTile_line {
padding-left: calc($name-width + $icon-width + $timestamp-width + 3 * $right-padding); // 15 px of padding
JorikSchellekens marked this conversation as resolved.
Show resolved Hide resolved
}
}

.mx_EventTile.mx_EventTile_info {
.mx_EventTile_avatar {
left: calc($name-width + 10px + $icon-width);
top: 0;
}

.mx_EventTile_line {
left: calc($name-width + 10px + $icon-width);
}

.mx_TextualEvent {
line-height: $font-22px;
}
}

.mx_EventTile_continuation:not(.mx_EventTile_info) {
.mx_EventTile_avatar {
visibility: hidden;
}

.mx_SenderProfile {
visibility: hidden;
}
}
}
1 change: 1 addition & 0 deletions src/components/structures/MessagePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ export default class MessagePanel extends React.Component {
isSelectedEvent={highlight}
getRelationsForEvent={this.props.getRelationsForEvent}
showReactions={this.props.showReactions}
useIRCLayout={this.state.useIRCLayout}
/>
</TileErrorBoundary>
</li>,
Expand Down
30 changes: 23 additions & 7 deletions src/components/views/rooms/EventTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ export default createReactClass({

// whether to show reactions for this event
showReactions: PropTypes.bool,

// whether to use the irc layout
useIRCLayout: PropTypes.bool,
},

getDefaultProps: function() {
Expand Down Expand Up @@ -653,6 +656,8 @@ export default createReactClass({
const classes = classNames({
mx_EventTile_bubbleContainer: isBubbleMessage,
mx_EventTile: true,
mx_EventTile_irc: this.props.useIRCLayout,
JorikSchellekens marked this conversation as resolved.
Show resolved Hide resolved
mx_EventTile_group: !this.props.useIRCLayout,
mx_EventTile_isEditing: isEditing,
mx_EventTile_info: isInfoMessage,
mx_EventTile_12hr: this.props.isTwelveHour,
Expand Down Expand Up @@ -696,6 +701,9 @@ export default createReactClass({
// joins/parts/etc
avatarSize = 14;
needsSenderProfile = false;
} else if (this.props.useIRCLayout) {
avatarSize = 14;
bwindels marked this conversation as resolved.
Show resolved Hide resolved
needsSenderProfile = true;
} else if (this.props.continuation && this.props.tileShape !== "file_grid") {
// no avatar or sender profile for continuation messages
avatarSize = 0;
Expand Down Expand Up @@ -879,21 +887,29 @@ export default createReactClass({
this.props.permalinkCreator,
this._replyThread,
);

const linkedTimestamp = <a
href={permalink}
onClick={this.onPermalinkClicked}
aria-label={formatTime(new Date(this.props.mxEvent.getTs()), this.props.isTwelveHour)}
>
{ timestamp }
</a>;

const groupTimestamp = !this.props.useIRCLayout ? linkedTimestamp : null;
const ircTimestamp = this.props.useIRCLayout ? linkedTimestamp : null;


// tab-index=-1 to allow it to be focusable but do not add tab stop for it, primarily for screen readers
return (
<div className={classes} tabIndex={-1}>
{ ircTimestamp }
<div className="mx_EventTile_msgOption">
{ readAvatars }
</div>
{ sender }
<div className="mx_EventTile_line">
<a
href={permalink}
onClick={this.onPermalinkClicked}
aria-label={formatTime(new Date(this.props.mxEvent.getTs()), this.props.isTwelveHour)}
>
{ timestamp }
</a>
{ groupTimestamp }
{ !isBubbleMessage && this._renderE2EPadlock() }
{ thread }
<EventTileType ref={this._tile}
Expand Down