From f57bffad3c5bf3ecfdc17c93a75ce814ab2e35ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=A0imon=20Brandner?=
Date: Fri, 6 Aug 2021 09:05:33 +0200
Subject: [PATCH 01/12] Soften border color
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Šimon Brandner
---
res/css/views/rooms/_EventTile.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss
index 1c9d8e87d9..47512c3094 100644
--- a/res/css/views/rooms/_EventTile.scss
+++ b/res/css/views/rooms/_EventTile.scss
@@ -510,7 +510,7 @@ $hover-select-border: 4px;
.mx_EventTile:hover .mx_EventTile_body pre,
.mx_EventTile.focus-visible:focus-within .mx_EventTile_body pre {
- border: 1px solid #e5e5e5; // deliberate constant as we're behind an invert filter
+ border: 1px solid $tertiary-fg-color; // deliberate constant as we're behind an invert filter
}
.mx_EventTile_pre_container {
From 3c0ac487da0a0f2f9c2d5d0ae4e2d074003c701e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=A0imon=20Brandner?=
Date: Fri, 6 Aug 2021 09:06:24 +0200
Subject: [PATCH 02/12] Remove comment
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Šimon Brandner
---
res/css/views/rooms/_EventTile.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss
index 47512c3094..6192fc4df9 100644
--- a/res/css/views/rooms/_EventTile.scss
+++ b/res/css/views/rooms/_EventTile.scss
@@ -510,7 +510,7 @@ $hover-select-border: 4px;
.mx_EventTile:hover .mx_EventTile_body pre,
.mx_EventTile.focus-visible:focus-within .mx_EventTile_body pre {
- border: 1px solid $tertiary-fg-color; // deliberate constant as we're behind an invert filter
+ border: 1px solid $tertiary-fg-color;
}
.mx_EventTile_pre_container {
From 59833d1306d7dd43a2abe385de9b6b94747736c9 Mon Sep 17 00:00:00 2001
From: David Baker
Date: Wed, 25 Aug 2021 17:21:48 +0100
Subject: [PATCH 03/12] Update changelog generator
---
package.json | 2 +-
yarn.lock | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index e0883f5556..d6845e0981 100644
--- a/package.json
+++ b/package.json
@@ -151,7 +151,7 @@
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",
- "allchange": "^1.0.0",
+ "allchange": "^1.0.2",
"babel-jest": "^26.6.3",
"chokidar": "^3.5.1",
"concurrently": "^5.3.0",
diff --git a/yarn.lock b/yarn.lock
index 80c6ac5155..0c9514ae30 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2036,10 +2036,10 @@ ajv@^8.0.1:
require-from-string "^2.0.2"
uri-js "^4.2.2"
-allchange@^1.0.0:
- version "1.0.1"
- resolved "https://registry.yarnpkg.com/allchange/-/allchange-1.0.1.tgz#f32a75f65ab182d044d18e8baa43bd1c9be982f6"
- integrity sha512-lj8HZcvQ04RsNqwLWjCYSDvchrW4nnjlOZ3z+VGhA78M7KootV0eRwlvTlYJec73jsz/Ts59kVArgooEsACOog==
+allchange@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/allchange/-/allchange-1.0.2.tgz#86b9190e12b7ede4f230ae763cbd504c48fd907b"
+ integrity sha512-qJv1t2yvBThkes8g/dPMt8CGu+04U+q5QjCJn2Ngp92edZU8DJBfKGyGXo7w1iV48LVuQKQDfMsdIWhP7zHdlQ==
dependencies:
"@actions/core" "^1.4.0"
"@actions/github" "^5.0.0"
From 76cc5bfb7db7a3b4b66e0e8d2656db6670986123 Mon Sep 17 00:00:00 2001
From: Travis Ralston
Date: Wed, 25 Aug 2021 22:30:57 -0600
Subject: [PATCH 04/12] Remember all capabilities given to a widget
Fixes https://github.com/vector-im/element-web/issues/18786
Instead of replacing the remembered set, we now add to it. This should be safe as the user expectation was previously to remember the capabilities, so we can keep appending to that list.
This commit also moves the utility functions closer to the widget driver as they aren't needed in the dialog anymore.
---
.../WidgetCapabilitiesPromptDialog.tsx | 13 +----------
src/stores/widgets/StopGapWidgetDriver.ts | 22 +++++++++++++++----
2 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx
index ebeab191b1..c184664df3 100644
--- a/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx
+++ b/src/components/views/dialogs/WidgetCapabilitiesPromptDialog.tsx
@@ -31,14 +31,6 @@ import LabelledToggleSwitch from "../elements/LabelledToggleSwitch";
import { CapabilityText } from "../../../widgets/CapabilityText";
import { replaceableComponent } from "../../../utils/replaceableComponent";
-export function getRememberedCapabilitiesForWidget(widget: Widget): Capability[] {
- return JSON.parse(localStorage.getItem(`widget_${widget.id}_approved_caps`) || "[]");
-}
-
-function setRememberedCapabilitiesForWidget(widget: Widget, caps: Capability[]) {
- localStorage.setItem(`widget_${widget.id}_approved_caps`, JSON.stringify(caps));
-}
-
interface IProps extends IDialogProps {
requestedCapabilities: Set;
widget: Widget;
@@ -95,10 +87,7 @@ export default class WidgetCapabilitiesPromptDialog extends React.PureComponent<
};
private closeAndTryRemember(approved: Capability[]) {
- if (this.state.rememberSelection) {
- setRememberedCapabilitiesForWidget(this.props.widget, approved);
- }
- this.props.onFinished({ approved });
+ this.props.onFinished({ approved, remember: this.state.rememberSelection });
}
public render() {
diff --git a/src/stores/widgets/StopGapWidgetDriver.ts b/src/stores/widgets/StopGapWidgetDriver.ts
index 13cd260ef0..af43c645a9 100644
--- a/src/stores/widgets/StopGapWidgetDriver.ts
+++ b/src/stores/widgets/StopGapWidgetDriver.ts
@@ -33,9 +33,7 @@ import { MatrixClientPeg } from "../../MatrixClientPeg";
import ActiveRoomObserver from "../../ActiveRoomObserver";
import Modal from "../../Modal";
import WidgetOpenIDPermissionsDialog from "../../components/views/dialogs/WidgetOpenIDPermissionsDialog";
-import WidgetCapabilitiesPromptDialog, {
- getRememberedCapabilitiesForWidget,
-} from "../../components/views/dialogs/WidgetCapabilitiesPromptDialog";
+import WidgetCapabilitiesPromptDialog from "../../components/views/dialogs/WidgetCapabilitiesPromptDialog";
import { WidgetPermissionCustomisations } from "../../customisations/WidgetPermissions";
import { OIDCState, WidgetPermissionStore } from "./WidgetPermissionStore";
import { WidgetType } from "../../widgets/WidgetType";
@@ -48,6 +46,14 @@ import { MatrixEvent } from "matrix-js-sdk/src/models/event";
// TODO: Purge this from the universe
+function getRememberedCapabilitiesForWidget(widget: Widget): Capability[] {
+ return JSON.parse(localStorage.getItem(`widget_${widget.id}_approved_caps`) || "[]");
+}
+
+function setRememberedCapabilitiesForWidget(widget: Widget, caps: Capability[]) {
+ localStorage.setItem(`widget_${widget.id}_approved_caps`, JSON.stringify(caps));
+}
+
export class StopGapWidgetDriver extends WidgetDriver {
private allowedCapabilities: Set;
@@ -100,6 +106,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
}
}
// TODO: Do something when the widget requests new capabilities not yet asked for
+ let rememberApproved = false;
if (missing.size > 0) {
try {
const [result] = await Modal.createTrackedDialog(
@@ -111,12 +118,19 @@ export class StopGapWidgetDriver extends WidgetDriver {
widgetKind: this.forWidgetKind,
}).finished;
(result.approved || []).forEach(cap => allowedSoFar.add(cap));
+ rememberApproved = result.remember;
} catch (e) {
console.error("Non-fatal error getting capabilities: ", e);
}
}
- return new Set(iterableUnion(allowedSoFar, requested));
+ const allAllowed = new Set(iterableUnion(allowedSoFar, requested));
+
+ if (rememberApproved) {
+ setRememberedCapabilitiesForWidget(this.forWidget, Array.from(allAllowed));
+ }
+
+ return allAllowed;
}
public async sendEvent(eventType: string, content: any, stateKey: string = null): Promise {
From cafa52c466e5e7831236e7d17b730edc84b864cc Mon Sep 17 00:00:00 2001
From: Travis Ralston
Date: Wed, 25 Aug 2021 22:40:51 -0600
Subject: [PATCH 05/12] Special case redaction event sending from widgets per
MSC2762
Fixes https://github.com/vector-im/element-web/issues/18573
See https://github.com/matrix-org/matrix-doc/pull/2762/commits/853bed215743f3e04af8683ea5e1ea2b47b7845b
---
src/stores/widgets/StopGapWidgetDriver.ts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/stores/widgets/StopGapWidgetDriver.ts b/src/stores/widgets/StopGapWidgetDriver.ts
index 13cd260ef0..57cf27764c 100644
--- a/src/stores/widgets/StopGapWidgetDriver.ts
+++ b/src/stores/widgets/StopGapWidgetDriver.ts
@@ -129,6 +129,9 @@ export class StopGapWidgetDriver extends WidgetDriver {
if (stateKey !== null) {
// state event
r = await client.sendStateEvent(roomId, eventType, content, stateKey);
+ } else if (eventType === EventType.RoomRedaction) {
+ // special case: extract the `redacts` property and call redact
+ r = await client.redactEvent(roomId, content['redacts']);
} else {
// message event
r = await client.sendEvent(roomId, eventType, content);
From 4415a7037c87421ac00c73d6bf68de799ba37419 Mon Sep 17 00:00:00 2001
From: Travis Ralston
Date: Wed, 25 Aug 2021 23:10:19 -0600
Subject: [PATCH 06/12] Fix left panel widgets not remembering collapsed state
Fixes https://github.com/vector-im/element-web/issues/17803
The `setExpanded` function takes a boolean, not a function.
---
src/components/structures/LeftPanelWidget.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/structures/LeftPanelWidget.tsx b/src/components/structures/LeftPanelWidget.tsx
index 144c0e3051..331e428355 100644
--- a/src/components/structures/LeftPanelWidget.tsx
+++ b/src/components/structures/LeftPanelWidget.tsx
@@ -115,7 +115,7 @@ const LeftPanelWidget: React.FC = () => {
aria-expanded={expanded}
aria-level={1}
onClick={() => {
- setExpanded(e => !e);
+ setExpanded(!expanded);
}}
>
Date: Thu, 26 Aug 2021 14:59:06 +0200
Subject: [PATCH 07/12] Fix areAnyCallsUnsilenced()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Šimon Brandner
---
src/CallHandler.tsx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx
index e11e828864..5b730acaec 100644
--- a/src/CallHandler.tsx
+++ b/src/CallHandler.tsx
@@ -250,7 +250,15 @@ export default class CallHandler extends EventEmitter {
* @returns {boolean}
*/
private areAnyCallsUnsilenced(): boolean {
- return this.calls.size > this.silencedCalls.size;
+ for (const call of this.calls.values()) {
+ if (
+ call.state === CallState.Ringing &&
+ !this.isCallSilenced(call.callId)
+ ) {
+ return true;
+ }
+ }
+ return false;
}
private async checkProtocols(maxTries) {
From d013ae79b701664c197bdacde1f01cc46b60aa2f Mon Sep 17 00:00:00 2001
From: "J. Ryan Stinnett"
Date: Thu, 26 Aug 2021 13:59:12 +0100
Subject: [PATCH 08/12] Fix changelog link colour back to blue
https://github.com/matrix-org/matrix-react-sdk/pull/5698 changed all dialog
links to green, which is not expected. In general, we use blue links for
information and green links for actions.
This resolves the regression by removing the general change and adjusting the
new links added by the above PR to be green as desired there.
Fixes https://github.com/vector-im/element-web/issues/18726
---
res/css/_common.scss | 5 -----
.../tabs/room/SecurityRoomSettingsTab.tsx | 20 +++++++++++--------
2 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/res/css/_common.scss b/res/css/_common.scss
index 5fcc10add0..a16e7d4d8f 100644
--- a/res/css/_common.scss
+++ b/res/css/_common.scss
@@ -381,11 +381,6 @@ input[type=text]:focus, input[type=password]:focus, textarea:focus {
font-size: $font-14px;
color: $primary-content;
word-wrap: break-word;
-
- a {
- color: $accent-color;
- cursor: pointer;
- }
}
.mx_Dialog_buttons {
diff --git a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx
index d9e97d570b..081b1a8698 100644
--- a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx
+++ b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx
@@ -149,10 +149,12 @@ export default class SecurityRoomSettingsTab extends React.Componentnew encrypted room for " +
"the conversation you plan to have.",
null,
- { "a": (sub) => {
- dialog.close();
- this.createNewRoom(false, true);
- }}> { sub } },
+ { "a": (sub) => {
+ dialog.close();
+ this.createNewRoom(false, true);
+ }}> { sub } },
) }
,
@@ -248,10 +250,12 @@ export default class SecurityRoomSettingsTab extends React.Component {
- dialog.close();
- this.createNewRoom(true, false);
- }}> { sub } ,
+ "a": (sub) => {
+ dialog.close();
+ this.createNewRoom(true, false);
+ }}> { sub } ,
},
) }
,
From e4f8c795bc3af11ef5fa40c4489e2fb1049ffdd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=A0imon=20Brandner?=
Date: Thu, 26 Aug 2021 15:00:36 +0200
Subject: [PATCH 09/12] Add stopRingingIfPossible()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Šimon Brandner
---
src/CallHandler.tsx | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx
index 5b730acaec..ad7209052d 100644
--- a/src/CallHandler.tsx
+++ b/src/CallHandler.tsx
@@ -937,6 +937,12 @@ export default class CallHandler extends EventEmitter {
}
};
+ private stopRingingIfPossible(callId: string): void {
+ this.silencedCalls.delete(callId);
+ if (this.areAnyCallsUnsilenced()) return;
+ this.pause(AudioID.Ring);
+ }
+
private async dialNumber(number: string) {
const results = await this.pstnLookup(number);
if (!results || results.length === 0 || !results[0].userid) {
From 242b4e73b9803e41774ad911c76ab7c060df47e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=A0imon=20Brandner?=
Date: Thu, 26 Aug 2021 15:00:56 +0200
Subject: [PATCH 10/12] Pause ringing more aggressively
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Šimon Brandner
---
src/CallHandler.tsx | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/CallHandler.tsx b/src/CallHandler.tsx
index ad7209052d..8fd45c49ae 100644
--- a/src/CallHandler.tsx
+++ b/src/CallHandler.tsx
@@ -886,6 +886,8 @@ export default class CallHandler extends EventEmitter {
break;
case 'hangup':
case 'reject':
+ this.stopRingingIfPossible(this.calls.get(payload.room_id).callId);
+
if (!this.calls.get(payload.room_id)) {
return; // no call to hangup
}
@@ -898,11 +900,15 @@ export default class CallHandler extends EventEmitter {
// the hangup event away)
break;
case 'hangup_all':
+ this.stopRingingIfPossible(this.calls.get(payload.room_id).callId);
+
for (const call of this.calls.values()) {
call.hangup(CallErrorCode.UserHangup, false);
}
break;
case 'answer': {
+ this.stopRingingIfPossible(this.calls.get(payload.room_id).callId);
+
if (!this.calls.has(payload.room_id)) {
return; // no call to answer
}
From fc1dd510463a6e0309c31fe57f9aa5ea9b1edf79 Mon Sep 17 00:00:00 2001
From: Dariusz Niemczyk
Date: Thu, 26 Aug 2021 14:55:37 +0200
Subject: [PATCH 11/12] Fix commit edit history
Fix https://github.com/vector-im/element-web/issues/18742
---
res/css/structures/_ScrollPanel.scss | 2 --
1 file changed, 2 deletions(-)
diff --git a/res/css/structures/_ScrollPanel.scss b/res/css/structures/_ScrollPanel.scss
index 82caeae29d..a668594bba 100644
--- a/res/css/structures/_ScrollPanel.scss
+++ b/res/css/structures/_ScrollPanel.scss
@@ -15,8 +15,6 @@ limitations under the License.
*/
.mx_ScrollPanel {
- contain: strict;
-
.mx_RoomView_MessageList {
position: relative;
display: flex;
From 6003e12e486d9278867407fa55deafb4e949dc43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=A0imon=20Brandner?=
Date: Thu, 26 Aug 2021 15:12:26 +0200
Subject: [PATCH 12/12] Fix color name
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Šimon Brandner
---
res/css/views/rooms/_EventTile.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/res/css/views/rooms/_EventTile.scss b/res/css/views/rooms/_EventTile.scss
index 64008346ca..447c878f14 100644
--- a/res/css/views/rooms/_EventTile.scss
+++ b/res/css/views/rooms/_EventTile.scss
@@ -514,7 +514,7 @@ $hover-select-border: 4px;
.mx_EventTile:hover .mx_EventTile_body pre,
.mx_EventTile.focus-visible:focus-within .mx_EventTile_body pre {
- border: 1px solid $tertiary-fg-color;
+ border: 1px solid $tertiary-content;
}
.mx_EventTile_pre_container {