Commit Graph

59687 Commits

Author SHA1 Message Date
fe30ffa3f9 DEV: Remove 'experimental' prefix from settings (#33233)
This PR takes the localization features out of "experimental" to prep
for the announcement
- rename settings and gives them its own area
- `experimental_content_localization` to `content_localization_enabled`
- `experimental_content_localization_allowed_groups` to
`content_localization_allowed_groups`
- `experimental_content_localization_supported_locales` to
`content_localization_supported_locales`
- `experimental_anon_language_switcher` to
`content_localization_anon_language_switcher`
- migration
- related to https://github.com/discourse/discourse-ai/pull/1439

| screenshot 📸 |
|---|
| <img width="964" alt="Screenshot 2025-06-17 at 5 06 32 PM"
src="https://github.com/user-attachments/assets/9a8b2c38-c846-4fc9-8ddd-815c45cc3d0e"
/> |
2025-06-19 12:23:42 +08:00
eefcbb554d DEV: Add outlet wrapper for post avatar flair (#33265)
This adds an outlet wrapper for post avatar flair to keep in line with 
the existing pattern we see with user card and profile avatar flair.
2025-06-18 20:29:40 -07:00
8cc009ceeb Build(deps-dev): Bump puppeteer-core from 24.10.1 to 24.10.2 (#33256)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from
24.10.1 to 24.10.2.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
-
[Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v24.10.1...puppeteer-core-v24.10.2)

---------

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-06-19 00:44:12 +02:00
473347eccb UX: add labels and update title of insert link modal (#33252)
Adds input labels, updates placeholders, and updates the modal title for
the insert/edit link modal.

**Before**

![image](https://github.com/user-attachments/assets/2fc40d54-8936-426e-81e2-ceea7dcd5249)


**After**

![image](https://github.com/user-attachments/assets/31b772de-e755-411d-b1e4-7014af0a8847)
2025-06-18 17:20:06 -03:00
8cf5585cc2 DEV: allows to disable ancestorScroll on float-kit (#33251)
Usage:

```gjs
<DMenu @updateOnScroll={{false}} />
```

https://floating-ui.com/docs/autoUpdate#ancestorscroll

No test as it's hard to test a scrolling behavior.
2025-06-18 18:16:20 +02:00
daa77feb73 UX: fix rich editor link toolbar misalignment (#33249)
Fixes a misalignment in the link toolbar caused by `DButton`'s zero
width space for icon-only buttons.

Also removes the horizontal margin of the toolbar separator, that was
causing an odd misalignment impression unnecessarily.

**Before**

![image](https://github.com/user-attachments/assets/b68b1199-5ce4-46fb-a7b2-eeb2439e4f80)


**After**

![image](https://github.com/user-attachments/assets/1776dda7-9205-4f8c-840e-764fcd4695e7)
2025-06-18 11:13:37 -03:00
15a491d2d0 FEATURE: add emojis to seeded categories (#33248)
This change adds some flair to the default seeded categories by adding
emojis for new sites.
2025-06-18 17:25:12 +04:00
76017950ab Build(deps-dev): Bump jsuites from 5.10.0 to 5.11.0 (#33241)
Bumps [jsuites](https://github.com/jsuites/jsuites) from 5.10.0 to
5.11.0.
- [Release notes](https://github.com/jsuites/jsuites/releases)
-
[Changelog](https://github.com/jsuites/jsuites/blob/master/changelog.md)
- [Commits](https://github.com/jsuites/jsuites/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 15:20:19 +02:00
ea56480681 Build(deps-dev): Bump ember-cli from 6.4.0 to 6.5.0 (#33223)
Bumps [ember-cli](https://github.com/ember-cli/ember-cli) from 6.4.0 to
6.5.0.
- [Release notes](https://github.com/ember-cli/ember-cli/releases)
-
[Changelog](https://github.com/ember-cli/ember-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ember-cli/ember-cli/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-06-18 15:18:08 +02:00
4f2a8d39da FIX: correctly refreshes associated fields after update (#33246)
The `on_update` callback of triggers is called with previous fields and
new fields, values. However since a recent change:
https://github.com/discourse/discourse/pull/32810 this relationship is
cached and would cause previous fields to equal new fields. This commit
ensures we are refreshing the relationship before calling the
`on_update` callback.
2025-06-18 14:01:09 +02:00
b76931cd57 Build(deps): Bump postcss from 8.5.5 to 8.5.6 (#33224)
Bumps [postcss](https://github.com/postcss/postcss) from 8.5.5 to 8.5.6.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.5.5...8.5.6)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 11:17:20 +02:00
11e498f9f9 Build(deps): Bump redis-client from 0.24.0 to 0.25.0 (#33243)
Bumps [redis-client](https://github.com/redis-rb/redis-client) from
0.24.0 to 0.25.0.
-
[Changelog](https://github.com/redis-rb/redis-client/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/redis-rb/redis-client/compare/v0.24.0...v0.25.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 10:26:02 +02:00
15937ff736 Build(deps-dev): Bump rubocop from 1.76.1 to 1.76.2 (#33242)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.76.1 to
1.76.2.
- [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.76.1...v1.76.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 10:25:17 +02:00
0bfa48c7f6 Build(deps): Bump terser from 5.42.0 to 5.43.0 (#33240)
Bumps [terser](https://github.com/terser/terser) from 5.42.0 to 5.43.0.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.42.0...v5.43.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 10:25:05 +02:00
12787b1baf Build(deps-dev): Bump mime-types-data from 3.2025.0610 to 3.2025.0617 (#33244)
Bumps [mime-types-data](https://github.com/mime-types/mime-types-data)
from 3.2025.0610 to 3.2025.0617.
-
[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.0610...v3.2025.0617)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 10:19:33 +02:00
b1833b6473 FIX: Incorrect key being used in S3Helper#upsert_tag (#33245)
This is a follow up to b02bc707dec12c607511d4a95c7d791f63131b49 where
the `S3Helper#upsert_tag` method was introduced. Using the method
resulted in an error being thrown because the key was incorrect.
2025-06-18 14:08:56 +08:00
9a3225681a DEV: Update link to comment in robots.txt as 'allow' is allowed (#33227)
The old link http://www.robotstxt.org/robotstxt.html seems to indicate
that `allow` is not allowed.
2025-06-18 13:30:26 +08:00
0b6155a8d8 Update translations (#33235) 2025-06-17 23:07:42 +02:00
91d697cfab UX: fix toolbar tooltip regression (#33237)
Fixes regression added on
https://github.com/discourse/discourse/pull/33228


![image](https://github.com/user-attachments/assets/4288046c-e749-4a3c-a227-e6c75213c2d9)
2025-06-17 11:19:48 -03:00
6e22f8fac8 DEV: Remove generic exception in model step in services
Currently when a model is not found, we raise an `ArgumentError`
exception and that exception is stored in the resulting context object.

However, since we’re also storing unexpected exceptions, this default
exception can pollute the context object when we need to inspect it or
act on it.

This patch addresses that issue by raising a custom exception instead,
and we then discard it from the context object.
2025-06-17 16:12:28 +02:00
d45ebd746c DEV: Add Discourse ID authenticator (#33186)
Adds a Discourse ID authenticator. Not available for use in production
just yet, but soon communities will be able to use this service to let
users authenticate using a central Discourse ID account.

Includes a support for a `/revoke` action, allowing users to log out of
multiple client instances from a central auth service.

Internal ticket: t/155397
---------

Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-06-17 09:47:00 -04:00
2362bf740d UX: strip base url and https/mailto protocol from link toolbar (#33228)
Strips the site's base URL and `https`/`mailto` protocols from the link
toolbar display


![image](https://github.com/user-attachments/assets/9a38c840-63bb-4a74-a210-f66dd56766cf)

Refactors the toolbar to use getters instead of function calls, re-uses
`DButton` for the `href` toolbar item instead of a custom `a` tag, fixes
a bug where we passed a translated string to DButton's `label` that
expects a i18n key, and adds support to “disabled” buttons.

Slightly simplifies the toolbar implementation by extracting one step of
indirection removing `toolbarButton` from d-editor.
2025-06-17 10:41:19 -03:00
aab7b9fc68 DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
342e9208b3 FIX: Upload#update_secure_status not updating s3 access control (#33232)
This commit is a follow-up to b02bc707dec12c607511d4a95c7d791f63131b49
where `Upload#update_secure_status` does not call
`FileStore::S3Store#update_upload_access_control` if
`s3_use_acls` is disabled. This is no longer correct as an upload's
access control on S3 can now be based on tags if the
`s3_enable_access_control_tags` site setting is
enabled.

To fix this, this commit removes the `s3_use_acls` check in
`Upload#update_secure_status` and updates
`FileStore::S3Store#default_s3_options`
to not set the `acl` option if the `s3_use_acls` site setting is
disabled.
2025-06-17 16:28:36 +08:00
cb7d26fae5 DEV: change experimental_system_themes setting to list (#33230)
Before it was Boolean. 
The list is giving more control over which system themes should be
displayed.
2025-06-17 15:41:19 +08:00
da1de52a06 FIX: Wrong argument error in FileStore::S3Store#update_access_control (#33231)
This commit is a follow up to b02bc707dec12c607511d4a95c7d791f63131b49.
When the `s3_enable_access_control_tags` site setting is enabled,
calling `FileStore::S3Store#update_access_control` will result in a
argument error.
2025-06-17 15:18:14 +08:00
1a2b003d35 FIX: import Horizon system theme (#33229)
System themes were introduced here -
https://github.com/discourse/discourse/pull/32681

In this PR, Horizon is imported.
2025-06-17 14:03:38 +08:00
c00c522530 DEV: Adds hasNoPreferredMode to chat state manager (#33213)
This commit introduces a new property `hasNoPreferredMode` to the
chat state manager, which represents a user who has not purposely
set chat mode to drawer or full page, meaning they have no LocalStorage
value set.

This can be useful for themes to change the chat mode but only
if the user has no preference already.

c.f.
https://meta.discourse.org/t/full-screen-chat-as-default-for-collaboration-setup/369849
2025-06-17 13:22:42 +10:00
6ea31d32f0 DEV: Fix lograg logger and log_level not following rails log_level (#33218)
Before this change, we were relying on the `lograge`'s gem default
`log_level` of `info`. However, `lograge` should be following
`Rails.application.config.log_level` instead and this commits seeks to
correct that behaviour.
2025-06-17 09:59:58 +08:00
c5a38d3c2e Build(deps-dev): Bump lefthook from 1.11.13 to 1.11.14 (#33225)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.11.13
to 1.11.14.
- [Release notes](https://github.com/evilmartians/lefthook/releases)
-
[Changelog](https://github.com/evilmartians/lefthook/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/evilmartians/lefthook/compare/v1.11.13...v1.11.14)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 09:34:58 +08:00
6c049af5c4 FIX: ignore SiteSetting.max_image_size_kb for theme screenshots (#33215)
Theme screenshots have their validations:
https://github.com/discourse/discourse/blob/main/lib/theme_screenshots_handler.rb#L4

Therefore, validations in `UploadCreator` can be ignored. Currently, the
import of system themes is crashing when the value is too low for
`SiteSetting.max_image_size_kb` .
2025-06-17 08:58:37 +08:00
c84e1abd03 UX: reload the page when the default theme is changed (#33217)
When the default theme is changed, reload the page to present new theme
to the admin.


https://github.com/user-attachments/assets/d127ea36-6960-419e-820e-265321dad0cd
2025-06-17 08:58:27 +08:00
a513a1cfb7 UX: Make the theme title fully clickable + accessible (#33205)
### What I changed

- Wrapped the theme title and the pencil icon in a single `DButton` so
the whole thing is clickable
- Added ARIA stuff: heading role, level, and label to help screen
readers know it’s both a title and editable

### Why

Changed it so the entire title acts as the edit trigger, instead of just
the icon.

[Kapture 2025-06-13 at
16.34.12.webm](https://github.com/user-attachments/assets/c44049a0-bfd0-455a-94a3-fe9ec4d387ff)
2025-06-16 16:51:44 -06:00
2364d3ccd0 DEV: Add an InterpolatedTranslation component. (#33082)
A new `<InterpolatedTranslation>` component for interpolating components into translatable strings.

This change also includes a little bit of refactoring in the `i18n` library to make it easier to hook into.
2025-06-17 07:52:06 +10:00
81b851824f FIX: rich editor mention case sensitivity (#33222)
Ensures we match user names and group names with case insensitivity.
2025-06-16 17:50:31 -03:00
47287c888d DEV: updates discourse-emojis to 1.0.41 (#33220)
This will improve support for emojis with diacritics like piñata and côte d'ivoire:

-
8cb7010842
-
5ff5c72aa2
2025-06-16 20:01:06 +02:00
fb9343891c DEV: Rename codemodded class names (#33198) 2025-06-16 16:31:57 +02:00
c222627313 DEV: Allow using %{base_path} in theme setting descriptions (#33180)
This brings them in line with site setting descriptions
2025-06-16 15:04:00 +01:00
0c6c8e9ec7 FEATURE: add plugin outlet to category settings images tab (#33155)
Allows plugins and themes to inject custom content or UI extensions
specifically for the image settings of each category.
2025-06-16 14:55:36 +01:00
b63d5121d6 Build(deps-dev): Bump @swc/core from 1.12.0 to 1.12.1 (#33211) 2025-06-16 15:50:23 +02:00
2f6ac0ec2f Build(deps): Bump faraday-net_http from 3.4.0 to 3.4.1 (#33212) 2025-06-16 15:48:29 +02:00
4269eaf4d5 Build(deps-dev): Bump sinon from 20.0.0 to 21.0.0 (#33210) 2025-06-16 15:47:49 +02:00
b2f0dc7c72 FIX: make mentions autocomplete search prioritise exact matches for groups more (#33195)
The current way mentions are prioritised when trying to autocomplete
(with the `@` character in composer and some other search interfaces),
it's fairly easy for the list of suggestions to get crowded out by
seemingly unrelated suggestions as users that match on metadata are
prioritised in front of all groups.

The existing order of prioritisation:
1. All users that match (even partially) on usernames, names, metadata
2. Emails
3. Groups

This PR changes the order of prioritisation to favour the following in
order:
1. Exact match on User usernames
5. Exact match on Group names
6. Emails (this is kind of a special case, we don’t allow the ‘@’
character in usernames or group names anyway, but we do want to include
it here to easily adhere to the suggestion list limit)
7. Partial match on User usernames
8. Partial match on Group names
9. Exact match on User names
10. Partial match on User names
11. Users with matching metadata

Previously, a mention autocomplete with no matching entities would at
minimum return groups viewable by the user, this change also removes
that so it's a stricter autocomplete.
2025-06-16 16:38:13 +08:00
16f555b477 DEV: simplify composer mentions plugin code (#33174)
We recently added validation for mentions in rich text editor mode of
composer in #32879.

In an effort to eliminate potential edge cases for non-text nodes, I
have restored the input rules and simplified the approach used in the
plugin code.

This change means that Instead of finding and inserting mention nodes
within text while the user is typing, we let the input rules handle the
mention node creation part. This allows the plugin code to focus
entirely on validating nodes within the document.

As part of this change we introduced a new data attribute ("data-valid")
which will assume by default that mentions are valid and therefore be
"true", but will proceed to invalidate them by changing to false for
mentions that were not found. It also means that invalid mentions are
retained as mention nodes, whereas previously we would convert them to
text.
2025-06-16 11:58:12 +04:00
21182883ef FIX: Multiple video uploads in composer failed (#33216)
When uploading > 1 video in the composer, any upload after
the first one would fail silently, and not show anything in
the composer.

This was happening because we were removing uploads before the video
thumbnail callback was fired, but that had code like this `if
(this.#inProgressUploads.length === 0) { this.#reset() }`, which meant
that before the second upload was completely done we were resetting the
state.

Instead, we can remove the in progress upload file inside the video
thumbnail callback, which will ensure that the state is not reset
until all uploads are done.
2025-06-16 17:32:14 +10:00
b02bc707de DEV: Add setting to tag s3 objects enabling tag based access control policies (#32988)
This commit introduces a `s3_enable_access_control_tags` site setting
which,
when enabled, adds a `discourse:acl` tag with values `public` or
`private` to
S3 objects created by the application. The presence of the tags on S3
objects
enables bucket administrators to implement tag-based access control
policies, providing an alternative to
object ACLs which AWS now discourages.

The `discourse:acl` tag can be customized via the
`s3_access_control_tag_key ` site setting.
Values for `public` and `private` can also be customized via the
`s3_access_control_tag_public_value` and
`s3_access_control_tag_private_value ` site settings respectively.

### Reviewer Notes

To test it locally, run the following commands in your working discourse
directory:

1. `script/install_minio_binaries.rb`
2. Start a local minio server by running: `bundle exec rails runner
script/local_minio_s3.rb`
3. bundle exec rails runner "SiteSetting.enable_s3_uploads = true"
5. Start your development rails server with the following environment
variables: `DISCOURSE_ENABLE_S3_UPLOADS=true
DISCOURSE_S3_ENABLE_ACCESS_CONTROL_TAGS=true
DISCOURSE_BACKUP_LOCATION=s3`
2025-06-16 13:26:18 +08:00
7dd1b170fa DEV: Add new color palette page to admin sidebar navigation (#33214)
This commit makes the "Color palettes" link in the admin sidebar points to
the new color palettes page at `/admin/config/colors` instead of the
legacy one `/admin/customize/colors` if the experimental feature flag
for the improved color palette system is enabled.
2025-06-16 08:15:15 +03:00
862116a176 FEATURE: Add description to invites (#33207)
Add the ability to attach a description to an invite for easier organization.
2025-06-16 11:31:07 +08:00
b3894e8728 DEV: Change admin site settings filter to be route based (#33167)
The filtering is currently being done in the controller. This leads to weird things where the filter loop might already be initiated and we get double filtering, as well as the issue that we can't abort like we could with a route transition.

After this change we:

- Cache the site settings fetched from the server in the route instance.
- Hook up the controller to the query params.
- Use the query params to filter the model in the route.
2025-06-16 11:20:38 +08:00
290b435a72 FIX: Admin can edit the name even if enable_names is disabled (#33170)
There is a bug that when `SiteSetting.enable_names` is disabled, the
admin can click the pencil next to the user and successfully update the
name. However, the change is not saved as the action is blocked by the
guardian.

Meta:
https://meta.discourse.org/t/disabling-enable-names-makes-admin-act-strange/291912
2025-06-16 09:24:17 +08:00