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

Commit 374a1dd

Browse files
authored
Merge branch 'develop' into TimelineCard
2 parents bac8253 + 765a715 commit 374a1dd

File tree

77 files changed

+1177
-1083
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1177
-1083
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ module.exports = {
8686
"jsx-a11y/no-static-element-interactions": "off",
8787
"jsx-a11y/role-supports-aria-props": "off",
8888
"jsx-a11y/tabindex-no-positive": "off",
89+
90+
"matrix-org/require-copyright-header": "error",
8991
},
9092
overrides: [
9193
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
"eslint-config-google": "^0.14.0",
174174
"eslint-plugin-import": "^2.25.4",
175175
"eslint-plugin-jsx-a11y": "^6.5.1",
176-
"eslint-plugin-matrix-org": "^0.4.0",
176+
"eslint-plugin-matrix-org": "^0.5.2",
177177
"eslint-plugin-react": "^7.28.0",
178178
"eslint-plugin-react-hooks": "^4.3.0",
179179
"fs-extra": "^10.0.1",

res/css/_components.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
@import "./views/dialogs/_SpacePreferencesDialog.scss";
127127
@import "./views/dialogs/_SpaceSettingsDialog.scss";
128128
@import "./views/dialogs/_SpotlightDialog.scss";
129-
@import "./views/dialogs/_TabbedIntegrationManagerDialog.scss";
130129
@import "./views/dialogs/_TermsDialog.scss";
131130
@import "./views/dialogs/_UntrustedDeviceDialog.scss";
132131
@import "./views/dialogs/_UploadConfirmDialog.scss";

res/css/views/dialogs/_TabbedIntegrationManagerDialog.scss

Lines changed: 0 additions & 62 deletions
This file was deleted.

res/css/views/elements/_Pill.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ limitations under the License.
5858
text-overflow: ellipsis;
5959
white-space: nowrap;
6060
overflow: hidden;
61-
max-width: calc(100% - 1ch);
6261
text-decoration: none !important; // To override .markdown-body
6362
}
6463
}

res/css/views/elements/_RichText.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@
3535
.mx_Markdown_STRIKETHROUGH {
3636
text-decoration: line-through;
3737
}
38+
39+
.mx_Emoji {
40+
// Should be 1.8rem for our default message bodies, and scale with the
41+
// surrounding text
42+
font-size: max($font-18px, 1em);
43+
vertical-align: bottom;
44+
}

res/css/views/messages/_MLocationBody.scss

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ limitations under the License.
1515
*/
1616

1717
.mx_MLocationBody {
18+
max-width: 100%;
19+
1820
.mx_MLocationBody_map {
21+
max-width: 100%;
1922
width: 450px;
2023
height: 300px;
2124
z-index: 0; // keeps the entire map under the message action bar
@@ -27,15 +30,11 @@ limitations under the License.
2730

2831
/* In the timeline, we fit the width of the container */
2932
.mx_EventTile_line .mx_MLocationBody .mx_MLocationBody_map {
30-
width: 100%;
3133
max-width: 450px;
34+
width: 100%;
3235
}
3336

34-
.mx_EventTile[data-layout="bubble"] .mx_EventTile_line .mx_MLocationBody {
37+
.mx_EventTile[data-layout="bubble"] .mx_EventTile_line .mx_MLocationBody .mx_MLocationBody_map {
3538
max-width: 100%;
36-
37-
.mx_MLocationBody_map {
38-
max-width: 100%;
39-
width: 450px;
40-
}
39+
width: 450px;
4140
}

res/css/views/rooms/_EventTile.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ $threadInfoLineHeight: calc(2 * $font-12px); // See: _commons.scss
704704

705705
.mx_MessagePanel_narrow .mx_ThreadSummary {
706706
min-width: initial;
707-
max-width: initial;
707+
max-width: 100%; // prevent overflow
708708
width: initial;
709709
}
710710

res/css/views/rooms/_ReplyPreview.scss

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,31 @@ limitations under the License.
2525

2626
.mx_ReplyPreview_section {
2727
border-bottom: 1px solid $primary-hairline-color;
28+
display: flex;
29+
flex-flow: column;
30+
row-gap: $spacing-8;
31+
padding: $spacing-8 $spacing-8 0 $spacing-8;
2832

2933
.mx_ReplyPreview_header {
30-
margin: 8px;
34+
display: flex;
35+
justify-content: space-between;
36+
column-gap: 8px;
37+
3138
color: $primary-content;
3239
font-weight: 400;
3340
opacity: 0.4;
34-
}
35-
36-
.mx_ReplyPreview_tile {
37-
margin: 0 8px;
38-
}
39-
40-
.mx_ReplyPreview_title {
41-
float: left;
42-
}
43-
44-
.mx_ReplyPreview_cancel {
45-
float: right;
46-
cursor: pointer;
47-
display: flex;
48-
}
4941

50-
.mx_ReplyPreview_clear {
51-
clear: both;
42+
.mx_ReplyPreview_header_cancel {
43+
background-color: $primary-content;
44+
mask: url('$(res)/img/cancel.svg');
45+
mask-repeat: no-repeat;
46+
mask-position: center;
47+
mask-size: 18px;
48+
width: 18px;
49+
height: 18px;
50+
min-width: 18px;
51+
min-height: 18px;
52+
}
5253
}
5354
}
5455
}

src/NodeAnimator.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2022 The Matrix.org Foundation C.I.C.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
import React from "react";
218
import ReactDom from "react-dom";
319

src/Notifier.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,6 @@ export const Notifier = {
408408
// don't bother notifying as user was recently active in this room
409409
return;
410410
}
411-
if (SettingsStore.getValue("doNotDisturb")) {
412-
// Don't bother the user if they didn't ask to be bothered
413-
return;
414-
}
415411

416412
if (this.isEnabled()) {
417413
this._displayPopupNotification(ev, room);

src/components/structures/MatrixChat.tsx

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ import { DoAfterSyncPreparedPayload } from '../../dispatcher/payloads/DoAfterSyn
129129
import { ViewStartChatOrReusePayload } from '../../dispatcher/payloads/ViewStartChatOrReusePayload';
130130
import { IConfigOptions } from "../../IConfigOptions";
131131
import { SnakedObject } from "../../utils/SnakedObject";
132-
import InfoDialog from '../views/dialogs/InfoDialog';
133132
import { leaveRoomBehaviour } from "../../utils/leave-behaviour";
134133
import VideoChannelStore from "../../stores/VideoChannelStore";
135134

@@ -1412,36 +1411,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
14121411
showNotificationsToast(false);
14131412
}
14141413

1415-
if (!localStorage.getItem("mx_seen_feature_thread_experimental")) {
1416-
setTimeout(() => {
1417-
if (SettingsStore.getValue("feature_thread") && SdkConfig.get("show_labs_settings")) {
1418-
Modal.createDialog(InfoDialog, {
1419-
title: _t("Threads Approaching Beta 🎉"),
1420-
description: <>
1421-
<p>
1422-
{ _t("We're getting closer to releasing a public Beta for Threads.") }
1423-
</p>
1424-
<p>
1425-
{ _t("As we prepare for it, we need to make some changes: threads created "
1426-
+ "before this point will be <strong>displayed as regular replies</strong>.",
1427-
{}, {
1428-
"strong": sub => <strong>{ sub }</strong>,
1429-
}) }
1430-
</p>
1431-
<p>
1432-
{ _t("This will be a one-off transition, as threads are now part "
1433-
+ "of the Matrix specification.") }
1434-
</p>
1435-
</>,
1436-
button: _t("Got it"),
1437-
onFinished: () => {
1438-
localStorage.setItem("mx_seen_feature_thread_experimental", "true");
1439-
},
1440-
});
1441-
}
1442-
}, 1 * 60 * 1000); // show after 1 minute to not overload user on launch
1443-
}
1444-
14451414
if (!localStorage.getItem("mx_seen_feature_spotlight_toast")) {
14461415
setTimeout(() => {
14471416
// Skip the toast if the beta is already enabled or the user has changed the setting from default

src/components/structures/MessagePanel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { MatrixEvent } from 'matrix-js-sdk/src/models/event';
2323
import { Relations } from "matrix-js-sdk/src/models/relations";
2424
import { logger } from 'matrix-js-sdk/src/logger';
2525
import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state";
26+
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
2627
import { M_BEACON_INFO } from 'matrix-js-sdk/src/@types/beacon';
2728

2829
import shouldHideEvent from '../../shouldHideEvent';
@@ -847,7 +848,7 @@ export default class MessagePanel extends React.Component<IProps, IState> {
847848
}
848849
const receipts: IReadReceiptProps[] = [];
849850
room.getReceiptsForEvent(event).forEach((r) => {
850-
if (!r.userId || r.type !== "m.read" || r.userId === myUserId) {
851+
if (!r.userId || ![ReceiptType.Read, ReceiptType.ReadPrivate].includes(r.type) || r.userId === myUserId) {
851852
return; // ignore non-read receipts and receipts from self.
852853
}
853854
if (MatrixClientPeg.get().isUserIgnored(r.userId)) {

src/components/structures/ScrollPanel.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ limitations under the License.
1717
import React, { createRef, CSSProperties, ReactNode, KeyboardEvent } from "react";
1818
import { logger } from "matrix-js-sdk/src/logger";
1919

20+
import SettingsStore from '../../settings/SettingsStore';
2021
import Timer from '../../utils/Timer';
2122
import AutoHideScrollbar from "./AutoHideScrollbar";
2223
import { getKeyBindingsManager } from "../../KeyBindingsManager";
2324
import ResizeNotifier from "../../utils/ResizeNotifier";
2425
import { KeyBindingAction } from "../../accessibility/KeyboardShortcuts";
2526

26-
const DEBUG_SCROLL = false;
27-
2827
// The amount of extra scroll distance to allow prior to unfilling.
2928
// See getExcessHeight.
3029
const UNPAGINATION_PADDING = 6000;
@@ -36,13 +35,11 @@ const UNFILL_REQUEST_DEBOUNCE_MS = 200;
3635
// much while the content loads.
3736
const PAGE_SIZE = 400;
3837

39-
let debuglog;
40-
if (DEBUG_SCROLL) {
41-
// using bind means that we get to keep useful line numbers in the console
42-
debuglog = logger.log.bind(console, "ScrollPanel debuglog:");
43-
} else {
44-
debuglog = function() {};
45-
}
38+
const debuglog = (...args: any[]) => {
39+
if (SettingsStore.getValue("debug_scroll_panel")) {
40+
logger.log.call(console, "ScrollPanel debuglog:", ...args);
41+
}
42+
};
4643

4744
interface IProps {
4845
/* stickyBottom: if set to true, then once the user hits the bottom of

src/components/structures/TimelinePanel.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { debounce } from 'lodash';
2828
import { logger } from "matrix-js-sdk/src/logger";
2929
import { ClientEvent } from "matrix-js-sdk/src/client";
3030
import { Thread } from 'matrix-js-sdk/src/models/thread';
31+
import { ReceiptType } from "matrix-js-sdk/src/@types/read_receipts";
3132

3233
import SettingsStore from "../../settings/SettingsStore";
3334
import { Layout } from "../../settings/enums/Layout";
@@ -61,13 +62,11 @@ const READ_RECEIPT_INTERVAL_MS = 500;
6162

6263
const READ_MARKER_DEBOUNCE_MS = 100;
6364

64-
const DEBUG = false;
65-
66-
let debuglog = function(...s: any[]) {};
67-
if (DEBUG) {
68-
// using bind means that we get to keep useful line numbers in the console
69-
debuglog = logger.log.bind(console, "TimelinePanel debuglog:");
70-
}
65+
const debuglog = (...args: any[]) => {
66+
if (SettingsStore.getValue("debug_timeline_panel")) {
67+
logger.log.call(console, "TimelinePanel debuglog:", ...args);
68+
}
69+
};
7170

7271
interface IProps {
7372
// The js-sdk EventTimelineSet object for the timeline sequence we are
@@ -864,14 +863,14 @@ class TimelinePanel extends React.Component<IProps, IState> {
864863
MatrixClientPeg.get().setRoomReadMarkers(
865864
roomId,
866865
this.state.readMarkerEventId,
867-
lastReadEvent, // Could be null, in which case no RR is sent
868-
{ hidden: hiddenRR },
866+
hiddenRR ? null : lastReadEvent, // Could be null, in which case no RR is sent
867+
lastReadEvent, // Could be null, in which case no private RR is sent
869868
).catch((e) => {
870869
// /read_markers API is not implemented on this HS, fallback to just RR
871870
if (e.errcode === 'M_UNRECOGNIZED' && lastReadEvent) {
872871
return MatrixClientPeg.get().sendReadReceipt(
873872
lastReadEvent,
874-
{},
873+
hiddenRR ? ReceiptType.ReadPrivate : ReceiptType.Read,
875874
).catch((e) => {
876875
logger.error(e);
877876
this.lastRRSentEventId = undefined;

0 commit comments

Comments
 (0)