Commit Graph
61335 Commits
Author SHA1 Message Date
Jarek RadoszandLoïc Guitaut 71834c898f DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-10-06 16:11:01 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 9a0a99b77d Build(deps): Bump @rollup/browser from 4.52.3 to 4.52.4 (#35194)
Bumps [@rollup/browser](https://github.com/rollup/rollup) from 4.52.3 to
4.52.4.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.52.3...v4.52.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 15:29:29 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> d466f8943f Build(deps): Bump rdoc from 6.14.2 to 6.15.0 (#35193)
Bumps [rdoc](https://github.com/ruby/rdoc) from 6.14.2 to 6.15.0.
- [Release notes](https://github.com/ruby/rdoc/releases)
- [Changelog](https://github.com/ruby/rdoc/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rdoc/compare/v6.14.2...v6.15.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 15:29:01 +02:00
dependabot[bot]dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Discourse CI
9b680d8d46 Build(deps): Bump ember-auto-import from 2.10.1 to 2.11.0 (#35195)
Bumps
[ember-auto-import](https://github.com/embroider-build/ember-auto-import/tree/HEAD/packages/ember-auto-import)
from 2.10.1 to 2.11.0.
- [Release
notes](https://github.com/embroider-build/ember-auto-import/releases)
-
[Changelog](https://github.com/embroider-build/ember-auto-import/blob/main/packages/ember-auto-import/CHANGELOG.md)
-
[Commits](https://github.com/embroider-build/ember-auto-import/commits/HEAD/packages/ember-auto-import)

---------

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-10-06 14:33:48 +02:00
Natalie Tay 273c21997a DEV: Move locale check to unified concern (#35207)
Moves the `in_user_locale?` check to the localizable which can be used
by any localized model.

/t/163217, related https://github.com/discourse/discourse/pull/35152
2025-10-06 20:11:52 +08:00
Arpit Jalan 390eaf532e FEATURE: add plugin_modifier to include AI summary in topic view serializer (#35110) 2025-10-06 17:24:01 +05:30
David Taylor 8c2d5f9a35 DEV: Drop plugin-api version handling (#35181)
The version parameter of the JS plugin-api has never really been used
properly. These days, themes and plugins use the
`.discourse-compatibility` system for defining compatibility with core,
and we made the plugin-api version argument optional in
acad83199e.

This commit removes the internal infrastructure which supported the
versioning system. There is no change to the API. Any passed version
numbers will be ignored.
2025-10-06 10:52:47 +01:00
Discourse Translator Bot f5fa4803e4 Update translations (#35208) 2025-10-06 11:26:37 +02:00
Osama Sayegh 7d2256c455 FEATURE: Split setting for allowing mods to manage categories and groups (#35174)
This commit splits the `moderators_manage_categories_and_groups` setting
into 2 separate settings to allow for more precise control over
categories and groups management by moderators.

Internal topic: t/141392.
2025-10-06 10:43:42 +03:00
Alan Guo Xiang Tan 45e80ce6cc DEV: Fix a flaky system test (#35206)
Follow-up to 0bc18fdf78

The `before` hooks were arragned in such a way that we were visiting the
admin user page first before the site setting was updated.
2025-10-06 15:16:25 +08:00
Natalie Tay 58bdb35fab DEV: Add translation specs for navigating across categories (#35152)
These specs are to ensure category names remain translated when
navigating around.

In a future PR there will be a fix for logged in users, where category
names get overridden in the local store due to async requests updating
the category names in store.

1 of 2.

/t/163217
2025-10-06 14:24:12 +08:00
Ted Johansson 3e310cde6e FIX: Ensure a reviewable is created when directly taking action on user (#35198)
In a previous refactor we lost the functionality that creates a reviewable when a moderator immediately takes action on a post and chooses to either silence or suspend a user.
2025-10-06 14:14:44 +08:00
Osama Sayegh a7fb9e1897 FEATURE: Allow editing theme-owned palettes (#34722)
This commit allows editing colors of palettes that are installed with
themes. Prior to this commit, editing colors of theme-owned palettes wasn't
allowed because a theme update could override the edits made by admins
and there was no way to revert edits to the original values. With this
commit, all of that is solved by copying the palette when it's first edited
by an admin, and making future updates to the theme update the original
copy only with the ability for admins to revert to the colors in the
original copy at any time.

Internal topic: t/162130.
2025-10-06 09:02:39 +03:00
small-lovely-cat 43d6193680 FIX: align text display behaviour for user-menu-billing with other buttons (#35200)
This PR is aimed at fixing a visual
mismatch in buttons at user-menu. More context in https://meta.discourse.org/t/minor-ui-mismatches-in-user-menu-billing-button/384751.
2025-10-06 13:32:45 +08:00
David Battersby 0c0296db69 DEV: remove category badge recursive (#35175)
Cleanup task to remove the recursive option from the category link
helper.

This was mostly replaced with the additional of the `ancestors` option
in #26638, this PR removes the last instance of where it was used and
removes it from the helper.
2025-10-06 09:31:33 +04:00
Alan Guo Xiang Tan ac2199c7ec DEV: Fix DMultiSelect component creating one promise per input event (#35142)
Before this change, every update to the `searchTerm` tracked property would create a new promise in the `data` function. The issue was that once the debounce delay completed, only the most recent promise would be handled, leaving the other promises in a limbo state. This is problematic because we pass these promises to TrackedAsyncData, which registers a test waiter in the test environment. If promises are never settled, the test waiters will never complete, causing tests to hang indefinitely.
2025-10-06 13:04:47 +08:00
Ted Johansson 3ec699a156 DEV: Hide overly technical image compression settings (#35197)
In our efforts to increase the signal-to-noise ratio and discoverability of site settings, we're hiding overly technical settings that few users override.
2025-10-06 13:04:31 +08:00
Martin Brennan 5faaa6f869 FEATURE: Bump wiki topics when OP is edited (#35137)
c.f. https://github.com/discourse/discourse/pull/34945

This commit updates `PostRevisor` to bump a topic if the
edited post is a wiki post and it is also the first post in
the topic (OP).

In this case, people want to know about a
change to the OP, because it may need to be reviewed (in the case of a
wiki) or it should be “promoted” so that others can see what’s changed
(in the case of general documentation).

A related change in this commit is to add a `should_bump_topic`
plugin modifier, so plugins like Discourse Doc Categories
(see https://meta.discourse.org/t/discourse-doc-categories/322376)
can enforce bumping in certain cases.
2025-10-06 12:46:28 +10:00
chapoi 5012d213e0 UX: remove subtitle from 404 page (#35185)
Removing the subtitle until we can make a better distinction between
"page not found" and "no access" 404 pages.
2025-10-04 10:34:50 -06:00
chapoi 2f9109f4b9 UX: update the copy in settings for the mobile logo (#35184)
The settings text doesn't reflect reality, as wide rectangular logo isn't a requirement. A square one works just as well, and is recommended to optimise header space.
2025-10-03 14:35:45 -06:00
Penar Musaraj ec23b73153 DEV: Bypass video thumbnail generation if events don't fire (#35182)
In the current version of DiscourseHub on iOS 26, video uploads are stalling.

This is because the video thumbnail generation code relies on video events and it looks like iOS 26 webviews are not firing those events.

This may require a fix in DiscourseHub, but in the meantime, we need to tighten the logic in thumbnail generation here.
2025-10-03 14:13:47 -04:00
Jarek Radosz 3729361c32 DEV: Move discourse-cakeday to core (#35172)
https://meta.discourse.org/t/373574

Internal `/t/-/159301`
2025-10-03 18:38:51 +02:00
Gerhard Schlager 58558849ac DEV: Add options to run only or skip some steps in converter and importer (#35127)
Examples:

* Run only the "badges" and "users" steps in the converter:
  ```
  migrations/bin/cli convert discourse --reset --only=badges,users
  ```

* Run all steps except "users" in the converter:
  ```
  migrations/bin/cli convert discourse --reset --skip=users
  ```

* Run only the "badges" step in importer:
   This also runs all steps that "badges" depends on (e.g. "users" and "uploads").
  ```
  migrations/bin/cli import --reset --only=badges
  ```

* Run only the "badges" step in importer and skip the "users" on which "badges" depends:
  ```
  migrations/bin/cli import --reset --only=badges --skip=users
  ```
2025-10-03 16:44:36 +02:00
Joffrey JAFFEUX ce7caaa0bc DEV: force chrome headless in dev container (#35179)
This will ensure tools like cursor can use our playwright’s chrome
executable and start it in --headless mode.
2025-10-03 16:44:14 +02:00
Discourse Translator Bot 5d239c5608 Update translations (#35139) 2025-10-03 15:55:36 +02:00
David Taylor e0dc8fefbb DEV: Improvements to DiscourseConnect spec helpers (#35173)
- Rename SSO -> DiscourseConnect. SSO is the general term for all
external login methods. DiscourseConnect is the name for this protocol
- Allocate different IP for each parallel spec environment, so they
don't clash. This will resolve some flaky specs we're seeing
- Only bind to localhost. No need to make this available from other
machines
2025-10-03 14:53:56 +01:00
chapoi 68d4113a75 FIX: double declarative button class names (#35177)
Buttons can only have 1 declarative class, not a combination. 

| BC | AC |
|--------|--------|
| <img width="666" height="1214" alt="CleanShot 2025-10-03 at 07 24
22@2x"
src="https://github.com/user-attachments/assets/448e4193-13a9-483c-80f7-6acc86e253d0"
/> | <img width="666" height="1214" alt="CleanShot 2025-10-03 at 07 23
56@2x"
src="https://github.com/user-attachments/assets/45c3abe5-a59f-4cf5-ad5e-19efb4721023"
/> |
2025-10-03 07:48:24 -06:00
David Taylor 564f82b84f DEV: Fix pause_test devtools URLs when running in container (#35171)
The `uri` variable was replaced when we moved from selenium to
playwright, so this was raising an error
2025-10-03 13:56:22 +01:00
David Taylor 04ed87792f DEV: Bump devcontainer image (#35168) 2025-10-03 14:04:32 +02:00
David Battersby 875a56921f FIX: pass ancestor data to category badge helper (#35169)
The badge in `CategoryChooser` is incorrectly showing the child category
badge when displaying both parent and child as the selected option. This
was already fixed for cases where the `ancestors` option is passed to
`categoryBadgeHTML` in the category link helper.

Updating the option within CategoryChooser fixes this issue, but I have
also added a fallback fix for any other components that still use the
recursive option.

_Note: as part of #26638 the preferred approach was to pass `ancestors:
category.predecessors` in place of `recursive: true`. That way reducing
multiple calls to `Category.findById` at the component level when
looping through category parents. We may want to completely remove the
recursive option in the future but leaving it be for now._

### Before

The category emojis are working correctly on the top header:

<img width="448" height="68" alt="Screenshot 2025-10-03 at 2 44 02 PM"
src="https://github.com/user-attachments/assets/f929cebf-3523-40cd-ac44-4c8d240793d5"
/>

The category chooser is showing the incorrect emoji for the parent
category when editing the topic:

<img width="430" height="159" alt="Screenshot 2025-10-03 at 2 43 55 PM"
src="https://github.com/user-attachments/assets/a7ed5cff-db10-4899-8096-45bd2b882eea"
/>

### After

<img width="451" height="153" alt="Screenshot 2025-10-03 at 2 43 02 PM"
src="https://github.com/user-attachments/assets/6033c164-3451-4526-8ff0-29819f8ae3d7"
/>
2025-10-03 15:43:34 +04:00
Jarek RadoszandLoïc Guitaut a54e3208cb DEV: Hand-pick Rails/WhereNot autofixes (#35117)
We can't enable `Rails/WhereNot` lint/autofix, because it would break
code that uses mini_sql instead of AR (which rubocop, and tbh also we,
can't easily differentiate)

Those are safe because they either:
* are executed in AR model scope definitions
* are clearly chained starting from a AR model
* are less-clearly chained, but still can be traced to a AR model/scope

---------

Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-10-03 13:29:22 +02:00
David Taylor e5ca38d2be DEV: Add ruby-lsp to development gems (#35170)
This significantly simplifies and speeds up using the ruby LSP in
development, since a separate 'composed bundle' is no longer needed.
2025-10-03 13:17:01 +02:00
Osama SayeghandAlan Guo Xiang Tan 0bc18fdf78 FEATURE: Add site setting to prevent mods from changing trust levels (#35160)
This commit adds a new setting `moderators_change_trust_levels` to
control whether moderators are allowed to change trust level of users.
Moderators are currently allowed to change trust levels, so this new
setting is enabled by default to avoid sudden changes in behavior for
existing sites.

When the setting is disabled and moderators are not allowed to change
trust levels, they see the trust levels dropdown disabled.

Internal topic: t/141392.

---------

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2025-10-03 13:19:24 +03:00
Juan David Martínez Cubillos b880921acf DEV: Ignore Posts with out topics when reordering posts based on their creation date (#35122)
**Description**
Add an option to ignore orphaned posts since these can cause errors when
running the task like:

```
ERROR:
duplicate key value violates unique
PG:: UniqueViolation:
DETAIL: Key (topic_i, post_number, user_id)=(212064, 1, 33887) already exists.

```
2025-10-03 11:58:24 +02:00
Loïc Guitaut a9c988a606 DEV: Serialize cookies using MessagePack (#35082)
This PR uses MessagePack instead of JSON for serializing our cookies.

MessagePack is almost as fast as Marshal but without the security
issues. It’s also able to serialize more objects than JSON (like Time,
Symbol, etc.). As it’s a binary format, it takes less space than JSON,
sometimes half less. Finally, MessagePack isn’t Ruby-specific and
implementations exist in every existing language.

Regarding the cookies Discourse is using, we can see a small improvement
on the `_forum_session` one when it’s almost empty (around 2%), but the
more things are put into it, the more we’ll see savings. For the `_t`
cookie, we’re saving around 20% for free.
2025-10-03 11:40:49 +02:00
David Taylor 00375be665 PERF: Re-use topic-footer-button elements when rerendering (#35167)
As well as improving perf, this should resolve some flaky specs we're
seeing

Followup to 4d03447450
2025-10-03 10:28:32 +01:00
Loïc Guitaut 0c41ff0680 DEV: Move more data into the server session (#35145)
Now that `ServerSession` can store arbitrary data, we can move some more
data into it.

This patch moves some data related to authentication into it, as
sometimes that kind of data can be pretty big.
2025-10-03 10:20:32 +02:00
Tethys Plex 43fa61b363 FIX: Disable replies button until replies are loaded (#35136)
This prevents users from clicking multiple times and causing replies to
be shown more than once while expansion is in progress.
2025-10-03 16:17:06 +08:00
Ted Johansson 911502eb9e DEV: Add back lost admin problem notification (#35146)
When we revamped the problem check system, we lost this job that creates admin notifications when there are lingering problems. This PR adds it back.

It is almost a line-for-line copy of the original job and its tests, except for the implementation of #persistent_problems?.
2025-10-03 16:14:28 +08:00
Joffrey JAFFEUX ba7fbd6d9c FIX: notification reminder is deleted with bookmark (#35141) 2025-10-03 08:34:19 +02:00
David Battersby 16518f6d33 FIX: respect img size when quoting multiple elements (#35144)
Adds the width/height to quoted images when selecting and quoting
multiple elements from a post at once.
2025-10-03 09:10:00 +04:00
David Battersby 3c8d6504be UX: make lightbox hover caption unselectable (#35148)
When quoting an image it is easy to accidentally select the image
caption as it appears on hovering the image. Because of this the caption
text also appears underneath the image (within the quote).

Making the caption text unselectable when hovering the image solves
this.
2025-10-03 08:55:36 +04:00
Blake Erickson c636f950d2 DEV: Favor Upload.s3_upload_bucket for mediaconvert (#35163)
In the aws_media_convert_adapter we were referencing
`SiteSetting.s3_upload_bucket` but that can be empty on some instances,
so we need to use the `SiteSetting.Upload.s3_upload_bucket` version,
which should always have a value when using s3.

This follows a similar pattern we used previously for other s3 related
settings.
2025-10-02 20:09:58 -06:00
Martin Brennan 127671166a DEV: Change to use debugger for pause_test (#35161)
We now use `debugger` instead of `pry` since

https://github.com/discourse/discourse/commit/f608e0cd7e7d4785b3ecb401999cfb837cfbe783,
so we can update `pause_test` to use `debugger` as well
in system specs.
2025-10-03 10:52:29 +10:00
Martin Brennan f0e0b02494 FIX: Streamline topic bump functionality and notification settings behaviour (#34945)
Followup 2a65bf4522

With the above change, we inadvertently made it so that
when you edited the topic title or category, we bumped
the topic.

This fix makes it so we do not bump topics when only title, category,
or tags are changed, to restore the previous behaviour.

In addition, we are making it so the following settings no longer
influence topic bump behaviour, keeping only their intended notification
behaviour around. The site setting description never mentioned anything
about topic bumps:

* disable_category_edit_notifications
* disable_tag_edit_notifications
2025-10-03 10:16:54 +10:00
dependabot[bot]dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Discourse CI
9ad3b0a9c4 Build(deps-dev): Bump puppeteer-core from 24.22.3 to 24.23.0 (#35131)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from
24.22.3 to 24.23.0.
- [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.22.3...puppeteer-core-v24.23.0)

---------

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-10-02 23:49:38 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> e6e358160b Build(deps): Bump net-imap from 0.5.10 to 0.5.11 (#35128)
Bumps [net-imap](https://github.com/ruby/net-imap) from 0.5.10 to
0.5.11.
- [Release notes](https://github.com/ruby/net-imap/releases)
- [Commits](https://github.com/ruby/net-imap/compare/v0.5.10...v0.5.11)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-02 23:47:55 +02:00
Chris Alberti af47faac80 Add a plugin outlet after preferences > security password section (#35155)
Needed to implement additional/replacement instructions or functionality where the password change buttons usually live.
2025-10-02 15:28:42 -05:00
benj 343292688c FIX: Removes debugging line (#35157)
Found while working on a customization. Caused a floating integer in the
admin settings.

Before:
<img width="426" height="199" alt="Screenshot 2025-10-02 at 1 08 13 PM"
src="https://github.com/user-attachments/assets/98e4148f-6e80-42fd-aa00-272cc05e238e"
/>

After:
<img width="388" height="211" alt="Screenshot 2025-10-02 at 1 37 48 PM"
src="https://github.com/user-attachments/assets/680d4c33-4d2b-44ee-ad4c-6b4ac0eb0bd2"
/>
2025-10-02 14:54:12 -05:00
chapoiandMartin Brennan 759fc04041 UX: rework button classes (#34882)
Context: The `btn` mixin is used for every functional button, but this
includes button elements that are not, or should not be, styled like our
default or primary buttons.

To change how this works this commit:
* stripped down the mixin to the bare essentials, mainly limiting to the
properties that use variables.
* moved most things into the `btn` class
* moved some things into specific descriptive classes (default, danger,
success) such as border-radius
Example of button that does not need a border-radius and would benefit
from this:
<img width="464" height="184" alt="CleanShot 2025-09-19 at 12 56 04@2x"
src="https://github.com/user-attachments/assets/e908b2cf-971f-4c1f-aade-7492bad2f89c"
/>

* Deprecated…
  * FlatButton component
* btn-active: we should use the proper pseudoclass :active or a –-active
modifier in code if we need it
* btn-text: every button by default is a btn-text. We already have a
class to indicate when it isn’t (no-text)
* fixed btn-link property to make DButton component behave like an
inline link (no padding, link-styling)
* Since I moved styling from .btn, ths means every button now needs a
specific declaration. So I’ve added btn-default where necessary.
* Fixed btn-flat hover effect: The difference between btn-flat and
btn-transparent was getting very ambiguous. I’ve fixed the hover effect
for btn-flat so that the distinction is:
<img width="1094" height="408" alt="image"
src="https://github.com/user-attachments/assets/addf56a9-1f61-463d-abd9-5028a3b88fad"
/>
* Changed the custom icon colour from header icons so it follows the
normal btn-flat styling, the way the sidebar icon already was doing.
(Consistency)


**Other small button-related change along the way**
What | BC | AC |
|----| ----|--------|
Inconsistent save/cancel colours | <img width="1720" height="1084"
alt="CleanShot 2025-09-19 at 15 31 40@2x"
src="https://github.com/user-attachments/assets/227289c3-6ded-4633-868d-6e33c32d83c3"
/> | <img width="1720" height="1084" alt="CleanShot 2025-09-19 at 15 30
56@2x"
src="https://github.com/user-attachments/assets/b23f96c9-04f3-40ea-9fba-2be59eae8e64"
/> |

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2025-10-02 13:32:36 -06:00