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

Commit 1daa34b

Browse files
authored
Merge pull request #9879 from matrix-org/gsouquet/threads-forceenablelabsflag
Switch threads on for everyone
2 parents a1ec86e + d4f247d commit 1daa34b

File tree

25 files changed

+38
-38
lines changed

25 files changed

+38
-38
lines changed

cypress/e2e/polls/polls.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe("Polls", () => {
7777
};
7878

7979
beforeEach(() => {
80-
cy.enableLabsFeature("feature_threadstable");
80+
cy.enableLabsFeature("feature_threadenabled");
8181
cy.window().then((win) => {
8282
win.localStorage.setItem("mx_lhs_size", "0"); // Collapse left panel for these tests
8383
});

cypress/e2e/threads/threads.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("Threads", () => {
2929

3030
beforeEach(() => {
3131
// Default threads to ON for this spec
32-
cy.enableLabsFeature("feature_threadstable");
32+
cy.enableLabsFeature("feature_threadenabled");
3333
cy.window().then((win) => {
3434
win.localStorage.setItem("mx_lhs_size", "0"); // Collapse left panel for these tests
3535
});

src/MatrixClientPeg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class MatrixClientPegClass implements IMatrixClientPeg {
218218
opts.pendingEventOrdering = PendingEventOrdering.Detached;
219219
opts.lazyLoadMembers = true;
220220
opts.clientWellKnownPollPeriod = 2 * 60 * 60; // 2 hours
221-
opts.experimentalThreadSupport = SettingsStore.getValue("feature_threadstable");
221+
opts.experimentalThreadSupport = SettingsStore.getValue("feature_threadenabled");
222222

223223
if (SettingsStore.getValue("feature_sliding_sync")) {
224224
const proxyUrl = SettingsStore.getValue("feature_sliding_sync_proxy_url");

src/components/structures/MessagePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export default class MessagePanel extends React.Component<IProps, IState> {
287287
// and we check this in a hot code path. This is also cached in our
288288
// RoomContext, however we still need a fallback for roomless MessagePanels.
289289
this._showHiddenEvents = SettingsStore.getValue("showHiddenEventsInTimeline");
290-
this.threadsEnabled = SettingsStore.getValue("feature_threadstable");
290+
this.threadsEnabled = SettingsStore.getValue("feature_threadenabled");
291291

292292
this.showTypingNotificationsWatcherRef = SettingsStore.watchSetting(
293293
"showTypingNotifications",

src/components/structures/RoomSearchView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const RoomSearchView = forwardRef<ScrollPanel, Props>(
100100
return b.length - a.length;
101101
});
102102

103-
if (SettingsStore.getValue("feature_threadstable")) {
103+
if (SettingsStore.getValue("feature_threadenabled")) {
104104
// Process all thread roots returned in this batch of search results
105105
// XXX: This won't work for results coming from Seshat which won't include the bundled relationship
106106
for (const result of results.results) {

src/components/structures/RoomView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
11821182
CHAT_EFFECTS.forEach((effect) => {
11831183
if (containsEmoji(ev.getContent(), effect.emojis) || ev.getContent().msgtype === effect.msgType) {
11841184
// For initial threads launch, chat effects are disabled see #19731
1185-
if (!SettingsStore.getValue("feature_threadstable") || !ev.isRelation(THREAD_RELATION_TYPE.name)) {
1185+
if (!SettingsStore.getValue("feature_threadenabled") || !ev.isRelation(THREAD_RELATION_TYPE.name)) {
11861186
dis.dispatch({ action: `effects.${effect.command}` });
11871187
}
11881188
}

src/components/structures/ThreadPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ const ThreadPanel: React.FC<IProps> = ({ roomId, onClose, permalinkCreator }) =>
249249
const openFeedback = shouldShowFeedback()
250250
? () => {
251251
Modal.createDialog(BetaFeedbackDialog, {
252-
featureId: "feature_threadstable",
252+
featureId: "feature_threadenabled",
253253
});
254254
}
255255
: null;

src/components/structures/TimelinePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1688,7 +1688,7 @@ class TimelinePanel extends React.Component<IProps, IState> {
16881688
is very tied to the main room timeline, we are forcing the timeline to
16891689
send read receipts for threaded events */
16901690
const isThreadTimeline = this.context.timelineRenderingType === TimelineRenderingType.Thread;
1691-
if (SettingsStore.getValue("feature_threadstable") && isThreadTimeline) {
1691+
if (SettingsStore.getValue("feature_threadenabled") && isThreadTimeline) {
16921692
return 0;
16931693
}
16941694
const index = this.state.events.findIndex((ev) => ev.getId() === evId);

src/components/views/context_menus/MessageContextMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const ReplyInThreadButton = ({ mxEvent, closeMenu }: IReplyInThreadButton) => {
7171
if (Boolean(relationType) && relationType !== RelationType.Thread) return null;
7272

7373
const onClick = (): void => {
74-
if (!SettingsStore.getValue("feature_threadstable")) {
74+
if (!SettingsStore.getValue("feature_threadenabled")) {
7575
dis.dispatch({
7676
action: Action.ViewUserSettings,
7777
initialTabId: UserTab.Labs,
@@ -640,7 +640,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
640640
rightClick &&
641641
contentActionable &&
642642
canSendMessages &&
643-
SettingsStore.getValue("feature_threadstable") &&
643+
SettingsStore.getValue("feature_threadenabled") &&
644644
Thread.hasServerSideSupport &&
645645
timelineRenderingType !== TimelineRenderingType.Thread
646646
) {

src/components/views/messages/MessageActionBar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ const ReplyInThreadButton = ({ mxEvent }: IReplyInThreadButton) => {
204204

205205
const relationType = mxEvent?.getRelation()?.rel_type;
206206
const hasARelation = !!relationType && relationType !== RelationType.Thread;
207-
const threadsEnabled = SettingsStore.getValue("feature_threadstable");
207+
const threadsEnabled = SettingsStore.getValue("feature_threadenabled");
208208

209209
if (!threadsEnabled && !Thread.hasServerSideSupport) {
210210
// hide the prompt if the user would only have degraded mode
@@ -216,7 +216,7 @@ const ReplyInThreadButton = ({ mxEvent }: IReplyInThreadButton) => {
216216
e.preventDefault();
217217
e.stopPropagation();
218218

219-
if (!SettingsStore.getValue("feature_threadstable")) {
219+
if (!SettingsStore.getValue("feature_threadenabled")) {
220220
dis.dispatch({
221221
action: Action.ViewUserSettings,
222222
initialTabId: UserTab.Labs,
@@ -252,7 +252,7 @@ const ReplyInThreadButton = ({ mxEvent }: IReplyInThreadButton) => {
252252
</div>
253253
{!hasARelation && (
254254
<div className="mx_Tooltip_sub">
255-
{SettingsStore.getValue("feature_threadstable")
255+
{SettingsStore.getValue("feature_threadenabled")
256256
? _t("Beta feature")
257257
: _t("Beta feature. Click to learn more.")}
258258
</div>
@@ -548,7 +548,7 @@ export default class MessageActionBar extends React.PureComponent<IMessageAction
548548
);
549549
}
550550
} else if (
551-
SettingsStore.getValue("feature_threadstable") &&
551+
SettingsStore.getValue("feature_threadenabled") &&
552552
// Show thread icon even for deleted messages, but only within main timeline
553553
this.context.timelineRenderingType === TimelineRenderingType.Room &&
554554
this.props.mxEvent.getThread()

src/components/views/right_panel/RoomHeaderButtons.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ export default class RoomHeaderButtons extends HeaderButtons<IProps> {
324324
);
325325
rightPanelPhaseButtons.set(
326326
RightPanelPhases.ThreadPanel,
327-
SettingsStore.getValue("feature_threadstable") ? (
327+
SettingsStore.getValue("feature_threadenabled") ? (
328328
<HeaderButton
329329
key={RightPanelPhases.ThreadPanel}
330330
name="threadsButton"

src/components/views/rooms/EventTile.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
387387
}
388388
}
389389

390-
if (SettingsStore.getValue("feature_threadstable")) {
390+
if (SettingsStore.getValue("feature_threadenabled")) {
391391
this.props.mxEvent.on(ThreadEvent.Update, this.updateThread);
392392

393393
if (this.thread && !this.supportsThreadNotifications) {
@@ -470,7 +470,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
470470
if (this.props.showReactions) {
471471
this.props.mxEvent.removeListener(MatrixEventEvent.RelationsCreated, this.onReactionsCreated);
472472
}
473-
if (SettingsStore.getValue("feature_threadstable")) {
473+
if (SettingsStore.getValue("feature_threadenabled")) {
474474
this.props.mxEvent.off(ThreadEvent.Update, this.updateThread);
475475
}
476476
this.threadState?.off(NotificationStateEvents.Update, this.onThreadStateUpdate);
@@ -501,7 +501,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
501501
};
502502

503503
private get thread(): Thread | null {
504-
if (!SettingsStore.getValue("feature_threadstable")) {
504+
if (!SettingsStore.getValue("feature_threadenabled")) {
505505
return null;
506506
}
507507

src/components/views/rooms/SearchResultTile.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class SearchResultTile extends React.Component<IProps> {
6868
const layout = SettingsStore.getValue("layout");
6969
const isTwelveHour = SettingsStore.getValue("showTwelveHourTimestamps");
7070
const alwaysShowTimestamps = SettingsStore.getValue("alwaysShowTimestamps");
71-
const threadsEnabled = SettingsStore.getValue("feature_threadstable");
71+
const threadsEnabled = SettingsStore.getValue("feature_threadenabled");
7272

7373
for (let j = 0; j < timeline.length; j++) {
7474
const mxEv = timeline[j];

src/components/views/rooms/SendMessageComposer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
436436
// For initial threads launch, chat effects are disabled
437437
// see #19731
438438
const isNotThread = this.props.relation?.rel_type !== THREAD_RELATION_TYPE.name;
439-
if (!SettingsStore.getValue("feature_threadstable") || isNotThread) {
439+
if (!SettingsStore.getValue("feature_threadenabled") || isNotThread) {
440440
dis.dispatch({ action: `effects.${effect.command}` });
441441
}
442442
}

src/components/views/rooms/wysiwyg_composer/utils/message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export async function sendMessage(
112112
// For initial threads launch, chat effects are disabled
113113
// see #19731
114114
const isNotThread = relation?.rel_type !== THREAD_RELATION_TYPE.name;
115-
if (!SettingsStore.getValue("feature_threadstable") || isNotThread) {
115+
if (!SettingsStore.getValue("feature_threadenabled") || isNotThread) {
116116
dis.dispatch({ action: `effects.${effect.command}` });
117117
}
118118
}

src/settings/Settings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,13 @@ export const SETTINGS: { [setting: string]: ISetting } = {
257257
supportedLevels: LEVELS_FEATURE,
258258
default: false,
259259
},
260-
"feature_threadstable": {
260+
"feature_threadenabled": {
261261
isFeature: true,
262262
labsGroup: LabGroup.Messaging,
263263
controller: new ThreadBetaController(),
264264
displayName: _td("Threaded messages"),
265265
supportedLevels: LEVELS_FEATURE,
266-
default: false,
266+
default: true,
267267
betaInfo: {
268268
title: _td("Threaded messages"),
269269
caption: () => (

src/stores/TypingStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default class TypingStore {
6565
if (SettingsStore.getValue("lowBandwidth")) return;
6666
// Disable typing notification for threads for the initial launch
6767
// before we figure out a better user experience for them
68-
if (SettingsStore.getValue("feature_threadstable") && threadId) return;
68+
if (SettingsStore.getValue("feature_threadenabled") && threadId) return;
6969

7070
let currentTyping = this.typingStates[roomId];
7171
if ((!isTyping && !currentTyping) || (currentTyping && currentTyping.isTyping === isTyping)) {

src/stores/right-panel/RightPanelStore.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ export default class RightPanelStore extends ReadyWatchingStore {
278278
// (A nicer fix could be to indicate, that the right panel is loading if there is missing state data and re-emit if the data is available)
279279
switch (card.phase) {
280280
case RightPanelPhases.ThreadPanel:
281-
if (!SettingsStore.getValue("feature_threadstable")) return false;
281+
if (!SettingsStore.getValue("feature_threadenabled")) return false;
282282
break;
283283
case RightPanelPhases.ThreadView:
284-
if (!SettingsStore.getValue("feature_threadstable")) return false;
284+
if (!SettingsStore.getValue("feature_threadenabled")) return false;
285285
if (!card.state.threadHeadEvent) {
286286
logger.warn("removed card from right panel because of missing threadHeadEvent in card state");
287287
}

src/stores/widgets/StopGapWidgetDriver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export class StopGapWidgetDriver extends WidgetDriver {
236236
// For initial threads launch, chat effects are disabled
237237
// see #19731
238238
const isNotThread = content["m.relates_to"].rel_type !== THREAD_RELATION_TYPE.name;
239-
if (!SettingsStore.getValue("feature_threadstable") || isNotThread) {
239+
if (!SettingsStore.getValue("feature_threadenabled") || isNotThread) {
240240
dis.dispatch({ action: `effects.${effect.command}` });
241241
}
242242
}

src/utils/Reply.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function makeReplyMixIn(ev?: MatrixEvent): IEventRelation {
176176
};
177177

178178
if (ev.threadRootId) {
179-
if (SettingsStore.getValue("feature_threadstable")) {
179+
if (SettingsStore.getValue("feature_threadenabled")) {
180180
mixin.is_falling_back = false;
181181
} else {
182182
// Clients that do not offer a threading UI should behave as follows when replying, for best interaction
@@ -203,7 +203,7 @@ export function shouldDisplayReply(event: MatrixEvent): boolean {
203203

204204
const relation = event.getRelation();
205205
if (
206-
SettingsStore.getValue("feature_threadstable") &&
206+
SettingsStore.getValue("feature_threadenabled") &&
207207
relation?.rel_type === THREAD_RELATION_TYPE.name &&
208208
relation?.is_falling_back
209209
) {

src/utils/exportUtils/HtmlExport.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default class HTMLExporter extends Exporter {
6262
this.mediaOmitText = !this.exportOptions.attachmentsIncluded
6363
? _t("Media omitted")
6464
: _t("Media omitted - file size limit exceeded");
65-
this.threadsEnabled = SettingsStore.getValue("feature_threadstable");
65+
this.threadsEnabled = SettingsStore.getValue("feature_threadenabled");
6666
}
6767

6868
protected async getRoomAvatar() {

test/components/structures/TimelinePanel-test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe("TimelinePanel", () => {
174174
const getValueCopy = SettingsStore.getValue;
175175
SettingsStore.getValue = jest.fn().mockImplementation((name: string) => {
176176
if (name === "sendReadReceipts") return true;
177-
if (name === "feature_threadstable") return false;
177+
if (name === "feature_threadenabled") return false;
178178
return getValueCopy(name);
179179
});
180180

@@ -188,7 +188,7 @@ describe("TimelinePanel", () => {
188188
const getValueCopy = SettingsStore.getValue;
189189
SettingsStore.getValue = jest.fn().mockImplementation((name: string) => {
190190
if (name === "sendReadReceipts") return false;
191-
if (name === "feature_threadstable") return false;
191+
if (name === "feature_threadenabled") return false;
192192
return getValueCopy(name);
193193
});
194194

@@ -365,7 +365,7 @@ describe("TimelinePanel", () => {
365365
client.supportsExperimentalThreads = () => true;
366366
const getValueCopy = SettingsStore.getValue;
367367
SettingsStore.getValue = jest.fn().mockImplementation((name: string) => {
368-
if (name === "feature_threadstable") return true;
368+
if (name === "feature_threadenabled") return true;
369369
return getValueCopy(name);
370370
});
371371

@@ -520,7 +520,7 @@ describe("TimelinePanel", () => {
520520
});
521521

522522
it("renders when the last message is an undecryptable thread root", async () => {
523-
jest.spyOn(SettingsStore, "getValue").mockImplementation((name) => name === "feature_threadstable");
523+
jest.spyOn(SettingsStore, "getValue").mockImplementation((name) => name === "feature_threadenabled");
524524

525525
const client = MatrixClientPeg.get();
526526
client.isRoomEncrypted = () => true;

test/components/views/messages/MessageActionBar-test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ describe("<MessageActionBar />", () => {
389389
describe("when threads feature is not enabled", () => {
390390
beforeEach(() => {
391391
jest.spyOn(SettingsStore, "getValue").mockImplementation(
392-
(setting) => setting !== "feature_threadstable",
392+
(setting) => setting !== "feature_threadenabled",
393393
);
394394
});
395395

@@ -435,7 +435,7 @@ describe("<MessageActionBar />", () => {
435435
describe("when threads feature is enabled", () => {
436436
beforeEach(() => {
437437
jest.spyOn(SettingsStore, "getValue").mockImplementation(
438-
(setting) => setting === "feature_threadstable",
438+
(setting) => setting === "feature_threadenabled",
439439
);
440440
});
441441

test/components/views/right_panel/RoomHeaderButtons-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe("RoomHeaderButtons-test.tsx", function () {
4444
});
4545

4646
jest.spyOn(SettingsStore, "getValue").mockImplementation((name: string) => {
47-
if (name === "feature_threadstable") return true;
47+
if (name === "feature_threadenabled") return true;
4848
});
4949
});
5050

test/components/views/rooms/EventTile-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe("EventTile", () => {
8080

8181
jest.spyOn(client, "getRoom").mockReturnValue(room);
8282
jest.spyOn(client, "decryptEventIfNeeded").mockResolvedValue();
83-
jest.spyOn(SettingsStore, "getValue").mockImplementation((name) => name === "feature_threadstable");
83+
jest.spyOn(SettingsStore, "getValue").mockImplementation((name) => name === "feature_threadenabled");
8484

8585
mxEvent = mkMessage({
8686
room: room.roomId,

0 commit comments

Comments
 (0)