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

Commit 5c069e0

Browse files
authored
Merge branch 'develop' into EventBubbleTile
2 parents 509a164 + 4831129 commit 5c069e0

File tree

15 files changed

+300
-79
lines changed

15 files changed

+300
-79
lines changed

res/css/structures/_SpacePanel.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ $activeBorderColor: $primary-content;
155155
border-radius: 12px;
156156
padding: 4px;
157157
width: calc(100% - 32px);
158+
min-width: 0;
158159
}
159160

160161
.mx_SpaceButton_name {
@@ -274,6 +275,7 @@ $activeBorderColor: $primary-content;
274275
display: flex;
275276
flex-direction: column;
276277
max-width: 250px;
278+
min-width: 0;
277279
flex-grow: 1;
278280

279281
.mx_BaseAvatar:not(.mx_UserMenu_userAvatar_BaseAvatar) .mx_BaseAvatar_initial {

res/css/views/messages/_MLocationBody.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ limitations under the License.
2121
z-index: 0; // keeps the entire map under the message action bar
2222

2323
border-radius: $timeline-image-border-radius;
24+
cursor: pointer;
2425
}
2526
}
2627

res/css/views/right_panel/_UserInfo.scss

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ limitations under the License.
5252

5353
.mx_UserInfo_container {
5454
padding: 8px 16px;
55+
56+
.mx_UserInfo_container_verifyButton {
57+
margin-top: $spacing-8;
58+
}
5559
}
5660

5761
.mx_UserInfo_separator {
@@ -193,10 +197,7 @@ limitations under the License.
193197
}
194198

195199
.mx_UserInfo_field {
196-
cursor: pointer;
197-
color: $accent;
198200
line-height: $font-16px;
199-
margin: 8px 0;
200201

201202
&.mx_UserInfo_destructive {
202203
color: $alert;
@@ -228,14 +229,18 @@ limitations under the License.
228229
padding-bottom: 0;
229230

230231
> :not(h3) {
231-
margin-left: 8px;
232+
margin-inline-start: $spacing-8;
233+
display: flex;
234+
flex-flow: column;
235+
align-items: flex-start;
236+
row-gap: $spacing-8;
232237
}
233238
}
234239

235240
.mx_UserInfo_devices {
236241
.mx_UserInfo_device {
237242
display: flex;
238-
margin: 8px 0;
243+
margin: $spacing-8 0;
239244

240245
&.mx_UserInfo_device_verified {
241246
.mx_UserInfo_device_trusted {
@@ -250,7 +255,7 @@ limitations under the License.
250255

251256
.mx_UserInfo_device_name {
252257
flex: 1;
253-
margin-right: 5px;
258+
margin: 0 5px;
254259
word-break: break-word;
255260
}
256261
}
@@ -259,20 +264,16 @@ limitations under the License.
259264
.mx_E2EIcon {
260265
// don't squeeze
261266
flex: 0 0 auto;
262-
margin: 2px 5px 0 0;
267+
margin: 0;
263268
width: 12px;
264269
height: 12px;
265270
}
266271

267272
.mx_UserInfo_expand {
268-
display: flex;
269-
margin-top: 11px;
273+
column-gap: 5px; // cf: mx_UserInfo_device_name
274+
margin-bottom: 11px;
270275
}
271276
}
272-
273-
.mx_AccessibleButton.mx_AccessibleButton_hasKind {
274-
padding: 8px 18px;
275-
}
276277
}
277278

278279
.mx_UserInfo.mx_UserInfo_smallAvatar {

res/css/views/rooms/_EventBubbleTile.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ limitations under the License.
411411

412412
.mx_MPollBody {
413413
width: 550px; // to prevent timestamp overlapping summary text
414+
max-width: 100%; // prevent overflowing a reply tile
414415

415416
.mx_MPollBody_totalVotes {
416417
// align summary text with corner timestamp

src/Lifecycle.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import { setSentryUser } from "./sentry";
6161
import SdkConfig from "./SdkConfig";
6262
import { DialogOpener } from "./utils/DialogOpener";
6363
import { Action } from "./dispatcher/actions";
64+
import AbstractLocalStorageSettingsHandler from "./settings/handlers/AbstractLocalStorageSettingsHandler";
6465

6566
const HOMESERVER_URL_KEY = "mx_hs_url";
6667
const ID_SERVER_URL_KEY = "mx_is_url";
@@ -878,6 +879,7 @@ async function clearStorage(opts?: { deleteEverything?: boolean }): Promise<void
878879
const registrationTime = window.localStorage.getItem("mx_registration_time");
879880

880881
window.localStorage.clear();
882+
AbstractLocalStorageSettingsHandler.clear();
881883

882884
try {
883885
await StorageManager.idbDelete("account", "mx_access_token");

src/components/structures/RoomView.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ export interface IRoomState {
179179
// this is true if we are fully scrolled-down, and are looking at
180180
// the end of the live timeline. It has the effect of hiding the
181181
// 'scroll to bottom' knob, among a couple of other things.
182-
atEndOfLiveTimeline: boolean;
183-
// used by componentDidUpdate to avoid unnecessary checks
184-
atEndOfLiveTimelineInit: boolean;
182+
atEndOfLiveTimeline?: boolean;
185183
showTopUnreadMessagesBar: boolean;
186184
statusBarVisible: boolean;
187185
// We load this later by asking the js-sdk to suggest a version for us.
@@ -257,8 +255,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
257255
isPeeking: false,
258256
showRightPanel: false,
259257
joining: false,
260-
atEndOfLiveTimeline: true,
261-
atEndOfLiveTimelineInit: false,
262258
showTopUnreadMessagesBar: false,
263259
statusBarVisible: false,
264260
canReact: false,
@@ -692,9 +688,8 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
692688
// in render() prevents the ref from being set on first mount, so we try and
693689
// catch the messagePanel when it does mount. Because we only want the ref once,
694690
// we use a boolean flag to avoid duplicate work.
695-
if (this.messagePanel && !this.state.atEndOfLiveTimelineInit) {
691+
if (this.messagePanel && this.state.atEndOfLiveTimeline === undefined) {
696692
this.setState({
697-
atEndOfLiveTimelineInit: true,
698693
atEndOfLiveTimeline: this.messagePanel.isAtEndOfLiveTimeline(),
699694
});
700695
}
@@ -2102,7 +2097,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
21022097
}
21032098
let jumpToBottom;
21042099
// Do not show JumpToBottomButton if we have search results showing, it makes no sense
2105-
if (!this.state.atEndOfLiveTimeline && !this.state.searchResults) {
2100+
if (this.state.atEndOfLiveTimeline === false && !this.state.searchResults) {
21062101
jumpToBottom = (<JumpToBottomButton
21072102
highlight={this.state.room.getUnreadNotificationCount(NotificationCountType.Highlight) > 0}
21082103
numUnreadMessages={this.state.numUnreadMessages}

src/components/structures/TimelinePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
10431043
/* return true if the content is fully scrolled down and we are
10441044
* at the end of the live timeline.
10451045
*/
1046-
public isAtEndOfLiveTimeline = (): boolean => {
1046+
public isAtEndOfLiveTimeline = (): boolean | undefined => {
10471047
return this.messagePanel.current?.isAtBottom()
10481048
&& this.timelineWindow
10491049
&& !this.timelineWindow.canPaginate(EventTimeline.FORWARDS);

src/components/views/right_panel/UserInfo.tsx

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,17 @@ function DevicesSection({ devices, userId, loading }: { devices: IDevice[], user
292292
let expandButton;
293293
if (expandSectionDevices.length) {
294294
if (isExpanded) {
295-
expandButton = (<AccessibleButton className="mx_UserInfo_expand mx_linkButton"
295+
expandButton = (<AccessibleButton
296+
kind="link"
297+
className="mx_UserInfo_expand"
296298
onClick={() => setExpanded(false)}
297299
>
298300
<div>{ expandHideCaption }</div>
299301
</AccessibleButton>);
300302
} else {
301-
expandButton = (<AccessibleButton className="mx_UserInfo_expand mx_linkButton"
303+
expandButton = (<AccessibleButton
304+
kind="link"
305+
className="mx_UserInfo_expand"
302306
onClick={() => setExpanded(true)}
303307
>
304308
<div className={expandIconClasses} />
@@ -331,6 +335,7 @@ const MessageButton = ({ userId }: { userId: string }) => {
331335

332336
return (
333337
<AccessibleButton
338+
kind="link"
334339
onClick={async (ev) => {
335340
if (busy) return;
336341
setBusy(true);
@@ -383,6 +388,7 @@ const UserOptionsSection: React.FC<{
383388

384389
ignoreButton = (
385390
<AccessibleButton
391+
kind="link"
386392
onClick={onIgnoreToggle}
387393
className={classNames("mx_UserInfo_field", { mx_UserInfo_destructive: !isIgnored })}
388394
>
@@ -413,14 +419,22 @@ const UserOptionsSection: React.FC<{
413419
const room = cli.getRoom(member.roomId);
414420
if (room?.getEventReadUpTo(member.userId)) {
415421
readReceiptButton = (
416-
<AccessibleButton onClick={onReadReceiptButton} className="mx_UserInfo_field">
422+
<AccessibleButton
423+
kind="link"
424+
onClick={onReadReceiptButton}
425+
className="mx_UserInfo_field"
426+
>
417427
{ _t('Jump to read receipt') }
418428
</AccessibleButton>
419429
);
420430
}
421431

422432
insertPillButton = (
423-
<AccessibleButton onClick={onInsertPillButton} className="mx_UserInfo_field">
433+
<AccessibleButton
434+
kind="link"
435+
onClick={onInsertPillButton}
436+
className="mx_UserInfo_field"
437+
>
424438
{ _t('Mention') }
425439
</AccessibleButton>
426440
);
@@ -448,15 +462,23 @@ const UserOptionsSection: React.FC<{
448462
};
449463

450464
inviteUserButton = (
451-
<AccessibleButton onClick={onInviteUserButton} className="mx_UserInfo_field">
465+
<AccessibleButton
466+
kind="link"
467+
onClick={onInviteUserButton}
468+
className="mx_UserInfo_field"
469+
>
452470
{ _t('Invite') }
453471
</AccessibleButton>
454472
);
455473
}
456474
}
457475

458476
const shareUserButton = (
459-
<AccessibleButton onClick={onShareUserClick} className="mx_UserInfo_field">
477+
<AccessibleButton
478+
kind="link"
479+
onClick={onShareUserClick}
480+
className="mx_UserInfo_field"
481+
>
460482
{ _t('Share Link to User') }
461483
</AccessibleButton>
462484
);
@@ -624,7 +646,11 @@ const RoomKickButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBas
624646
member.membership === "invite" ? _t("Disinvite from space") : _t("Remove from space")
625647
: member.membership === "invite" ? _t("Disinvite from room") : _t("Remove from room");
626648

627-
return <AccessibleButton className="mx_UserInfo_field mx_UserInfo_destructive" onClick={onKick}>
649+
return <AccessibleButton
650+
kind="link"
651+
className="mx_UserInfo_field mx_UserInfo_destructive"
652+
onClick={onKick}
653+
>
628654
{ kickLabel }
629655
</AccessibleButton>;
630656
};
@@ -642,7 +668,11 @@ const RedactMessagesButton: React.FC<IBaseProps> = ({ member }) => {
642668
});
643669
};
644670

645-
return <AccessibleButton className="mx_UserInfo_field mx_UserInfo_destructive" onClick={onRedactAllMessages}>
671+
return <AccessibleButton
672+
kind="link"
673+
className="mx_UserInfo_field mx_UserInfo_destructive"
674+
onClick={onRedactAllMessages}
675+
>
646676
{ _t("Remove recent messages") }
647677
</AccessibleButton>;
648678
};
@@ -739,7 +769,11 @@ const BanToggleButton = ({ room, member, startUpdating, stopUpdating }: Omit<IBa
739769
mx_UserInfo_destructive: !isBanned,
740770
});
741771

742-
return <AccessibleButton className={classes} onClick={onBanOrUnban}>
772+
return <AccessibleButton
773+
kind="link"
774+
className={classes}
775+
onClick={onBanOrUnban}
776+
>
743777
{ label }
744778
</AccessibleButton>;
745779
};
@@ -809,7 +843,11 @@ const MuteToggleButton: React.FC<IBaseRoomProps> = ({ member, room, powerLevels,
809843
});
810844

811845
const muteLabel = muted ? _t("Unmute") : _t("Mute");
812-
return <AccessibleButton className={classes} onClick={onMuteToggle}>
846+
return <AccessibleButton
847+
kind="link"
848+
className={classes}
849+
onClick={onMuteToggle}
850+
>
813851
{ muteLabel }
814852
</AccessibleButton>;
815853
};
@@ -1212,7 +1250,11 @@ const BasicUserInfo: React.FC<{
12121250
// FIXME this should be using cli instead of MatrixClientPeg.matrixClient
12131251
if (isSynapseAdmin && member.userId.endsWith(`:${MatrixClientPeg.getHomeserverName()}`)) {
12141252
synapseDeactivateButton = (
1215-
<AccessibleButton onClick={onSynapseDeactivate} className="mx_UserInfo_field mx_UserInfo_destructive">
1253+
<AccessibleButton
1254+
kind="link"
1255+
className="mx_UserInfo_field mx_UserInfo_destructive"
1256+
onClick={onSynapseDeactivate}
1257+
>
12161258
{ _t("Deactivate user") }
12171259
</AccessibleButton>
12181260
);
@@ -1290,8 +1332,9 @@ const BasicUserInfo: React.FC<{
12901332
if (canVerify) {
12911333
if (hasCrossSigningKeys !== undefined) {
12921334
// Note: mx_UserInfo_verifyButton is for the end-to-end tests
1293-
verifyButton = (
1335+
verifyButton = (<div className="mx_UserInfo_container_verifyButton">
12941336
<AccessibleButton
1337+
kind="link"
12951338
className="mx_UserInfo_field mx_UserInfo_verifyButton"
12961339
onClick={() => {
12971340
if (hasCrossSigningKeys) {
@@ -1303,7 +1346,7 @@ const BasicUserInfo: React.FC<{
13031346
>
13041347
{ _t("Verify") }
13051348
</AccessibleButton>
1306-
);
1349+
</div>);
13071350
} else if (!showDeviceListSpinner) {
13081351
// HACK: only show a spinner if the device section spinner is not shown,
13091352
// to avoid showing a double spinner
@@ -1316,6 +1359,7 @@ const BasicUserInfo: React.FC<{
13161359
if (member.userId == cli.getUserId()) {
13171360
editDevices = (<div>
13181361
<AccessibleButton
1362+
kind="link"
13191363
className="mx_UserInfo_field"
13201364
onClick={() => {
13211365
dis.dispatch({

src/components/views/rooms/SearchBar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export default class SearchBar extends React.Component<IProps, IState> {
7878
}
7979

8080
private onSearch = (): void => {
81+
if (!this.searchTerm.current.value.trim()) return;
8182
this.props.onSearch(this.searchTerm.current.value, this.state.scope);
8283
};
8384

src/contexts/RoomContext.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ const RoomContext = createContext<IRoomState>({
4141
isPeeking: false,
4242
showRightPanel: true,
4343
joining: false,
44-
atEndOfLiveTimeline: true,
45-
atEndOfLiveTimelineInit: false,
4644
showTopUnreadMessagesBar: false,
4745
statusBarVisible: false,
4846
canReact: false,

0 commit comments

Comments
 (0)