Commit Graph

59559 Commits

Author SHA1 Message Date
27227c9ece DEV: Simplify CORS logic for public asset routes (#33106)
Previously we would check the request for a matching CDN hostname before
applying the `Access-Control-Allow-Origin` header. That logic requires
the CDN to include its public-facing hostname in the `Host` header,
which is not always the case.

Since we are only running this `apply_cdn_headers` before_action on
publicly-accessible asset routes, we can simplify things so that the
`Access-Control-Allow-Origin: *` header is always included. That will
make CDN config requirements much more relaxed.

At the moment, this is primarily relevant to the HighlightJsController
routes, which are loaded using native JS `type=module`. But in the near
future, we plan to expand our use of `type=module` to more critical JS
assets like translations and themes.

Also drops the `Access-Control-Allow-Methods` header from these
responses. That isn't needed for `GET` and `HEAD` requests.
2025-06-09 08:58:27 +01:00
b1d4db17e3 Bump version to v3.5.0.beta7-dev 2025-06-09 12:19:57 +08:00
189e1361e1 Bump version to v3.5.0.beta6 v3.5.0.beta6 2025-06-09 12:19:56 +08:00
232f220546 UX: add * mention to site setting description 2025-06-09 12:04:15 +08:00
aa6d0bb685 SECURITY: Respect max length in bot-human PMs
…and work around long-url parsing issue.
2025-06-09 12:04:11 +08:00
Nat
72e224b762 SECURITY: Escape topic title for mailers 2025-06-09 12:04:06 +08:00
ff1f2ee0a0 FIX: Wrong link to groups in post-small-action widget (#33099) 2025-06-09 09:08:56 +08:00
a12a78dc6d Build(deps): Bump rbtrace from 0.5.1 to 0.5.2 (#33115)
Bumps [rbtrace](https://github.com/tmm1/rbtrace) from 0.5.1 to 0.5.2.
- [Changelog](https://github.com/tmm1/rbtrace/blob/master/CHANGELOG)
- [Commits](https://github.com/tmm1/rbtrace/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-09 09:08:03 +08:00
2d6e24689c Build(deps-dev): Bump rubocop-ast from 1.45.0 to 1.45.1 (#33116)
Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.45.0
to 1.45.1.
- [Release notes](https://github.com/rubocop/rubocop-ast/releases)
-
[Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop-ast/compare/v1.45.0...v1.45.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-09 09:07:37 +08:00
0971556058 FIX: Do not show header search icon if welcome banner search shown (#33098)
This brings the search_icon header search mode to parity with the
search_field mode. We don't want to show either of these if the welcome
banner is showing, since it has a search field, this is redundant.

If you scroll the page and the welcome banner is hidden, then we
show the header search icon.

This commit also cleans up some code related to the page-search
shortcut, which we no longer use, including limiting showing search
on topic only if there are > 20 posts.
2025-06-09 09:17:13 +10:00
43e41cea44 Build(deps-dev): Bump @swc/core from 1.11.29 to 1.11.31 (#33091)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.29 to
1.11.31.
- [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.29...v1.11.31)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-07 17:01:47 +02:00
6608c0958c Build(deps): Bump terser from 5.40.0 to 5.41.0 (#33090)
Bumps [terser](https://github.com/terser/terser) from 5.40.0 to 5.41.0.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.40.0...v5.41.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-07 14:46:10 +02:00
a867a8fe1b Build(deps): Bump @babel/standalone from 7.27.5 to 7.27.6 in the babel group (#33089)
Bumps the babel group with 1 update:
[@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/standalone` from 7.27.5 to 7.27.6
- [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.27.6/packages/babel-standalone)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-07 14:45:53 +02:00
623cde985b FIX: Wrap theme translations in IIFE (#33108)
Without this wrapper, `data` is defined in the global scope and clashes
when there are multiple themes with translations.

Followup to 033cccdf17a56b43f9f243bb549abe0a41a0de63

We can remove the wrapper once we land
https://github.com/discourse/discourse/pull/33107
2025-06-06 16:40:07 +01:00
033cccdf17 DEV: Simplify theme translation JS generation (#33104)
Theme translations are very simple JS, and do not need to be run through
the theme transpiler. This brings their format in-line with core/plugin
translations.

Extracted from https://github.com/discourse/discourse/pull/33103
2025-06-06 16:00:49 +01:00
6b5dea22f9 DEV: Use canonical hostname for omniauth callbacks (#33102)
In production, the enforce_hostname middleware overwrites the HTTP_HOST
env using `Discourse.base_url_no_prefix`, which takes into account any
configured protocol/hostname/post overrides.

That middleware is not used in development, so if we want omniauth to
respect any host/port overrides, we need to configure the 'full host'
directly.
2025-06-06 15:35:48 +01:00
cb6cc8dcd3 DEV: Drop support for template overrides and mobile-specific templates (#33101)
https://meta.discourse.org/t/355668
2025-06-06 14:34:20 +01:00
1cde45c2b4 DEV: allow custom community sidebar links to pass models for route params (#33070) 2025-06-06 08:28:56 -04:00
14e6124fac UX: only show single composer tip at a time (#33050)
Most composer tips use the "educational" template name but similar
topics uses it's own template. We only allow showing if a tip using the
template name wasn't shown already. So therefore a welcome message (ie.
"educational") could show at the same time as a "similar topics" tip,
which isn't ideal from a UX perspective.

This change prevents overlapping composer tips by only opening the popup
if there are no popups open already. Therefore requiring the user to
close a tip before another different tip type could open.
2025-06-06 15:28:50 +04:00
4fc7e4b1c9 DEV: Fix post highlighting for keyboard navigation in the Glimmer Post Stream (#33097)
This commit fixes displaying the post highlighted when navigating using
the keyboard.

Ember was overriding the direct DOM manipulations, causing the browser
outline to be displayed.
2025-06-06 10:14:35 +01:00
b5711590f9 UX: Add z-index to the admin save all banner (#33093)
### Before

![image](https://github.com/user-attachments/assets/2876d06e-6c01-4e86-871a-5433128b7e25)


### After

![image](https://github.com/user-attachments/assets/c5709398-ff5b-4f8b-ae82-65c077cb2be6)
2025-06-06 17:00:59 +10:00
c8c9504486 DEV: Have about page extra groups depend on groups selected (#33095)
When we ported over the about page extra groups theme component, we used a hidden site setting to control this as per MO.

We don't need this any more. We can simply rely on the presence of any configured groups to decide.
2025-06-06 11:25:59 +08:00
efd01c18cf DEV: Modernize the remaining of the post stream to Glimmer components (#32653)
Co-authored-by: David Taylor <david@taylorhq.com>
2025-06-05 19:48:29 -03:00
417f1d1adc DEV: Add applyValueTransformer to poster name (#33086)
## Changes

This PR adds applyValueTransformer to poster name.
2025-06-05 13:38:37 -05:00
ce9ece434f UX: fix admin reports breadcrumb link (#33085)
`/admin.config.reports` does not exist

Reported here:
https://meta.discourse.org/t/breadcrumb-link-on-admin-reports-returns-404/368982
2025-06-05 09:16:42 -04:00
23eebee825 Build(deps-dev): Bump bullet from 8.0.7 to 8.0.8 (#33081)
Bumps [bullet](https://github.com/flyerhzm/bullet) from 8.0.7 to 8.0.8.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/8.0.7...8.0.8)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-05 10:29:55 +02:00
10f45a0efe DEV: Skip flaky system tests (#33084) 2025-06-05 16:10:02 +08:00
60a3fe41d2 FIX: Disallow encoded words in e-mail addresses (#33083)
RFC 5322 allows special characters, including ? and =, to be used in e-mail addresses.

RFC 2047 is an extension that adds a feature called "encoded words" which let you embed different encodings in the same header. However, it explicitly says that these aren't allowed in e-mail address headers.

Encoded words have the format:

encoded-word = "=?" charset "?" encoding "?" encoded-text "?="
Where encoding is either Q or B, but could take on other values in the future.

After this change we consider e-mail addresses with an encoded word inside invalid.
2025-06-05 12:58:01 +08:00
7021c2f789 Build(deps): Bump cgi from 0.4.2 to 0.5.0 (#33077)
Bumps [cgi](https://github.com/ruby/cgi) from 0.4.2 to 0.5.0.
- [Release notes](https://github.com/ruby/cgi/releases)
- [Commits](https://github.com/ruby/cgi/compare/v0.4.2...v0.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-05 12:34:59 +10:00
c794784138 Build(deps): Bump bigdecimal from 3.2.1 to 3.2.2 (#33078)
Bumps [bigdecimal](https://github.com/ruby/bigdecimal) from 3.2.1 to
3.2.2.
- [Release notes](https://github.com/ruby/bigdecimal/releases)
- [Changelog](https://github.com/ruby/bigdecimal/blob/master/CHANGES.md)
- [Commits](https://github.com/ruby/bigdecimal/compare/v3.2.1...v3.2.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-05 03:07:43 +02:00
1e35efc64a Build(deps-dev): Bump rubocop from 1.75.8 to 1.76.0 (#33079)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.75.8 to
1.76.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
-
[Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop/compare/v1.75.8...v1.76.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-05 03:06:48 +02:00
e5f1240b7f FIX: ensures post toolbar text can't be selected (#33075)
We suspect it might interfere with text selection of posts on android.
2025-06-04 23:34:14 +02:00
60b3a216e9 DEV: Drop fakeweb dependency (#33069)
This was only be `require`'d by one official plugin
(discourse-perspective), but was causing failures in specs of unrelated
plugins. See
https://github.com/discourse/discourse-perspective-api/pull/110
2025-06-04 14:29:25 +01:00
12811524fe DEV: Support 'cors origins' site setting for message-bus (#33066)
Discourse message-bus traffic is not considered a 'public api' for
general consumption. However, it does make sense to have consistency
with the CORS behavior of the rest of the app, so that people can use it
at their own risk.
2025-06-04 14:22:15 +01:00
f66339338e A11Y: SVG icons should be hidden unless a label is provided (#33059)
This is fairly minor because usually SVGs aren't focusable, but this
adds `aria-hidden='true'` to all SVGs by default unless either an
`aria-label` or `label` is provided. This gets reported to us in
automated tests from time to time.

So now:

1. SVG: `aria-hidden="true"` (new behavior, safe default when no label
is provided)
2. SVG with `label` param: `aria-hidden="true"` and `sr-only` label is
provided
3. SVG with `aria-label` param: `aria-hidden="false"` and `aria-label`
is provided
2025-06-04 08:21:36 -04:00
1633d7788a UX: keep marks when using emoji input rules on rich editor (#33058)
When typing `:emoji:` or `:)` to create emoji nodes through ProseMirror
inputrules, this PR changes the handler to enforce the use of the
existing marks in the current caret position (if it's a link, bold, etc)
so the newly created emoji is marked with the same marks(s).
2025-06-04 07:18:47 -03:00
72326aad65 Build(deps): Bump ace-builds from 1.41.0 to 1.42.0 (#33063)
Bumps [ace-builds](https://github.com/ajaxorg/ace-builds) from 1.41.0 to
1.42.0.
- [Release notes](https://github.com/ajaxorg/ace-builds/releases)
-
[Changelog](https://github.com/ajaxorg/ace-builds/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/ajaxorg/ace-builds/compare/v1.41.0...v1.42.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-04 12:04:35 +02:00
009d835095 DEV: remove max similar results site setting (#32936)
We phased out the site setting for `max_similar_results` in #32934 -
this change is a follow up migration to delete the site setting from the
database.
2025-06-04 16:41:03 +10:00
7fce724089 FEATURE: Theme-owned color palettes (#32795)
This commit removes the color palette dropdown from the theme page and replaces it with a new "Colors" tab where the theme's color palette can be edited directly in that tab on the theme page. With this change, a theme's color palette is strongly tied to its theme and can't be linked to other themes and it can't be selected by users without using the theme as well.

All of the changes are behind a feature flag. To enable it, turn on the `use_overhauled_theme_color_palette` setting.

Co-authored-by: Ella <ella.estigoy@gmail.com>
2025-06-04 07:47:58 +03:00
a5d6e6ae4d FIX: Respect category/tag filtering for reviewable webhooks (#33051)
Currently, if you configure a webhook with reviewable events and apply
categories/tags filtering, no webhook gets fired for reviewable events.
This is because when we schedule the `EmitWebHookEvent` job, we don't
pass to it the reviewable's category or tags, making it seem like the
reviewable doesn't belong to the filtering category/tags that webhook
specifies.
2025-06-04 10:42:23 +08:00
631d2e3369 FIX: Exclude reviewable_notes from intermediate DB schema (#33068) 2025-06-04 10:31:28 +08:00
4e4ff41d19 FIX: latest duplicated groups to about components (#33003)
When "Add Groups to About" component is duplicated, choose the most
recently updated settings for migration.
2025-06-04 09:48:18 +08:00
727bd5dcfb UX: Add subheader to admin themes page (#32987)
Add subheader with install button to match the Components tab.

Remove the "special" card with the install button from the end of the list.
2025-06-04 09:43:55 +08:00
2eb459116c DEV: Update Bullet to latest version (#32904)
A few minor versions of Bullet were incompatible with Discourse because we use our own content security policy middleware.

This has now been fixed upstream and released in 8.0.7.
2025-06-04 09:40:06 +08:00
1ba8c0dcdc FIX: Back to themes page not working when theme has enabled components (#33048) 2025-06-04 08:59:50 +08:00
599404de31 DEV: Add a ReviewableNote model, and tie it into the Reviewable model. (#33047)
As part of the review queue refresh, we'll be adding the ability for moderators to make notes on individual reviewable items. As a first step, this change adds the new model and associated backend code.
2025-06-04 09:33:02 +10:00
d4644733a5 Build(deps): Bump @babel/standalone from 7.27.4 to 7.27.5 in the babel group (#33062)
Bumps the babel group with 1 update:
[@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/standalone` from 7.27.4 to 7.27.5
- [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.27.5/packages/babel-standalone)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-04 01:07:57 +02:00
246eca1258 Build(deps-dev): Bump rubocop-ast from 1.44.1 to 1.45.0 (#33064)
Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.44.1
to 1.45.0.
- [Release notes](https://github.com/rubocop/rubocop-ast/releases)
-
[Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop-ast/compare/v1.44.1...v1.45.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-04 01:07:35 +02:00
0263336693 Build(deps-dev): Bump mime-types-data from 3.2025.0527 to 3.2025.0603 (#33065)
Bumps [mime-types-data](https://github.com/mime-types/mime-types-data)
from 3.2025.0527 to 3.2025.0603.
-
[Changelog](https://github.com/mime-types/mime-types-data/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/mime-types/mime-types-data/compare/v3.2025.0527...v3.2025.0603)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-04 01:07:24 +02:00
88ce76bd16 DEV: Added the ability to use users' names in group mention notifications and mentions shown in emails (#33055)
**Description**
These changes were introduced in a previous PR but were reverted due to
a bug when several users were mentioned in a response. This PR
reintroduces the changes along with a fix to the issue.

This is part of a series of changes to allow customers to display users'
names instead of the user's username.

When a user belongs to a group that has been mentioned by another user.
It shows the name of the user that mentioned the group.

[Previous
commit](e147d2afe6)

**Before**


![imagen](https://github.com/user-attachments/assets/b62224fb-9b69-4603-be00-e7aa61d9b33c)

**After**


![imagen](https://github.com/user-attachments/assets/8495cb63-6530-4d86-a51c-f0510d48f6c7)

When a email is sent to the user when mentioned in a post 

**Before**



![imagen](https://github.com/user-attachments/assets/94e674da-085a-41cb-8145-ba6fbe3636ce)

**After**


![imagen](https://github.com/user-attachments/assets/490cb365-bf85-4745-93b9-e47048b2f02e)
2025-06-03 15:49:55 -05:00