Commit Graph

59392 Commits

Author SHA1 Message Date
58d14b075d FEATURE: trigger an event when chat channel is trashed (#32844)
Required for this PR:
https://github.com/discourse/discourse-livestream/pull/55
2025-05-22 09:48:32 +05:30
93e1ba365f DEV: Use ampersand for themes and components admin section (#32855)
We use ampersand to concatenate sidebar sections, e.g. Login & authentication, Logs & screening, etc.

This updates Themes & components to have the same.
2025-05-22 11:08:51 +08:00
2b6efa56f3 DEV: Add site description to crawler homepage view (#32845)
In some cases, Google crawlers don't output the meta description but
rather they output the first bit of text in the UI. Sometimes that is a
mix of table headings, topic titles and excerpts, which don't reflect
the site's mission. Adding the description to the homepage header might
help.

Internal ticket t/154372
2025-05-22 08:33:59 +10:00
b3a39ccdf6 UX: Update unsaved changes popup (#32849)
This PR slightly updates the unsaved changes popup in the admin panel.

# New
| desktop | mobile | 
|--|--|
| ![CleanShot 2025-05-21 at 16 18
18@2x](https://github.com/user-attachments/assets/923468a5-49a3-431c-823f-b5e2b67b0585)|
![CleanShot 2025-05-21 at 16 20
30@2x](https://github.com/user-attachments/assets/297f7804-2fe0-431b-9091-4d914618481b)|


# Old

| desktop | mobile | 
|--|--|
| ![CleanShot 2025-05-21 at 16 18
32@2x](https://github.com/user-attachments/assets/d471aef4-df89-450c-ab3f-d11781959cf8)
| ![CleanShot 2025-05-21 at 16 19
33@2x](https://github.com/user-attachments/assets/6db7f98f-93a5-4aeb-8e43-167da445fddd)
|
2025-05-22 08:11:39 +10:00
3b0889facd DEV: Add jsDiff dependency (#32833)
For use in Discourse AI
(https://github.com/discourse/discourse-ai/pull/1355)
2025-05-22 07:22:11 +10:00
52c6c852df DEV: new topic map outlet and header participant flexibility (#32826)
Header: 
* Allows optional avatar size for header participant component (for
reuse elsewhere)

Topic map:
* Adds a new `topic-map-participants-after` outlet
* Removes an `!important`
2025-05-21 09:59:57 -04:00
ae395dab3c UX: fix overflow name in usercard (#32838)
![CleanShot 2025-05-21 at 10 16
44@2x](https://github.com/user-attachments/assets/76640201-e153-43a9-9205-06d33621e1ce)
⬇️ 
![CleanShot 2025-05-21 at 10 16
35@2x](https://github.com/user-attachments/assets/a61e8524-f504-4b5d-8acb-82c65c08177a)
2025-05-21 15:25:14 +02:00
ae4ee7754f DEV: Update linting (#32836) 2025-05-21 12:02:52 +02:00
94e653af08 FEATURE: Also localize topic excerpts (#32839)
Currently, topic excerpts are not localized.

This commit adds the excerpt column into topic_localization and displays the
localized excerpt if present.
2025-05-21 17:49:27 +08:00
b7fcc0e854 DEV: Fix state leak in test (#32835)
```
rspec --seed 52075 spec/models/site_spec.rb spec/lib/freedom_patches/translate_accelerator_spec.rb

Randomized with seed 52075
....................................................F

Failures:

  1) translate accelerator plugins loads plural rules from plugins
     Failure/Error: self.locale_no_cache = value

     I18n::InvalidLocale:
       :foo is not a valid locale
     # ./lib/freedom_patches/translate_accelerator.rb:254:in 'I18n.locale='
     # ./spec/lib/freedom_patches/translate_accelerator_spec.rb:118:in 'block (3 levels) in <main>'
```

This is because setting `I18n.config.available_locales` is equivalent to
hard coding the
locales for the entire process. It should not be set so that `I18n` will
fallback to `backend.locales`.
2025-05-21 16:33:53 +08:00
02bc561db3 DEV: allows to pass @currentWhen to NavItem (#32825)
Some cases are more complex than the default behavior of
`this.router.isActive(this.args.route)`, in this case you can give use
`@currentWhen` on your `NavItem` component.

Example:

```gjs
get isItCurrent() {
  return true;
}

<template>
  <NavItem @i18nLabel="test" @currentWhen={{this.isItCurrent}} />
</template>

<template>
  <NavItem @i18nLabel="test" @currentWhen="foo" />
</template>

<template>
  <NavItem @i18nLabel="test" @currentWhen="foo.show foo.index" />
</template>
```

No test as I can't write a component test for this as it relies on the
router.
2025-05-21 09:31:47 +02:00
66e210b41c Build(deps-dev): Bump webpack from 5.99.8 to 5.99.9 (#32827)
Bumps [webpack](https://github.com/webpack/webpack) from 5.99.8 to
5.99.9.
- [Release notes](https://github.com/webpack/webpack/releases)
-
[Commits](https://github.com/webpack/webpack/compare/v5.99.8...v5.99.9)

---------

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-21 09:19:16 +02:00
945a214e46 Build(deps-dev): Bump puppeteer-core from 24.8.2 to 24.9.0 (#32828) 2025-05-21 07:09:04 +02:00
cab2e1a8d5 Build(deps-dev): Bump mime-types-data from 3.2025.0514 to 3.2025.0520 (#32832)
Bumps [mime-types-data](https://github.com/mime-types/mime-types-data)
from 3.2025.0514 to 3.2025.0520.
-
[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.0514...v3.2025.0520)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 10:37:43 +08:00
bacf120559 Build(deps-dev): Bump hashdiff from 1.1.2 to 1.2.0 (#32830)
Bumps [hashdiff](https://github.com/liufengyun/hashdiff) from 1.1.2 to
1.2.0.
-
[Changelog](https://github.com/liufengyun/hashdiff/blob/master/changelog.md)
-
[Commits](https://github.com/liufengyun/hashdiff/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-21 10:37:23 +08:00
11ee8e4fd5 Build(deps-dev): Bump rails-dom-testing from 2.2.0 to 2.3.0 (#32829)
Bumps [rails-dom-testing](https://github.com/rails/rails-dom-testing)
from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/rails/rails-dom-testing/releases)
-
[Commits](https://github.com/rails/rails-dom-testing/compare/v2.2.0...v2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 10:37:10 +08:00
823fcc333d Build(deps-dev): Bump zeitwerk from 2.7.2 to 2.7.3 (#32831)
Bumps [zeitwerk](https://github.com/fxn/zeitwerk) from 2.7.2 to 2.7.3.
- [Changelog](https://github.com/fxn/zeitwerk/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fxn/zeitwerk/compare/v2.7.2...v2.7.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 10:36:46 +08:00
1eba96a75f DEV: Remove branding and styling steps from wizard (#32797)
https://github.com/discourse/discourse/pull/32797
2025-05-21 09:46:49 +08:00
5c041a14ba UX: Close admin search modal immediately when result is selected (#32811)
Previously it was relying on the default Modal behavior, which is to
close **after** the next route transition.
2025-05-21 08:09:15 +10:00
9d70336bab DEV: support un-hiding site settings programmatically (#32824)
This might be useful to revert changes made by plugins when they're
disabled for example.
2025-05-20 21:44:56 +02:00
ce2f096045 DEV: Remove Top route title for crawlers (#32820)
These lines of code would output "Period - Site name" as the page title
for the crawlier view only for Top routes. This is too specific and
unnecessary, since the top route isn't highly prioritized for crawlers.
Without this, the page title defaults to "Site name" for these routes.

One major advantage of this change is that when the homepage is set to
the Top route, the page title for crawlers on the homepage is now "Site
name", which is a lot better.
2025-05-20 13:52:00 -04:00
6640a9d234 UX: improve mobile date picker slightly (#32822)
As seen in the advanced search filters... iOS doesn't show placeholders
for the date input, so we have a CSS adjustment for this, but it doesn't
clear when a value is present.

This update adds a class when a value is present so the placeholder can
be cleared.

Before:

![image](https://github.com/user-attachments/assets/37edad10-886b-41d7-b412-b303be351603)


After:

![image](https://github.com/user-attachments/assets/fee713ab-09f9-49fb-9fda-96bd72a260e1)


Also fixed extra left margin by removing a class.
2025-05-20 11:49:58 -04:00
f2ed537559 Update translations (#32815) 2025-05-20 17:33:42 +02:00
349d7df52b PERF: prevents N+1 on last_updated_by (#32817) 2025-05-20 17:07:37 +02:00
9a7a576dc1 DEV: Add below-login-page PluginOutlet to login.gjs (#32821) 2025-05-20 10:01:50 -05:00
0de08e780b UX: better error message when social login fails (#32772)
This improves the error message(s) displayed when an error happens while
using a social login to log in / sign up into a Discourse community.

Unfortunately, we can't be super precise in the reason behind the error
(it can be the user clicked "cancel" during the authorization phase, or
any of the plethora of other possible errors) because the reason isn't
provided (either for security reasons, or because it's just hard to do
so in a reliable & consistent way accross all social logins).

The best I could do was to

- add the name of the "social login" provider in the error message
- tweak the copy a bit for the different cases handle
- fix the CSS/HTML to match the one used by the main application

In order to show the name of the provider, we use either the "provider"
or the "strategy" query parameter, or use the name of the authenticator
(if it's the only one enabled).

Internal ref - t/153662

---

**BEFORE**


![before](https://github.com/user-attachments/assets/67579a3e-5a61-4e8f-aa72-4dc375547e39)

**AFTER**


![after](https://github.com/user-attachments/assets/954f9c8a-e865-44ff-b1e3-841393a26edf)
2025-05-20 16:22:38 +02:00
fe4c02f5d8 DEV: Resolve flaky ThemeField spec (#32818)
This error sometimes includes a filepath in the middle, which has a
random tmp/ prefix. To workaround this, we can just assert for the
"Missed semicolon" part
2025-05-20 14:53:36 +01:00
796bc10f8b UX: adjust styling for composer tip similar topics + limit amount (#32774)
** Will still need followup to only show 3 topics – handled in different
PR **
* remove blurb
* adjust sizing
* limit to 3 topics

![CleanShot 2025-05-16 at 20 33
42@2x](https://github.com/user-attachments/assets/70547903-1d6c-4af0-9efb-2ea0b06dc1c1)
⬇️ 
![CleanShot 2025-05-16 at 20 33
10@2x](https://github.com/user-attachments/assets/e8c5bd16-c188-4fde-bb12-4bec00e703e9)



![CleanShot 2025-05-16 at 20 34
58@2x](https://github.com/user-attachments/assets/0d6f197d-e919-4560-8b2e-6775e0ddac85)
⬇️ 

![CleanShot 2025-05-16 at 20 35
32@2x](https://github.com/user-attachments/assets/1a29fe49-44d1-43fa-90ff-457c4f8e19d9)

---------

Co-authored-by: David Battersby <info@davidbattersby.com>
2025-05-20 14:58:47 +02:00
70e517153b FIX: Add missing translation for reviewable post action (#32813) 2025-05-20 09:51:42 -03:00
1a31769676 PERF: correctly use preloaded association (#32814) 2025-05-20 14:34:19 +02:00
0f35647c5d DEV: removes unnecessary lines (#32812)
Technically we want to follow DDAU but most of our usage in the code
base are just mutating `@checked`. This will eventually get converted to
form-kit but in the meantime we can just remove this bit of code as it's
doing two times the same thing and you could even end up in the
situation where they both fight for what is the correct value.
2025-05-20 14:03:14 +02:00
4c9384e50d PERF: fixes N+1 for automation plugin (#32810)
- Add a safeguard until we implement pagination for the index, it
ensures we won't try to load more than 500 automations ever.
- Includes the fields of the automation so we don't have an N+1 and also
filter them in ruby land instead of doing two additional queries
- Ensures a field object in the field serializer is capable to find the
loaded automation associated to it instead of trying to reload it
- Includes pending_automations to avoid an N+1
2025-05-20 12:24:07 +02:00
f955d04d9c Build(deps): Bump rdoc from 6.13.1 to 6.14.0 (#32809)
Bumps [rdoc](https://github.com/ruby/rdoc) from 6.13.1 to 6.14.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.13.1...v6.14.0)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jarek Radosz <jarek@cvx.dev>
2025-05-20 00:57:55 +02:00
bbb9583131 UX: fix alignment of more topics nav pills (#32808)
Trying to stabilize these styles, applied padding to match th elements,
adjusted for border, removed unique hover/active styles


Before (desktop/mobile):

<img
src="https://github.com/user-attachments/assets/9eaa88c0-06bc-4de1-8c61-5be7c00cadeb"
width=600>


![image](https://github.com/user-attachments/assets/8433d1f0-ebf0-45cd-8d99-22ed8f01917c)

After:

![image](https://github.com/user-attachments/assets/50294c39-3e56-45ce-bb6e-08d7da879305)

![image](https://github.com/user-attachments/assets/20f37cd7-8c41-40ad-affd-904e7e143b9d)
2025-05-20 07:36:12 +10:00
f8d61a341e Revert "DEV: Make outletArgs available as regular arguments in Plugin… (#32807)
…Outlet (#32742)"

This reverts commit 707a91243c35ea1693b80249e1c00fb5320f47cb.

This is causing some unexpected re-rendering. Reverting while we
investigate
2025-05-19 20:45:26 +01:00
1a959cf9cc DEV: Add test for plugin-outlet whitespace (#32805)
Fixes for recent regressions:
- da6b82f7767cbeb038dfbebda92a4474626ff1e8
- 2a18834db1cb6b9c8f071eeab8554257336b2802

These tests should stop it happening for a third time 😅
2025-05-19 17:13:23 +01:00
72b6ad42f3 FIX: ensures we have changed page first (#32802)
We should check the H1 is not present anymore only once we have
confirmed we changed page.
2025-05-19 17:44:56 +02:00
69a5da7208 FIX: headerSearch not always appearing when welcomeBanner is removed (#32804)
To reproduce...

Site settings must be enabled:  
`Enable welcome banner`
`Search experience` = `Search field in site header` 

1. Visit /categories, refresh, do not scroll
2. Click a category 
3. Observe no search banner or header search


![image](https://github.com/user-attachments/assets/3e9da6cd-aa8b-4141-8e98-5419e54ef685)

The fix resets `welcomeBannerSearchInViewport` when the search banner
component is destroyed.


![image](https://github.com/user-attachments/assets/63d799e7-4b1b-4e55-bb1b-cc2555a12a50)
2025-05-19 10:52:02 -04:00
da6b82f776 DEV: Remove accidental whitespace from PluginOutlet (#32803)
A followup to 707a91243c35ea1693b80249e1c00fb5320f47cb
2025-05-19 16:27:35 +02:00
b8d733045f FIX: Catch postcss errors correctly for theme fields (#32800) 2025-05-19 13:19:49 +01:00
707a91243c DEV: Make outletArgs available as regular arguments in PluginOutlet (#32742)
Historically, plugin outlet arguments had to be accessed like
`@outletArgs.foo` in templates, or `this.args.outletArgs.foo` in
javascript. Following this commit, outletArgs will be passed to
connectors at the top level, so they can be accessed like `@foo` in
templates or `this.args.foo` in JS.

`@outletArgs` remains available for compatibility, and there are no
plans to remove it.

For custom classic component connectors, these new arguments may clash
with functions/fields defined on the component class. This rare case
will be automatically detected, protected against, and a deprecation
will be shown.
2025-05-19 11:09:40 +01:00
d86b4ff298 DEV: Remove precompile for locale js (#32799)
The Rails asset pipeline isn't used for locale bundles any more. Plus,
`assets.precompile` isn't used for anything since we switched to
propshaft.
2025-05-19 11:08:01 +01:00
5cf6ebf70c DEV: Deprecate inline script tags for templates & initializers (#32773)
https://meta.discourse.org/t/366482
2025-05-19 10:55:52 +01:00
1e368a04ec DEV: Move the catch-all route to the bottom (#32798)
This avoids making unnecessary database queries when routing to paths
that were positioned below this entry, e.g.

```
curl http://localhost:3000/form-templates

# SELECT 1 AS one FROM "permalinks" WHERE "permalinks"."url" = 'form-templates' LIMIT 1
# …
```
2025-05-19 11:06:37 +02:00
b9e919074d FIX: Wait for data before showing admin search results (#32796)
What is the problem?
When we construct the admin search component, we fire off a call to get data from the back-end. When this is done, there's an async callback that re-does the search. This can result in confusing flickering of the results.

This was compounded by a separate issue that caused the data endpoint to be extremely slow if we had two specific plugins installed at the same time. That issue has already been resolved.

The first time we construct the component (and fetch the data) we initialize it with a flag to indicate that data is still loading. Until the data is loaded, we will show the regular loading spinner if the admin starts typing.

On Meta the endpoint takes ~600ms. That countdown starts when you click or use the shortcut, then you need to start typing as well, so this delay shouldn't be a big issue.
2025-05-19 14:14:29 +08:00
76e1373b04 FIX: N+1 in admin themes page (#32763)
`strict_loading` was added to prevent it happening in the future. Few
adjustments had to be made:
- include color_scheme and color_scheme_colors, also for parent and
child themes;
- internal translations were using preload_fields, but it was too deep
to correctly use preloaded tables. I had to pass
`preloaded_locale_fields` manually;
- include theme in color_scheme.

Before:
<img width="663" alt="Screenshot 2025-05-15 at 3 43 47 pm"
src="https://github.com/user-attachments/assets/b55ce11e-80cb-43eb-8e31-940b0e9859f3"
/>

After:
<img width="665" alt="Screenshot 2025-05-16 at 11 29 00 am"
src="https://github.com/user-attachments/assets/f00bac19-f64b-4048-b220-4d0a9d90a929"
/>
2025-05-19 11:05:23 +08:00
b823fb297f FIX: skip flaky specs (#32786)
The proper fix was to apply what has been reverted in
7558e2c7cd
but we would have to break the API to apply this fix so I will just skip
these specs for now.
2025-05-19 09:47:37 +08:00
746c332df3 DEV: simplify test to remove flaky part (#32790)
This test is about testing that we can set notification_level, which it
does correctly. The rest of the spec was testing some undefined behavior
which is flaky.
2025-05-19 09:47:12 +08:00
8784a42940 Build(deps): Bump ember-resolver from 13.1.0 to 13.1.1 (#32793)
Bumps [ember-resolver](https://github.com/ember-cli/ember-resolver) from
13.1.0 to 13.1.1.
- [Release notes](https://github.com/ember-cli/ember-resolver/releases)
-
[Changelog](https://github.com/ember-cli/ember-resolver/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/ember-cli/ember-resolver/compare/v13.1.0...v13.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-19 09:46:59 +08:00
63be73730a Build(deps-dev): Bump rubocop-rails from 2.31.0 to 2.32.0 (#32791)
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from
2.31.0 to 2.32.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
-
[Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop-rails/compare/v2.31.0...v2.32.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-19 09:34:30 +08:00