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

Commit 2d2755d

Browse files
author
Germain
authored
🧵 Enable threads by default (#9736)
* Delabs threads * remove threads reload when labs is toggled * Fix ts strict * fix rebase mistake * remove .only * fix pr comments * re-introduce backwards compat * Fix export test * Fix SearchREsultTile test * strict ts
1 parent 9668a24 commit 2d2755d

File tree

32 files changed

+88
-170
lines changed

32 files changed

+88
-170
lines changed

cypress/e2e/polls/polls.spec.ts

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

7979
beforeEach(() => {
80-
cy.enableLabsFeature("feature_thread");
8180
cy.window().then((win) => {
8281
win.localStorage.setItem("mx_lhs_size", "0"); // Collapse left panel for these tests
8382
});

cypress/e2e/threads/threads.spec.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,10 @@ limitations under the License.
1919
import { SynapseInstance } from "../../plugins/synapsedocker";
2020
import { MatrixClient } from "../../global";
2121

22-
function markWindowBeforeReload(): void {
23-
// mark our window object to "know" when it gets reloaded
24-
cy.window().then((w) => (w.beforeReload = true));
25-
}
26-
2722
describe("Threads", () => {
2823
let synapse: SynapseInstance;
2924

3025
beforeEach(() => {
31-
// Default threads to ON for this spec
32-
cy.enableLabsFeature("feature_thread");
3326
cy.window().then((win) => {
3427
win.localStorage.setItem("mx_lhs_size", "0"); // Collapse left panel for these tests
3528
});
@@ -44,35 +37,6 @@ describe("Threads", () => {
4437
cy.stopSynapse(synapse);
4538
});
4639

47-
it("should reload when enabling threads beta", () => {
48-
markWindowBeforeReload();
49-
50-
// Turn off
51-
cy.openUserSettings("Labs").within(() => {
52-
// initially the new property is there
53-
cy.window().should("have.prop", "beforeReload", true);
54-
55-
cy.leaveBeta("Threads");
56-
cy.wait(1000);
57-
// after reload the property should be gone
58-
cy.window().should("not.have.prop", "beforeReload");
59-
});
60-
61-
cy.get(".mx_MatrixChat", { timeout: 15000 }); // wait for the app
62-
markWindowBeforeReload();
63-
64-
// Turn on
65-
cy.openUserSettings("Labs").within(() => {
66-
// initially the new property is there
67-
cy.window().should("have.prop", "beforeReload", true);
68-
69-
cy.joinBeta("Threads");
70-
cy.wait(1000);
71-
// after reload the property should be gone
72-
cy.window().should("not.have.prop", "beforeReload");
73-
});
74-
});
75-
7640
it("should be usable for a conversation", () => {
7741
let bot: MatrixClient;
7842
cy.getBot(synapse, {

res/css/views/messages/_MessageActionBar.pcss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,6 @@ limitations under the License.
118118
color: $primary-content;
119119
}
120120

121-
&.mx_MessageActionBar_threadButton {
122-
.mx_Indicator {
123-
background: $links;
124-
animation-iteration-count: infinite;
125-
}
126-
}
127-
128121
&.mx_MessageActionBar_favouriteButton_fillstar {
129122
color: var(--MessageActionBar-star-button-color);
130123
}

res/img/betas/threads.png

-85 KB
Binary file not shown.

src/MatrixClientPeg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ class MatrixClientPegClass implements IMatrixClientPeg {
233233
opts.pendingEventOrdering = PendingEventOrdering.Detached;
234234
opts.lazyLoadMembers = true;
235235
opts.clientWellKnownPollPeriod = 2 * 60 * 60; // 2 hours
236-
opts.experimentalThreadSupport = SettingsStore.getValue("feature_thread");
236+
opts.experimentalThreadSupport = SettingsStore.getValue("feature_threadstable");
237237

238238
if (SettingsStore.getValue("feature_sliding_sync")) {
239239
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_thread");
290+
this.threadsEnabled = SettingsStore.getValue("feature_threadstable");
291291

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

src/components/structures/RoomSearchView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import ResizeNotifier from "../../utils/ResizeNotifier";
3333
import MatrixClientContext from "../../contexts/MatrixClientContext";
3434
import { RoomPermalinkCreator } from "../../utils/permalinks/Permalinks";
3535
import RoomContext from "../../contexts/RoomContext";
36+
import SettingsStore from "../../settings/SettingsStore";
3637

3738
const DEBUG = false;
3839
let debuglog = function (msg: string) {};
@@ -98,7 +99,7 @@ export const RoomSearchView = forwardRef<ScrollPanel, Props>(
9899
return b.length - a.length;
99100
});
100101

101-
if (client.supportsExperimentalThreads()) {
102+
if (SettingsStore.getValue("feature_threadstable")) {
102103
// Process all thread roots returned in this batch of search results
103104
// XXX: This won't work for results coming from Seshat which won't include the bundled relationship
104105
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
@@ -1177,7 +1177,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
11771177
CHAT_EFFECTS.forEach((effect) => {
11781178
if (containsEmoji(ev.getContent(), effect.emojis) || ev.getContent().msgtype === effect.msgType) {
11791179
// For initial threads launch, chat effects are disabled see #19731
1180-
if (!SettingsStore.getValue("feature_thread") || !ev.isRelation(THREAD_RELATION_TYPE.name)) {
1180+
if (!SettingsStore.getValue("feature_threadstable") || !ev.isRelation(THREAD_RELATION_TYPE.name)) {
11811181
dis.dispatch({ action: `effects.${effect.command}` });
11821182
}
11831183
}

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_thread",
252+
featureId: "feature_threadstable",
253253
});
254254
}
255255
: null;

src/components/structures/TimelinePanel.tsx

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

0 commit comments

Comments
 (0)