From 1af8da4a4a07fe5c4835d595d7f3358ae2b633a8 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 27 Jun 2019 17:19:01 +0200 Subject: [PATCH 01/15] change lozenge color of unsent redacted events to red use css vars so we don't have to repeat the whole lozenge style --- res/css/views/rooms/_EventTile.scss | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index 1f75373be8..02eb0049d9 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -171,12 +171,19 @@ limitations under the License. opacity: 0.4; } +div.mx_EventTile_notSent.mx_EventTile_redacted .mx_UnknownBody { + --lozenge-color: $event-notsent-color !important; + --lozenge-border-color: $event-notsent-color !important; +} + .mx_EventTile_notSent { color: $event-notsent-color; } .mx_EventTile_redacted .mx_EventTile_line .mx_UnknownBody, .mx_EventTile_redacted .mx_EventTile_reply .mx_UnknownBody { + --lozenge-color: $event-redacted-fg-color; + --lozenge-border-color: $event-redacted-border-color; display: block; width: 100%; height: 22px; @@ -184,12 +191,12 @@ limitations under the License. border-radius: 11px; background: repeating-linear-gradient( -45deg, - $event-redacted-fg-color, - $event-redacted-fg-color 3px, + var(--lozenge-color), + var(--lozenge-color) 3px, transparent 3px, transparent 6px ); - box-shadow: 0px 0px 3px $event-redacted-border-color inset; + box-shadow: 0px 0px 3px var(--lozenge-border-color) inset; } .mx_EventTile_highlight, From 6d458154a9501039401f2603e5fb8a1e8ab250fe Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 27 Jun 2019 17:41:47 +0200 Subject: [PATCH 02/15] support resending edit in context menu --- .../views/context_menus/MessageContextMenu.js | 15 +++++++++++++++ src/i18n/strings/en_EN.json | 1 + 2 files changed, 16 insertions(+) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 95bf59b470..8fc226c31a 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -90,6 +90,11 @@ module.exports = React.createClass({ this.closeMenu(); }, + onResendEditClick: function() { + Resend.resend(this.props.mxEvent.replacingEvent()); + this.closeMenu(); + }, + e2eInfoClicked: function() { this.props.e2eInfoCallback(); this.closeMenu(); @@ -220,6 +225,8 @@ module.exports = React.createClass({ render: function() { const mxEvent = this.props.mxEvent; const eventStatus = mxEvent.status; + const editEvent = mxEvent.replacingEvent(); + const editStatus = editEvent && editEvent.status; let resendButton; let redactButton; let cancelButton; @@ -242,6 +249,14 @@ module.exports = React.createClass({ ); } + if (editStatus === EventStatus.NOT_SENT) { + resendButton = ( +
+ { _t('Resend edit') } +
+ ); + } + if (isSent && this.state.canRedact) { redactButton = (
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 769316cd3b..912648b0c9 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1302,6 +1302,7 @@ "Unable to reject invite": "Unable to reject invite", "You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)", "Resend": "Resend", + "Resend edit": "Resend edit", "Cancel Sending": "Cancel Sending", "Forward Message": "Forward Message", "Pin Message": "Pin Message", From d66d3ca4d2284c12dbc287a4a867b66c86849096 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 27 Jun 2019 17:52:42 +0200 Subject: [PATCH 03/15] support resending redaction in context menu --- .../views/context_menus/MessageContextMenu.js | 17 +++++++++++++++-- src/i18n/strings/en_EN.json | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 8fc226c31a..2d4004e065 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -95,6 +95,11 @@ module.exports = React.createClass({ this.closeMenu(); }, + onResendRedactionClick: function() { + Resend.resend(this.props.mxEvent.localRedactionEvent()); + this.closeMenu(); + }, + e2eInfoClicked: function() { this.props.e2eInfoCallback(); this.closeMenu(); @@ -225,8 +230,8 @@ module.exports = React.createClass({ render: function() { const mxEvent = this.props.mxEvent; const eventStatus = mxEvent.status; - const editEvent = mxEvent.replacingEvent(); - const editStatus = editEvent && editEvent.status; + const editStatus = mxEvent.replacingEvent() && mxEvent.replacingEvent().status; + const redactStatus = mxEvent.localRedactionEvent() && mxEvent.localRedactionEvent().status; let resendButton; let redactButton; let cancelButton; @@ -257,6 +262,14 @@ module.exports = React.createClass({ ); } + if (redactStatus === EventStatus.NOT_SENT) { + resendButton = ( +
+ { _t('Resend removal') } +
+ ); + } + if (isSent && this.state.canRedact) { redactButton = (
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 912648b0c9..b68e72ed1e 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1303,6 +1303,7 @@ "You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)", "Resend": "Resend", "Resend edit": "Resend edit", + "Resend removal": "Resend removal", "Cancel Sending": "Cancel Sending", "Forward Message": "Forward Message", "Pin Message": "Pin Message", From 8160759a52524d8f16a81e1335653026df5aedc9 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 1 Jul 2019 17:37:32 +0200 Subject: [PATCH 04/15] show the various resend options as different menu items --- src/components/views/context_menus/MessageContextMenu.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 2d4004e065..fd99ed5f6b 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -233,6 +233,8 @@ module.exports = React.createClass({ const editStatus = mxEvent.replacingEvent() && mxEvent.replacingEvent().status; const redactStatus = mxEvent.localRedactionEvent() && mxEvent.localRedactionEvent().status; let resendButton; + let resendEditButton; + let resendRedactionButton; let redactButton; let cancelButton; let forwardButton; @@ -255,7 +257,7 @@ module.exports = React.createClass({ } if (editStatus === EventStatus.NOT_SENT) { - resendButton = ( + resendEditButton = (
{ _t('Resend edit') }
@@ -263,7 +265,7 @@ module.exports = React.createClass({ } if (redactStatus === EventStatus.NOT_SENT) { - resendButton = ( + resendRedactionButton = (
{ _t('Resend removal') }
@@ -380,6 +382,9 @@ module.exports = React.createClass({ return (
{ resendButton } + { resendEditButton } + { resendReactionsButton } + { resendRedactionButton } { redactButton } { cancelButton } { forwardButton } From 0d79b03f537855c026b5fb0eff70d4a119457552 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 1 Jul 2019 17:39:00 +0200 Subject: [PATCH 05/15] support resending reactions --- .../views/context_menus/MessageContextMenu.js | 30 +++++++++++++++++++ src/i18n/strings/en_EN.json | 1 + 2 files changed, 31 insertions(+) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index fd99ed5f6b..4fe4304257 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -100,6 +100,13 @@ module.exports = React.createClass({ this.closeMenu(); }, + onResendReactionsClick: function() { + for (const reaction of this._getUnsentReactions()) { + Resend.resend(reaction); + } + this.closeMenu(); + }, + e2eInfoClicked: function() { this.props.e2eInfoCallback(); this.closeMenu(); @@ -227,13 +234,28 @@ module.exports = React.createClass({ this.closeMenu(); }, + _getUnsentReactions() { + const cli = MatrixClientPeg.get(); + const room = cli.getRoom(this.props.mxEvent.getRoomId()); + const eventId = this.props.mxEvent.getId(); + return room.getPendingEvents().filter(e => { + const relation = e.getRelation(); + return relation && + relation.rel_type === "m.annotation" && + relation.event_id === eventId && + e.status === EventStatus.NOT_SENT; + }); + }, + render: function() { const mxEvent = this.props.mxEvent; const eventStatus = mxEvent.status; const editStatus = mxEvent.replacingEvent() && mxEvent.replacingEvent().status; const redactStatus = mxEvent.localRedactionEvent() && mxEvent.localRedactionEvent().status; + const unsentReactionsCount = this._getUnsentReactions().length; let resendButton; let resendEditButton; + let resendReactionsButton; let resendRedactionButton; let redactButton; let cancelButton; @@ -264,6 +286,14 @@ module.exports = React.createClass({ ); } + if (unsentReactionsCount !== 0) { + resendReactionsButton = ( +
+ { _t('Resend %(unsentCount)s reactions', {unsentCount: unsentReactionsCount}) } +
+ ); + } + if (redactStatus === EventStatus.NOT_SENT) { resendRedactionButton = (
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index b68e72ed1e..8ebd1a0792 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1303,6 +1303,7 @@ "You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)", "Resend": "Resend", "Resend edit": "Resend edit", + "Resend %(unsentCount)s reactions": "Resend %(unsentCount)s reactions", "Resend removal": "Resend removal", "Cancel Sending": "Cancel Sending", "Forward Message": "Forward Message", From 4be16a380ab5fbb3dc7da797d6e9db3b05f50c27 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 1 Jul 2019 17:39:30 +0200 Subject: [PATCH 06/15] only show resend options if event hasn't been redacted (which can now be only local, which is why this wasn't neccesary before) --- .../views/context_menus/MessageContextMenu.js | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 4fe4304257..097b86d1a9 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -269,29 +269,30 @@ module.exports = React.createClass({ // status is SENT before remote-echo, null after const isSent = !eventStatus || eventStatus === EventStatus.SENT; + if (!mxEvent.isRedacted()) { + if (eventStatus === EventStatus.NOT_SENT) { + resendButton = ( +
+ { _t('Resend') } +
+ ); + } - if (eventStatus === EventStatus.NOT_SENT) { - resendButton = ( -
- { _t('Resend') } -
- ); - } + if (editStatus === EventStatus.NOT_SENT) { + resendEditButton = ( +
+ { _t('Resend edit') } +
+ ); + } - if (editStatus === EventStatus.NOT_SENT) { - resendEditButton = ( -
- { _t('Resend edit') } -
- ); - } - - if (unsentReactionsCount !== 0) { - resendReactionsButton = ( -
- { _t('Resend %(unsentCount)s reactions', {unsentCount: unsentReactionsCount}) } -
- ); + if (unsentReactionsCount !== 0) { + resendReactionsButton = ( +
+ { _t('Resend %(unsentCount)s reactions', {unsentCount: unsentReactionsCount}) } +
+ ); + } } if (redactStatus === EventStatus.NOT_SENT) { From 1a4bdbaf963b1b54a9a68b458f9d49cb51256a46 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 1 Jul 2019 18:12:42 +0200 Subject: [PATCH 07/15] add (s) for singular to tr --- src/i18n/strings/en_EN.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 8ebd1a0792..e0ad966119 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1303,7 +1303,7 @@ "You cannot delete this message. (%(code)s)": "You cannot delete this message. (%(code)s)", "Resend": "Resend", "Resend edit": "Resend edit", - "Resend %(unsentCount)s reactions": "Resend %(unsentCount)s reactions", + "Resend %(unsentCount)s reaction(s)": "Resend %(unsentCount)s reaction(s)", "Resend removal": "Resend removal", "Cancel Sending": "Cancel Sending", "Forward Message": "Forward Message", From 515ed2e1bb29f3737a9a4c05b70a0cae97f37c11 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 1 Jul 2019 18:13:05 +0200 Subject: [PATCH 08/15] Also cancel associated events when canceling sending from ctx menu --- .../views/context_menus/MessageContextMenu.js | 45 ++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 097b86d1a9..04bc7c75ef 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -29,6 +29,10 @@ import SettingsStore from '../../../settings/SettingsStore'; import { isUrlPermitted } from '../../../HtmlUtils'; import { isContentActionable } from '../../../utils/EventUtils'; +function canCancel(eventStatus) { + return eventStatus === EventStatus.QUEUED || eventStatus === EventStatus.NOT_SENT; +} + module.exports = React.createClass({ displayName: 'MessageContextMenu', @@ -165,7 +169,25 @@ module.exports = React.createClass({ }, onCancelSendClick: function() { - Resend.removeFromQueue(this.props.mxEvent); + const mxEvent = this.props.mxEvent; + const editEvent = mxEvent.replacingEvent(); + const redactEvent = mxEvent.localRedactionEvent(); + const pendingReactions = this._getPendingReactions(); + + if (editEvent && canCancel(editEvent.status)) { + Resend.removeFromQueue(editEvent); + } + if (redactEvent && canCancel(redactEvent.status)) { + Resend.removeFromQueue(redactEvent); + } + if (pendingReactions.length) { + for (const reaction of pendingReactions) { + Resend.removeFromQueue(reaction); + } + } + if (canCancel(mxEvent.status)) { + Resend.removeFromQueue(this.props.mxEvent); + } this.closeMenu(); }, @@ -234,7 +256,7 @@ module.exports = React.createClass({ this.closeMenu(); }, - _getUnsentReactions() { + _getReactions(filter) { const cli = MatrixClientPeg.get(); const room = cli.getRoom(this.props.mxEvent.getRoomId()); const eventId = this.props.mxEvent.getId(); @@ -243,16 +265,29 @@ module.exports = React.createClass({ return relation && relation.rel_type === "m.annotation" && relation.event_id === eventId && - e.status === EventStatus.NOT_SENT; + filter(e); }); }, + _getPendingReactions() { + return this._getReactions(e => canCancel(e.status)); + }, + + _getUnsentReactions() { + return this._getReactions(e => e.status === EventStatus.NOT_SENT); + }, + render: function() { const mxEvent = this.props.mxEvent; const eventStatus = mxEvent.status; const editStatus = mxEvent.replacingEvent() && mxEvent.replacingEvent().status; const redactStatus = mxEvent.localRedactionEvent() && mxEvent.localRedactionEvent().status; const unsentReactionsCount = this._getUnsentReactions().length; + const pendingReactionsCount = this._getPendingReactions().length; + const allowCancel = canCancel(mxEvent.status) || + canCancel(editStatus) || + canCancel(redactStatus) || + pendingReactionsCount !== 0; let resendButton; let resendEditButton; let resendReactionsButton; @@ -289,7 +324,7 @@ module.exports = React.createClass({ if (unsentReactionsCount !== 0) { resendReactionsButton = (
- { _t('Resend %(unsentCount)s reactions', {unsentCount: unsentReactionsCount}) } + { _t('Resend %(unsentCount)s reaction(s)', {unsentCount: unsentReactionsCount}) }
); } @@ -311,7 +346,7 @@ module.exports = React.createClass({ ); } - if (eventStatus === EventStatus.QUEUED || eventStatus === EventStatus.NOT_SENT) { + if (allowCancel) { cancelButton = (
{ _t('Cancel Sending') } From d0d327620bb95f6220d6103a1697fb0f01d39be6 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 2 Jul 2019 13:56:27 +0200 Subject: [PATCH 09/15] hide reactions for redacted events --- src/components/views/rooms/EventTile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index 988bf7eb3c..192e203f35 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -681,7 +681,7 @@ module.exports = withMatrixClient(React.createClass({
: null; let reactionsRow; - if (SettingsStore.isFeatureEnabled("feature_reactions")) { + if (SettingsStore.isFeatureEnabled("feature_reactions") && !isRedacted) { const ReactionsRow = sdk.getComponent('messages.ReactionsRow'); reactionsRow = Date: Tue, 2 Jul 2019 14:52:29 +0200 Subject: [PATCH 10/15] cancel pending edit when sending new edit --- src/components/views/elements/MessageEditor.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/views/elements/MessageEditor.js b/src/components/views/elements/MessageEditor.js index 0830708701..194c2d4a67 100644 --- a/src/components/views/elements/MessageEditor.js +++ b/src/components/views/elements/MessageEditor.js @@ -31,6 +31,7 @@ import {renderModel} from '../../../editor/render'; import EditorStateTransfer from '../../../utils/EditorStateTransfer'; import {MatrixClient} from 'matrix-js-sdk'; import classNames from 'classnames'; +import {EventStatus} from 'matrix-js-sdk'; export default class MessageEditor extends React.Component { static propTypes = { @@ -195,12 +196,21 @@ export default class MessageEditor extends React.Component { }, contentBody); const roomId = this.props.editState.getEvent().getRoomId(); + this._cancelPreviousPendingEdit(); this.context.matrixClient.sendMessage(roomId, content); dis.dispatch({action: "edit_event", event: null}); dis.dispatch({action: 'focus_composer'}); } + _cancelPreviousPendingEdit() { + const originalEvent = this.props.editState.getEvent(); + const previousEdit = originalEvent.replacingEvent(); + if (previousEdit.status === EventStatus.QUEUED || previousEdit.status === EventStatus.NOT_SENT) { + this.context.matrixClient.cancelPendingEvent(previousEdit); + } + } + _onAutoCompleteConfirm = (completion) => { this.model.autoComplete.onComponentConfirm(completion); } From 14caed62d0c1c77e72854d25cd4be4dcc0255cdb Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 2 Jul 2019 17:29:37 +0200 Subject: [PATCH 11/15] make sure scrollpanel is mounted before checking scroll have seen errors in this direction, so hope this will fix it, as this is invoked from any EventTile's onHeightChanged callback, which is often called after some async operation (by when the timeline can be unmounted already). doesn't hurt in any case. --- src/components/structures/ScrollPanel.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/structures/ScrollPanel.js b/src/components/structures/ScrollPanel.js index 7e1f0ff469..40caa627af 100644 --- a/src/components/structures/ScrollPanel.js +++ b/src/components/structures/ScrollPanel.js @@ -214,6 +214,9 @@ module.exports = React.createClass({ // after an update to the contents of the panel, check that the scroll is // where it ought to be, and set off pagination requests if necessary. checkScroll: function() { + if (this.unmounted) { + return; + } this._restoreSavedScrollState(); this.checkFillState(); }, From 3fd96008c31891752a94f6c3745d058e044e17c1 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 2 Jul 2019 17:34:07 +0200 Subject: [PATCH 12/15] Fixup: dont assume there is a prior edit --- src/components/views/elements/MessageEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/MessageEditor.js b/src/components/views/elements/MessageEditor.js index 194c2d4a67..0a3d6443d9 100644 --- a/src/components/views/elements/MessageEditor.js +++ b/src/components/views/elements/MessageEditor.js @@ -206,7 +206,7 @@ export default class MessageEditor extends React.Component { _cancelPreviousPendingEdit() { const originalEvent = this.props.editState.getEvent(); const previousEdit = originalEvent.replacingEvent(); - if (previousEdit.status === EventStatus.QUEUED || previousEdit.status === EventStatus.NOT_SENT) { + if (previousEdit && (previousEdit.status === EventStatus.QUEUED || previousEdit.status === EventStatus.NOT_SENT)) { this.context.matrixClient.cancelPendingEvent(previousEdit); } } From daa2250023d3cbe592de402b3bf5f4a3538cbb5f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 2 Jul 2019 18:30:57 +0200 Subject: [PATCH 13/15] fix lint --- src/components/views/elements/MessageEditor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/MessageEditor.js b/src/components/views/elements/MessageEditor.js index 0a3d6443d9..593e5bc616 100644 --- a/src/components/views/elements/MessageEditor.js +++ b/src/components/views/elements/MessageEditor.js @@ -206,7 +206,10 @@ export default class MessageEditor extends React.Component { _cancelPreviousPendingEdit() { const originalEvent = this.props.editState.getEvent(); const previousEdit = originalEvent.replacingEvent(); - if (previousEdit && (previousEdit.status === EventStatus.QUEUED || previousEdit.status === EventStatus.NOT_SENT)) { + if (previousEdit && ( + previousEdit.status === EventStatus.QUEUED || + previousEdit.status === EventStatus.NOT_SENT + )) { this.context.matrixClient.cancelPendingEvent(previousEdit); } } From fc3c4fccc2a3b8d6f4d7a2d737fba6cb26df014b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 2 Jul 2019 18:31:11 +0200 Subject: [PATCH 14/15] set background on highlighted messages --- res/css/views/rooms/_EventTile.scss | 8 ++++++-- res/themes/dark/css/_dark.scss | 3 +++ res/themes/light/css/_light.scss | 10 ++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss index 02eb0049d9..9f14cf1b00 100644 --- a/res/css/views/rooms/_EventTile.scss +++ b/res/css/views/rooms/_EventTile.scss @@ -201,8 +201,12 @@ div.mx_EventTile_notSent.mx_EventTile_redacted .mx_UnknownBody { .mx_EventTile_highlight, .mx_EventTile_highlight .markdown-body - { - color: $warning-color; +{ + color: $event-highlight-fg-color; + + .mx_EventTile_line { + background-color: $event-highlight-bg-color; + } } .mx_EventTile_contextual { diff --git a/res/themes/dark/css/_dark.scss b/res/themes/dark/css/_dark.scss index ed1cc162a0..f2bfe5bc8a 100644 --- a/res/themes/dark/css/_dark.scss +++ b/res/themes/dark/css/_dark.scss @@ -121,6 +121,9 @@ $event-sending-color: $text-secondary-color; $event-redacted-fg-color: #606060; $event-redacted-border-color: #000000; +$event-highlight-fg-color: $warning-color; +$event-highlight-bg-color: $event-selected-color; + // event timestamp $event-timestamp-color: $text-secondary-color; diff --git a/res/themes/light/css/_light.scss b/res/themes/light/css/_light.scss index 2dd193b8c5..159b9a6b76 100644 --- a/res/themes/light/css/_light.scss +++ b/res/themes/light/css/_light.scss @@ -195,12 +195,18 @@ $panel-divider-color: #dee1f3; $widget-menu-bar-bg-color: $secondary-accent-color; // ******************** - +// both $event-highlight-bg-color and $room-warning-bg-color share this value, +// so to not make their order dependent on who depends on who, have a shared value +// defined before both +$yellow-background: #fff8e3; // event tile lifecycle $event-encrypting-color: #abddbc; $event-sending-color: #ddd; $event-notsent-color: #f44; +$event-highlight-fg-color: $warning-color; +$event-highlight-bg-color: $yellow-background; + // event redaction $event-redacted-fg-color: #e2e2e2; $event-redacted-border-color: #cccccc; @@ -244,7 +250,7 @@ $togglesw-ball-color: #fff; $progressbar-color: #000; -$room-warning-bg-color: #fff8e3; +$room-warning-bg-color: $yellow-background; $memberstatus-placeholder-color: $roomtile-name-color; From cca82635f3643128c82c6b3875f4a22036acbd51 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 3 Jul 2019 10:32:37 +0200 Subject: [PATCH 15/15] whitespace --- res/themes/light/css/_light.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/res/themes/light/css/_light.scss b/res/themes/light/css/_light.scss index 159b9a6b76..447516a26b 100644 --- a/res/themes/light/css/_light.scss +++ b/res/themes/light/css/_light.scss @@ -195,10 +195,12 @@ $panel-divider-color: #dee1f3; $widget-menu-bar-bg-color: $secondary-accent-color; // ******************** + // both $event-highlight-bg-color and $room-warning-bg-color share this value, // so to not make their order dependent on who depends on who, have a shared value // defined before both $yellow-background: #fff8e3; + // event tile lifecycle $event-encrypting-color: #abddbc; $event-sending-color: #ddd;