Commit Graph

58490 Commits

Author SHA1 Message Date
b80e8180ee DEV: [gjs-codemod] add codemod commit to git-blame-ignore-revs 2025-03-19 10:21:07 +00:00
a017f566a8 DEV: [gjs-codemod] convert second batch of files to gjs
Updated using `@embroider/template-tag-codemod`, plus some manual fixups.

Co-authored-by: Jarek Radosz <jarek@cvx.dev>
2025-03-19 10:20:56 +00:00
f049f775c7 DEV: [gjs-codemod] merge js and hbs 2025-03-19 10:18:20 +00:00
27f17ccee2 DEV: [gjs-codemod] renamed js to gjs 2025-03-19 10:18:19 +00:00
b0f19109b3 DEV: [gjs-codemod] renamed hbs to gjs 2025-03-19 10:18:12 +00:00
e0a4adb224 FIX: Safely restart Sidekiq when mem usage is high (#31883)
This commit changes the way Sidekiq is restarted when memory limit is
exceeded. The HUP signal was replaced with TERM, as mentioned in the
official documentation. The stopping timeout has been set to 10 seconds
to account for the Sidekiq timeout (5 seconds) and another for it
shutdown cleanly (5 more seconds).

See https://github.com/sidekiq/sidekiq/wiki/Deployment.
2025-03-19 11:47:28 +02:00
1cde30e6bd FIX: Don't error out after destroying first post with webhook configured (#31902)
When hard deleting a first post by passing force_destroy: true as an option to PostDestroyer, the post/topic is correctly deleted, and the staff record is created, but the app then errors out.

This only happens on sites with a topic_destroyed webhook setup.

After deleting the record, we pass the topic's ID to TopicView, which then raises an error because it can not load it from the DB.

TopicView supports being initialized with either an ID or an already instantiated record. Since we still have the record in memory after deleting, we can pass that to TopicView.
2025-03-19 16:30:27 +08:00
c0630dbee4 DEV: Make group auto e-mail domain limit configurable (#31873)
We currently limit the number of characters in the bar-separated list of auto-membership e-mail domains. We want to make this configurable through site settings.

After this change, we limit the length of each individual domain, and enable the number of domains to be configured through a hidden site setting.

The original limit is there to prevent DoS, since a TEXT column can take up to 1Gb. With this new limit we're still at a maximum of around 10kb.
2025-03-19 14:33:50 +08:00
7d402ddb76 DEV: remove unnecessary use of buffered mixin in share-topic modal (#31871)
Use of the buffer API within this component was removed back in
https://github.com/discourse/discourse/pull/23940.
2025-03-19 12:37:37 +08:00
b20f6bd620 DEV: Remove flaky system test (#31899)
This commit removes a flaky system test without replacement given that
the test isn't really testing something in the critical path or
something that happens often.

### Reviewer notes

Example of flakiness:

1.
https://github.com/discourse/discourse/actions/runs/13901410315/job/38893877234
2.
https://github.com/discourse/discourse/actions/runs/12362090310/job/34500684809
2025-03-19 12:20:23 +08:00
22a00fd872 UX: Add separator for "Learn more..." on admin pages (#31898)
We have this rule in

https://meta.discourse.org/t/formatting-text-in-discourse-documentation-and-uis/324637:

> Do not use a period for the following:
>
> Tooltips, image captions, or other UI elements with only one sentence

However, this looks strange on some admin pages because we also show
a "Learn more..." link after the header description, which kind of
runs on into the link.

This commit adds a separator after the link to address this issue.
2025-03-19 13:34:17 +10:00
625d086f35 UX: Themes & components I18n adjustments (#31897)
Moves the Themes & components I18n text to use the
admin > config structure, so the description shows
up properly in admin search
2025-03-19 13:24:05 +10:00
e63716d650 FIX: Updating a group without e-mail domains (#31896)
The change made in #31854 introduced a regression when editing groups, preventing saving when no auto membership e-mail domains are entered.

This change fixes that and adds a system test.
2025-03-19 10:38:41 +08:00
622d681f96 FIX: twitter_summary_large_image is renamed to x (#31870)
In this PR x_summary_large_image was introduced but now updated in all
places.

Also `min_first_post_typing_time` deprecation should not be removed.
2025-03-19 11:55:11 +11:00
a34e0433cc FEATURE: Allow typing/pasting colors in palette editor (#31811)
Follow-up to https://github.com/discourse/discourse/pull/31742

Adding a text input field to type in or paste color values can be useful
when creating/editing a color palette with specific colors.
2025-03-19 03:45:22 +03:00
52cfe766f9 UX: Remove bg color on search info (#31895) 2025-03-18 19:43:27 -05:00
6fa6d32ac4 UX: avoid autocomplete/input rules on rich editor inline code (#31836)
Avoids autocompleting or applying mention/emoji/hashtag/any input rules on
rich editor inline code.

There's also a refactor on how the params are passed to input rules – we
now use the same params from plugins, keeping it more consistent.
2025-03-18 20:23:17 -03:00
e242edd40d DEV: Fix scss deprecation warning (#31893) 2025-03-18 23:51:48 +01:00
d21aa14e2c DEV: Do not use string based actions in components (#31891) 2025-03-18 22:54:08 +01:00
0313eff1fe DEV: Bump lint-configs (#31881) 2025-03-18 21:55:10 +01:00
9e7384298b DEV: Introduce postcss minmax transform (#31885)
This will auto-transform media query range syntax like `width < 100px`
into the more-widely-supported min/max-width syntax
2025-03-18 19:28:52 +00:00
a46d2ef40c DEV: Pluralize email domain count string (#31877)
The string introduced in
https://github.com/discourse/discourse/pull/31854 included a count but
was not pluralized. Even though the singular form may not be used in
English, proper pluralization is necessary for other languages. Some
languages have different plural forms depending on the number, so
explicitly defining pluralization ensures accurate translations.
2025-03-18 18:25:13 +01:00
464da9a4fb Update translations (#31875) 2025-03-18 15:08:14 +01:00
1a7303a35e FIX: Amend broken group automatic member dialog (#31854)
When creating or editing a group, we are meant to show a dialog telling the admin how many members will be automatically added.
2025-03-18 19:37:37 +08:00
fb5cdb1da4 DEV: Grant all anniversary badges during imports (#31830)
This change adds an import step to retroactively grant anniversary
badges to users.
2025-03-18 10:45:47 +00:00
b1b2b8e4c8 UX: keep existing marks when pasting a url to make a link in rich editor (#31814) 2025-03-18 07:15:35 -03:00
c0c6c55809 DEV: Make expanding select-kit more reliable in system tests (#31868)
Before this commit,
`PageObjects::Components::SelectKit#expanded_component` might not expand
the component if `is_collapsed?` returns true which can return true if
the method was called before the select-kit component appears on the
screen. When that happens, we end up not expanding the `select-kit`
because we think it is collapsed when in fact the select-kit component
is not rendered yet. This lead to system test failures with errors like:

```
Capybara::ElementNotFound:
  Unable to find css "#add-synonyms.is-expanded"
```

This commit updates `PageObjects::Components::SelectKit#is_collapsed?`
to check that the select-kit component has rendered first before
checking if the component is not expanded.
### Reviewer notes

Instances of test flakiness due to this bug:

1.
https://github.com/discourse/discourse/actions/runs/13905226478/job/38906569777
2.
https://github.com/discourse/discourse/actions/runs/13848357836/job/38751122333
2025-03-18 16:46:39 +08:00
f09c8f61c8 DEV: Fix flaky automation system test (#31867)
This commit updates `PageObjects::Pages::Automation#update` to check
that the button is not disabled before clicking the button.

### Reviewer notes

Instances of flakiness:
1.
https://github.com/discourse/discourse/actions/runs/13864294630/job/38801362996
2.
https://github.com/discourse/discourse/actions/runs/13392214535/job/37402368070
2025-03-18 15:13:59 +08:00
76dce62cf2 DEV: Move media query to breakpoint scss (#31865) 2025-03-17 20:37:56 -05:00
9d14492f22 FIX: When displaying a reviewable, don't append the title to the content (#31851)
Follow up to e4401e587e98ac4020c2c4fd965e227146cf33d4.

In the previous change, when serialising a Reviewable post, we were appending the title to the post content whilst checking for watched word matches. This append action was acting upon the object itself, rather than just a copy of the string, causing the UI to display the title appended twice to the content.

Fortunately, since it was only happening in the serialiser, the incorrect data was never stored in the database, it was only happening when viewing the review queue.
2025-03-18 11:57:39 +11:00
fbef97c632 DEV: Skip another flaky test on CI (#31864)
### Reviewer notes 

Instances of test flake: 

1.
https://github.com/discourse/discourse/actions/runs/13911507249/job/38926557337
2.
https://github.com/discourse/discourse/actions/runs/13902570393/job/38897729522
2025-03-18 08:50:11 +08:00
6cd282eeb3 FEATURE: Display a toast popup after completing a review action. (#31786)
When performing an action in the review queue, this change makes two improvements:

- The buttons on the reviewable item are disabled, so you can't accidentally multi-click.
- A toast is displayed when the action is complete, as a success indication.
2025-03-18 11:26:59 +11:00
4816bceaf6 DEV: Correct log level when logging in Demon::Base (#31853)
This commit updates the log level for certain log messages to the
approporiate level for the severity of the message being logged.
2025-03-18 08:12:47 +08:00
5002f95259 DEV: Remove flaky system test and replace it with simpler unit test (#31855)
This commit removes a system test that has been flaky in Github's CI and
replaces it with a much simpler unit test that covers the fix introduced
in 48c8ed49d6eda40fbee0d926ea67a81f2851e641


### Reviewer notes

Example of multiple flakes in CI:
1.
https://github.com/discourse/discourse/actions/runs/13888933997/job/38857572872
2.
https://github.com/discourse/discourse/actions/runs/13793587465/job/38579530997
2025-03-18 08:12:38 +08:00
429a10b2b9 FIX: uploader lightbox preview for new images (#31762)
It is an old bug that preview is not working for newly uploaded images.
To fix it, we need to initialize lightbox when image is rendered and not
when component.

We have Qunit test when image is already available
https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/tests/integration/components/uppy-image-uploader-test.gjs#L28

System test was added to ensure lightbox is working right after image is
uploaded.

<img width="1236" alt="Screenshot 2025-03-12 at 10 23 18 am"
src="https://github.com/user-attachments/assets/3984306b-f351-4b35-936c-eb7f0e57ea9d"
/>

After fix


https://github.com/user-attachments/assets/1091cd55-b24b-4640-8e8f-a60c3426ff65
2025-03-18 10:01:55 +11:00
998264b665 UX: header search adjustments (#31863) 2025-03-17 17:59:21 -05:00
2e2e2b37ff UX: re-hide hidden upload field (#31861)
follow-up to
6d92165ae7,
rehides this:


before:


![image](https://github.com/user-attachments/assets/34f07b8c-a547-476f-bfc4-ba92bd6f056e)


after: 


![image](https://github.com/user-attachments/assets/d2f18305-75e0-47f2-9ef9-d3a3a31d43d6)
2025-03-17 14:54:37 -04:00
7b874b6a85 DEV: merge mobile stylesheets into common (#31838)
This eliminates the mobile dashboard, edit-category, and sidebar
stylesheets and moves the relevant styles into the common directory
files
2025-03-17 13:53:05 -04:00
ecbd3cc93a DEV: Fix custom homepage crawler display and override (#31841)
Fixes the custom homepage crawler output to include links to the site's
top menu.

![CleanShot 2025-03-15 at 16 27
16@2x](https://github.com/user-attachments/assets/57f25b65-a218-4811-b7d4-211e3d60e586)

This also provides a way to override that content via a plugin. Example
usage in a `plugin.rb` file:

```
register_html_builder("server:custom-homepage-crawler-view") do |c|
  "<div>override</div>"
end
```
2025-03-17 13:06:09 -04:00
08d99dc44a DEV: normalize tag text color assignment (#31860)
This reduces some duplicate color assignment to tags and rolls them up
under a common css var

```css
:root {
  --tag-text-color: var(--primary-high);
}

.extra-info-wrapper {
  --tag-text-color: var(--header_primary-high);
}
```

This also makes the tag separator color consistent with the tag color,
by setting it to `--tag-text-color`

Ultimately we have 3 tag text color states (this appeared to be
consistent across all tag styles):
* Default: primary-high
* Header: header__primary-high
* Visited topic in the topic list: primary-medium
2025-03-17 12:54:15 -04:00
c07c954809 DEV: Remove search_result_view search menu app event in favor of search_menu_opened (#31777) 2025-03-17 09:54:09 -05:00
06b7b4981f DEV: Improve color-definition stylesheet failure mode (#31858)
- Raise exception in dev/test environments
- Include a clue about the failure via a comment in production mode
2025-03-17 14:04:26 +00:00
c3c2ee2a03 UX: Improve loading state when changing admin user list (#31856)
Previously we were showing a loading spinner, but the old user list
persisted so the spinner was often off the bottom of the screen. This
commit updates the `users` list to be a getter, so it's always perfectly
in-sync with the `_results` set. That means no users will be shown while
a new list is being loaded, so the spinner is more visible.


https://meta.discourse.org/t/load-spinner-missing-from-dynamic-pages/357525/4
2025-03-17 14:03:17 +00:00
2bca748a05 Revert "DEV: remove singleton mixin (#31823)" (#31857)
This reverts commit 992bdf173ad8ad25764c0a89132bc35df4c81f12.

This change was causing issues in a [third party
plugin](https://meta.discourse.org/t/events-plugin):
https://meta.discourse.org/t/events-plugin/69776/869

```
Uncaught Error: Could not find module `discourse/mixins/singleton` imported from `discourse/plugins/discourse-events/discourse/models/provider`
    at loader.js:247:1
    at h (loader.js:258:1)
    at u.findDeps (loader.js:168:1)
    at h (loader.js:262:1)
    at u.findDeps (loader.js:168:1)
    at h (loader.js:262:1)
    at requireModule (loader.js:24:1)
    at y (app.js:170:18)
    at b (app.js:193:19)
    at app.js:156:29
    at g.start (app.js:167:1)
    at HTMLDocument.<anonymous> (start-app.js:5:7)
    at discourse-boot.js:13:12
    at discourse-boot.js:1:1
```
2025-03-17 14:43:14 +01:00
e2b3eb4c28 Build(deps-dev): Bump message-bus-client from 4.3.9 to 4.4.0 (#31843)
Bumps [message-bus-client](https://github.com/discourse/message_bus)
from 4.3.9 to 4.4.0.
-
[Changelog](https://github.com/discourse/message_bus/blob/main/CHANGELOG)
-
[Commits](https://github.com/discourse/message_bus/compare/v4.3.9...v4.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-17 15:05:10 +08:00
7be5b8a6a8 Build(deps): Bump nokogiri from 1.18.3 to 1.18.4 (#31844)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.18.3
to 1.18.4.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
-
[Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.18.4/CHANGELOG.md)
-
[Commits](https://github.com/sparklemotion/nokogiri/compare/v1.18.3...v1.18.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-17 15:04:47 +08:00
327375abee FIX: Use theme screenshot names in theme fields (#31852)
Currently we allow for 2 theme screenshots to be specified,
with a lightweight spec to allow both a light and dark
version of the screenshot. However, we were not storing this
screenshot name anywhere, so we would not be able to use it
for light/dark switching.

This commit fixes that issue, and also does some general refactoring
around theme screenshots, and adds more tests.
2025-03-17 15:56:19 +10:00
d0a5fd5e21 Build(deps-dev): Bump rubocop-ast from 1.38.1 to 1.39.0 (#31847)
Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.38.1
to 1.39.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.38.1...v1.39.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-17 15:42:57 +11:00
097e1d7ee4 Build(deps): Bump google-protobuf from 4.30.0 to 4.30.1 (#31846)
Bumps [google-protobuf](https://github.com/protocolbuffers/protobuf)
from 4.30.0 to 4.30.1.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
-
[Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
-
[Commits](https://github.com/protocolbuffers/protobuf/compare/v4.30.0...v4.30.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-17 15:23:24 +11:00
6af9f415bf DEV: Skip a flaky test (#31850)
Test is flaking in CI with:

```
Failure/Error: expect(theme_translations_settings_editor.get_input_value).to have_content("Bonjour!")
  expected to find text "Bonjour!" in "Hello there!"

[Screenshot Image]: /__w/discourse/discourse/tmp/capybara/failures_r_spec_example_groups_admin_customize_themes_when_editing_theme_translations_should_allow_admin_to_edit_and_save_the_theme_translations_from_other_languages_797.png

~~~~~~~ JS LOGS ~~~~~~~
(no logs)
~~~~~ END JS LOGS ~~~~~

./spec/system/admin_customize_themes_spec.rb:158:in `block (3 levels) in <main>'
```
2025-03-17 10:47:37 +08:00