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

Commit beef07b

Browse files
committed
Merge branch 'develop' into err
2 parents 379d19e + 70d7a59 commit beef07b

File tree

18 files changed

+323
-234
lines changed

18 files changed

+323
-234
lines changed

CHANGELOG.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,115 @@
1+
Changes in [3.20.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.20.0) (2021-05-10)
2+
=====================================================================================================
3+
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.20.0-rc.1...v3.20.0)
4+
5+
* Upgrade to JS SDK 10.1.0
6+
* [Release] Don't use the event's metadata to calc the scale of an image
7+
[\#6004](https://github.com/matrix-org/matrix-react-sdk/pull/6004)
8+
9+
Changes in [3.20.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.20.0-rc.1) (2021-05-04)
10+
===============================================================================================================
11+
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.19.0...v3.20.0-rc.1)
12+
13+
* Upgrade to JS SDK 10.1.0-rc.1
14+
* Translations update from Weblate
15+
[\#5966](https://github.com/matrix-org/matrix-react-sdk/pull/5966)
16+
* Fix more space panel layout and hover behaviour issues
17+
[\#5965](https://github.com/matrix-org/matrix-react-sdk/pull/5965)
18+
* Fix edge case with space panel alignment with subspaces on ff
19+
[\#5964](https://github.com/matrix-org/matrix-react-sdk/pull/5964)
20+
* Fix saving room pill part to history
21+
[\#5951](https://github.com/matrix-org/matrix-react-sdk/pull/5951)
22+
* Generate room preview even when minimized
23+
[\#5948](https://github.com/matrix-org/matrix-react-sdk/pull/5948)
24+
* Another change from recovery passphrase to Security Phrase
25+
[\#5934](https://github.com/matrix-org/matrix-react-sdk/pull/5934)
26+
* Sort rooms in the add existing to space dialog based on recency
27+
[\#5943](https://github.com/matrix-org/matrix-react-sdk/pull/5943)
28+
* Inhibit sending RR when context switching to a room
29+
[\#5944](https://github.com/matrix-org/matrix-react-sdk/pull/5944)
30+
* Prevent room list keyboard handling from landing focus on hidden nodes
31+
[\#5950](https://github.com/matrix-org/matrix-react-sdk/pull/5950)
32+
* Make the text filter search all spaces instead of just the selected one
33+
[\#5942](https://github.com/matrix-org/matrix-react-sdk/pull/5942)
34+
* Enable indent rule and fix indent
35+
[\#5931](https://github.com/matrix-org/matrix-react-sdk/pull/5931)
36+
* Prevent peeking members from reacting
37+
[\#5946](https://github.com/matrix-org/matrix-react-sdk/pull/5946)
38+
* Disallow inline display maths
39+
[\#5939](https://github.com/matrix-org/matrix-react-sdk/pull/5939)
40+
* Space creation prompt user to add existing rooms for "Just Me" spaces
41+
[\#5923](https://github.com/matrix-org/matrix-react-sdk/pull/5923)
42+
* Add test coverage collection script
43+
[\#5937](https://github.com/matrix-org/matrix-react-sdk/pull/5937)
44+
* Fix joining room using via servers regression
45+
[\#5936](https://github.com/matrix-org/matrix-react-sdk/pull/5936)
46+
* Revert "Fixes the two Todays problem in Redaction"
47+
[\#5938](https://github.com/matrix-org/matrix-react-sdk/pull/5938)
48+
* Handle encoded matrix URLs
49+
[\#5903](https://github.com/matrix-org/matrix-react-sdk/pull/5903)
50+
* Render ignored users setting regardless of if there are any
51+
[\#5860](https://github.com/matrix-org/matrix-react-sdk/pull/5860)
52+
* Fix inserting trailing colon after mention/pill
53+
[\#5830](https://github.com/matrix-org/matrix-react-sdk/pull/5830)
54+
* Fixes the two Todays problem in Redaction
55+
[\#5917](https://github.com/matrix-org/matrix-react-sdk/pull/5917)
56+
* Fix page up/down scrolling only half a page
57+
[\#5920](https://github.com/matrix-org/matrix-react-sdk/pull/5920)
58+
* Voice messages: Composer controls
59+
[\#5935](https://github.com/matrix-org/matrix-react-sdk/pull/5935)
60+
* Support MSC3086 asserted identity
61+
[\#5886](https://github.com/matrix-org/matrix-react-sdk/pull/5886)
62+
* Handle possible edge case with getting stuck in "unsent messages" bar
63+
[\#5930](https://github.com/matrix-org/matrix-react-sdk/pull/5930)
64+
* Fix suggested rooms not showing up regression from room list optimisation
65+
[\#5932](https://github.com/matrix-org/matrix-react-sdk/pull/5932)
66+
* Broadcast language change to ElectronPlatform
67+
[\#5913](https://github.com/matrix-org/matrix-react-sdk/pull/5913)
68+
* Fix VoIP PIP frame color
69+
[\#5701](https://github.com/matrix-org/matrix-react-sdk/pull/5701)
70+
* Convert some Flow-typed files to TypeScript
71+
[\#5912](https://github.com/matrix-org/matrix-react-sdk/pull/5912)
72+
* Initial SpaceStore tests work
73+
[\#5906](https://github.com/matrix-org/matrix-react-sdk/pull/5906)
74+
* Fix issues with space hierarchy in layout and with incompatible servers
75+
[\#5926](https://github.com/matrix-org/matrix-react-sdk/pull/5926)
76+
* Scale all mxc thumbs using device pixel ratio for hidpi
77+
[\#5928](https://github.com/matrix-org/matrix-react-sdk/pull/5928)
78+
* Fix add existing to space dialog no longer showing rooms for public spaces
79+
[\#5918](https://github.com/matrix-org/matrix-react-sdk/pull/5918)
80+
* Disable spaces context switching for when exploring a space
81+
[\#5924](https://github.com/matrix-org/matrix-react-sdk/pull/5924)
82+
* Autofocus search box in the add existing to space dialog
83+
[\#5921](https://github.com/matrix-org/matrix-react-sdk/pull/5921)
84+
* Use label element in add existing to space dialog for easier hit target
85+
[\#5922](https://github.com/matrix-org/matrix-react-sdk/pull/5922)
86+
* Dynamic max and min zoom in the new ImageView
87+
[\#5916](https://github.com/matrix-org/matrix-react-sdk/pull/5916)
88+
* Improve message error states
89+
[\#5897](https://github.com/matrix-org/matrix-react-sdk/pull/5897)
90+
* Check for null room in `VisibilityProvider`
91+
[\#5914](https://github.com/matrix-org/matrix-react-sdk/pull/5914)
92+
* Add unit tests for various collection-based utility functions
93+
[\#5910](https://github.com/matrix-org/matrix-react-sdk/pull/5910)
94+
* Spaces visual fixes
95+
[\#5909](https://github.com/matrix-org/matrix-react-sdk/pull/5909)
96+
* Remove reliance on DOM API to generated message preview
97+
[\#5908](https://github.com/matrix-org/matrix-react-sdk/pull/5908)
98+
* Expand upon voice message event & include overall waveform
99+
[\#5888](https://github.com/matrix-org/matrix-react-sdk/pull/5888)
100+
* Use floats for image background opacity
101+
[\#5905](https://github.com/matrix-org/matrix-react-sdk/pull/5905)
102+
* Show invites to spaces at the top of the space panel
103+
[\#5902](https://github.com/matrix-org/matrix-react-sdk/pull/5902)
104+
* Improve edge cases with spaces context switching
105+
[\#5899](https://github.com/matrix-org/matrix-react-sdk/pull/5899)
106+
* Fix spaces notification dots wrongly including upgraded (hidden) rooms
107+
[\#5900](https://github.com/matrix-org/matrix-react-sdk/pull/5900)
108+
* Iterate the spaces face pile design
109+
[\#5898](https://github.com/matrix-org/matrix-react-sdk/pull/5898)
110+
* Fix alignment issue with nested spaces being cut off wrong
111+
[\#5890](https://github.com/matrix-org/matrix-react-sdk/pull/5890)
112+
1113
Changes in [3.19.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.19.0) (2021-04-26)
2114
=====================================================================================================
3115
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.19.0-rc.1...v3.19.0)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "matrix-react-sdk",
3-
"version": "3.19.0",
3+
"version": "3.20.0",
44
"description": "SDK for matrix.org using React",
55
"author": "matrix.org",
66
"repository": {
@@ -97,7 +97,7 @@
9797
"react-transition-group": "^4.4.1",
9898
"resize-observer-polyfill": "^1.5.1",
9999
"rfc4648": "^1.4.0",
100-
"sanitize-html": "github:apostrophecms/sanitize-html#3c7f93f2058f696f5359e3e58d464161647226db",
100+
"sanitize-html": "^2.3.2",
101101
"tar-js": "^0.3.0",
102102
"text-encoding-utf-8": "^1.0.2",
103103
"url": "^0.11.0",

res/css/views/rooms/_VoiceRecordComposerTile.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ limitations under the License.
4646
mask-image: url('$(res)/img/element-icons/trashcan.svg');
4747
}
4848

49-
.mx_VoiceRecordComposerTile_recording.mx_VoiceMessagePrimaryContainer {
49+
.mx_MessageComposer_row .mx_VoiceMessagePrimaryContainer {
5050
// Note: remaining class properties are in the PlayerContainer CSS.
5151

5252
margin: 6px; // force the composer area to put a gutter around us
53-
margin-right: 12px; // isolate from stop button
53+
margin-right: 12px; // isolate from stop/send button
5454

5555
position: relative; // important for the live circle
5656

src/components/structures/RoomSearch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import { Action } from "../../dispatcher/actions";
2727
import RoomListStore from "../../stores/room-list/RoomListStore";
2828
import { NameFilterCondition } from "../../stores/room-list/filters/NameFilterCondition";
2929
import { getKeyBindingsManager, RoomListAction } from "../../KeyBindingsManager";
30-
import {replaceableComponent} from "../../utils/replaceableComponent";
31-
import SpaceStore, {UPDATE_SELECTED_SPACE, UPDATE_TOP_LEVEL_SPACES} from "../../stores/SpaceStore";
30+
import { replaceableComponent } from "../../utils/replaceableComponent";
31+
import SpaceStore, { UPDATE_SELECTED_SPACE, UPDATE_TOP_LEVEL_SPACES } from "../../stores/SpaceStore";
3232

3333
interface IProps {
3434
isMinimized: boolean;

src/components/views/context_menus/MessageContextMenu.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ export default class MessageContextMenu extends React.Component {
7878

7979
// We explicitly decline to show the redact option on ACL events as it has a potential
8080
// to obliterate the room - https://github.com/matrix-org/synapse/issues/4042
81+
// Similarly for encryption events, since redacting them "breaks everything"
8182
const canRedact = room.currentState.maySendRedactionForEvent(this.props.mxEvent, cli.credentials.userId)
82-
&& this.props.mxEvent.getType() !== EventType.RoomServerAcl;
83+
&& this.props.mxEvent.getType() !== EventType.RoomServerAcl
84+
&& this.props.mxEvent.getType() !== EventType.RoomEncryption;
8385
let canPin = room.currentState.mayClientSendStateEvent('m.room.pinned_events', cli);
8486

8587
// HACK: Intentionally say we can't pin if the user doesn't want to use the functionality

src/components/views/dialogs/UploadConfirmDialog.js renamed to src/components/views/dialogs/UploadConfirmDialog.tsx

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2019 New Vector Ltd
2+
Copyright 2019, 2021 The Matrix.org Foundation C.I.C.
33
Copyright 2019 Michael Telatynski <[email protected]>
44
55
Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,20 +16,23 @@ limitations under the License.
1616
*/
1717

1818
import React from 'react';
19-
import PropTypes from 'prop-types';
2019
import * as sdk from '../../../index';
2120
import { _t } from '../../../languageHandler';
2221
import filesize from "filesize";
23-
import {replaceableComponent} from "../../../utils/replaceableComponent";
22+
import { replaceableComponent } from "../../../utils/replaceableComponent";
23+
import { getBlobSafeMimeType } from '../../../utils/blobs';
24+
25+
interface IProps {
26+
file: File;
27+
currentIndex: number;
28+
totalFiles?: number;
29+
onFinished: (uploadConfirmed: boolean, uploadAll?: boolean) => void;
30+
}
2431

2532
@replaceableComponent("views.dialogs.UploadConfirmDialog")
26-
export default class UploadConfirmDialog extends React.Component {
27-
static propTypes = {
28-
file: PropTypes.object.isRequired,
29-
currentIndex: PropTypes.number,
30-
totalFiles: PropTypes.number,
31-
onFinished: PropTypes.func.isRequired,
32-
}
33+
export default class UploadConfirmDialog extends React.Component<IProps> {
34+
private objectUrl: string;
35+
private mimeType: string;
3336

3437
static defaultProps = {
3538
totalFiles: 1,
@@ -38,22 +41,28 @@ export default class UploadConfirmDialog extends React.Component {
3841
constructor(props) {
3942
super(props);
4043

41-
this._objectUrl = URL.createObjectURL(props.file);
44+
// Create a fresh `Blob` for previewing (even though `File` already is
45+
// one) so we can adjust the MIME type if needed.
46+
this.mimeType = getBlobSafeMimeType(props.file.type);
47+
const blob = new Blob([props.file], { type:
48+
this.mimeType,
49+
});
50+
this.objectUrl = URL.createObjectURL(blob);
4251
}
4352

4453
componentWillUnmount() {
45-
if (this._objectUrl) URL.revokeObjectURL(this._objectUrl);
54+
if (this.objectUrl) URL.revokeObjectURL(this.objectUrl);
4655
}
4756

48-
_onCancelClick = () => {
57+
private onCancelClick = () => {
4958
this.props.onFinished(false);
5059
}
5160

52-
_onUploadClick = () => {
61+
private onUploadClick = () => {
5362
this.props.onFinished(true);
5463
}
5564

56-
_onUploadAllClick = () => {
65+
private onUploadAllClick = () => {
5766
this.props.onFinished(true, true);
5867
}
5968

@@ -75,10 +84,10 @@ export default class UploadConfirmDialog extends React.Component {
7584
}
7685

7786
let preview;
78-
if (this.props.file.type.startsWith('image/')) {
87+
if (this.mimeType.startsWith('image/')) {
7988
preview = <div className="mx_UploadConfirmDialog_previewOuter">
8089
<div className="mx_UploadConfirmDialog_previewInner">
81-
<div><img className="mx_UploadConfirmDialog_imagePreview" src={this._objectUrl} /></div>
90+
<div><img className="mx_UploadConfirmDialog_imagePreview" src={this.objectUrl} /></div>
8291
<div>{this.props.file.name} ({filesize(this.props.file.size)})</div>
8392
</div>
8493
</div>;
@@ -95,15 +104,15 @@ export default class UploadConfirmDialog extends React.Component {
95104

96105
let uploadAllButton;
97106
if (this.props.currentIndex + 1 < this.props.totalFiles) {
98-
uploadAllButton = <button onClick={this._onUploadAllClick}>
107+
uploadAllButton = <button onClick={this.onUploadAllClick}>
99108
{_t("Upload all")}
100109
</button>;
101110
}
102111

103112
return (
104113
<BaseDialog className='mx_UploadConfirmDialog'
105114
fixedWidth={false}
106-
onFinished={this._onCancelClick}
115+
onFinished={this.onCancelClick}
107116
title={title}
108117
contentId='mx_Dialog_content'
109118
>
@@ -113,7 +122,7 @@ export default class UploadConfirmDialog extends React.Component {
113122

114123
<DialogButtons primaryButton={_t('Upload')}
115124
hasCancel={false}
116-
onPrimaryButtonClick={this._onUploadClick}
125+
onPrimaryButtonClick={this.onUploadClick}
117126
focus={true}
118127
>
119128
{uploadAllButton}

src/components/views/elements/ImageView.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ export default class ImageView extends React.Component<IProps, IState> {
108108
window.addEventListener("resize", this.calculateZoom);
109109
// After the image loads for the first time we want to calculate the zoom
110110
this.image.current.addEventListener("load", this.calculateZoom);
111-
// Try to precalculate the zoom from width and height props
112-
this.calculateZoom();
113111
}
114112

115113
componentWillUnmount() {
@@ -122,11 +120,8 @@ export default class ImageView extends React.Component<IProps, IState> {
122120
const image = this.image.current;
123121
const imageWrapper = this.imageWrapper.current;
124122

125-
const width = this.props.width || image.naturalWidth;
126-
const height = this.props.height || image.naturalHeight;
127-
128-
const zoomX = imageWrapper.clientWidth / width;
129-
const zoomY = imageWrapper.clientHeight / height;
123+
const zoomX = imageWrapper.clientWidth / image.naturalWidth;
124+
const zoomY = imageWrapper.clientHeight / image.naturalHeight;
130125

131126
// If the image is smaller in both dimensions set its the zoom to 1 to
132127
// display it in its original size

src/components/views/right_panel/UserInfo.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,15 @@ function DeviceItem({userId, device}: {userId: string, device: IDevice}) {
187187
verifyDevice(cli.getUser(userId), device);
188188
};
189189

190-
const deviceName = device.ambiguous ?
191-
(device.getDisplayName() ? device.getDisplayName() : "") + " (" + device.deviceId + ")" :
192-
device.getDisplayName();
190+
let deviceName;
191+
if (!device.getDisplayName()?.trim()) {
192+
deviceName = device.deviceId;
193+
} else {
194+
deviceName = device.ambiguous ?
195+
device.getDisplayName() + " (" + device.deviceId + ")" :
196+
device.getDisplayName();
197+
}
198+
193199
let trustedLabel = null;
194200
if (userTrust.isVerified()) trustedLabel = isVerified ? _t("Trusted") : _t("Not trusted");
195201

src/components/views/spaces/SpacePanel.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,27 @@ import {SpaceItem} from "./SpaceTreeLevel";
2626
import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";
2727
import {useEventEmitter} from "../../../hooks/useEventEmitter";
2828
import SpaceStore, {
29-
HOME_SPACE,
3029
UPDATE_INVITED_SPACES,
3130
UPDATE_SELECTED_SPACE,
3231
UPDATE_TOP_LEVEL_SPACES,
3332
} from "../../../stores/SpaceStore";
3433
import AutoHideScrollbar from "../../structures/AutoHideScrollbar";
35-
import {SpaceNotificationState} from "../../../stores/notifications/SpaceNotificationState";
3634
import NotificationBadge from "../rooms/NotificationBadge";
3735
import {
3836
RovingAccessibleButton,
3937
RovingAccessibleTooltipButton,
4038
RovingTabIndexProvider,
4139
} from "../../../accessibility/RovingTabIndex";
4240
import {Key} from "../../../Keyboard";
41+
import {RoomNotificationStateStore} from "../../../stores/notifications/RoomNotificationStateStore";
42+
import {NotificationState} from "../../../stores/notifications/NotificationState";
4343

4444
interface IButtonProps {
4545
space?: Room;
4646
className?: string;
4747
selected?: boolean;
4848
tooltip?: string;
49-
notificationState?: SpaceNotificationState;
49+
notificationState?: NotificationState;
5050
isNarrow?: boolean;
5151
onClick(): void;
5252
}
@@ -212,8 +212,8 @@ const SpacePanel = () => {
212212
className="mx_SpaceButton_home"
213213
onClick={() => SpaceStore.instance.setActiveSpace(null)}
214214
selected={!activeSpace}
215-
tooltip={_t("Home")}
216-
notificationState={SpaceStore.instance.getNotificationState(HOME_SPACE)}
215+
tooltip={_t("All rooms")}
216+
notificationState={RoomNotificationStateStore.instance.globalState}
217217
isNarrow={isPanelCollapsed}
218218
/>
219219
{ invites.map(s => <SpaceItem

src/i18n/strings/en_EN.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@
10121012
"Create": "Create",
10131013
"Expand space panel": "Expand space panel",
10141014
"Collapse space panel": "Collapse space panel",
1015-
"Home": "Home",
1015+
"All rooms": "All rooms",
10161016
"Click to copy": "Click to copy",
10171017
"Copied!": "Copied!",
10181018
"Failed to copy": "Failed to copy",
@@ -2016,10 +2016,10 @@
20162016
"Continue with %(provider)s": "Continue with %(provider)s",
20172017
"Sign in with single sign-on": "Sign in with single sign-on",
20182018
"And %(count)s more...|other": "And %(count)s more...",
2019+
"Home": "Home",
20192020
"Enter a server name": "Enter a server name",
20202021
"Looks good": "Looks good",
20212022
"Can't find this server or its room list": "Can't find this server or its room list",
2022-
"All rooms": "All rooms",
20232023
"Your server": "Your server",
20242024
"Are you sure you want to remove <b>%(serverName)s</b>": "Are you sure you want to remove <b>%(serverName)s</b>",
20252025
"Remove server": "Remove server",

0 commit comments

Comments
 (0)