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

Commit 7129ba6

Browse files
committed
Merge branch 'develop' into feature/url-tooltip
2 parents f18cce8 + bb4064f commit 7129ba6

36 files changed

+1261
-446
lines changed

res/css/_common.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ legend {
294294
background-color: $background;
295295
color: $light-fg-color;
296296
z-index: 4012;
297-
font-weight: 300;
298297
font-size: $font-15px;
299298
position: relative;
300299
padding: 24px;

res/css/_components.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
@import "./structures/_BackdropPanel.scss";
2828
@import "./structures/_CompatibilityPage.scss";
2929
@import "./structures/_ContextualMenu.scss";
30-
@import "./structures/_CreateRoom.scss";
3130
@import "./structures/_FileDropTarget.scss";
3231
@import "./structures/_FilePanel.scss";
3332
@import "./structures/_GenericErrorPage.scss";
@@ -249,6 +248,7 @@
249248
@import "./views/rooms/_NotificationBadge.scss";
250249
@import "./views/rooms/_PinnedEventTile.scss";
251250
@import "./views/rooms/_PresenceLabel.scss";
251+
@import "./views/rooms/_ReadReceiptGroup.scss";
252252
@import "./views/rooms/_RecentlyViewedButton.scss";
253253
@import "./views/rooms/_ReplyPreview.scss";
254254
@import "./views/rooms/_ReplyTile.scss";

res/css/views/right_panel/_TimelineCard.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ limitations under the License.
125125
padding-left: 36px;
126126
}
127127

128-
.mx_EventTile_readAvatars {
129-
top: -10px;
128+
.mx_ReadReceiptGroup {
129+
top: -6px;
130130
}
131131

132132
.mx_WhoIsTypingTile {

res/css/views/rooms/_EventBubbleTile.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ limitations under the License.
447447
}
448448
}
449449

450-
.mx_EventTile_readAvatars {
450+
.mx_ReadReceiptGroup {
451451
position: absolute;
452452
right: -78px; // as close to right gutter without clipping as possible
453453
bottom: 0;
@@ -585,8 +585,8 @@ limitations under the License.
585585
right: 127px; // align with that of right-column bubbles
586586
}
587587

588-
.mx_EventTile_readAvatars {
589-
right: -18px; // match alignment to RRs of chat bubbles
588+
.mx_ReadReceiptGroup {
589+
right: -14px; // match alignment to RRs of chat bubbles
590590
}
591591

592592
&::before {

res/css/views/rooms/_EventTile.scss

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,18 @@ $left-gutter: 64px;
2222

2323
.mx_EventTile_receiptSent,
2424
.mx_EventTile_receiptSending {
25-
// Give it some dimensions so the tooltip can position properly
25+
position: relative;
2626
display: inline-block;
27-
width: 14px;
28-
height: 14px;
29-
// We don't use `position: relative` on the element because then it won't line
30-
// up with the other read receipts
27+
width: 16px;
28+
height: 16px;
3129

3230
&::before {
3331
background-color: $tertiary-content;
3432
mask-repeat: no-repeat;
3533
mask-position: center;
36-
mask-size: 14px;
37-
width: 14px;
38-
height: 14px;
34+
mask-size: 16px;
35+
width: 16px;
36+
height: 16px;
3937
content: '';
4038
position: absolute;
4139
top: 0;
@@ -223,12 +221,6 @@ $left-gutter: 64px;
223221
overflow-y: hidden;
224222
}
225223

226-
&.mx_EventTile_selected .mx_EventTile_line,
227-
&:hover .mx_EventTile_line {
228-
border-top-left-radius: 4px;
229-
border-bottom-left-radius: 4px;
230-
}
231-
232224
&:hover.mx_EventTile_verified .mx_EventTile_line {
233225
box-shadow: inset calc(50px + $selected-message-border-width) 0 0 -50px $e2e-verified-color;
234226
}
@@ -355,36 +347,6 @@ $left-gutter: 64px;
355347
}
356348
}
357349

358-
.mx_EventTile_readAvatars {
359-
position: relative;
360-
display: inline-block;
361-
width: 14px;
362-
height: 14px;
363-
// This aligns the avatar with the last line of the
364-
// message. We want to move it one line up - 2.2rem
365-
top: -2.2rem;
366-
user-select: none;
367-
z-index: 1;
368-
}
369-
370-
.mx_EventTile_readAvatars .mx_BaseAvatar {
371-
position: absolute;
372-
display: inline-block;
373-
height: $font-14px;
374-
width: $font-14px;
375-
376-
will-change: left, top;
377-
transition:
378-
left var(--transition-short) ease-out,
379-
top var(--transition-standard) ease-out;
380-
}
381-
382-
.mx_EventTile_readAvatarRemainder {
383-
color: $event-timestamp-color;
384-
font-size: $font-11px;
385-
position: absolute;
386-
}
387-
388350
.mx_EventTile_bigEmoji {
389351
font-size: 48px;
390352
line-height: 57px;

res/css/views/rooms/_GroupLayout.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ $left-gutter: 64px;
9797
top: 3px;
9898
}
9999

100-
.mx_EventTile_readAvatars {
100+
.mx_ReadReceiptGroup {
101101
// This aligns the avatar with the last line of the
102102
// message. We want to move it one line up - 2rem
103103
top: -2rem;

res/css/views/rooms/_IRCLayout.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ $irc-line-height: $font-18px;
4949
order: 5;
5050
flex-shrink: 0;
5151

52-
.mx_EventTile_readAvatars {
53-
top: 0.2rem; // ($irc-line-height - avatar height) / 2
52+
.mx_ReadReceiptGroup {
53+
top: -0.3rem; // ($irc-line-height - avatar height) / 2
5454
}
5555
}
5656

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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+
17+
.mx_ReadReceiptGroup {
18+
position: relative;
19+
display: inline-block;
20+
// This aligns the avatar with the last line of the
21+
// message. We want to move it one line up
22+
// See .mx_GroupLayout .mx_EventTile .mx_EventTile_line in _GroupLayout.scss
23+
top: calc(-$font-22px - 3px);
24+
user-select: none;
25+
z-index: 1;
26+
27+
.mx_ReadReceiptGroup_button {
28+
display: inline-flex;
29+
flex-direction: row;
30+
height: 16px;
31+
padding: 4px;
32+
border-radius: 6px;
33+
34+
&.mx_AccessibleButton {
35+
&:hover {
36+
background: $event-selected-color;
37+
}
38+
}
39+
}
40+
41+
.mx_ReadReceiptGroup_remainder {
42+
color: $secondary-content;
43+
font-size: $font-11px;
44+
line-height: $font-16px;
45+
margin-right: 4px;
46+
}
47+
48+
.mx_ReadReceiptGroup_container {
49+
position: relative;
50+
display: block;
51+
height: 100%;
52+
53+
.mx_BaseAvatar {
54+
position: absolute;
55+
display: inline-block;
56+
height: 14px;
57+
width: 14px;
58+
border: 1px solid $background;
59+
border-radius: 100%;
60+
61+
will-change: left, top;
62+
transition:
63+
left var(--transition-short) ease-out,
64+
top var(--transition-standard) ease-out;
65+
}
66+
}
67+
}
68+
69+
.mx_ReadReceiptGroup_popup {
70+
max-height: 300px;
71+
width: 220px;
72+
border-radius: 8px;
73+
display: flex;
74+
flex-direction: column;
75+
text-align: left;
76+
font-size: 12px;
77+
line-height: 15px;
78+
79+
right: 0;
80+
81+
&.mx_ContextualMenu_top {
82+
top: 8px;
83+
}
84+
85+
&.mx_ContextualMenu_bottom {
86+
bottom: 8px;
87+
}
88+
89+
.mx_ReadReceiptGroup_title {
90+
font-size: 12px;
91+
line-height: 15px;
92+
margin: 16px 16px 8px;
93+
font-weight: 600;
94+
// shouldn’t be actually focusable
95+
outline: none;
96+
}
97+
98+
.mx_AutoHideScrollbar {
99+
.mx_ReadReceiptGroup_person {
100+
display: flex;
101+
flex-direction: row;
102+
padding: 4px;
103+
margin: 0 12px;
104+
border-radius: 8px;
105+
106+
&:hover {
107+
background: $menu-selected-color;
108+
}
109+
110+
&:last-child {
111+
margin-bottom: 8px;
112+
}
113+
114+
.mx_BaseAvatar {
115+
margin: 6px 8px;
116+
align-self: center;
117+
justify-self: center;
118+
}
119+
120+
.mx_ReadReceiptGroup_name {
121+
display: flex;
122+
flex-direction: column;
123+
flex-grow: 1;
124+
flex-shrink: 1;
125+
overflow: hidden;
126+
127+
p {
128+
margin: 2px 0;
129+
text-overflow: ellipsis;
130+
overflow: hidden;
131+
white-space: nowrap;
132+
}
133+
134+
.mx_ReadReceiptGroup_secondary {
135+
color: $secondary-content;
136+
}
137+
}
138+
}
139+
}
140+
}
141+
142+
.mx_ReadReceiptGroup_person--tooltip {
143+
overflow-y: hidden;
144+
text-overflow: ellipsis;
145+
white-space: nowrap;
146+
}

src/PasswordReset.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default class PasswordReset {
3131
private clientSecret: string;
3232
private password: string;
3333
private sessionId: string;
34+
private logoutDevices: boolean;
3435

3536
/**
3637
* Configure the endpoints for password resetting.
@@ -50,10 +51,16 @@ export default class PasswordReset {
5051
* sending an email to the provided email address.
5152
* @param {string} emailAddress The email address
5253
* @param {string} newPassword The new password for the account.
54+
* @param {boolean} logoutDevices Should all devices be signed out after the reset? Defaults to `true`.
5355
* @return {Promise} Resolves when the email has been sent. Then call checkEmailLinkClicked().
5456
*/
55-
public resetPassword(emailAddress: string, newPassword: string): Promise<IRequestTokenResponse> {
57+
public resetPassword(
58+
emailAddress: string,
59+
newPassword: string,
60+
logoutDevices = true,
61+
): Promise<IRequestTokenResponse> {
5662
this.password = newPassword;
63+
this.logoutDevices = logoutDevices;
5764
return this.client.requestPasswordEmailToken(emailAddress, this.clientSecret, 1).then((res) => {
5865
this.sessionId = res.sid;
5966
return res;
@@ -90,7 +97,7 @@ export default class PasswordReset {
9097
// See https://github.com/matrix-org/matrix-doc/issues/2220
9198
threepid_creds: creds,
9299
threepidCreds: creds,
93-
}, this.password);
100+
}, this.password, this.logoutDevices);
94101
} catch (err) {
95102
if (err.httpStatus === 401) {
96103
err.message = _t('Failed to verify email address: make sure you clicked the link in the email');

src/accessibility/roving/RovingAccessibleButton.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,21 @@ import AccessibleButton from "../../components/views/elements/AccessibleButton";
2020
import { useRovingTabIndex } from "../RovingTabIndex";
2121
import { Ref } from "./types";
2222

23-
interface IProps extends Omit<React.ComponentProps<typeof AccessibleButton>, "onFocus" | "inputRef" | "tabIndex"> {
23+
interface IProps extends Omit<React.ComponentProps<typeof AccessibleButton>, "inputRef" | "tabIndex"> {
2424
inputRef?: Ref;
2525
}
2626

2727
// Wrapper to allow use of useRovingTabIndex for simple AccessibleButtons outside of React Functional Components.
28-
export const RovingAccessibleButton: React.FC<IProps> = ({ inputRef, ...props }) => {
29-
const [onFocus, isActive, ref] = useRovingTabIndex(inputRef);
30-
return <AccessibleButton {...props} onFocus={onFocus} inputRef={ref} tabIndex={isActive ? 0 : -1} />;
28+
export const RovingAccessibleButton: React.FC<IProps> = ({ inputRef, onFocus, ...props }) => {
29+
const [onFocusInternal, isActive, ref] = useRovingTabIndex(inputRef);
30+
return <AccessibleButton
31+
{...props}
32+
onFocus={event => {
33+
onFocusInternal();
34+
onFocus?.(event);
35+
}}
36+
inputRef={ref}
37+
tabIndex={isActive ? 0 : -1}
38+
/>;
3139
};
3240

0 commit comments

Comments
 (0)