58573 Commits

Author SHA1 Message Date
Gary Pendergast
9abeff460c
FEATURE: Display the Watched Words that caused a post to be flagged. (#31435)
When a post is flagged due to matching watched words, it can be difficult to know what you're looking for, particularly if you have a lot of watched words built up over a long period of time.

This change stores the list of matched words, and later displays them in the review queue, listing which Watched Words were responsible for the flag. Because watched words can change, this is recorded at the time the post is flagged. For posts that were flagged prior to this feature landing, it tries to guess the relevant words based on the current Watched Words set.
2025-03-04 17:22:12 +11:00
Martin Brennan
b329eac79a
FIX: Handle href admin sidebar links better (#31575)
Admin sidebar links can have either a `href` or a
`route`, and the admin search was not handling
this properly. Also, we should always use `getURL()`
on the href in case the link is internal, for subfolder
sites.

This is hard to test right now, I plan on adding more extensive
links for admin-search-data-source in another PR.
2025-03-04 13:38:49 +10:00
Keegan George
879faa82b3
DEV: Add value transformer for admin reports show query params (#31597)
## 🔍 Overview
This update adds a new value transformer to the `queryParams` property
on the `AdminReportsShowController`. This is necessary so that plugins
can add additional `queryParams` to the route and have it reflected when
the route is transitioned.
2025-03-04 13:33:08 +11:00
Martin Brennan
c815294c57
DEV: Update gemfile.lock from ruby bump (#31599)
Followup 76e58a55edb18a22760273b8787240a18b7b2be3

Gemfile.lock wants the ruby version, and it's blocking
the build. Not sure why this didn't come up in the
original PR.

This is not a hard requirement, other ruby versions satisfying
~> 3.3.0 will still work
2025-03-04 11:58:13 +10:00
Krzysztof Kotlarek
dbba838ef4
FEATURE: rebranded admin logos settings (#31554)
Redesigned page to update site logos. `AdminBrandingLogoFormComponent`
is attached to the old logos page and the new branding page. In the next
steps, branding will replace the logos page.

A new `AdminConfigAreaCardSection` component was added hidden and less
frequently used settings.

An image placeholder was also needed because many additional logos have
a fallback to the site logo.

Finally, `twitter_summary_large_image` was renamed to
`x_summary_large_image`.

Desktop
![localhost_4200_admin_config_branding
(4)](https://github.com/user-attachments/assets/b6ae5266-72f6-4582-b0ef-4d05545943e8)


Mobile
![localhost_4200_admin_config_branding(iPhone 12 Pro)
(3)](https://github.com/user-attachments/assets/bf329a5c-9ba0-4d88-b30d-e8f1feb02e31)
2025-03-04 12:51:27 +11:00
Martin Brennan
76e58a55ed
DEV: Bump ruby version requirement to 3.3.0 (#31538)
This bumps the core ruby version requirement
to at least 3.3.0, and moves this version check
into the Gemfile per
https://bundler.io/guides/gemfile_ruby.html

We are doing this because generally our gems
are using a higher version, it's about time
for a bump anyway.
2025-03-04 12:23:32 +11:00
Ella E.
028a587363
Update INSTALL-cloud.md (#31500)
Include blurb about hosting.

Internal: /t/122265/
2025-03-03 17:33:11 -07:00
Jarek Radosz
024d752083
DEV: Remove extraneous rubocop arguments (#31596)
1. `--parallel` is the default
2. it runs in the current directory by default
2025-03-04 01:28:26 +01:00
Jarek Radosz
3aa383a4de
UX: Tweak footnote button styling (#31595)
1. remove the margin (it's displayed inline with text, so having a left
margin didn't make sense)
2. use em unit in min-height
3. slighty tighten the button (inline padding 0.5em -> 0.4em) so it's
more proportional
2025-03-04 01:24:27 +01:00
Krzysztof Kotlarek
64683389a2
UX: rich text for review_process_description (#31594)
In this PR, information about the review process was added to the flag
modal - https://github.com/discourse/discourse/pull/31300

Admins would like to use HTML tags to customise it even more.
2025-03-04 10:34:02 +11:00
dependabot[bot]
2dee19f244
Build(deps-dev): Bump puppeteer-core from 24.3.0 to 24.3.1 (#31591)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from
24.3.0 to 24.3.1.
- [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.3.0...puppeteer-core-v24.3.1)

---------

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-03 23:33:59 +01:00
Jarek Radosz
4ed7a88a94
UX: Fix notifications tracking buttons styling (#31592)
A follow up to c95c3c4311a7af461e23f18a2aad6f6e68414560
2025-03-03 23:33:49 +01:00
Jarek Radosz
481ac4d43a
DEV: Fix Gemfile.lock (#31590) 2025-03-03 20:54:25 +01:00
Joffrey JAFFEUX
f2bf669dc2
DEV: aliases should be considered as existing (#31589)
Before this commit doing: `Emoji.exists?(some_alias)` would return
false. The only important thing in emoji is to never remove an emoji
code which has been used by users but changing the name of an emoji and
keeping old name as an alias should not break the application in any
way, this commit should ensure this is true.
2025-03-03 20:17:49 +01:00
David Taylor
85406d9475
DEV: Resolve flaky terser spec (#31588) 2025-03-03 18:40:44 +00:00
Blake Erickson
98cdfa33c3
DEV: Create plugin outlet for console site setting logging (#31564)
This change allows plugins to customize the description for site setting
logs that occur via site setting changes via the rails console.
2025-03-03 10:27:03 -07:00
Osama Sayegh
49902a0cc3
FIX: Correct translation key for admin color palettes page heading (#31587) 2025-03-03 20:12:55 +03:00
Jarek Radosz
454dd1ea51
DEV: Change glimmer_topic_list_mode to enabled by default (#31585)
https://meta.discourse.org/t/343404
2025-03-03 18:07:15 +01:00
Joffrey JAFFEUX
d456e83adc
DEV: bump discourse-emojis gem (#31583)
This should fix an issue with a 100 emoji alias. 100 should now be
considered as the top level emoji name and hundred_points an alias.

Other renames are also part of this gem bump: sweat_smile, grin, ...
2025-03-03 17:39:55 +01:00
dependabot[bot]
4a05f3198d
Build(deps-dev): Bump @ember/render-modifiers from 2.1.0 to 3.0.0 (#31569)
Bumps
[@ember/render-modifiers](https://github.com/emberjs/ember-render-modifiers)
from 2.1.0 to 3.0.0.
- [Release
notes](https://github.com/emberjs/ember-render-modifiers/releases)
-
[Changelog](https://github.com/emberjs/ember-render-modifiers/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/emberjs/ember-render-modifiers/compare/v2.1.0...v3.0.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-03-03 16:58:56 +01:00
dependabot[bot]
8165de9483
Build(deps-dev): Bump @swc/core from 1.11.4 to 1.11.5 (#31571)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.4 to
1.11.5.
- [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.4...v1.11.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:29:06 +01:00
dependabot[bot]
6da6809014
Build(deps): Bump @faker-js/faker from 9.5.0 to 9.5.1 (#31573)
Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 9.5.0 to
9.5.1.
- [Release notes](https://github.com/faker-js/faker/releases)
- [Changelog](https://github.com/faker-js/faker/blob/next/CHANGELOG.md)
- [Commits](https://github.com/faker-js/faker/compare/v9.5.0...v9.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:06:03 +01:00
dependabot[bot]
7cbd7ad39c
Build(deps): Bump core-js from 3.40.0 to 3.41.0 (#31572)
Bumps
[core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js)
from 3.40.0 to 3.41.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
-
[Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/zloirock/core-js/commits/v3.41.0/packages/core-js)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:05:35 +01:00
dependabot[bot]
077393fb59
Build(deps-dev): Bump ember-async-data from 1.0.3 to 2.0.0 (#31570)
Bumps
[ember-async-data](https://github.com/tracked-tools/ember-async-data)
from 1.0.3 to 2.0.0.
- [Release
notes](https://github.com/tracked-tools/ember-async-data/releases)
-
[Changelog](https://github.com/tracked-tools/ember-async-data/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tracked-tools/ember-async-data/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:03:31 +01:00
Loïc Guitaut
b9dd9c70a5 DEV: Migrate Sidekiq to a dedicated Redis DB
As we’re currently using a namespace for Sidekiq, in order to upgrade to
the latest version, we need to drop it as it’s not supported anymore.

The recommended way is to use a different Redis DB for Sidekiq.

This patch uses a different config for Sidekiq and also takes care of
migrating existing jobs (in queues and the retry and scheduled sets).
2025-03-03 15:42:26 +01:00
Joffrey JAFFEUX
80625f6c1c
DEV: explicit json for emojis/search-aliases (#31582)
Adds `.json` a suffix everywhere and makes it clear that's it's a json
route.

Also adds a missing spec for this endpoint and updates the underlying
discourse-emojis gem for better symlinking
2025-03-03 15:21:16 +01:00
David Taylor
1bd61630ef
UX: Simplify admin theme editor (#31561)
- Hide seldom-used fields behind an 'advanced' checkbox. This replaces
the old 'only show edited' checkbox, since the number of fields shown by
default is now so small that 'only show edited' isn't useful.
Mobile/desktop targets are included in that list because we now
recommend people use CSS breakpoints for handling different device
sizes.

- Update names & descriptions of fields to be more descriptive

- Show the descriptions of fields at the top of the editor. Previously
they were only shown as tooltips.

Before:
<img width="1109" alt="SCR-20250228-lunn"
src="https://github.com/user-attachments/assets/8faebba1-39c1-491a-b236-411cfb6d9c74"
/>

After, default view:
<img width="1102" alt="SCR-20250303-kayr"
src="https://github.com/user-attachments/assets/1e483845-613f-44d6-83d6-ade628251fe5"
/>

After, advanced view:
<img width="1122" alt="SCR-20250303-kazn"
src="https://github.com/user-attachments/assets/45b8933d-2271-42ba-b5b4-81b326709adb"
/>
2025-03-03 12:20:11 +00:00
Joffrey JAFFEUX
d38acc5df1
DEV: discourse-emojis gem (#31408)
This commit moves most of emoji logic into the discourse-emojis gem:
https://github.com/discourse/discourse-emojis/

Most notably:
- images are now symlinked from the gem
- the gem provides path to the json files

Search aliases have also been made asynchronous and memoized. When you
will search for an emoji we will now load the aliases and store the list
for future use.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-03-03 13:09:08 +01:00
David Taylor
6b6cffdf85
DEV: Resolve flaky user-agent spec (#31580)
Followup to 8615fc6cbbd1085b37b5ec251e4acd39b16cb839

Stubbing things which are memoized means we'd need to clear the caches
before & after the tests to be safe. Easier to just avoid the stubs
altogether.
2025-03-03 10:43:33 +00:00
Hugh Lashbrooke
a5c21a92b2
UX: Add recommended image size for category logos (#31574)
This adds a description to the category logo image fields that informs users of the recommended image aspect ratio and minimum size to upload.
2025-03-03 20:53:36 +11:00
Kelv
0d90f6e3c3
FIX: cross origin opener policy should apply to public error responses (#31559)
In some error paths, headers that were set earlier can get overwritten
(e.g. `Cross-Origin-Opener-Policy`) by middleware such as
ActionDispatch::ShowExceptions.

This PR sets the `Cross-Origin-Opener-Policy` header to the value of the
SiteSetting `cross_origin_opener_policy_header` if it's missing and if
the response is for HTML.

In future, this DefaultHeaders middleware can be used to set other
default headers that relate to security or other purposes.

### Testing
<img width="631" alt="test"
src="https://github.com/user-attachments/assets/05106a40-2bc7-435d-91a2-4dd2a098f349"
/>
2025-03-03 17:04:24 +08:00
Alan Guo Xiang Tan
66ecfc8996
DEV: Correct users create API docs (#31578)
The API docs is incorrect as the `active` param is only permitted when
an admin API key
is used. This has always been the case since
429f27ec96c090d9054c498263f0cb635b665d99
2025-03-03 16:42:46 +08:00
David Battersby
5c4c8b81eb
DEV: prevent sass mixed declarations warning (#31577)
Prevents deprecation warning of sass mixed declarations. We should move
declarations above nested styles.

We get the following message from logs:
```
DEPRECATION WARNING [mixed-decls]: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.
```

For more info see:
https://sass-lang.com/documentation/breaking-changes/mixed-decls/
2025-03-03 12:10:56 +04:00
David Battersby
081a0159d8
UX: search dropdown layout improvements (#31568)
This change improves the alignment and placement of the search spinner
and icons (ie. clear search / advanced search). Having a fixed width on
desktop prevents the search field from changing width when the loading
icon is toggled.
2025-03-03 09:36:53 +04:00
Gary Pendergast
8615fc6cbb
DEV: Add a user agent to all HTTP requests that Discourse makes. (#31555)
This change standardises the `User-Agent` header that Discourse will send when talking to other sites.

`Discourse.user_agent` is now the authority on what the user agent value should be. For Onebox requests, this changes the user agent from their existing value to match the new value (unless overridden).

For all other requests, `Net::HTTPHeader` is monkey-patched to add a default `User-Agent` header when one hasn't been provided.
2025-03-03 16:32:25 +11:00
Martin Brennan
8325d42e56
FEATURE: Experimental admin search refinements round 1 (#31441)
Followup e26a1175d7c33746bddbc858ad89e68cc14beefe

Adds extra functionality and tests for the admin search modal.

* Show third level plugin config pages in search, e.g.  AI Usage
* Remember last used search filters
* Allow navigating search results with keyboard, using tab or up/down
and enter to go to result
* Add a placeholder beneath search input to tell the admin what to do
* Add a full page search at `/admin/search` which can be reached from
pressing Enter on the search input
* Add specs for modal and full page search
* Change admin sidebar filter "no results found" to point to full page
search
* Add keyboard shortcut help to modal for admin search
2025-03-03 13:56:07 +10:00
Ted Johansson
c0bbff598a
FEATURE: Allow admins to access group chats (#31440)
In #31366, we added the ability for admins to remove people from group chats. However, that only works as long as the admin is already in the group chat.

For forum-side group messages, admins can join any of them at will. This PR extends that same ability to chat for parity.
2025-03-03 09:20:13 +08:00
Ted Johansson
258dfab8d7
DEV: Replace Rinku native gem with PrettyText (#31557)
We have a native dependency, Rinku, that's used only to make links in one place. We can get rid of this and use PrettyText instead.

This is almost a one-for-one replacement, but PrettyText adds rel="noopener nofollow ugc" to external links, which I suspect is actually what we want. It also wraps the result in a <p> tag, which we strip out for parity with Rinku.
2025-03-03 09:19:17 +08:00
Isaac Janzen
176ee0bf60
DEV: Add posts_controller_create_user modifier (#31562)
Add `posts_controller_create_user` modifier to modify which user is associated with the post creation.
2025-02-28 15:11:12 -06:00
Joffrey JAFFEUX
c95c3c4311
DEV: correct class on trigger of notifications-tracking (#31560)
If we have a custom content for a `DMenu` trigger the `DButton` has no
way to know there's text in this custom content so it will output the
"no-text" class on the `DButton`. The correct way to fix this is to use
our own `DButton` and the `@triggerComponent` so we can fully replace
the behavior and set the correct classes.
2025-02-28 21:07:33 +01:00
Amanda Alves Branquinho
dfb9418da0
DEV:add outlet wrapper for user summary topic (#31546)
- Add an outlet wrapper for user summary topic
2025-02-28 16:33:22 -03:00
Jean
cbdd28321e
DEV: Add app event triggers for interface color changes (#31558) 2025-02-28 12:08:42 -04:00
Osman Gormus
56a0b17b12
Introduce a new plugin outlet (#31542)
Adds a new plugin outlet below the `flagging.review_process_description`
customizable text.

The customizable text only accepts plain-text. This plugin outlet would
allow developers to add additional description with any rich-text
content they need, such as paragraphs and links.
2025-02-28 10:52:31 -05:00
Kris
5312550bf9
A11Y: read who liked/read a post when count clicked (#31549)
This change adjusts the markup and aria tags so that the like and read
counts on posts will read who liked/read when clicked. Previously this
content was inaccessible to screen readers.


![image](https://github.com/user-attachments/assets/d205eb9a-ffa9-4955-8191-7a0411b23c46)

This change required: 

* Keeping the empty containing divs present and adding `aria-live` tags
(if the `aria-live` tag isn't initially present in the DOM, it will not
read changes to the content within)
* Adjusting some styles to avoid extra margin from the empty div (added
a conditional class to add the margin back when expanded)
* Cleaned up the aria tags, we don't need to hide the "liked this" text,
as it will be read naturally after the usernames like "username1,
username2, liked this" This allows us to remove the screenreader only
description.
* Removed "Click to view" from the button label, the interactivity is
inherent because the screenreader identifies it as a button
2025-02-28 09:15:04 -05:00
David Battersby
3efbd95ad8
FEATURE: add search field to header (#31447)
Adds a search field to the page header on desktop that is controlled by
a site setting (within Search).

The search field toggles back to the search icon (magnifying class) when
the header is minimized (ie. scrolling in topics) and restores to the
field again when header is no longer minimized.

On mobile the search experience is still the same.
2025-02-28 12:47:09 +04:00
dependabot[bot]
a19c45fdc0
Build(deps): Bump excon from 1.2.4 to 1.2.5 (#31552)
Bumps [excon](https://github.com/excon/excon) from 1.2.4 to 1.2.5.
- [Changelog](https://github.com/excon/excon/blob/master/changelog.txt)
- [Commits](https://github.com/excon/excon/compare/v1.2.4...v1.2.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-28 00:07:22 +01:00
dependabot[bot]
4a97e58902
Build(deps-dev): Bump rubocop from 1.73.0 to 1.73.1 (#31551)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.73.0 to
1.73.1.
- [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.73.0...v1.73.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-28 00:07:04 +01:00
dependabot[bot]
edd413a71a
Build(deps-dev): Bump @swc/core from 1.11.1 to 1.11.4 (#31550)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.1 to
1.11.4.
- [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.1...v1.11.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-28 00:06:42 +01:00
Jordan Vidrine
17b42d9786
UX: Evenly distribute nav-space for drop-downs & buttons (#31545) 2025-02-27 16:03:32 -06:00
Angus McLeod
fb98ced782
DEV: add scope param to user_confirmed_email event (#31394)
EmailToken.confirm is called in a number of contexts (hence the need for
the `scope`) and this is sometimes needed in `user_confirmed_email`
callbacks to distinguish those contexts.
2025-02-27 14:53:06 -05:00