Commit Graph

59478 Commits

Author SHA1 Message Date
38ee9a0a79 DEV: scroll to reply button before click (#32663)
This will help with reliability of specs.
2025-05-09 11:46:15 +02:00
b28df068fc FIX: ensure old email set correctly when updating email (#32309)
Previously when changing back to the same email (ie. change to new
email, then change back again) we can easily end up showing the
incorrect old email if changing back to the same email more than once.
Then passing the incorrect old email causes an error as it can't be found.

This happens because we only searched for a combination of `user_id` and
`new_email` which can load an older change from the database. By using
the current email address when finding / initializing the
`EmailChangeRequest` we can prevent this issue as we will be creating a
new entry rather than loading an outdated one.
2025-05-09 12:50:01 +04:00
abee294616 DEV: Expose show_additional_about_groups to client (#32660)
We just added this site setting to be used for switchover as we merge a theme component into core. However, as it wasn't marked client: true, the theme component cannot read it. 🤦
2025-05-09 13:36:57 +08:00
b97d1c63f0 DEV: Add a flag to facilitate merging about groups into core (#32657)
We are merging the add-groups-to-about theme component into core. As per protocol, we'll use a hidden site setting to facilitate the switchover.
2025-05-09 10:00:50 +08:00
af71b09246 DEV: bring back admin search page priority test (#32644)
In this PR, test was removed

https://github.com/discourse/discourse/pull/32639

To be sure result are consistent, we need to define a data set which
will confirm that the page is getting bonus points.
2025-05-09 09:10:08 +08:00
713fa8874a FIX: Purge ExtraLocalesController cache correctly for multisite (#32654)
When Translation Overrides are changed, a message is sent on the
`/i18n-flush` channel to ensure all running unicorns flush their caches.
This message is not received in a database-specific context, so running
`ExtraLocalesController.clear_cache!` was only affecting the default
site in a multisite cluster. This commit updates it to flush caches for
all sites.
2025-05-08 23:52:45 +01:00
1afdb5df7b UX: always close hamburger menu when navigating to admin (#32651)
When we create a custom homepage using the `custom_homepage` modifier we
can hide the sidebar using `{{hideApplicationSidebar}}` in the template
— this forces the hamburger dropdown to appear in the header.

This creates an issue when navigating from the custom homepage to the
admin area, because when the route transitions the hamburger menu isn't
closed... and at this point, it cannot be closed at all. The
`clickOutside` listener from the open menu is calling
`toggleNavigation`, which is now the sidebar... so instead of closing
the hamburger menu, it toggles the sidebar and prevents other elements
from being clicked (because the `clickOuside` listener is only removed
when the hamburger menu is destroyed).


![image](https://github.com/user-attachments/assets/b6893513-6f0e-4f5b-8d47-6b63916c0a29)

This change ensures that when the admin sidebar is forced, the hamburger
menu will be hidden.
2025-05-08 16:08:11 -04:00
6154fa6b45 FEATURE: Add translations to posts (#32564)
## 🔍 Overview
This update adds the ability for users to manually add translations to
specific posts. It adds a 🌐 icon on the post menu where you can click to
add translations for posts.

It also introduces a new site setting:
`content_localization_debug_allowed_groups` which is convenient when
debugging localized posts. It adds a globe icon in the post meta data
area along with a number of how many languages the post is translated
in. Hovering over the icon will show a tooltip with access to editing
and deleting the translated posts.

## 📸 Screenshots
<img width="1234" alt="Screenshot 2025-05-07 at 13 26 09"
src="https://github.com/user-attachments/assets/9d65374d-ee3e-4e8b-b171-b98db6f90f23"
/>
<img width="300" alt="Screenshot 2025-05-07 at 13 26 41"
src="https://github.com/user-attachments/assets/6ee9c5e6-16ed-4dab-97ec-9401804a4ac8"
/>
2025-05-08 10:40:36 -07:00
49802d667f DEV: Remove post length check to allow loading to end (#32648)
As reported:
https://meta.discourse.org/t/endless-spinning-on-user-activity-of-user-without-activity/365313

If a user has no posts, their post list will show a loading spinner
indefinitely


![image](https://github.com/user-attachments/assets/23af7c84-444e-4f6b-bfbb-dcc84162b1f6)

This is because if there are no posts we never set `canLoadMore` or
`loading` to `false`

If we always check for new posts we avoid the issue. 


![image](https://github.com/user-attachments/assets/8bfb0267-7b3c-44cc-8f77-8d442598c50d)
2025-05-08 13:34:39 -04:00
e564ab5f63 PERF: Improve performance of the new themes listing page (#32641)
The new themes listing page at `/admin/config/customize/themes`
currently has poor performance compared to the components page
(`/admin/config/customize/components`) due to various N+1 issues,
loading all themes and components from the server when only themes are
needed, and serializing data/attributes that aren't needed for rendering
the themes grid.

This commit improves the performance by eliminating all N+1 that are
currently present, excluding components from the page payload, and
reducing the amount of data transmitted for each theme when loading the
page.
2025-05-08 19:18:07 +03:00
a71a0dcaaa UX: don't always fill username for forgot password (#32646)
Reported here:
https://meta.discourse.org/t/autofill-with-username-in-forgot-password-modal/365310

When `hide_email_address_taken` is enabled, we don't want to populate
the username in the forgot email input, because we require an email
address. This will remove username content that doesn't look like an
email when that site setting is enabled.

Before (username populated when email required): 

![image](https://github.com/user-attachments/assets/7a6eb638-9b5e-4767-b111-e32cec94d8a7)

After (username not populated, email is):

![image](https://github.com/user-attachments/assets/2d5eff84-92f8-4f76-bc98-b66bc6381fd3)


![image](https://github.com/user-attachments/assets/ecd071a0-804e-45ef-b0a2-ae331f87f029)
2025-05-08 10:16:33 -04:00
cf2f1ac5ee FIX: Link to browser support section of website (#32647) 2025-05-08 14:52:24 +01:00
0947a14284 DEV: correctly returns contract error (#32645)
If a user was using invalid values for the contract we would return
"Unexpected error", which is incorrect given we know the exact error.
The user will now get the following exception: "Page size must be less
than or equal to 50"
2025-05-08 14:30:02 +02:00
ad5e02a85f DEV: Use media query for capabilities.touch (#32620)
This will allow us to have perfect consistency with CSS-based touch
detection
2025-05-08 13:23:02 +01:00
b2d0ec0e15 Build(deps-dev): Bump chrome-launcher from 1.1.2 to 1.2.0 (#32636)
Bumps [chrome-launcher](https://github.com/GoogleChrome/chrome-launcher)
from 1.1.2 to 1.2.0.
- [Release
notes](https://github.com/GoogleChrome/chrome-launcher/releases)
-
[Changelog](https://github.com/GoogleChrome/chrome-launcher/blob/main/changelog.md)
-
[Commits](https://github.com/GoogleChrome/chrome-launcher/compare/v1.1.2...v1.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-08 11:24:41 +02:00
74d5279a14 Build(deps-dev): Bump mime-types from 3.6.2 to 3.7.0 (#32634)
Bumps [mime-types](https://github.com/mime-types/ruby-mime-types) from
3.6.2 to 3.7.0.
-
[Changelog](https://github.com/mime-types/ruby-mime-types/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/mime-types/ruby-mime-types/compare/v3.6.2...v3.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-08 11:23:58 +02:00
4d9bc4fef4 DEV: More helper methods for topic localization (#32643)
This adds more methods on `Topic` so it can be used in a later PR that
will localize topics.
2025-05-08 16:12:28 +08:00
abb265f7dd Build(deps-dev): Bump bullet from 8.0.5 to 8.0.6 (#32633)
Bumps [bullet](https://github.com/flyerhzm/bullet) from 8.0.5 to 8.0.6.
- [Changelog](https://github.com/flyerhzm/bullet/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flyerhzm/bullet/compare/8.0.5...8.0.6)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-08 14:32:01 +08:00
413fea8051 DEV: Add new key for anon cache for localization (#32640)
As we move content localization to core, we will need to register a new
key to handle cases when anon users hit the cache to avoid cache
poisoning.

Related:
- https://github.com/discourse/discourse-translator/pull/273
-
d7ae611981/lib/discourse_translator/inline_translation.rb (L94-L98)
2025-05-08 14:30:03 +08:00
acd195071f DEV: flaky AdminSearchDataSource test (#32639)
Delete broken test
2025-05-08 12:34:41 +08:00
a1ed6f36f0 FIX: redirect to new themes page after deletion (#32638)
When a theme is deleted, we should redirect to new themes page.
2025-05-08 12:29:04 +08:00
e5e775de8b Scripts:Xenforo: Modify importer to use reactions table (#31859)
This PR addresses a problem with the Xenforo importer.

Xenforo has moved from "likes" table and now calls the same table
"reactions" table. Similarly the columns has been also renamed.

With this PR, the importer is upgraded to use the latest naming.

Signed-off-by: Abhiram Shibu <abhiramshibu1998@gmail.com>
2025-05-08 12:55:32 +10:00
33d92537ca FIX: prioritize pages over other categories in admin search (#32614)
Add 20 points for matched pages to move them higher.

Before:
![Screenshot 2025-05-07 at 3 53
41 pm](https://github.com/user-attachments/assets/cb54516a-d81b-45f0-ada3-7b33e43352a9)

After:
![Screenshot 2025-05-07 at 3 53
53 pm](https://github.com/user-attachments/assets/93a9a83b-761f-490c-853e-926762940353)
2025-05-08 07:48:04 +10:00
718a3cec08 DEV: Add common css to theme qunit (#32630) 2025-05-07 23:37:28 +02:00
4490a52976 DEV: Recover from missing ember-cli assets in development (#32625) 2025-05-07 14:42:32 -04:00
832eefd20f UX: Do not reserve space for the tip message on the signup page (#32627)
Before
<img width="300" alt="image"
src="https://github.com/user-attachments/assets/df30cae9-6734-4427-be7b-72fa24eb7d80"
/>

After
<img width="300" alt="image"
src="https://github.com/user-attachments/assets/7ca5e8dc-15d6-42a5-9caf-f50ae10cbc1a"
/>
2025-05-07 13:38:39 -04:00
e16634ac6d UX: improve image uploader setting control layout (#32626)
This improves the new image uploader controls layout — this matches the
layout the uploader uses in other contexts (user profile, logo config
area)


Before:

![image](https://github.com/user-attachments/assets/a669e4ef-0bd8-4fc4-af5a-c1f31e65fbfb)


After: 

![image](https://github.com/user-attachments/assets/105184ea-a4b6-47a5-999c-40347f2b71f6)
2025-05-07 13:19:54 -04:00
44a1848ed9 DEV: remove deps (#32628)
Users won't be able to use video locally but we think it's not necessary
for now. This could also cause permissions errors on CI as deps require
sudo to be installed.
2025-05-07 19:09:42 +02:00
153ee0eb9f UX: Include custom text field description in signup form (#32624)
Reported in
https://meta.discourse.org/t/signup-instructions-arent-showing-for-text-custom-user-fields/359935?u=rishabh
2025-05-07 13:05:48 -04:00
a1cc27bc01 DEV: Add PostFlag value modifiers (#32622) 2025-05-07 11:59:09 -05:00
d98a0105ad DEV: Raise errors in playwright install (#32623) 2025-05-07 18:31:18 +02:00
930eeb1890 DEV: add create-topic-label value transformer (#32621)
On mobile we remove the create topic button label:


![image](https://github.com/user-attachments/assets/18dfb2e1-c7fc-4253-b24e-ba95d8533855)

and we don't have a great way to add it back
(https://meta.discourse.org/t/new-topic-button-hidden-text/364902)

this will allow the translation to be set for both mobile and desktop
like this:

```js
import { apiInitializer } from "discourse/lib/api";

export default apiInitializer((api) => {
  api.registerValueTransformer("create-topic-label", ({ value, context }) => {
    return context.defaultKey;
  });
});
```


![image](https://github.com/user-attachments/assets/7e1200f0-e8fc-4966-9693-310b3fad3682)


and also grants the flexibility to have a custom labels for mobile and
desktop
2025-05-07 12:01:44 -04:00
183546c2a1 UX: Various improvements to the new color palette page (#32597)
This commit makes various changes and improvements to the new color palettes
page that was introduced in
https://github.com/discourse/discourse/pull/32379. Specifically, it:

* Removes the ‘Logos and fonts’ banner
* Removes the icon from the palette names in the list
* Moves the ‘new’ button to the top of the palette list
* Excludes theme-owned color palettes from the color palettes page since
these will be editable directly from the theme page
* Makes the name the primary text if a color has no description
* Adds a button next to the name field to save just the name
* Adds a ‘Delete’ button alongside the existing ‘Duplicate’ button
* Adds a ‘Revert’ button to change a modified color back to its default
value (based on the base palette of the palette)
2025-05-07 17:53:50 +03:00
6455e75da1 DEV: Add locale for topics (#32619)
Similar to https://github.com/discourse/discourse/pull/32526.

Reviewer note: There had been some deliberation if we should just take
the `topic.first_post.locale` instead of having a `topic.locale`.
Ultimately, titles may be of a different language of the post itself,
and secondarily in some cases it could be faster without having to load
the first_post at all.
2025-05-07 22:25:58 +08:00
61de461412 DEV: Refactor lazy-video initialization for Glimmer compatibility (#32599)
Modernizes the renderGlimmer API to use Glimmer components, replacing
deprecated ember-cli-htmlbars templates. Adds deprecation warnings for
invalid parameters and improves compatibility with the new Glimmer Post
Stream API.
2025-05-07 10:47:02 -03:00
5de93abbaa DEV: Remap legacy breakpoints to new rem versions (#32530) 2025-05-07 13:20:13 +01:00
25bb2ea2ab DEV: ensures trace/video is configured after driver (#32617)
Order matters and was the source of oddities.
2025-05-07 13:00:41 +02:00
03f3e84ce5 DEV: move file instead of rewriting it (#32616)
It was not working locally and should just be less wasteful.
2025-05-07 10:31:12 +02:00
a2c3adc90e DEV: remove load-more mixin (#32557)
Follow up from https://github.com/discourse/discourse/pull/32285 and
https://github.com/discourse/discourse/pull/32363.

Removes the load-more mixin file.
2025-05-07 16:19:17 +08:00
addaa03192 DEV: uses local playwright chromium for now (#32613)
We have had multiple issues while using the chrome channel:
- super slow start of the spec, I can confirm I don't have it on
chromium
- more risk of different failures between local dev machines and CI

There was a test not working on chromium, as it doesn't have mp4 codecs
out of the box. I changed the spec to use webm instead and it's now
working correctly.

This commit also fixes a bug with the video/trace paths which were
incorrect, and also makes another test less flakey with uploads event
though Im not very clear on what is going on here, we need to dig this.

We now need to figure out a way to have this on the test image, but this
is for now a better solution.
2025-05-07 10:17:25 +02:00
b16fb6a60b FIX: Ensure hashtag_lookup falls back to system user if post user is deleted (#32466)
`hashtag_lookup` fails if called with a deleted user's ID. This change
defaults to system user if the user does not exist.
2025-05-07 15:49:49 +10:00
dcc0eff0c7 DEV: remove theme_download_screenshots site setting (#32612)
Enable theme screenshots to everyone

![Screenshot 2025-05-07 at 10 21
48 am](https://github.com/user-attachments/assets/263cc256-c6c6-49ed-bb9b-0ddff9bb1ecb)
2025-05-07 12:09:20 +08:00
3a8c8dfddb FIX: Don't enforce strict loading on anon user main record (#32590)
Chat is currently broken in local development if anonymous mode is enabled in site settings. This is happening after #32416. One of the strict_loading directives in ChannelFetcher is trickling down to an anonymous user check.

We don't need to enforce strict_loading on this 1-to-1 association that's only used in a few code paths, so mark it as strict_loading: false on the User model.
2025-05-07 09:46:07 +08:00
18bbfa87ed DEV: replace select-kit utils mixin methods with input-utils lib (#32594)
This PR replaces the set of methods related to validation and
normalization of input values in the select-kit utils mixin with simple
exported functions from a input-utils lib file.

We maintain the `_normalize` method on the select-kit component because
there are external repos dependent on that part of the interface.

We'll replace the remainder of the mixin with another utils lib file in
a separate PR.
2025-05-07 09:25:52 +08:00
bff638888c FIX: improvements for admin search (#32574)
Instead of simple match keywords, search login was a bit enhanced by calculating score.

20 points if item label starts with searched phrase. This is to prioritize automation when auto is typed;
10 points for each exact word matches keywords. This is to prioritize discourse-ai when ai is typed;
5 points if matches fallback to original phrase match.
In addition, stop showing loading sign when modal is opened.
2025-05-07 09:23:19 +08:00
d39401a190 Build(deps-dev): Bump capybara-playwright-driver from 0.5.5 to 0.5.6 (#32607)
Bumps
[capybara-playwright-driver](https://github.com/YusukeIwaki/capybara-playwright-driver)
from 0.5.5 to 0.5.6.
-
[Commits](https://github.com/YusukeIwaki/capybara-playwright-driver/compare/0.5.5...0.5.6)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-07 01:58:03 +02:00
31ad00a1c2 Build(deps): Bump version_gem from 1.1.7 to 1.1.8 (#32608)
Bumps [version_gem](https://gitlab.com/oauth-xx/version_gem) from 1.1.7
to 1.1.8.
-
[Commits](https://gitlab.com/oauth-xx/version_gem/compare/v1.1.7...v1.1.8)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-07 01:57:54 +02:00
35cfd0dc89 Build(deps-dev): Bump mime-types-data from 3.2025.0402 to 3.2025.0506 (#32606)
Bumps [mime-types-data](https://github.com/mime-types/mime-types-data)
from 3.2025.0402 to 3.2025.0506.
-
[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.0402...v3.2025.0506)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-07 01:57:27 +02:00
652492ea38 Build(deps-dev): Bump webpack from 5.99.7 to 5.99.8 (#32605)
Bumps [webpack](https://github.com/webpack/webpack) from 5.99.7 to
5.99.8.
- [Release notes](https://github.com/webpack/webpack/releases)
-
[Commits](https://github.com/webpack/webpack/compare/v5.99.7...v5.99.8)

---------

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-05-07 01:23:13 +02:00
3f070bd76f DEV: Fix typo in tests workflow (#32611) 2025-05-07 07:15:49 +08:00