A platform for community discussion. Free, open, simple.
DEV: Remove `rich_editor` site setting (#41873)
Renato Atiliob834edd62537
diff --git a/config/locales/server.en.yml b/config/locales/server.en.ymlindex a4bfbb82698..39d5a97894a 100644--- a/config/locales/server.en.yml+++ b/config/locales/server.en.yml@@ -2925,7 +2925,6 @@ en:about_page_extra_groups_order: "Ordering of the extra groups on the about page."adobe_analytics_tags_url: "Adobe Analytics tags URL (`https://assets.adobedtm.com/...`)"view_raw_email_allowed_groups: "Groups which can view the raw email content of a post if it was created by an incoming email. This includes email headers and other technical information."- rich_editor: "Enable the rich editor for the composer so all users can switch between the current Markdown mode and the new rich text editor for more intuitive and user-friendly composition."default_composition_mode: "Set the default mode for your community's composer. Rich text mode provides a more modern, familiar writing experience for most users, while Markdown mode may be suitable for more technical audiences. Members can use a toggle in the composer toolbar to switch between modes."reviewable_ui_refresh: "Groups that can use the experimental new UI in the review queue."content_localization_enabled: "Displays localized content for users based on their browser or user language preferences. Such content may include categories, tags, posts, and topics. Supported locales are set in {{setting:content_localization_supported_locales}}."diff --git a/config/site_settings.yml b/config/site_settings.ymlindex fa29c60ad8f..850f6b49840 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -1918,11 +1918,6 @@ posting:type: integermin: 1hidden: true- rich_editor:- client: true- default: true- hidden: true- area: "posts_and_topics"content_localization:content_localization_enabled:diff --git a/db/post_migrate/20260721122254_remove_rich_editor_setting.rb b/db/post_migrate/20260721122254_remove_rich_editor_setting.rbnew file mode 100644index 00000000000..8669441c5c3--- /dev/null+++ b/db/post_migrate/20260721122254_remove_rich_editor_setting.rb@@ -0,0 +1,10 @@+# frozen_string_literal: true+class RemoveRichEditorSetting < ActiveRecord::Migration[8.0]+ def up+ execute "DELETE FROM site_settings WHERE name = 'rich_editor'"+ end++ def down+ raise ActiveRecord::IrreversibleMigration+ end+enddiff --git a/db/structure.sql b/db/structure.sqlindex cec0df12d9c..62ab9fdc506 100644--- a/db/structure.sql+++ b/db/structure.sql@@ -22830,6 +22830,7 @@ SET search_path TO "$user", public;INSERT INTO "schema_migrations" (version) VALUES('20260722140539'),('20260722140536'),+('20260721122254'),('20260721080424'),('20260721080420'),('20260721043536'),diff --git a/frontend/discourse/app/components/composer-editor.gjs b/frontend/discourse/app/components/composer-editor.gjsindex 3f606fead55..c5511b2c93a 100644--- a/frontend/discourse/app/components/composer-editor.gjs+++ b/frontend/discourse/app/components/composer-editor.gjs@@ -149,7 +149,7 @@ export default class ComposerEditor extends Component {);let key;- if (this.siteSettings.rich_editor && this.currentUser.useRichEditor) {+ if (this.currentUser.useRichEditor) {key = allowImages? "reply_placeholder_rte": "reply_placeholder_rte_no_images";diff --git a/frontend/discourse/app/models/composer.js b/frontend/discourse/app/models/composer.jsindex 58e7dce855c..5f2679bd7f8 100644--- a/frontend/discourse/app/models/composer.js+++ b/frontend/discourse/app/models/composer.js@@ -461,7 +461,7 @@ export default class Composer extends RestModel {}get composerVersion() {- if (this.siteSettings.rich_editor && this.currentUser.useRichEditor) {+ if (this.currentUser.useRichEditor) {return 2;}diff --git a/frontend/discourse/app/ui-kit/d-editor.gjs b/frontend/discourse/app/ui-kit/d-editor.gjsindex dd1739067f3..52d0bf241f0 100644--- a/frontend/discourse/app/ui-kit/d-editor.gjs+++ b/frontend/discourse/app/ui-kit/d-editor.gjs@@ -126,38 +126,16 @@ export default class DEditor extends Component {return;}- if (this.siteSettings.rich_editor) {- // TODO (martin) Remove this once we are sure all users have migrated- // to the new rich editor preference, or a few months after the 3.5 release.- await this.handleOldRichEditorPreference();-- if (this.currentUser.useRichEditor) {- this.editorComponent = await loadRichEditor();- }+ if (this.currentUser.useRichEditor) {+ this.editorComponent = await loadRichEditor();}this.editorComponent ??= TextareaEditor;}- async handleOldRichEditorPreference() {- const oldValue = this.keyValueStore.get("d-editor-prefers-rich-editor");-- if (!oldValue) {- return;- }-- await this.#saveRichEditorPreference(- oldValue === "true"- ? USER_OPTION_COMPOSITION_MODES.rich- : USER_OPTION_COMPOSITION_MODES.markdown- ).finally(() => {- this.keyValueStore.remove("d-editor-prefers-rich-editor");- });- }-- @computed("siteSettings.rich_editor", "forceEditorMode")+ @computed("forceEditorMode")get showEditorModeToggle() {- return this.siteSettings.rich_editor && isNone(this.forceEditorMode);+ return isNone(this.forceEditorMode);}_readyNow() {@@ -234,7 +212,7 @@ export default class DEditor extends Component {// itsatrap expects the return value to be false to prevent defaultkeymap["tab"] = () => !this.textManipulation.indentSelection("right");keymap["shift+tab"] = () => !this.textManipulation.indentSelection("left");- if (this.siteSettings.rich_editor && isNone(this.forceEditorMode)) {+ if (isNone(this.forceEditorMode)) {keymap["ctrl+m"] = () => this.toggleRichEditor();}@@ -839,7 +817,7 @@ export default class DEditor extends Component {<ToolbarButtons@data={{this.toolbar}}@rovingButtonBar={{this.rovingButtonBar}}- @isFirst={{not this.siteSettings.rich_editor}}+ @isFirst={{not this.showEditorModeToggle}}/></DOverflowControls>{{/if}}diff --git a/frontend/discourse/tests/acceptance/transformers/composer-force-editor-mode-test.js b/frontend/discourse/tests/acceptance/transformers/composer-force-editor-mode-test.jsindex d7b5bcc3ab4..2c575e19d17 100644--- a/frontend/discourse/tests/acceptance/transformers/composer-force-editor-mode-test.js+++ b/frontend/discourse/tests/acceptance/transformers/composer-force-editor-mode-test.js@@ -8,7 +8,6 @@ import { acceptance } from "discourse/tests/helpers/qunit-helpers";acceptance("composer-force-editor-mode transformer", function (needs) {needs.user();needs.settings({- rich_editor: true,allow_uncategorized_topics: true,});diff --git a/frontend/discourse/tests/helpers/rich-editor-helper.gjs b/frontend/discourse/tests/helpers/rich-editor-helper.gjsindex c9068dde56a..33dae210fee 100644--- a/frontend/discourse/tests/helpers/rich-editor-helper.gjs+++ b/frontend/discourse/tests/helpers/rich-editor-helper.gjs@@ -109,8 +109,6 @@ export async function testMarkdown(*/export function testRenderedMarkdown(markdown, assertions) {return async function (assert) {- this.siteSettings.rich_editor = true;-const [editorClass] = await setupRichEditor(assert, markdown);// The editor is already in the DOM, so we can use assert.dom directlydiff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/code-block-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/code-block-test.jsindex 151259d0b02..0d480decd52 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/code-block-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/code-block-test.js@@ -7,10 +7,6 @@ module(function (hooks) {setupRenderingTest(hooks);- hooks.beforeEach(function () {- this.siteSettings.rich_editor = true;- });-const select = (lang = "") =>`<select contenteditable="false" class="code-language-select"><option>${lang}</option><option>javascript</option><option>ruby</option><option>sql</option></select>`;diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/emoji-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/emoji-test.jsindex 364ade0dfe1..2faa6be21ed 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/emoji-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/emoji-test.js@@ -49,8 +49,6 @@ module(Object.entries(testCases).forEach(([name, [markdown, expectedHtml, expectedMarkdown]]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;-await testMarkdown(assert, markdown, expectedHtml, expectedMarkdown);});}diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/hashtag-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/hashtag-test.jsindex 9456591fae2..1b350ea3b4b 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/hashtag-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/hashtag-test.js@@ -104,8 +104,6 @@ module(Object.entries(testCases).forEach(([name, [markdown, expectedHtml, expectedMarkdown]]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;-await testMarkdown(assert, markdown, expectedHtml, expectedMarkdown);});}@@ -128,8 +126,6 @@ module(}));- this.siteSettings.rich_editor = true;-await testMarkdown(assert,"Hello #unknown-type-channel",diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/html-block-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/html-block-test.jsindex 30a50114c28..9f0cb924a05 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/html-block-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/html-block-test.js@@ -35,7 +35,6 @@ module(],}).forEach(([name, [markdown, html, expectedMarkdown]]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;await testMarkdown(assert, markdown, html, expectedMarkdown);});});diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/html-inline-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/html-inline-test.jsindex 38e5f92706a..9be6dc9ba93 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/html-inline-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/html-inline-test.js@@ -118,7 +118,6 @@ module(],}).forEach(([name, [markdown, html, expectedMarkdown]]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;await testMarkdown(assert, markdown, html, expectedMarkdown);});});diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/link-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/link-test.jsindex 1b9d1213343..f19810955cd 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/link-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/link-test.js@@ -45,7 +45,6 @@ module(],}).forEach(([name, [markdown, html, expectedMarkdown]]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;await testMarkdown(assert, markdown, html, expectedMarkdown);});});diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/mention-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/mention-test.jsindex 11471c20268..1d6af5587e4 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/mention-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/mention-test.js@@ -64,8 +64,6 @@ module(Object.entries(testCases).forEach(([name, [markdown, expectedHtml, expectedMarkdown]]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;-await testMarkdown(assert, markdown, expectedHtml, expectedMarkdown);});}diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/onebox-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/onebox-test.jsindex a73ff764820..85aa95224a0 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/onebox-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/onebox-test.js@@ -52,7 +52,6 @@ module(});test("holds a lone link inline while the cursor is on its line", async function (assert) {- this.siteSettings.rich_editor = true;const [editor] = await setupRichEditor(assert, "a\n\nb");const { view } = editor;@@ -71,7 +70,6 @@ module(});test("promotes a lone inline onebox to a full onebox when the cursor leaves its line", async function (assert) {- this.siteSettings.rich_editor = true;const [editor] = await setupRichEditor(assert, "a\n\nb");const { view } = editor;@@ -102,8 +100,6 @@ module(// onebox is a block node, so it must replace the whole paragraph rather// than split it and leave an empty paragraph behind.test("a top-level URL alone on its line becomes a full onebox with no empty paragraph before it", async function (assert) {- this.siteSettings.rich_editor = true;-const topLevelUrl = "http://www.example.com";pretender.get("/onebox", () => [200,@@ -137,7 +133,6 @@ module(// shift+enter) must split into a clean block onebox plus a paragraph for the// following line — not a stray empty paragraph wrapping the block.test("a URL followed by a hard break and text splits into onebox + paragraph", async function (assert) {- this.siteSettings.rich_editor = true;const [editor] = await setupRichEditor(assert, "x");const { view } = editor;const { schema } = view.state;diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/prosemirror-editor-test.gjs b/frontend/discourse/tests/integration/components/prosemirror-editor/prosemirror-editor-test.gjsindex a4a9f376f23..8717d19adf8 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/prosemirror-editor-test.gjs+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/prosemirror-editor-test.gjs@@ -60,8 +60,6 @@ module("Integration | Component | ProsemirrorEditor", function (hooks) {});test("supports registered nodeSpec/parser/serializer", async function (assert) {- this.siteSettings.rich_editor = true;-withPluginApi((api) => {// Multiple parsers can be registered for the same node typeapi.registerRichEditorExtension({@@ -114,8 +112,6 @@ module("Integration | Component | ProsemirrorEditor", function (hooks) {});test("supports registered markSpec/parser/serializer", async function (assert) {- this.siteSettings.rich_editor = true;-withPluginApi((api) => {api.registerRichEditorExtension({// just for testing purpose - our actual hashtag is a node, not a mark@@ -151,8 +147,6 @@ module("Integration | Component | ProsemirrorEditor", function (hooks) {});test("supports registered nodeViews", async function (assert) {- this.siteSettings.rich_editor = true;-const state = {};withPluginApi((api) => {@@ -181,8 +175,6 @@ module("Integration | Component | ProsemirrorEditor", function (hooks) {});test("supports registered plugins with array, object or function", async function (assert) {- this.siteSettings.rich_editor = true;-const state = {};withPluginApi((api) => {diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/prosemirror-markdown-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/prosemirror-markdown-test.jsindex ee069c7836a..3462dec19c7 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/prosemirror-markdown-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/prosemirror-markdown-test.js@@ -169,8 +169,6 @@ module(Object.entries(testCases).forEach(([name, tests]) => {tests.forEach(([markdown, expectedHtml, expectedMarkdown]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;-await testMarkdown(assert, markdown, expectedHtml, expectedMarkdown);});});diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/quote-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/quote-test.jsindex 5759c56bc7a..ed0e82b21fb 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/quote-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/quote-test.js@@ -45,7 +45,6 @@ module(],}).forEach(([name, [markdown, html, expectedMarkdown]]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;await testMarkdown(assert, markdown, html, expectedMarkdown);});});diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/strikethrough-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/strikethrough-test.jsindex 1798db0dbc5..ed8b54b89d1 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/strikethrough-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/strikethrough-test.js@@ -29,8 +29,6 @@ module(Object.entries(testCases).forEach(([name, tests]) => {tests.forEach(([markdown, expectedHtml, expectedMarkdown]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;-await testMarkdown(assert, markdown, expectedHtml, expectedMarkdown);});});diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/table-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/table-test.jsindex 77f164daa33..28e00dd7826 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/table-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/table-test.js@@ -30,7 +30,6 @@ module(],}).forEach(([name, [markdown, html, expectedMarkdown]]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;await testMarkdown(assert, markdown, html, expectedMarkdown);});});diff --git a/frontend/discourse/tests/integration/components/prosemirror-editor/underline-test.js b/frontend/discourse/tests/integration/components/prosemirror-editor/underline-test.jsindex 5ba1b09f0d1..635185f4cce 100644--- a/frontend/discourse/tests/integration/components/prosemirror-editor/underline-test.js+++ b/frontend/discourse/tests/integration/components/prosemirror-editor/underline-test.js@@ -33,8 +33,6 @@ module(Object.entries(testCases).forEach(([name, tests]) => {tests.forEach(([markdown, expectedHtml, expectedMarkdown]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;-await testMarkdown(assert, markdown, expectedHtml, expectedMarkdown);});});diff --git a/frontend/discourse/tests/integration/ui-kit/d-editor-test.gjs b/frontend/discourse/tests/integration/ui-kit/d-editor-test.gjsindex 551f6a3f70f..2e49ba85ca2 100644--- a/frontend/discourse/tests/integration/ui-kit/d-editor-test.gjs+++ b/frontend/discourse/tests/integration/ui-kit/d-editor-test.gjs@@ -14,6 +14,7 @@ import {import { module, test } from "qunit";import DMenus from "discourse/float-kit/components/d-menus";import { ToolbarBase } from "discourse/lib/composer/toolbar";+import { USER_OPTION_COMPOSITION_MODES } from "discourse/lib/constants";import { withPluginApi } from "discourse/lib/plugin-api";import { setCaretPosition } from "discourse/lib/utilities";import { setupRenderingTest } from "discourse/tests/helpers/component-test";@@ -890,10 +891,12 @@ third line`});testCase(- "toolbar buttons tabindex when not using rich_editor",+ "toolbar buttons tabindex without the editor mode toggle",async function (assert) {- this.siteSettings.rich_editor = false;- await render(<template><DEditor /></template>);+ const forceEditorMode = USER_OPTION_COMPOSITION_MODES.markdown;+ await render(+ <template><DEditor @forceEditorMode={{forceEditorMode}} /></template>+ );const buttons = findAll(".d-editor-button-bar .btn");assert@@ -904,9 +907,8 @@ third line`);testCase(- "toolbar buttons tabindex when using rich_editor",+ "toolbar buttons tabindex with the editor mode toggle",async function (assert) {- this.siteSettings.rich_editor = true;await render(<template><DEditor /></template>);const buttons = findAll(".d-editor-button-bar .btn");@@ -1482,8 +1484,6 @@ module("Integration | ui-kit | DEditor | Rich Editor", function (hooks) {setupRenderingTest(hooks);test("hides preview when rich editor is enabled", async function (assert) {- this.siteSettings.rich_editor = true;-await render(<template><DEditor /></template>);await click(".composer-toggle-switch");@@ -1496,8 +1496,6 @@ module("Integration | ui-kit | DEditor | Rich Editor", function (hooks) {});test("replaceText escapes markdown symbols that could be regexp symbols", async function (assert) {- this.siteSettings.rich_editor = true;-const initialValue = "Hello\n\n* world\n* am am here $";withPluginApi((api) => {diff --git a/frontend/discourse/tests/unit/models/composer-test.js b/frontend/discourse/tests/unit/models/composer-test.jsindex 41102abb663..6124ce580bc 100644--- a/frontend/discourse/tests/unit/models/composer-test.js+++ b/frontend/discourse/tests/unit/models/composer-test.js@@ -576,8 +576,6 @@ module("Unit | Model | composer", function (hooks) {});test("composerVersion is correct when using modern 'rich text' composer", async function (assert) {- this.siteSettings.rich_editor = true;-const composer = createComposer.call(this, {});composer.currentUser = User.current();composer.currentUser.set(diff --git a/lib/stylesheet/importer.rb b/lib/stylesheet/importer.rbindex bb019343227..006cc56b579 100644--- a/lib/stylesheet/importer.rb+++ b/lib/stylesheet/importer.rb@@ -64,23 +64,14 @@ module StylesheetCSS- if SiteSetting.rich_editor- contents << <<~CSS- #{font_css(jetbrains_mono)}- #{render_font_special_properties(jetbrains_mono, "body")}- :root {- --d-font-family--monospace: #{jetbrains_mono[:stack]};- }-- CSS- else- contents << <<~CSS- :root {- --d-font-family--monospace: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", menlo, monaco, consolas, monospace;- }-- CSS- end+ contents << <<~CSS+ #{font_css(jetbrains_mono)}+ #{render_font_special_properties(jetbrains_mono, "body")}+ :root {+ --d-font-family--monospace: #{jetbrains_mono[:stack]};+ }++ CSScontentsenddiff --git a/plugins/chat/test/javascripts/components/rich-editor-extension-test.gjs b/plugins/chat/test/javascripts/components/rich-editor-extension-test.gjsindex 9bb5b4ed4b8..caf3ac3c4b3 100644--- a/plugins/chat/test/javascripts/components/rich-editor-extension-test.gjs+++ b/plugins/chat/test/javascripts/components/rich-editor-extension-test.gjs@@ -14,7 +14,6 @@ module(setupRenderingTest(hooks);hooks.beforeEach(function () {- this.siteSettings.rich_editor = true;this.siteSettings.chat_enabled = true;// This is necessary for the chat transcripts to work in JS, because thisdiff --git a/plugins/checklist/spec/system/rich_editor_extension_spec.rb b/plugins/checklist/spec/system/rich_editor_extension_spec.rbindex 57c2d6c31b6..dac49b85501 100644--- a/plugins/checklist/spec/system/rich_editor_extension_spec.rb+++ b/plugins/checklist/spec/system/rich_editor_extension_spec.rb@@ -6,10 +6,7 @@ describe "Composer - ProseMirror editor - Checklist extension" dolet(:rich) { composer.rich_editor }let(:checklist) { PageObjects::Components::RichChecklist.new(rich) }- before do- sign_in(user)- SiteSetting.rich_editor = true- end+ before { sign_in(user) }def open_composer_and_toggle_rich_editorpage.visit "/new-topic"diff --git a/plugins/checklist/test/javascripts/integration/rich-editor-extension-test.js b/plugins/checklist/test/javascripts/integration/rich-editor-extension-test.jsindex d2c95174f6c..09c60e94c7f 100644--- a/plugins/checklist/test/javascripts/integration/rich-editor-extension-test.js+++ b/plugins/checklist/test/javascripts/integration/rich-editor-extension-test.js@@ -13,8 +13,6 @@ module(setupRenderingTest(hooks);hooks.beforeEach(function () {- this.siteSettings.rich_editor = true;-resetRichEditorExtensions().then(() => {registerRichEditorExtension(richEditorExtension);});diff --git a/plugins/discourse-ai/spec/system/ai_helper/ai_proofreading_spec.rb b/plugins/discourse-ai/spec/system/ai_helper/ai_proofreading_spec.rbindex cbd8ecf4d86..1ba09d8e981 100644--- a/plugins/discourse-ai/spec/system/ai_helper/ai_proofreading_spec.rb+++ b/plugins/discourse-ai/spec/system/ai_helper/ai_proofreading_spec.rb@@ -85,8 +85,6 @@ RSpec.describe "AI Composer Proofreading Features" doendcontext "when using rich text editor" do- before { SiteSetting.rich_editor = true }-it "proofreads selected text and replaces it" dovisit "/new-topic"expect(composer).to be_openeddiff --git a/plugins/discourse-calendar/assets/javascripts/discourse/initializers/add-event-ui-builder.js b/plugins/discourse-calendar/assets/javascripts/discourse/initializers/add-event-ui-builder.jsindex 926fa825677..6ffc7e132e7 100644--- a/plugins/discourse-calendar/assets/javascripts/discourse/initializers/add-event-ui-builder.js+++ b/plugins/discourse-calendar/assets/javascripts/discourse/initializers/add-event-ui-builder.js@@ -7,7 +7,6 @@ function initializeEventBuilder(api) {const currentUser = api.getCurrentUser();const modal = api.container.lookup("service:modal");const composer = api.container.lookup("service:composer");- const siteSettings = api.container.lookup("service:site-settings");api.addComposerToolbarPopupMenuOption({action: (toolbarEvent) => {@@ -28,8 +27,7 @@ function initializeEventBuilder(api) {// either the ProseMirror node view (rich-text) or the markdown preview// pane. Fall back to the modal when there's no visible surface (preview// toggled off, or mobile where it's behind a tap).- const richTextMode =- siteSettings.rich_editor && currentUser.useRichEditor;+ const richTextMode = currentUser.useRichEditor;if (richTextMode || composer.isPreviewVisible) {const params = `start="${start.format("YYYY-MM-DD HH:mm")}" end="${end.format("YYYY-MM-DD HH:mm")}" status="public" timezone="${timezone}" reminders="${reminderToBBCode(reminder)}"`;toolbarEvent.addText(`[event ${params}]\n[/event]`);diff --git a/plugins/discourse-calendar/spec/system/composer/event_preview_focus_spec.rb b/plugins/discourse-calendar/spec/system/composer/event_preview_focus_spec.rbindex 34646e65acf..97f46522a75 100644--- a/plugins/discourse-calendar/spec/system/composer/event_preview_focus_spec.rb+++ b/plugins/discourse-calendar/spec/system/composer/event_preview_focus_spec.rb@@ -8,7 +8,6 @@ describe "Composer - Event preview focus" dobefore doSiteSetting.calendar_enabled = trueSiteSetting.discourse_post_event_enabled = true- SiteSetting.rich_editor = falsesign_in(admin)enddiff --git a/plugins/discourse-calendar/spec/system/composer/prosemirror_event_spec.rb b/plugins/discourse-calendar/spec/system/composer/prosemirror_event_spec.rbindex ca90548a91e..2e8cf9395be 100644--- a/plugins/discourse-calendar/spec/system/composer/prosemirror_event_spec.rb+++ b/plugins/discourse-calendar/spec/system/composer/prosemirror_event_spec.rb@@ -6,7 +6,6 @@ describe "Composer - ProseMirror - Event Editor" dobefore doSiteSetting.calendar_enabled = trueSiteSetting.discourse_post_event_enabled = true- SiteSetting.rich_editor = trueenddescribe "event rendering" dodiff --git a/plugins/discourse-calendar/test/javascripts/integration/components/rich-editor-extension-test.js b/plugins/discourse-calendar/test/javascripts/integration/components/rich-editor-extension-test.jsindex 7e2666bd767..d8f93a7f2a5 100644--- a/plugins/discourse-calendar/test/javascripts/integration/components/rich-editor-extension-test.js+++ b/plugins/discourse-calendar/test/javascripts/integration/components/rich-editor-extension-test.js@@ -59,15 +59,12 @@ module("Integration | Component | RichEditorExtension", function (hooks) {Object.entries(testCases).forEach(([name, tests]) => {tests.forEach(([markdown, expectedHtml, expectedMarkdown]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;-await testMarkdown(assert, markdown, expectedHtml, expectedMarkdown);});});});test("event preserves allowed custom fields", async function (assert) {- this.siteSettings.rich_editor = true;this.siteSettings.discourse_post_event_allowed_custom_fields ="fancy_field";@@ -82,7 +79,6 @@ module("Integration | Component | RichEditorExtension", function (hooks) {});test("event preserves custom fields with uppercase letters", async function (assert) {- this.siteSettings.rich_editor = true;this.siteSettings.discourse_post_event_allowed_custom_fields = "dress_CODE";await testMarkdown(diff --git a/plugins/discourse-details/spec/system/details_spec.rb b/plugins/discourse-details/spec/system/details_spec.rbindex 77dd3e5e282..6b799c73a06 100644--- a/plugins/discourse-details/spec/system/details_spec.rb+++ b/plugins/discourse-details/spec/system/details_spec.rb@@ -7,10 +7,7 @@ describe "Details button" dolet(:rich) { composer.rich_editor }context "with rich editor" do- before do- SiteSetting.rich_editor = true- sign_in(admin)- end+ before { sign_in(admin) }it "uses the text selection for content" dovisit("/new-topic")diff --git a/plugins/discourse-details/test/javascripts/integration/prosemirror-editor/details-test.js b/plugins/discourse-details/test/javascripts/integration/prosemirror-editor/details-test.jsindex 970f6f7f84f..a123bcefd7c 100644--- a/plugins/discourse-details/test/javascripts/integration/prosemirror-editor/details-test.js+++ b/plugins/discourse-details/test/javascripts/integration/prosemirror-editor/details-test.js@@ -45,15 +45,12 @@ module(Object.entries(testCases).forEach(([name, tests]) => {tests.forEach(([markdown, expectedHtml, expectedMarkdown]) => {test(name, async function (assert) {- this.siteSettings.rich_editor = true;-await testMarkdown(assert, markdown, expectedHtml, expectedMarkdown);});});});test("opens and closes details on click", async function (assert) {- this.siteSettings.rich_editor = true;const detailsMarkdown = `[details="Summary"]This text will be hidden[/details]`;await setupRichEditor(assert, detailsMarkdown);diff --git a/plugins/discourse-local-dates/spec/system/rich_editor_extension_spec.rb b/plugins/discourse-local-dates/spec/system/rich_editor_extension_spec.rbindex cdd9e54dc3b..659e59fd51d 100644--- a/plugins/discourse-local-dates/spec/system/rich_editor_extension_spec.rb+++ b/plugins/discourse-local-dates/spec/system/rich_editor_extension_spec.rb@@ -6,10 +6,7 @@ describe "Composer - ProseMirror editor - Local Dates extension" dolet(:composer) { PageObjects::Components::Composer.new }let(:rich) { composer.rich_editor }- before do- sign_in(user)- SiteSetting.rich_editor = true- end+ before { sign_in(user) }def open_composer_and_toggle_rich_editorpage.visit "/new-topic"diff --git a/plugins/discourse-local-dates/test/javascripts/integration/rich-editor-extension-test.js b/plugins/discourse-local-dates/test/javascripts/integration/rich-editor-extension-test.jsindex d6828b4bfc1..d461ac9fb91 100644--- a/plugins/discourse-local-dates/test/javascripts/integration/rich-editor-extension-test.js+++ b/plugins/discourse-local-dates/test/javascripts/integration/rich-editor-extension-test.js@@ -7,10 +7,6 @@ module(function (hooks) {setupRenderingTest(hooks);- hooks.beforeEach(function () {- this.siteSettings.rich_editor = true;- });-function findDate() {return document.querySelector(".ProseMirror .discourse-local-date");}diff --git a/plugins/discourse-math/spec/system/composer_spec.rb b/plugins/discourse-math/spec/system/composer_spec.rbindex 02e5cd83c2d..e882f630e79 100644--- a/plugins/discourse-math/spec/system/composer_spec.rb+++ b/plugins/discourse-math/spec/system/composer_spec.rb@@ -12,7 +12,6 @@ RSpec.describe "Discourse Math - composer" dobefore doSiteSetting.discourse_math_enabled = true- SiteSetting.rich_editor = truesign_in(current_user)enddiff --git a/plugins/discourse-math/test/javascripts/integration/prosemirror-editor/math-test.js b/plugins/discourse-math/test/javascripts/integration/prosemirror-editor/math-test.jsindex d2b94445e3d..b23b7bf6a9f 100644--- a/plugins/discourse-math/test/javascripts/integration/prosemirror-editor/math-test.js+++ b/plugins/discourse-math/test/javascripts/integration/prosemirror-editor/math-test.js@@ -13,7 +13,6 @@ module(setupRenderingTest(hooks);test("renders inline math and preserves markdown", async function (assert) {- this.siteSettings.rich_editor = true;this.siteSettings.discourse_math_enabled = true;const markdown = "Inline $E=mc^2$ math.";@@ -30,7 +29,6 @@ module(});test("renders block math and preserves markdown", async function (assert) {- this.siteSettings.rich_editor = true;this.siteSettings.discourse_math_enabled = true;const markdown = "$$\nE=mc^2\n$$";@@ -50,7 +48,6 @@ module(});test("edits math via modal", async function (assert) {- this.siteSettings.rich_editor = true;this.siteSettings.discourse_math_enabled = true;const markdown = "Inline $E=mc^2$ math.";diff --git a/plugins/footnote/spec/system/rich_editor_extension_spec.rb b/plugins/footnote/spec/system/rich_editor_extension_spec.rbindex 12f144da997..249daa22bb6 100644--- a/plugins/footnote/spec/system/rich_editor_extension_spec.rb+++ b/plugins/footnote/spec/system/rich_editor_extension_spec.rb@@ -6,10 +6,7 @@ describe "Composer - ProseMirror editor - Footnote extension" dolet(:composer) { PageObjects::Components::Composer.new }let(:rich) { composer.rich_editor }- before do- sign_in(user)- SiteSetting.rich_editor = true- end+ before { sign_in(user) }def open_composer_and_toggle_rich_editorpage.visit "/new-topic"diff --git a/plugins/poll/test/javascripts/component/rich-editor-extension-test.js b/plugins/poll/test/javascripts/component/rich-editor-extension-test.jsindex bb5662032f3..4d9d6175f6d 100644--- a/plugins/poll/test/javascripts/component/rich-editor-extension-test.js+++ b/plugins/poll/test/javascripts/component/rich-editor-extension-test.js@@ -13,8 +13,6 @@ module(setupRenderingTest(hooks);hooks.beforeEach(function () {- this.siteSettings.rich_editor = true;-resetRichEditorExtensions().then(() => {registerRichEditorExtension(richEditorExtension);});diff --git a/plugins/spoiler-alert/test/javascripts/integration/rich-editor-extension-test.js b/plugins/spoiler-alert/test/javascripts/integration/rich-editor-extension-test.jsindex 804a74e5ad6..db248b25156 100644--- a/plugins/spoiler-alert/test/javascripts/integration/rich-editor-extension-test.js+++ b/plugins/spoiler-alert/test/javascripts/integration/rich-editor-extension-test.js@@ -13,8 +13,6 @@ module(setupRenderingTest(hooks);hooks.beforeEach(function () {- this.siteSettings.rich_editor = true;-resetRichEditorExtensions().then(() => {registerRichEditorExtension(richEditorExtension);});diff --git a/spec/fabricators/user_fabricator.rb b/spec/fabricators/user_fabricator.rbindex 0c147430cba..f08d2f92ddc 100644--- a/spec/fabricators/user_fabricator.rb+++ b/spec/fabricators/user_fabricator.rb@@ -26,8 +26,7 @@ Fabricator(:user, class_name: :user) do# TODO (martin) It would be good to remove this at some point once specs are updated# to use the rich editor by default. Otherwise, if this is not done, there are tons- # of specs failing when setting SiteSetting.rich_editor default to true and SiteSetting.default_composition_mode- # default to rich+ # of specs failing when setting SiteSetting.default_composition_mode default to richuser.user_option.update!(composition_mode: transients[:composition_mode])if transients[:seen_before]diff --git a/spec/system/composer/prosemirror_container_spec.rb b/spec/system/composer/prosemirror_container_spec.rbindex 1a99d78fe6a..26802d463eb 100644--- a/spec/system/composer/prosemirror_container_spec.rb+++ b/spec/system/composer/prosemirror_container_spec.rb@@ -39,34 +39,6 @@ describe "Composer - ProseMirror - Container" doexpect(composer).to have_rich_editor_activeend- # TODO (martin) Remove this once we are sure all users have migrated- # to the new rich editor preference, or a few months after the 3.5 release.- it "saves the old keyValueStore editor preference to the database" do- visit "/"-- page.execute_script "window.localStorage.setItem('discourse_d-editor-prefers-rich-editor', 'true');"-- expect(- page.evaluate_script("window.localStorage.getItem('discourse_d-editor-prefers-rich-editor')"),- ).to eq("true")-- open_composer-- expect(composer).to have_rich_editor-- try_until_success(reason: "Relies on an Ember timer to update the user option") do- expect(current_user.user_option.reload.composition_mode).to eq(- UserOption.composition_mode_types[:rich],- )- end-- expect(- page.evaluate_script(- "window.localStorage.getItem('discourse_d-editor-prefers-rich-editor') === null",- ),- ).to eq(true)- end-it "handles uploads and disables the editor toggle while uploading" doopen_composerdiff --git a/spec/system/embed_mode_spec.rb b/spec/system/embed_mode_spec.rbindex 51ed6663fbf..e1459be266a 100644--- a/spec/system/embed_mode_spec.rb+++ b/spec/system/embed_mode_spec.rb@@ -72,10 +72,7 @@ describe "Embed mode" docontext "when logged in" dofab!(:user) { Fabricate(:user, refresh_auto_groups: true) }- before do- SiteSetting.rich_editor = true- sign_in(user)- end+ before { sign_in(user) }context "with a topic that has no replies" dofab!(:no_reply_topic, :topic)diff --git a/spec/system/image_grid_carousel_spec.rb b/spec/system/image_grid_carousel_spec.rbindex 5e604f4b382..6e2a275d733 100644--- a/spec/system/image_grid_carousel_spec.rb+++ b/spec/system/image_grid_carousel_spec.rb@@ -84,7 +84,6 @@ describe "Image Carousel" doendit "allows changing modes in the rich text editor", js: true do- SiteSetting.rich_editor = trueSiteSetting.post_menu_hidden_items = ""current_user.user_option.update!(composition_mode: 1)