Commit Graph

35476 Commits

Author SHA1 Message Date
2dcfb49de3 FIX: improves post toolbar behavior (#33342)
This commit is applying different techniques to make selecting text of a
post less error prone:
- ensure we only ever show the toolbar when the common ancestor of a
range is cooked
- ensures the menu is not interfering with text selection

The situation was very bad on android but it should also improve other
devices.

Note that one visual change of this commit is that the fast edit menu is
now a standalone modal.
2025-06-26 10:07:26 +02:00
d92de3e4d0 FIX: Admin search not including plugin pages (#33356)
Followup 4fe85fdb53d32a4ceda2fffcadbf22d2cbf5de7e

It's not ideal, but currently the admin-sidebar modifies ADMIN_NAV_MAP,
and the admin search data source relies on this modification to include
plugin pages in search.

This commit removes the cloneJSON added in the previous one and adds a
test to ensure this doesn't regress.

A followup commit will do some refactoring to stop this behaviour of
modifying the global ADMIN_NAV_MAP.
2025-06-26 13:35:13 +10:00
4fe85fdb53 DEV: Fix flaky AdminSearchDataSource tests (#33346)
and remove unnecessary code
2025-06-26 01:51:29 +02:00
cf387d320f DEV: remove unused sidebar section-message component (#33351)
Long ago (~2 years), we had a sidebar section with text content. This
contained "about" content for anonymous visitors. We no longer have this
section so this component is completely unused.
2025-06-25 17:14:51 -04:00
00c97178d5 FIX: Don't allow submitting bulk topic actions without a notification… (#33292)
… level

See report https://meta.discourse.org/t/-/371074

---------

Co-authored-by: Blake Erickson <blake@discourse.org>
2025-06-25 14:48:36 -06:00
237abe4c96 DEV: Update eye icon behavior for secret site settings (#33345)
Previously it always had a slash through it. Now it has a slash if
clicking it will hide the site setting, and no slash if clicking it will
show the site setting.


![image](https://github.com/user-attachments/assets/28dbed34-7a1a-4932-99c2-58f0f5f215a5)

![image](https://github.com/user-attachments/assets/d55069d6-065e-4522-b615-71a8c69f82bc)
2025-06-25 10:23:22 -05:00
448dc2601b REFACTOR: move mobile/signup-progress-bar CSS into common/signup-progress-bar (#33331)
This concerns these green dots for progress on signup. 
 
Most of the mobile CSS was redundant due to some previous design
changes, so this is largely removing the contents of that file.


Desktop:

![image](https://github.com/user-attachments/assets/0894e0b2-2145-4d13-a85b-b1b7caf64363)

Mobile:

![image](https://github.com/user-attachments/assets/8d2acbfc-6935-4bcd-acef-91a44820ebaa)
2025-06-25 09:33:23 -04:00
398dcaa8af REFACTOR: move mobile/modal-overrides CSS into common/modal-overrides (#33332)
This is largely a 1:1 move with no visual changes, but I noticed an
issue with the mobile change owner modal so I've also added a fix for
that:

Before (dropdown obscured): 

![image](https://github.com/user-attachments/assets/b6654227-291d-4731-9b97-a1bcc3483b84)

After:

![image](https://github.com/user-attachments/assets/1ef55afa-bc8f-4d2a-9a66-03dd1ffc47b9)
2025-06-25 09:33:14 -04:00
85aad95be9 DEV: Display correctly the items in the post action summary (#33330)
- Refactored the `actions-summary` widget and its related test to
directly use a `post` model instance, ensuring more consistent data
handling. Updated relevant rendering and widget registration logic to
align with the changes.
- Fix displaying the user that deleted the post
- Fix the post action text displayed
2025-06-25 09:15:43 -03:00
eb804d4f1c Build(deps-dev): Bump @swc/core from 1.12.5 to 1.12.6 (#33333)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.12.5 to
1.12.6.
- [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.12.5...v1.12.6)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-25 13:10:41 +02:00
22093826d7 FIX: Make theme relative selectors save (#33344)
The parent component of `ThemeSettingRelativesSelectorComponent`,
`SiteSettingComponent`, has recently been migrated from being a legacy
component to a Glimmer component (in
https://github.com/discourse/discourse/pull/33255), but we missed
updating the child class to use Glimmer's patterns, namely how arguments
are accessed in Glimmer components (`this.args.foo` vs `this.foo`).
2025-06-25 14:06:13 +03:00
c74366c595 UX: display active state on rich editor toolbar (#33296)
Highlights the active formatting state in the toolbar based on the
current cursor position/selection.


![image](https://github.com/user-attachments/assets/383d71c1-bf42-4353-b16b-bf16ae3b321f)

---------

Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
2025-06-25 06:50:00 -03:00
684569c30e PERF: Avoid slow preloading in SiteSerializer (#33283)
`SiteSerializer#post_action_types` and `SiteSerializer#topic_flag_types`
both call the `Flag.used_flag_ids` method which executes queries that
becomes very slow on sites with alot of records in either the
`post_actions` or `reviewable_scores` table.

On the `post_actions` table, we execute `SELECT DISTINCT
post_action_type_id FROM post_actions`. On the `reviewable_scores`
table, we execute `SELECT DISTINCT reviewable_scope_type FROM
reviewable_scopes`. The problem with both queries is that it requires
the PG planner to scan through every single row in those tables.

For our use case, all we actually need is to check if a flag is being
referenced by a record in either the `post_actions` or
`reviewable_scores` tables. This commit updates the `Flag.used_flag_ids`
to accept a `flag_ids`
argument and use the argument to check whether the flag ids are
referenced in the `post_action_type_id` or `reviewable_scope_type`
foreign keys.
2025-06-25 15:03:34 +08:00
b9628ad40a DEV: Update uploads:sync_access_control rake task to remove ACLs (#33286)
The `uploads:sync_access_control` rake task should reset the access
control
of all s3 objects linked to an upload record. This means that if the
`s3_use_acls` site setting has been disabled, the rake task should
remove the existing ACL that has been set previously.
2025-06-25 15:03:05 +08:00
3a9d2ac491 DEV: Skip admin search data source label test (#33324)
This is too flaky on CI
2025-06-25 16:53:40 +10:00
1d1743152b FIX: Add humanized setting names for theme setting serializer (#33341)
Followup 5b236ccc0774e3b0f5e0b34c99c1c36d9ea9604e, a change here
made it so the theme setting name was no longer showing on the
UI, this commit fixes the issue by making sure it's sent from
the server in the same way as site setting humanized names.
2025-06-25 16:53:28 +10:00
b03d2ae808 FIX: correctly displaying the failure error message
when a provider was submitted as a query param.

Internal ref - t/155006
2025-06-25 10:25:41 +08:00
61033eed4c FIX: Hide secret admin fields by default (#33255)
Fixed the refs to the `setting` argument and refactored more of the component over to glimmer style, added test against regression
2025-06-24 13:36:59 -05:00
9603cfb781 DEV: Move creation of user archive PM with upload to its own function (#33328)
...so I can override it in a customer plugin.

The goal here is to be able to create the same user data export but
provide the results by uploading to an s3 bucket instead of sending a PM
to the user.
2025-06-24 10:30:36 -05:00
8ac57fc272 FIX: make topic optional in render-tags so reviewables can use discourseTags (#33181)
We lost the comma separator for tags in reviewables after 55a3a4e

This gets it back by using `discourseTags` in `ReviewableTags` — to
support this I made the topic optional in `renderTags` because queued
posts don't pass the full topic


Before:


![image](https://github.com/user-attachments/assets/2302d946-a3d9-46dc-bf26-8a9b9e720980)

After:


![image](https://github.com/user-attachments/assets/49824676-a4a0-41dd-b6ae-e4d7b419070c)


![image](https://github.com/user-attachments/assets/20493467-15a0-4072-a452-fac319ae222e)
2025-06-24 11:23:49 -04:00
5eaa876898 DEV: Add bypass_time_window arg to SendPushNotification job (#33293)
This PR allows `bypass_time_window` to be passed to the
`SendPushNotification` job, to continue sending a PN, even if the user
has been active recently.
2025-06-24 09:43:54 -05:00
a6d3597758 FIX: Return the post's raw when GET /post (#33325)
Previously, there was no way to edit post localizations, so the
`post.raw` was always returning the localized value. With localization
UI and endpoints now, we want to always return the original raw and the
composer to reflect the original value.

https://github.com/discourse/discourse/pull/33184 will handle the
decision to show the post edit composer or the post localization
composer.
2025-06-24 22:11:02 +08:00
113bff5d0d DEV: Make admin search data source tests more reliable (#33321)
Also fix some issues in the source, wasn't returning a promise
with the early return.

Saw this in the CI log failures:

> ℹ️ Hint: when the assertion failed, the Ember runloop was not in a
settled state. Maybe you missed an `await` further up the test? Or maybe
you need to manually add `await settled()` before your assertion?
(hasPendingTimers, hasRunLoop, isRenderPending)
2025-06-24 15:41:57 +10:00
5b236ccc07 DEV: Move site setting name humanization to server side (#33311)
This commit moves the humanization of site setting names from the client
side to the server side, since this is becoming more widely used and
will be useful for specs to be able to access the same humanized name
formatting without duplicating the logic on the server.

There are only a couple of places in the admin UI that we send this
down in the JSON, the `site.sitSettings` object does not include these
humanized names as they are not needed.
2025-06-24 13:20:29 +10:00
f69dbcd2c1 FIX: Make Ctrl+K shortcut work consistently in RTE, and not always show chat channel switcher
Followup fb7fa2902cf685ee9d4002e5448b4817f2dbef98,
prevent opening the chat channel selector with Ctrl/Meta+K
in any inputs except the chat composer, most of the time you
do not want this, but especially in the topic composer.

In that case, you want the link insert modal to open.
2025-06-24 12:20:00 +10:00
475baff2bb FEATURE: Hide topic if OP is hidden (#33201)
Before this change, topics with a hidden OP were still visible, we only
checked if all posts were hidden to change visibility of the topic.

With this change, if the OP is flagged and is hidden the topic will also
be hidden.

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2025-06-24 11:44:38 +10:00
e4eab8cc5f FIX: Correct new_user_posting_on_first_day? logic (#33303)
All the way back in bc52bdfa1280ba08e6fb1931c26e18aa7fee9f7f we changed
the definition of new_user_posting_on_first_day? to return true if the
user was TL0 unconditionally. However this changes the logic of
the method, and essentially makes it "lie". Yes TL0 may be considered
a new user in other places, but in this method specifically we want
to check it's their "first day" of posting, not just that they are TL0.

The intent per these commits:

* 487c20959c874666db726d69c00abe139ba1aeab
* 5aa1272f05fc0de0b08577707d3370d10fafdd51
* 9834d1150300de26ffc35cb6af9a3ac91666e216

Was consider any user < TL2 who hadn't made their first post yet
as a new user posting on their first day. If they had made a post
>= 24 hours ago, they were no longer considered a new user posting
on their first day.

This commit restores that logic and also cleans up the spec and
guardian check to be clearer.
2025-06-24 08:05:51 +10:00
4cf4225f3d DEV: Introduce state handling for post cooked HTML decorators (#33200)
This PR introduces explicit state management for decorators as part of
the quote controls refactor. The legacy quote controls logic has been
migrated to a new Glimmer component, and state handling for decorator
functions associated with post content rendering is now formalized and
standardized.

### Key Points

- **Decorator State Introduction:**  
- Introduces explicit state objects for use within post and cooked-html
decorators, replacing previous ad-hoc or implicit state tracking.
- Uses `TrackedMap` for state management, improving reactivity and
ensuring consistent, predictable updates when decorator state changes.

- **Component Refactor:**  
- The quote controls logic is now fully encapsulated in a Glimmer
component, leveraging the new decorator state handling for cleaner, more
maintainable code.
  - Legacy implementations have been removed to reduce technical debt.

- **Context and Data Handling:**  
- Decorators and components now receive state and context as explicit
parameters, standardizing the interface and improving code readability.
- Direct properties (such as `post`, `highlightTerm`, and
`ignoredUsers`) replace the previous `data` object, simplifying context
management.

- **Other Improvements:**  
  - Enhanced error handling for async content.
- Improved extensibility by supporting custom wrapper elements in quoted
content.
  - Added functionality to highlight original quoted text.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-06-23 18:13:49 -03:00
38cf7cdbea FIX: improvements to keyboard shortcuts from toolbar API (#33290)
## 🔍 Overview

This update fixes a few issues related to keyboard shortcuts from the
toolbar API and the textarea text manipulation:
- it converts the keymap return value from `itsatrap` format to
`ProseMirror` format so that the default is prevented, thus allowing for
custom keyboard shortcuts to work inside the editor without triggering
system defaults.
- pushes a fix where the keyboard shortcut could get triggered even when
the `condition` value returned `false` whenever it had a custom
shortcut.
- fixes an issue in the markdown textarea editor where selecting text
and tabbing works but also focuses the next element
2025-06-23 09:59:20 -07:00
5bca4c30d9 UX: fix tag suggestion alignment (#33315)
Before:

![image](https://github.com/user-attachments/assets/fbadbb06-e267-41bc-9cb5-41c32819f95b)


After: 

![image](https://github.com/user-attachments/assets/fe2bb8fd-bcd4-4bb4-a9fd-6225da99004b)
2025-06-23 11:50:55 -04:00
Sam
f0f75b1a63 DEV: implement missing icons (#33310)
missing icons
2025-06-23 17:42:12 +02:00
43fb58ee08 UX: consistent sizing for configure default nav links (#33314)
Before:

![image](https://github.com/user-attachments/assets/f01356eb-c6ca-4fdd-910e-61cc25eff49c)


After: 

![image](https://github.com/user-attachments/assets/a048f018-e198-43cd-9ce7-8cbf57f4f492)


To match the sizing with tags: 


![image](https://github.com/user-attachments/assets/d6071d33-00d2-4460-9338-6eb3e53dd92f)
2025-06-23 11:24:19 -04:00
d81faa1226 FIX: Do not set locale when replying and also default to none (#33312)
This PR relates to the locale setting in the composer and fixes 2
quirks:
- When replying to a post, the composer sets the locale of the new post
in composer to the locale of the post being replied. This PR defaults
the value to "none"
- When creating a new post, the composer sets the locale to the user's
locale. However we are seeing the behaviour that users do not write in
the locale they set their profile to. This PR defaults the value to
"none"
2025-06-23 21:11:03 +08:00
8094cb502a Build(deps-dev): Bump @swc/core from 1.12.3 to 1.12.5 (#33298)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.12.3 to
1.12.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.12.3...v1.12.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 14:23:58 +02:00
8337b49fe8 Build(deps): Bump ace-builds from 1.42.0 to 1.43.0 (#33299)
Bumps [ace-builds](https://github.com/ajaxorg/ace-builds) from 1.42.0 to
1.43.0.
- [Release notes](https://github.com/ajaxorg/ace-builds/releases)
-
[Changelog](https://github.com/ajaxorg/ace-builds/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/ajaxorg/ace-builds/compare/v1.42.0...v1.43.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-23 13:46:20 +02:00
00942ddffd FIX: Admin search labels doubled up with parent label (#33308)
Fixes an issue where the admin search results was showing
breadcrumbs with a double up of the parent label. For example,
we would show "Plugins > Plugins > AI > Usage" or
"Advanced > Advanced > Backups > Logs".

Also adds a missing translation for the chat incoming webhooks
page.
2025-06-23 16:21:29 +10:00
f29c8b7a38 DEV: Add get() method to the FormKit API (#33309)
This change adds an API for retrieving the current value of a component within a FormKit form. It makes use of the existing `@onRegisterApi` parameter, adding a `get()` method to match the existing `set()` method.
2025-06-23 15:50:36 +10:00
1fab4974ee FIX: Add @disabled parameter support to the FormKit Submit component (#33307)
When the `@disabled` parameter is set a on `<Submit>` component, the component now passes it through to the underlying `<DButton>`.
2025-06-23 15:50:18 +10:00
84da9508eb FIX: FormKit textarea value attribute binding (#33306)
The FormKit textarea component was using `@field.value` as inner content, preventing dynamic updates to the `textarea` value through the form API.

This change moves the `textarea` value to being set in the `value` attribute, instead.
2025-06-23 15:50:14 +10:00
4107803704 UX: Fix new/unread topic banner overlap with topic filter empty state (#33305)
Followup 30b0e38877af703606042cf1a2997a9a06582c32

Changes margin to padding for topic filter empty state to prevent the
"See X new or updated topics" banner from overlapping with the empty
state
when there are no topics in the filter.
2025-06-23 14:40:35 +10:00
f641a1fb6e DEV: Remove old CSS class for empty topic filter (#33302)
Followup 30b0e38877af703606042cf1a2997a9a06582c32
2025-06-23 10:15:23 +10:00
4b947d2404 DEV: Partially refactor themes controller to services (#33141)
This commit starts to introduce services to replace actions in the
ThemesController. We will start with the low langing fruit:

* Create
* Destroy
* BulkDestroy
* GetTranslations

Endpoints like #import and #update will be much harder.
Also, the https://github.com/discourse/discourse-theme-creator plugin
overrides some of these controller actions directly, so we need
to be careful.
2025-06-23 10:14:58 +10:00
0dc01d55fd FIX: ensures colors are set for tl-growth report (#33294) 2025-06-21 12:55:23 +02:00
f4bdd2f6e7 DEV: Add PluginOutlets to preferences-email and exception templates to remove template overrides (#33071)
**Description**

As part of removing template overrides from plugins and themes we need
to introduce these pluginOutlets.
2025-06-20 10:55:49 -05:00
ee6b59344f UX: Order Form Template TagChooser choices alphabetically (#33109) 2025-06-20 10:05:01 -05:00
0eb6da387c DEV: add tag hashtag data source style type (#33289)
Follow up from #33284 to add the missing style type value. This value
was originally meant for just categories but it makes things much easier
(and more complete) to add these values for other hashtag data types
like tags/channels etc, especially since they have default `icon` values
already.
2025-06-20 18:08:47 +04:00
63cc658891 UX: apply colour vars to svg (#33287)
Small follow-up for #32669

Replacing hardcoded HEX with css var
2025-06-20 12:24:55 +02:00
61dace2d9c Build(deps): Bump terser from 5.43.0 to 5.43.1 (#33280)
Bumps [terser](https://github.com/terser/terser) from 5.43.0 to 5.43.1.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.43.0...v5.43.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-20 12:21:17 +02:00
e8c483fd62 Build(deps-dev): Bump @swc/core from 1.12.1 to 1.12.3 (#33279)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.12.1 to
1.12.3.
- [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.12.1...v1.12.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-20 12:01:26 +02:00
3c5cf90f74 UX: scroll to top of form on error (#33276)
This commit ensures the form errors summary is visible on error.
2025-06-20 11:16:54 +02:00