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

Commit

Permalink
Merge branch 'develop' into gsouquet-scroll-to-live-reset-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
germain-gg committed Jun 2, 2021
2 parents ecff5bd + 9d126c5 commit bc50028
Show file tree
Hide file tree
Showing 96 changed files with 4,935 additions and 1,482 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ module.exports = {

"quotes": "off",
"no-extra-boolean-cast": "off",
"no-restricted-properties": [
"error",
...buildRestrictedPropertiesOptions(
["window.innerHeight", "window.innerWidth", "window.visualViewport"],
"Use UIStore to access window dimensions instead",
),
],
},
}],
};

function buildRestrictedPropertiesOptions(properties, message) {
return properties.map(prop => {
const [object, property] = prop.split(".");
return {
object,
property,
message,
};
});
}
113 changes: 113 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,116 @@
Changes in [3.22.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.22.0) (2021-05-24)
=====================================================================================================
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.22.0-rc.1...v3.22.0)

* Upgrade to JS SDK 11.1.0
* [Release] Bump libolm version
[\#6087](https://github.com/matrix-org/matrix-react-sdk/pull/6087)

Changes in [3.22.0-rc.1](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.22.0-rc.1) (2021-05-19)
===============================================================================================================
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.21.0...v3.22.0-rc.1)

* Upgrade to JS SDK 11.1.0-rc.1
* Translations update from Weblate
[\#6068](https://github.com/matrix-org/matrix-react-sdk/pull/6068)
* Show DMs in space for invited members too, to match Android impl
[\#6062](https://github.com/matrix-org/matrix-react-sdk/pull/6062)
* Support filtering by alias in add existing to space dialog
[\#6057](https://github.com/matrix-org/matrix-react-sdk/pull/6057)
* Fix issue when a room without a name or alias is marked as suggested
[\#6064](https://github.com/matrix-org/matrix-react-sdk/pull/6064)
* Fix space room hierarchy not updating when removing a room
[\#6055](https://github.com/matrix-org/matrix-react-sdk/pull/6055)
* Revert "Try putting room list handling behind a lock"
[\#6060](https://github.com/matrix-org/matrix-react-sdk/pull/6060)
* Stop assuming encrypted messages are decrypted ahead of time
[\#6052](https://github.com/matrix-org/matrix-react-sdk/pull/6052)
* Add error detail when languges fail to load
[\#6059](https://github.com/matrix-org/matrix-react-sdk/pull/6059)
* Add space invaders chat effect
[\#6053](https://github.com/matrix-org/matrix-react-sdk/pull/6053)
* Create SpaceProvider and hide Spaces from the RoomProvider autocompleter
[\#6051](https://github.com/matrix-org/matrix-react-sdk/pull/6051)
* Don't mark a room as unread when redacted event is present
[\#6049](https://github.com/matrix-org/matrix-react-sdk/pull/6049)
* Add support for MSC2873: Client information for Widgets
[\#6023](https://github.com/matrix-org/matrix-react-sdk/pull/6023)
* Support UI for MSC2762: Widgets reading events from rooms
[\#5960](https://github.com/matrix-org/matrix-react-sdk/pull/5960)
* Fix crash on opening notification panel
[\#6047](https://github.com/matrix-org/matrix-react-sdk/pull/6047)
* Remove custom LoggedInView::shouldComponentUpdate logic
[\#6046](https://github.com/matrix-org/matrix-react-sdk/pull/6046)
* Fix edge cases with the new add reactions prompt button
[\#6045](https://github.com/matrix-org/matrix-react-sdk/pull/6045)
* Add ids to homeserver and passphrase fields
[\#6043](https://github.com/matrix-org/matrix-react-sdk/pull/6043)
* Update space order field validity requirements to match msc update
[\#6042](https://github.com/matrix-org/matrix-react-sdk/pull/6042)
* Try putting room list handling behind a lock
[\#6024](https://github.com/matrix-org/matrix-react-sdk/pull/6024)
* Improve progress bar progression for smaller voice messages
[\#6035](https://github.com/matrix-org/matrix-react-sdk/pull/6035)
* Fix share space edge case where space is public but not invitable
[\#6039](https://github.com/matrix-org/matrix-react-sdk/pull/6039)
* Add missing 'rel' to image view download button
[\#6033](https://github.com/matrix-org/matrix-react-sdk/pull/6033)
* Improve visible waveform for voice messages
[\#6034](https://github.com/matrix-org/matrix-react-sdk/pull/6034)
* Fix roving tab index intercepting home/end in space create menu
[\#6040](https://github.com/matrix-org/matrix-react-sdk/pull/6040)
* Decorate room avatars with publicity in add existing to space flow
[\#6030](https://github.com/matrix-org/matrix-react-sdk/pull/6030)
* Improve Spaces "Just Me" wizard
[\#6025](https://github.com/matrix-org/matrix-react-sdk/pull/6025)
* Increase hover feedback on room sub list buttons
[\#6037](https://github.com/matrix-org/matrix-react-sdk/pull/6037)
* Show alternative button during space creation wizard if no rooms
[\#6029](https://github.com/matrix-org/matrix-react-sdk/pull/6029)
* Swap rotation buttons in the image viewer
[\#6032](https://github.com/matrix-org/matrix-react-sdk/pull/6032)
* Typo: initilisation -> initialisation
[\#5915](https://github.com/matrix-org/matrix-react-sdk/pull/5915)
* Save edited state of a message when switching rooms
[\#6001](https://github.com/matrix-org/matrix-react-sdk/pull/6001)
* Fix shield icon in Untrusted Device Dialog
[\#6022](https://github.com/matrix-org/matrix-react-sdk/pull/6022)
* Do not eagerly decrypt breadcrumb rooms
[\#6028](https://github.com/matrix-org/matrix-react-sdk/pull/6028)
* Update spaces.png
[\#6031](https://github.com/matrix-org/matrix-react-sdk/pull/6031)
* Encourage more diverse reactions to content
[\#6027](https://github.com/matrix-org/matrix-react-sdk/pull/6027)
* Wrap decodeURIComponent in try-catch to protect against malformed URIs
[\#6026](https://github.com/matrix-org/matrix-react-sdk/pull/6026)
* Iterate beta feedback dialog
[\#6021](https://github.com/matrix-org/matrix-react-sdk/pull/6021)
* Disable space fields whilst their form is busy
[\#6020](https://github.com/matrix-org/matrix-react-sdk/pull/6020)
* Add missing space on beta feedback dialog
[\#6018](https://github.com/matrix-org/matrix-react-sdk/pull/6018)
* Fix colours used for the back button in space create menu
[\#6017](https://github.com/matrix-org/matrix-react-sdk/pull/6017)
* Prioritise and reduce the amount of events decrypted on application startup
[\#5980](https://github.com/matrix-org/matrix-react-sdk/pull/5980)
* Linkify topics in space room directory results
[\#6015](https://github.com/matrix-org/matrix-react-sdk/pull/6015)
* Persistent space collapsed states
[\#5972](https://github.com/matrix-org/matrix-react-sdk/pull/5972)
* Catch another instance of unlabeled avatars.
[\#6010](https://github.com/matrix-org/matrix-react-sdk/pull/6010)
* Rescale and smooth voice message playback waveform to better match
expectation
[\#5996](https://github.com/matrix-org/matrix-react-sdk/pull/5996)
* Scale voice message clock with user's font size
[\#5993](https://github.com/matrix-org/matrix-react-sdk/pull/5993)
* Remove "in development" flag from voice messages
[\#5995](https://github.com/matrix-org/matrix-react-sdk/pull/5995)
* Support voice messages on Safari
[\#5989](https://github.com/matrix-org/matrix-react-sdk/pull/5989)
* Translations update from Weblate
[\#6011](https://github.com/matrix-org/matrix-react-sdk/pull/6011)

Changes in [3.21.0](https://github.com/matrix-org/matrix-react-sdk/releases/tag/v3.21.0) (2021-05-17)
=====================================================================================================
[Full Changelog](https://github.com/matrix-org/matrix-react-sdk/compare/v3.21.0-rc.1...v3.21.0)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matrix-react-sdk",
"version": "3.21.0",
"version": "3.22.0",
"description": "SDK for matrix.org using React",
"author": "matrix.org",
"repository": {
Expand Down Expand Up @@ -121,6 +121,7 @@
"@babel/preset-typescript": "^7.12.7",
"@babel/register": "^7.12.10",
"@babel/traverse": "^7.12.12",
"@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.3.tgz",
"@peculiar/webcrypto": "^1.1.4",
"@sinonjs/fake-timers": "^7.0.2",
"@types/classnames": "^2.2.11",
Expand Down Expand Up @@ -161,7 +162,6 @@
"matrix-mock-request": "^1.2.3",
"matrix-react-test-utils": "^0.2.2",
"matrix-web-i18n": "github:matrix-org/matrix-web-i18n",
"olm": "https://packages.matrix.org/npm/olm/olm-3.2.1.tgz",
"react-test-renderer": "^16.14.0",
"rimraf": "^3.0.2",
"stylelint": "^13.9.0",
Expand Down
2 changes: 2 additions & 0 deletions res/css/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ html {
N.B. Breaks things when we have legitimate horizontal overscroll */
height: 100%;
overflow: hidden;
// Stop similar overscroll bounce in Firefox Nightly for macOS
overscroll-behavior: none;
}

body {
Expand Down
1 change: 1 addition & 0 deletions res/css/structures/_SpaceRoomView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ $SpaceRoomViewInnerWidth: 428px;
font-size: $font-15px;
margin-top: 12px;
margin-bottom: 16px;
white-space: pre;
}

> hr {
Expand Down
37 changes: 15 additions & 22 deletions res/css/views/messages/_MessageActionBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ limitations under the License.
visibility: hidden;
cursor: pointer;
display: flex;
height: 24px;
height: 32px;
line-height: $font-24px;
border-radius: 4px;
background: $message-action-bar-bg-color;
top: -26px;
border-radius: 8px;
background: $primary-bg-color;
border: 1px solid $input-border-color;
top: -32px;
right: 8px;
user-select: none;
// Ensure the action bar appears above over things, like the read marker.
Expand All @@ -51,31 +52,19 @@ limitations under the License.
white-space: nowrap;
display: inline-block;
position: relative;
border: 1px solid $message-action-bar-border-color;
margin-left: -1px;
margin: 2px;

&:hover {
border-color: $message-action-bar-hover-border-color;
background: $roomlist-button-bg-color;
border-radius: 6px;
z-index: 1;
}

&:first-child {
border-radius: 3px 0 0 3px;
}

&:last-child {
border-radius: 0 3px 3px 0;
}

&:only-child {
border-radius: 3px;
}
}
}


.mx_MessageActionBar_maskButton {
width: 27px;
width: 28px;
height: 28px;
}

.mx_MessageActionBar_maskButton::after {
Expand All @@ -88,7 +77,11 @@ limitations under the License.
mask-size: 18px;
mask-repeat: no-repeat;
mask-position: center;
background-color: $message-action-bar-fg-color;
background-color: $secondary-fg-color;
}

.mx_MessageActionBar_maskButton:hover::after {
background-color: $primary-fg-color;
}

.mx_MessageActionBar_reactButton::after {
Expand Down
3 changes: 2 additions & 1 deletion res/css/views/rooms/_EventTile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ $left-gutter: 64px;
.mx_EventTile_line, .mx_EventTile_reply {
position: relative;
padding-left: $left-gutter;
border-radius: 4px;
border-radius: 8px;
}

.mx_RoomView_timeline_rr_enabled,
Expand Down Expand Up @@ -280,6 +280,7 @@ $left-gutter: 64px;
height: $font-14px;
width: $font-14px;

will-change: left, top;
transition:
left var(--transition-short) ease-out,
top var(--transition-standard) ease-out;
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_RoomSublist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ limitations under the License.
&.mx_RoomSublist_headerContainer_sticky {
position: fixed;
height: 32px; // to match the header container
// width set by JS
width: calc(100% - 22px);
// width set by JS because of a compat issue between Firefox and Chrome
width: calc(100% - 15px);
}

// We don't have a top style because the top is dependent on the room list header's
Expand Down
2 changes: 2 additions & 0 deletions src/@types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import TypingStore from "../stores/TypingStore";
import { EventIndexPeg } from "../indexing/EventIndexPeg";
import {VoiceRecordingStore} from "../stores/VoiceRecordingStore";
import PerformanceMonitor from "../performance";
import UIStore from "../stores/UIStore";

declare global {
interface Window {
Expand Down Expand Up @@ -82,6 +83,7 @@ declare global {
mxEventIndexPeg: EventIndexPeg;
mxPerformanceMonitor: PerformanceMonitor;
mxPerformanceEntryNames: any;
mxUIStore: UIStore;
}

interface Document {
Expand Down
8 changes: 7 additions & 1 deletion src/CallHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ export default class CallHandler extends EventEmitter {
if (call.hangupReason === CallErrorCode.UserHangup) {
title = _t("Call Declined");
description = _t("The other party declined the call.");
} else if (call.hangupReason === CallErrorCode.UserBusy) {
title = _t("User Busy");
description = _t("The user you called is busy.");
} else if (call.hangupReason === CallErrorCode.InviteTimeout) {
title = _t("Call Failed");
// XXX: full stop appended as some relic here, but these
Expand Down Expand Up @@ -799,7 +802,10 @@ export default class CallHandler extends EventEmitter {

const mappedRoomId = CallHandler.sharedInstance().roomIdForCall(call);
if (this.getCallForRoom(mappedRoomId)) {
// ignore multiple incoming calls to the same room
console.log(
"Got incoming call for room " + mappedRoomId +
" but there's already a call for this room: ignoring",
);
return;
}

Expand Down
13 changes: 9 additions & 4 deletions src/CountlyAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import SdkConfig from './SdkConfig';
import {MatrixClientPeg} from "./MatrixClientPeg";
import {sleep} from "./utils/promise";
import RoomViewStore from "./stores/RoomViewStore";
import { Action } from "./dispatcher/actions";

// polyfill textencoder if necessary
import * as TextEncodingUtf8 from 'text-encoding-utf-8';
Expand Down Expand Up @@ -265,7 +266,7 @@ interface ICreateRoomEvent extends IEvent {
}

interface IJoinRoomEvent extends IEvent {
key: "join_room";
key: Action.JoinRoom;
dur: number; // how long it took to join (until remote echo)
segmentation: {
room_id: string; // hashed
Expand Down Expand Up @@ -684,7 +685,9 @@ export default class CountlyAnalytics {
}

private getOrientation = (): Orientation => {
return window.innerWidth > window.innerHeight ? Orientation.Landscape : Orientation.Portrait;
return window.matchMedia("(orientation: landscape)").matches
? Orientation.Landscape
: Orientation.Portrait
};

private reportOrientation = () => {
Expand Down Expand Up @@ -813,7 +816,9 @@ export default class CountlyAnalytics {
window.addEventListener("mousemove", this.onUserActivity);
window.addEventListener("click", this.onUserActivity);
window.addEventListener("keydown", this.onUserActivity);
window.addEventListener("scroll", this.onUserActivity);
// Using the passive option to not block the main thread
// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners
window.addEventListener("scroll", this.onUserActivity, { passive: true });

this.activityIntervalId = setInterval(() => {
this.inactivityCounter++;
Expand Down Expand Up @@ -858,7 +863,7 @@ export default class CountlyAnalytics {
}

public trackRoomJoin(startTime: number, roomId: string, type: IJoinRoomEvent["segmentation"]["type"]) {
this.track<IJoinRoomEvent>("join_room", { type }, roomId, {
this.track<IJoinRoomEvent>(Action.JoinRoom, { type }, roomId, {
dur: CountlyAnalytics.getTimestamp() - startTime,
});
}
Expand Down
3 changes: 1 addition & 2 deletions src/GroupAddressPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import MultiInviter from './utils/MultiInviter';
import { _t } from './languageHandler';
import {MatrixClientPeg} from './MatrixClientPeg';
import GroupStore from './stores/GroupStore';
import {allSettled} from "./utils/promise";
import StyledCheckbox from './components/views/elements/StyledCheckbox';

export function showGroupInviteDialog(groupId) {
Expand Down Expand Up @@ -120,7 +119,7 @@ function _onGroupInviteFinished(groupId, addrs) {
function _onGroupAddRoomFinished(groupId, addrs, addRoomsPublicly) {
const matrixClient = MatrixClientPeg.get();
const errorList = [];
return allSettled(addrs.map((addr) => {
return Promise.allSettled(addrs.map((addr) => {
return GroupStore
.addRoomToGroup(groupId, addr.address, addRoomsPublicly)
.catch(() => { errorList.push(addr.address); })
Expand Down
Loading

0 comments on commit bc50028

Please sign in to comment.