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

Commit 7e320e5

Browse files
committed
Take the TAC out of labs!
Requires #12438 and ideally #12418
1 parent 2c848d7 commit 7e320e5

File tree

5 files changed

+8
-28
lines changed

5 files changed

+8
-28
lines changed

src/components/views/dialogs/devtools/RoomNotifications.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
import { NotificationCountType, Room, Thread, ReceiptType } from "matrix-js-sdk/src/matrix";
18-
import React, { useContext, useMemo } from "react";
18+
import React, { useContext } from "react";
1919
import { ReadReceipt } from "matrix-js-sdk/src/models/read-receipt";
2020

2121
import MatrixClientContext from "../../../../contexts/MatrixClientContext";
@@ -25,7 +25,6 @@ import { determineUnreadState } from "../../../../RoomNotifs";
2525
import { humanReadableNotificationLevel } from "../../../../stores/notifications/NotificationLevel";
2626
import { doesRoomOrThreadHaveUnreadMessages } from "../../../../Unread";
2727
import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./BaseTool";
28-
import SettingsStore from "../../../../settings/SettingsStore";
2928

3029
function UserReadUpTo({ target }: { target: ReadReceipt<any, any> }): JSX.Element {
3130
const cli = useContext(MatrixClientContext);
@@ -66,12 +65,10 @@ function UserReadUpTo({ target }: { target: ReadReceipt<any, any> }): JSX.Elemen
6665
}
6766

6867
export default function RoomNotifications({ onBack }: IDevtoolsProps): JSX.Element {
69-
const tacEnabled = useMemo(() => SettingsStore.getValue("threadsActivityCentre"), []);
70-
7168
const { room } = useContext(DevtoolsContext);
7269
const cli = useContext(MatrixClientContext);
7370

74-
const { level, count } = determineUnreadState(room, undefined, !tacEnabled);
71+
const { level, count } = determineUnreadState(room, undefined, false);
7572
const [notificationState] = useNotificationState(room);
7673

7774
return (

src/components/views/spaces/SpacePanel.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,6 @@ const SpacePanel: React.FC = () => {
368368
}
369369
});
370370

371-
const isThreadsActivityCentreEnabled = useSettingValue<boolean>("threadsActivityCentre");
372-
373371
return (
374372
<RovingTabIndexProvider handleHomeEnd handleUpDown={!dragging}>
375373
{({ onKeyDownHandler, onDragEndHandler }) => (
@@ -426,9 +424,8 @@ const SpacePanel: React.FC = () => {
426424
)}
427425
</Droppable>
428426

429-
{isThreadsActivityCentreEnabled && (
430-
<ThreadsActivityCentre displayButtonLabel={!isPanelCollapsed} />
431-
)}
427+
<ThreadsActivityCentre displayButtonLabel={!isPanelCollapsed} />
428+
432429
<QuickSettingsButton isPanelCollapsed={isPanelCollapsed} />
433430
</nav>
434431
</DragDropContext>

src/hooks/useUnreadNotifications.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ limitations under the License.
1515
*/
1616

1717
import { RoomEvent } from "matrix-js-sdk/src/matrix";
18-
import { useCallback, useEffect, useMemo, useState } from "react";
18+
import { useCallback, useEffect, useState } from "react";
1919

2020
import type { NotificationCount, Room } from "matrix-js-sdk/src/matrix";
2121
import { determineUnreadState } from "../RoomNotifs";
2222
import { NotificationLevel } from "../stores/notifications/NotificationLevel";
2323
import { useEventEmitter } from "./useEventEmitter";
24-
import SettingsStore from "../settings/SettingsStore";
2524

2625
export const useUnreadNotifications = (
2726
room?: Room,
@@ -31,8 +30,6 @@ export const useUnreadNotifications = (
3130
count: number;
3231
level: NotificationLevel;
3332
} => {
34-
const tacEnabled = useMemo(() => SettingsStore.getValue("threadsActivityCentre"), []);
35-
3633
const [symbol, setSymbol] = useState<string | null>(null);
3734
const [count, setCount] = useState<number>(0);
3835
const [level, setLevel] = useState<NotificationLevel>(NotificationLevel.None);
@@ -53,11 +50,11 @@ export const useUnreadNotifications = (
5350
useEventEmitter(room, RoomEvent.MyMembership, () => updateNotificationState());
5451

5552
const updateNotificationState = useCallback(() => {
56-
const { symbol, count, level } = determineUnreadState(room, threadId, !tacEnabled);
53+
const { symbol, count, level } = determineUnreadState(room, threadId, false);
5754
setSymbol(symbol);
5855
setCount(count);
5956
setLevel(level);
60-
}, [room, threadId, tacEnabled]);
57+
}, [room, threadId]);
6158

6259
useEffect(() => {
6360
updateNotificationState();

src/settings/Settings.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -1148,15 +1148,6 @@ export const SETTINGS: { [setting: string]: ISetting } = {
11481148
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
11491149
default: [],
11501150
},
1151-
"threadsActivityCentre": {
1152-
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
1153-
labsGroup: LabGroup.Threads,
1154-
controller: new ReloadOnChangeController(),
1155-
displayName: _td("labs|threads_activity_centre"),
1156-
description: () => _t("labs|threads_activity_centre_description", { brand: SdkConfig.get().brand }),
1157-
default: false,
1158-
isFeature: true,
1159-
},
11601151
/**
11611152
* Enable or disable the release announcement feature
11621153
*/

src/stores/notifications/RoomNotificationStateStore.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export class RoomNotificationStateStore extends AsyncStoreWithClient<IState> {
4242
private listMap = new Map<TagID, ListNotificationState>();
4343
private _globalState = new SummarizedNotificationState();
4444

45-
private tacEnabled = SettingsStore.getValue("threadsActivityCentre");
46-
4745
private constructor(dispatcher = defaultDispatcher) {
4846
super(dispatcher, {});
4947
SettingsStore.watchSetting("feature_dynamic_room_predecessors", null, () => {
@@ -99,7 +97,7 @@ export class RoomNotificationStateStore extends AsyncStoreWithClient<IState> {
9997
*/
10098
public getRoomState(room: Room): RoomNotificationState {
10199
if (!this.roomMap.has(room)) {
102-
this.roomMap.set(room, new RoomNotificationState(room, !this.tacEnabled));
100+
this.roomMap.set(room, new RoomNotificationState(room, false));
103101
}
104102
return this.roomMap.get(room)!;
105103
}

0 commit comments

Comments
 (0)