FEATURE: Make experimental hashtag autocomplete default for new sites (#19681)

This feature is stable enough now to make it the default going forward
for new sites. Existing sites that have not yet set enable_experimental_hashtag_autocomplete
to `true` will have it set to `false` for their site settings, which was the old default.

c.f https://meta.discourse.org/t/hashtags-are-getting-a-makeover/248866
This commit is contained in:
Martin Brennan
2023-01-05 08:44:58 +10:00
committed by GitHub
parent 16b9165630
commit c2013865d7
3 changed files with 20 additions and 2 deletions

View File

@@ -8,7 +8,10 @@ import { test } from "qunit";
acceptance("Category and Tag Hashtags", function (needs) { acceptance("Category and Tag Hashtags", function (needs) {
needs.user(); needs.user();
needs.settings({ tagging_enabled: true }); needs.settings({
tagging_enabled: true,
enable_experimental_hashtag_autocomplete: false,
});
needs.pretender((server, helper) => { needs.pretender((server, helper) => {
server.get("/hashtags", () => { server.get("/hashtags", () => {
return helper.response({ return helper.response({

View File

@@ -2035,7 +2035,7 @@ developer:
default: true default: true
client: true client: true
enable_experimental_hashtag_autocomplete: enable_experimental_hashtag_autocomplete:
default: false default: true
client: true client: true
experimental_hashtag_search_result_limit: experimental_hashtag_search_result_limit:
default: 20 default: 20

View File

@@ -0,0 +1,15 @@
# frozen_string_literal: true
class MakeExperimentalHashtagFeatureDefaultForNewSites < ActiveRecord::Migration[7.0]
def up
execute(<<~SQL)
INSERT INTO site_settings (name, data_type, value, created_at, updated_at)
VALUES ('enable_experimental_hashtag_autocomplete', 5, 'f', now(), now())
ON CONFLICT DO NOTHING
SQL
end
def down
raise ActiveRecord::IrreversibleMigration
end
end