Commit Graph

59554 Commits

Author SHA1 Message Date
9ead2e6720 PERF: Introduce lazyHash and update PluginOutlet calls to use it (#32823)
This is a more efficient version of `{{hash`, where the values are only evaluated when they're actually accessed. Also enables a new lint rule which will ensure `{{hash` is not reintroduced on PluginOutlets
2025-05-22 12:07:22 +01:00
f0fcac1243 DEV: Refactor Chat::LookupChannelThreads to follow best practices
- use `model` where possible
- extract threads fetching logic to its own action
- refactor specs to follow current guidelines/best practices
2025-05-22 12:06:54 +02:00
3e8c293fe9 Build(deps): Bump snaky_hash from 2.0.1 to 2.0.2 (#32853)
Bumps [snaky_hash](https://github.com/oauth-xx/snaky_hash) from 2.0.1 to
2.0.2.
-
[Changelog](https://github.com/oauth-xx/snaky_hash/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/oauth-xx/snaky_hash/compare/v2.0.1...v2.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 12:02:07 +02:00
03ea73c550 Build(deps-dev): Bump @swc/core from 1.11.24 to 1.11.29 (#32850)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.24 to
1.11.29.
- [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.24...v1.11.29)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 12:01:25 +02:00
e1984f886e FIX: forgotten background (#32857) 2025-05-22 12:00:52 +02:00
1fcb3a8b33 DEV: Port install theme button modal to new themes page (#32834)
We recently added a new themes and components page. We didn't port over the code that enables the Install theme button on Meta. It works by looking for certain query parameters and opening a special version of the install modal.

This PR is a lift-and-shift of that code from the old themes page.
2025-05-22 17:24:37 +08:00
5458e6ad2e FIX: Themes and components page title (#32856)
We removed a duplicate translation key, but it was being used here. Update the title token to use the canonical one.
2025-05-22 16:27:34 +08:00
11a0ad933a DEV: do not convert (tm) and (TM) to emoji (#32713)
This regressed because with recent emojis changes, the base name is now
`trade_mark` and not `tm`. `tm` is just an alias emoji.
2025-05-22 10:26:23 +02:00
0a156380cb UX: new styling for composer tips (#32843)
* Removed backgound from composer tips popup
* Added more spacing
* Made links the default link colour, so it's clear they are links.
* Applied `d-border-radius-large` var



![CleanShot 2025-05-21 at 17 26
14@2x](https://github.com/user-attachments/assets/2fbdcdce-5a51-4e71-8b85-c66aaf9aa257)

![CleanShot 2025-05-21 at 17 25
47@2x](https://github.com/user-attachments/assets/c52dfe70-d5b9-4c89-8b04-810a599281ac)

![CleanShot 2025-05-22 at 09 20
23@2x](https://github.com/user-attachments/assets/9f469d6c-498d-45f1-a6d5-450b7e20f264)
2025-05-22 09:22:12 +02:00
84179ec51a Build(deps): Bump drb from 2.2.1 to 2.2.3 (#32852)
Bumps [drb](https://github.com/ruby/drb) from 2.2.1 to 2.2.3.
- [Release notes](https://github.com/ruby/drb/releases)
- [Changelog](https://github.com/ruby/drb/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/drb/compare/v2.2.1...v2.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 16:48:43 +10:00
206dff5e13 FIX: bring back sidebar filter (#32837)
In this PR, filter was removed and replaced by search.

#32485

However, moderator should still be able to filter sidebar. Also, plugins like doc-category should have filterable sidebar.
2025-05-22 13:44:25 +08:00
386553d98b Build(deps-dev): Bump rubocop from 1.75.6 to 1.75.7 (#32851)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.75.6 to
1.75.7.
- [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.75.6...v1.75.7)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 12:42:10 +08:00
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