Commit Graph

58395 Commits

Author SHA1 Message Date
d1a8ed1beb FEATURE: add horizontal_rule rich editor input rule (#31788)
Adds support to typing `---`, `___` or `***` to create a horizontal
rule.

Converting when typing `---` is actually written here as an en-dash +
`-`, because the typographer replacements extension turns `--` into an
en-dash first.

`___` and `***` are only triggered after a whitespace, because they
could also mean bold+italic.
2025-03-12 22:45:10 -03:00
6820622467 DEV: Add protection for migrations that creates index concurrently (#31763)
This commit updates `Migration::SafeMigrate` to protect against unsafe
ways of adding a Postgres index concurrently.

Per postgres documentation:

If a problem arises while scanning the table, such as a deadlock or a
uniqueness violation in a unique index,
the CREATE INDEX command will fail but leave behind an "invalid" index.
This index will be ignored for querying
purposes because it might be incomplete; however it will still consume
update overhead. The recommended recovery
method in such cases is to drop the index and try again to perform
CREATE INDEX CONCURRENTLY .

Therefore, the simplest way for us to ensure that migrations that create
indexes concurrently are idempotent is to follow postgres'
recommendation of dropping the index first before trying to create the
index concurrently.
2025-03-13 09:34:14 +08:00
962bdf3697 FIX: use virtualElementFromTextRange on emoji autocomplete more (#31783)
There's no `textarea` with the rich editor, so being `undefined` it
fails with a `TypeError: Cannot read properties of undefined (reading
'id')`.

This has the same behavior with the textarea editor but works much
better (positioning closer to the caret) with the rich editor.
2025-03-12 22:24:40 -03:00
9b692ede96 UX: make an em-dash from en-dash plus hyphen on rich editor (#31787)
As `--` is converted to an en-dash, we need to make an en-dash plus
another `-` into an em-dash.
2025-03-12 22:22:08 -03:00
d1b63e3056 DEV: Delete topic map specs (#31785)
These specs are causing far more flakes and trouble than they are worth,
I think it's just the killer
combination of relying on messagebus and background jobs along with the
specs being quite big. Let's just get rid of them...
2025-03-13 10:51:02 +10:00
159aa43cfe UX: add title and aria-label to md/rich editor toggle (#31784) 2025-03-12 20:53:09 -03:00
ce05f9ece5 Build(deps-dev): Bump @swc/core from 1.11.8 to 1.11.9 (#31781)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.8 to
1.11.9.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/swc-project/swc/compare/v1.11.8...v1.11.9)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 23:31:12 +01:00
85f68623b5 Build(deps-dev): Bump rubocop-capybara from 2.22.0 to 2.22.1 (#31779)
Bumps [rubocop-capybara](https://github.com/rubocop/rubocop-capybara)
from 2.22.0 to 2.22.1.
- [Release notes](https://github.com/rubocop/rubocop-capybara/releases)
-
[Changelog](https://github.com/rubocop/rubocop-capybara/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop-capybara/compare/v2.22.0...v2.22.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 23:06:28 +01:00
d9e86c550d Build(deps): Bump minitest from 5.25.4 to 5.25.5 (#31778)
Bumps [minitest](https://github.com/minitest/minitest) from 5.25.4 to
5.25.5.
-
[Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc)
-
[Commits](https://github.com/minitest/minitest/compare/v5.25.4...v5.25.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 23:06:17 +01:00
935c3dc9a3 Build(deps-dev): Bump @ember/test-waiters from 4.0.0 to 4.1.0 (#31780)
Bumps
[@ember/test-waiters](https://github.com/emberjs/ember-test-waiters)
from 4.0.0 to 4.1.0.
- [Release
notes](https://github.com/emberjs/ember-test-waiters/releases)
-
[Changelog](https://github.com/emberjs/ember-test-waiters/blob/master/CHANGELOG.md)
- [Commits](https://github.com/emberjs/ember-test-waiters/commits)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Discourse CI <ci@ci.invalid>
2025-03-12 23:05:32 +01:00
6a80c6bf43 UX: remove auto-conversion from .. -> … (#31770) 2025-03-12 15:48:38 -03:00
f07ce80583 DEV: discourse-emojis 1.0.38 (#31775)
Removes components emojis (white_hair, curly_hair, red_hair,bald) which
were showing in search.
2025-03-12 19:31:48 +01:00
897b043f01 DEV: Add code comments around oauth user-api-key/new handling (#31774)
Followup to #31759
2025-03-12 14:01:20 -04:00
f2fda8e8b9 Build(deps): Bump json from 2.10.1 to 2.10.2 (#31772)
Bumps [json](https://github.com/ruby/json) from 2.10.1 to 2.10.2.
- [Release notes](https://github.com/ruby/json/releases)
- [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md)
- [Commits](https://github.com/ruby/json/compare/v2.10.1...v2.10.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 18:46:31 +01:00
1f2043de4e DEV: removes code block enter edge case (#31773)
This was causing some confusion and now that we have the chat preference
to send with enter or metakey+enter it's even more confusing.

If your setting is send on enter, you need to use shift+enter for a new
line, even in codeblocks. If your setting is meta+enter you need to use
enter in the codeblock for a new line, meta+enter will send as expected.
2025-03-12 18:01:00 +01:00
38ba191be0 FIX: Ensure auth completes correctly when going via /user-api-key/new for new users (#31759)
A new user joining a community via DiscourseHub and logging in via oauth
goes through this process. This would break down for two reasons.

Reason 1: in some cases, especially on Safari mobile, the redirect in
the omniauth callback was happening too early. A new user may not be
signed in yet by that point, which means the redirect to
`/user-api-key/new` triggers a redirect to `/login` which ends up in a
bit of an infinite loop. Not all browsers exhibited this behaviour, but
Safari definitely did.

Reason 2: `/user-api-key/new` is gated via group membership using the
`user_api_key_allowed_groups` site setting. By default that is set to
include `trust_level_0`, however, auto group assignment wasn't taking
place for all user `create` events (only some that go through staged
users).
2025-03-12 11:58:59 -04:00
9bb4257810 UX: Remove forced block display in dmenu (#31768) 2025-03-12 15:19:00 +01:00
25e8b5af9f FEATURE: Introduce new color palettes config area (#31742)
As part of the theme/color palette overhaul project, we're introducing a
new admin page for editing color palettes. The new page is located at
`/admin/config/colors/:id`. It's linked from anywhere, but it will be
linked in the sidebar as we progress more in the overhaul project.

Related PRs: https://github.com/discourse/discourse/pull/30893
https://github.com/discourse/discourse/pull/30915
https://github.com/discourse/discourse/pull/31328.

Internal topic: t/148628.
2025-03-12 16:57:31 +03:00
69fa96df21 FIX: Add metadata to /hot RSS feed (#31766)
Some RSS readers require metadata to be present.
2025-03-12 08:56:22 -04:00
1cb940b113 DEV: replace UserFieldsValidation mixin with helper class (#31670)
This PR refactors the UserFieldsValidation mixin into a helper class.

### Key Changes
* moved this.userFields to a tracked collection of TrackedUserFields
stored on the helper class itself
* introduced `validationVisible` property to explicitly control when to
display the validation result, we expect the helper to not display
validation until form submission in the `SignupController` and
`CreateAccount` components.
* added backward compatibility to the plugin API
`addCustomUserFieldValidationCallback` to ensure ex-Core instances of
the mixin continues working till we remove them
2025-03-12 20:50:53 +08:00
b56816ad70 Build(deps): Bump the babel group with 2 updates (#31757)
Bumps the babel group with 2 updates:
[@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core)
and
[@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/core` from 7.26.9 to 7.26.10
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-core)

Updates `@babel/standalone` from 7.26.9 to 7.26.10
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-standalone)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 12:11:17 +01:00
36c9d75f19 Build(deps-dev): Bump @embroider/core from 3.5.2 to 3.5.3 in the embroider group (#31735)
Bumps the embroider group with 1 update:
[@embroider/core](https://github.com/embroider-build/embroider/tree/HEAD/packages/core).


Updates `@embroider/core` from 3.5.2 to 3.5.3
- [Release notes](https://github.com/embroider-build/embroider/releases)
-
[Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/core)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Discourse CI <ci@ci.invalid>
2025-03-12 11:53:01 +01:00
46c721305e DEV: [gjs-codemod] add codemod commit to git-blame-ignore-revs 2025-03-12 08:54:28 +00:00
1d0d7ddbb5 DEV: [gjs-codemod] convert first batch of files to gjs
Updated using `@embroider/template-tag-codemod`, plus some manual fixups.

Co-authored-by: Jarek Radosz <jarek@cvx.dev>
2025-03-12 08:54:04 +00:00
ca2f974f38 DEV: [gjs-codemod] merge js and hbs 2025-03-12 08:49:36 +00:00
a4fce08c7c DEV: [gjs-codemod] renamed hbs to gjs 2025-03-12 08:49:14 +00:00
7f3f4af12f DEV: [gjs-codemod] renamed js to gjs 2025-03-12 08:49:03 +00:00
d5e8a77b37 DEV: Fix flaky custom sidebar sections system spec (#31767) 2025-03-12 16:12:16 +08:00
5ddae1c574 DEV: Rerun AddIndexToPostStatComposerColumns migration (#31765)
The previous version of the migration is not idempotent and can result
in indexes created but marked as "invalid" by Postgres.

Per postgres documentation:

If a problem arises while scanning the table, such as a deadlock or a
uniqueness violation in a unique index,
the CREATE INDEX command will fail but leave behind an "invalid" index.
This index will be ignored for querying
purposes because it might be incomplete; however it will still consume
update overhead. The recommended recovery
  method in such cases is to drop the index and try again to perform
  CREATE INDEX CONCURRENTLY.
2025-03-12 11:49:51 +08:00
cf4d80d0b3 FIX: Notification email CTA by system user (#31726)
Followup https://github.com/discourse/discourse/pull/31505/

When sending notification emails for system user responses for PMs,
we removed the part of the CTA where it says "to respond to xyz" in a
previous commit.

This commit takes it slightly further -- we now only show a "Visit
Topic"
or "Visit Message" button if the PM notification is from a system user,
it's a bit cleaner.

This commit also adds more in-depth tests, and refactors the message
builder a little.
2025-03-12 13:49:12 +10:00
6e1954aa41 DEV: Try improve flaky topic map specs (#31764) 2025-03-12 13:24:18 +10:00
623f02aff6 FEATURE: add details (plugin) rich editor extension (#31718)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds `details` and `summary` nodes, parsers, and serializers, and a
click handler to toggle the `open` attribute.

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2025-03-11 20:15:32 -03:00
968b851c1b FEATURE: add spoiler (plugin) rich editor extension (#31717)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds `spoiler` and `inline_spoiler` nodes, parsers, and serializers, and
a click handler to toggle its blurriness in the editor.
2025-03-11 20:13:52 -03:00
7e23096d5e FEATURE: add check (plugin) rich editor extension (#31716)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `check` node, parser, and serializer, and an input rule to
convert when typing `[]`/`[ ]`/`[x]`
2025-03-11 20:13:44 -03:00
049e65ffe2 FEATURE: add poll (plugin) rich editor extension (#31715)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `poll` node, parser, and serializer.
2025-03-11 20:13:27 -03:00
d1870d4811 FEATURE: add local-dates (plugin) rich editor extension (#31714)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds `local_date` and `local_date_range` nodes, parsers, and
serializers.
2025-03-11 20:13:09 -03:00
d56e69e7c0 FEATURE: add trailing-paragraph rich editor extension (#31713)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a plugin to enforce an empty trailing paragraph.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-03-11 20:12:31 -03:00
c9518f2384 FEATURE: add onebox rich editor extension (#31691)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `onebox` and an `onebox_inline` node spec, their serializers, and
a plugin that automatically converts links to oneboxes.
2025-03-11 20:09:33 -03:00
b461c5f7a7 FIX: When testing multiple flagged words, ensure test matches expected word order. (#31758)
This fixes a flaky test, where the generated flagged words would sometimes not be in alphabetical order.
2025-03-12 09:45:44 +11:00
b4f9626984 DEV: allow render-tags to pass classes so we can use it in the history modal (#31755) 2025-03-11 17:34:04 -04:00
0a31aaa9e3 UX: restore CSS tag comma separator for Discourse oneboxes (#31756)
This is a follow-up to 55a3a4e, this restores the tag separator using
CSS — core's tags are no longer separated this way but it's necessary in
the Discourse oneboxes

Before:

![image](https://github.com/user-attachments/assets/d2cce1de-58df-49f3-93df-25aa26b89500)


After:

![image](https://github.com/user-attachments/assets/9a6dc82f-c82e-4c91-b695-2f855c0661b6)
2025-03-11 16:03:33 -04:00
e6034af1ba DEV: more resilient email change spec (#31754)
This might not reduce the failures to zero but some screenshots of the
failures clearly show we were still on the success message page.

Same fix than: https://github.com/discourse/discourse/pull/31750
2025-03-11 18:48:11 +01:00
b5ad4425e0 FIX: Limit referrerUrl redirect to topic URLs (#31751)
This should avoid unwanted early redirects from other routes (like the
user api key routes).
2025-03-11 13:33:09 -04:00
0c203f7689 DEV: more resilient homepage spec (#31753)
I suspect that sometimes the button was still not disabled yet when we
where checking for it. Checking for saved confirmation should be more
resilient.
2025-03-11 18:29:19 +01:00
d3c68ef1a7 Update translations (#31747) 2025-03-11 17:47:42 +01:00
31b621bfda DEV: more resilient email change spec (#31750)
This might not reduce the failures to zero but some screenshots of the
failures clearly show we were still on the success message page.
2025-03-11 17:44:03 +01:00
4433a72083 DEV: attempts to fix flakey drawer spec (#31749)
The setup was happening after the page has loaded which could lead to
inconsistent results.
2025-03-11 14:57:35 +01:00
14fe567bc6 DEV: Remove the symlinking message (#31745)
we don't need it at all
2025-03-11 13:36:35 +01:00
5d09300867 DEV: Fix stylelint violations (#31744)
Followup to 95922fe96b94df0e0887c71edd8e224b97446965
2025-03-11 12:32:38 +01:00
18c46ab0e8 DEV: Fix flaky signup spec (#31743)
- Remove `wait: 0` and base flow on site setting instead
- Ensure full-page-login has actually opened before running `go_back` -
otherwise we'll end up going back to `about:blank`
2025-03-11 10:56:59 +00:00