From 818061d53bd85e2df98b22bf8f225f0c61c4c7be Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 29 Jan 2019 16:20:25 +0100 Subject: [PATCH 1/7] show invite count in invite sublist header --- src/components/structures/RoomSubList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 676e0e6976..04d1fb4e39 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -254,9 +254,9 @@ const RoomSubList = React.createClass({ badge =
{ FormattingUtils.formatCount(subListNotifCount) }
; - } else if (this.props.isInvite) { + } else if (this.props.isInvite && this.props.list.length) { // no notifications but highlight anyway because this is an invite badge - badge =
!
; + badge =
{this.props.list.length}
; } } From 495f264ad583d4eaa7791a8ddd7ee9f654476f0d Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 29 Jan 2019 16:20:39 +0100 Subject: [PATCH 2/7] prevent badge jumping when hovering over sublist this was caused by the layout growing wider than it could, hence the overflow event being triggered. The overflow event is only supported in FF and we fire the manual check often enough that the overflow gradient still reliably (dis)appears when needed. --- src/components/structures/AutoHideScrollbar.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/components/structures/AutoHideScrollbar.js b/src/components/structures/AutoHideScrollbar.js index a8fccec08e..a385df0401 100644 --- a/src/components/structures/AutoHideScrollbar.js +++ b/src/components/structures/AutoHideScrollbar.js @@ -102,10 +102,6 @@ export default class AutoHideScrollbar extends React.Component { installBodyClassesIfNeeded(); this._needsOverflowListener = document.body.classList.contains("mx_scrollbar_nooverlay"); - if (this._needsOverflowListener) { - this.containerRef.addEventListener("overflow", this.onOverflow); - this.containerRef.addEventListener("underflow", this.onUnderflow); - } this.checkOverflow(); } @@ -118,13 +114,6 @@ export default class AutoHideScrollbar extends React.Component { } } - componentWillUnmount() { - if (this._needsOverflowListener && this.containerRef) { - this.containerRef.removeEventListener("overflow", this.onOverflow); - this.containerRef.removeEventListener("underflow", this.onUnderflow); - } - } - render() { return (
Date: Tue, 29 Jan 2019 16:29:30 +0100 Subject: [PATCH 3/7] show Guest instead of random username when in guest mode --- src/components/structures/TopLeftMenuButton.js | 10 +++++++++- src/i18n/strings/en_EN.json | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/structures/TopLeftMenuButton.js b/src/components/structures/TopLeftMenuButton.js index 592b64634f..601fb2e654 100644 --- a/src/components/structures/TopLeftMenuButton.js +++ b/src/components/structures/TopLeftMenuButton.js @@ -22,6 +22,7 @@ import AccessibleButton from '../views/elements/AccessibleButton'; import BaseAvatar from '../views/avatars/BaseAvatar'; import MatrixClientPeg from '../../MatrixClientPeg'; import Avatar from '../../Avatar'; +import { _t } from '../../languageHandler'; const AVATAR_SIZE = 28; @@ -70,7 +71,14 @@ export default class TopLeftMenuButton extends React.Component { render() { const fallbackUserId = MatrixClientPeg.get().getUserId(); const profileInfo = this.state.profileInfo; - const name = profileInfo ? profileInfo.name : fallbackUserId; + let name; + if (MatrixClientPeg.get().isGuest()) { + name = _t("Guest"); + } else if (profileInfo) { + name = profileInfo.name; + } else { + name = fallbackUserId; + } let nameElement; if (!this.props.collapsed) { nameElement =
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 4d67c33dad..1d9913f2fd 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1497,5 +1497,6 @@ "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.", "Failed to set direct chat tag": "Failed to set direct chat tag", "Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room", - "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room" + "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room", + "Guest": "Guest" } From 6ffc5e093dafb44915378036f81a69adebc0a1bf Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 29 Jan 2019 16:56:07 +0100 Subject: [PATCH 4/7] add icons to top left menu options --- res/css/structures/_ContextualMenu.scss | 4 --- res/css/views/context_menus/_TopLeftMenu.scss | 25 ++++++++++++++++++- res/img/feather-icons/sign-out.svg | 5 ++++ .../views/context_menus/TopLeftMenu.js | 4 +-- 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 res/img/feather-icons/sign-out.svg diff --git a/res/css/structures/_ContextualMenu.scss b/res/css/structures/_ContextualMenu.scss index a01cd896a8..001c405e15 100644 --- a/res/css/structures/_ContextualMenu.scss +++ b/res/css/structures/_ContextualMenu.scss @@ -43,10 +43,6 @@ limitations under the License. right: 8px; } -.mx_ContextualMenu_noChevron { - border-radius: unset !important; -} - .mx_ContextualMenu_chevron_right { position: absolute; right: -8px; diff --git a/res/css/views/context_menus/_TopLeftMenu.scss b/res/css/views/context_menus/_TopLeftMenu.scss index fb2c972fe3..18463da824 100644 --- a/res/css/views/context_menus/_TopLeftMenu.scss +++ b/res/css/views/context_menus/_TopLeftMenu.scss @@ -16,6 +16,7 @@ limitations under the License. .mx_TopLeftMenu { min-width: 180px; + border-radius: 4px; .mx_TopLeftMenu_section:not(:last-child) { border-bottom: 1px solid $menu-border-color; @@ -26,10 +27,32 @@ limitations under the License. margin: 5px 0; padding: 0; + li.mx_TopLeftMenu_icon_settings::after { + mask-image: url('$(res)/img/feather-icons/settings.svg'); + } + + li.mx_TopLeftMenu_icon_signout::after { + mask-image: url('$(res)/img/feather-icons/sign-out.svg'); + } + + li::after { + mask-repeat: no-repeat; + mask-position: 0 center; + mask-size: 16px; + position: absolute; + width: 16px; + height: 16px; + content: ""; + top: 5px; + left: 14px; + background-color: $primary-fg-color; + } + li { + position: relative; cursor: pointer; white-space: nowrap; - padding: 5px 20px; + padding: 5px 20px 5px 43px; } li:hover { diff --git a/res/img/feather-icons/sign-out.svg b/res/img/feather-icons/sign-out.svg new file mode 100644 index 0000000000..06ab9903ec --- /dev/null +++ b/res/img/feather-icons/sign-out.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/components/views/context_menus/TopLeftMenu.js b/src/components/views/context_menus/TopLeftMenu.js index b8e82a92e4..87b277215b 100644 --- a/src/components/views/context_menus/TopLeftMenu.js +++ b/src/components/views/context_menus/TopLeftMenu.js @@ -30,10 +30,10 @@ export class TopLeftMenu extends React.Component { render() { return
    -
  • {_t("Settings")}
  • +
  • {_t("Settings")}
    -
  • {_t("Sign out")}
  • +
  • {_t("Sign out")}
; } From 6dc042287e55b8ce1032d1eea72ffc471943e993 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 29 Jan 2019 17:21:14 +0100 Subject: [PATCH 5/7] dont allow whitespace in room sub lists while resizing --- src/components/views/rooms/RoomList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index 44fb14476a..c6d70c4cd5 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -83,7 +83,7 @@ module.exports = React.createClass({ this._layoutSections = []; const unfilteredOptions = { - allowWhitespace: true, + allowWhitespace: false, handleHeight: 1, }; this._unfilteredlayout = new Layout((key, size) => { From 1b82ec6e3674cdfc68a14b4ade4f16b88f125e23 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 29 Jan 2019 18:01:29 +0100 Subject: [PATCH 6/7] make resize handle not overlap with left panel sublist scrollbars --- res/css/views/elements/_ResizeHandle.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/res/css/views/elements/_ResizeHandle.scss b/res/css/views/elements/_ResizeHandle.scss index 42ff6e3825..5544799a34 100644 --- a/res/css/views/elements/_ResizeHandle.scss +++ b/res/css/views/elements/_ResizeHandle.scss @@ -32,6 +32,11 @@ limitations under the License. cursor: row-resize; } +.mx_MatrixChat > .mx_ResizeHandle.mx_ResizeHandle_horizontal { + margin: 0 -10px 0 0; + padding: 0 10px 0 0; +} + .mx_ResizeHandle > div { background: $panel-divider-color; } From 9ba592b2c62c69f18fa27365bbf3141b89dd88a4 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 29 Jan 2019 18:25:47 +0100 Subject: [PATCH 7/7] run i18n --- src/i18n/strings/en_EN.json | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 1d9913f2fd..f5f39f4ca9 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -267,8 +267,8 @@ "Increase performance by only loading room members on first view": "Increase performance by only loading room members on first view", "Backup of encryption keys to server": "Backup of encryption keys to server", "Render simple counters in room header": "Render simple counters in room header", - "Enable Emoji suggestions while typing": "Enable Emoji suggestions while typing", "Two-way device verification using short text": "Two-way device verification using short text", + "Enable Emoji suggestions while typing": "Enable Emoji suggestions while typing", "Use compact timeline layout": "Use compact timeline layout", "Show a placeholder for removed messages": "Show a placeholder for removed messages", "Show join/leave messages (invites/kicks/bans unaffected)": "Show join/leave messages (invites/kicks/bans unaffected)", @@ -430,11 +430,11 @@ "Upload profile picture": "Upload profile picture", "Display Name": "Display Name", "Save": "Save", + "Flair": "Flair", "Failed to change password. Is your password correct?": "Failed to change password. Is your password correct?", "Success": "Success", "Your password was successfully changed. You will not receive push notifications on other devices until you log back in to them": "Your password was successfully changed. You will not receive push notifications on other devices until you log back in to them", "Profile": "Profile", - "Flair": "Flair", "Account": "Account", "Set a new account password...": "Set a new account password...", "Email addresses": "Email addresses", @@ -818,8 +818,6 @@ "Failed to load group members": "Failed to load group members", "Filter community members": "Filter community members", "Invite to this community": "Invite to this community", - "Flair will appear if enabled in room settings": "Flair will appear if enabled in room settings", - "Flair will not appear": "Flair will not appear", "Are you sure you want to remove '%(roomName)s' from %(groupId)s?": "Are you sure you want to remove '%(roomName)s' from %(groupId)s?", "Removing a room from the community will also remove it from the community page.": "Removing a room from the community will also remove it from the community page.", "Failed to remove room from community": "Failed to remove room from community", @@ -1334,6 +1332,7 @@ "Tried to load a specific point in this room's timeline, but you do not have permission to view the message in question.": "Tried to load a specific point in this room's timeline, but you do not have permission to view the message in question.", "Tried to load a specific point in this room's timeline, but was unable to find it.": "Tried to load a specific point in this room's timeline, but was unable to find it.", "Failed to load timeline position": "Failed to load timeline position", + "Guest": "Guest", "Uploading %(filename)s and %(count)s others|other": "Uploading %(filename)s and %(count)s others", "Uploading %(filename)s and %(count)s others|zero": "Uploading %(filename)s", "Uploading %(filename)s and %(count)s others|one": "Uploading %(filename)s and %(count)s other", @@ -1497,6 +1496,5 @@ "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.": "If you didn't remove the recovery method, an attacker may be trying to access your account. Change your account password and set a new recovery method immediately in Settings.", "Failed to set direct chat tag": "Failed to set direct chat tag", "Failed to remove tag %(tagName)s from room": "Failed to remove tag %(tagName)s from room", - "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room", - "Guest": "Guest" + "Failed to add tag %(tagName)s to room": "Failed to add tag %(tagName)s to room" }