Commit Graph
62046 Commits
Author SHA1 Message Date
David Taylor a647df147e DEV: Restore qunit testing for plugins with only gjs files (#36046) 2025-11-14 17:20:59 +00:00
Steven Chang 0f252b6676 UX: Improve template filtering with usage count and preserving tags (#35881)
On sites with a large amount of templates, the default display and
filter can become ineffective. By default, templates are ordered by
alphabetical title order. If filtered by keyword, the plugin does a
simple scoring based on whether the text is in the title (+2) or in the
content (+1), then by alphabetical title order. This PR updates it to
use the `usages` count, so the new priority of ordering is by score >
usage > title.

Also adds a localstorage for the selected tag used to filter the
template list. The tag field will be pre-populated with the last used
filtered tag if available.

Renames hint from "Filter by title..." to "Filter by keyword..." to
reflect actual filtering behavior.
2025-11-14 09:01:42 -08:00
David Taylor 6e28b06cec DEV: Disable broken Firefox qunit runs (#36045)
@cvx noticed that I broke these back in February
(00907363d4). Since then, we've been
running the suite against Chrome 3 times 🤦‍♂️

Unfortunately the suite is no longer stable in Firefox, so it'll need
some work to get it running again. In the meantime, let's disable the
pointless jobs.
2025-11-14 16:57:26 +00:00
David Taylor 9c36c7bf93 DEV: Reduce console noise in qunit tests (#36044)
1. Patch node deprecation in http-proxy
2. Disable Discourse/Ember version logging in qunit tests
3. Disable memory-use reporting, but keep code so it can be re-enabled
when debugging
2025-11-14 15:55:09 +00:00
Natalie Tay 1417b9828d FIX: Prevent discourse_reactions from overriding topic_view.posts preloads (#36041)
Meta:
https://meta.discourse.org/t/tl-lang-crawler-view-not-showing-posts-in-lang/388443/6

When loading topics at `/t/:id` we use the `topic_view` and have some
preloads:

https://github.com/discourse/discourse/blob/d4313be4859bd07d95c620b15179424a87d94ddd/lib/topic_view.rb#L925-L939

Unfortunately these preloads have been overridden in reaction's
`TopicViewSerializer` as overriding posts with a new `post.includes`
would create a new query, so we're using `Preloader` here to preserve
existing associations.
2025-11-14 09:53:53 -05:00
Kelv 0320843ef5 FIX: emoji picker autocomplete in chat replaces entire draft (#36017)
Fixes the bug reported in:
https://meta.discourse.org/t/emoji-is-inserted-at-the-wrong-place/302931/12

The textarea element's `selectionStart`/`selectionEnd` properties are
reset once the emoji-picker menu opens and changes focus. This results
in the replacement of the entire textarea's text in
https://github.com/discourse/discourse/blob/d1e1c02fcb0cbc6722280afb6e086cb6a8b53882/frontend/discourse/app/lib/textarea-text-manipulation.js#L747.

The solution here records the relevant start/end position of the emoji
term to be replaced by a selected emoji, before opening the
emoji-picker. This allows us to correctly replace the relevant emoji
term within the chat draft.


https://github.com/user-attachments/assets/f0007883-9420-411a-b9af-9231cc0b827c
2025-11-14 18:06:03 +08:00
Joffrey JAFFEUX d4313be485 UX/UI: various d-otp improvements (#35993)
- auto submit after otp is filled on login form
- ensures input is not taking full width and we render the 1password
helper outside of the input
- ensures there's enough spacing between otp input and submit button
- changes autofocus option from autofocus to autoFocus, this is to have
parity with our autoFocus modifier
- prevents a white rectangle to appear while 1password is filling the
field

This is how it should look now:
<img width="638" height="206" alt="Screenshot 2025-11-12 at 16 48 16"
src="https://github.com/user-attachments/assets/bb367458-9959-4cae-a045-d9887ab60e71"
/>
2025-11-14 09:28:27 +01:00
Yuriy Kurant 4793193c0b UX: add filter button to user card of deactivated account (#36024)
As a follow-up of #35908.

Allow filtering posts by user from the user card of deactivated user.

### Context
The filter button was missing for deactivated accounts because
`topic_post_count` wasn’t exposed in `InactiveUserSerializer`.

### Result
<img width="701" height="216" alt="Screenshot 2025-11-14 at 00 11 27"
src="https://github.com/user-attachments/assets/e1b8d2a4-9465-4225-aaed-0582f43b8d90"
/>
2025-11-14 15:56:41 +08:00
Martin Brennan 66cee823ab FIX: Image optimization error when re-encoding to JPEG (#36039)
Followup 782e0ea394

When we refactored the code in the above commit, we missed
the need to wrap the potentially resized image data in the
media-optimization-bundle with `Uint8ClampedArray` before
passing it to `encode` from `@jsquash/jpeg`. This led to
this cryptic error in Chrome:

```
media-optimization-worker.js:24 TypeError: Failed to construct 'ImageData': The provided value is not of type 'ImageDataSettings'.
    at globalThis.optimize (media-optimization-bundle.js:116:5)
    at onmessage (media-optimization-worker.js:7:42)
```

And this much more helpful error in FireFox:

```
TypeError: ImageData constructor: Argument 1 does not implement interface Uint8ClampedArray.
    optimize media-optimization-bundle.js:116
    onmessage media-optimization-worker.js:7
    EventHandlerNonNull* media-optimization-worker.js:1
```

The difference in errors seems to be due to differences in how the
browsers
overload the `ImageData` constructor. Anyway, the fix here is to
wrap `maybeResized` in a `Uint8ClampedArray` before passing it to
`encode`, which is what we do before passing it to `resize`.
2025-11-14 16:08:46 +10:00
Gary Pendergast c7e105d15c FIX: Ensure retry_count is set when checking if a job is being retried (#36034)
When checking how many times an email job has been retried, we need to check
that the `retry_count` attribute has been set.

In a related error, the `UserEmail` retry wait handler assumed that the
triggering exception would always have a `wrapped` attribute, which
isn't necessarily the case if the exception was raised outside of the
job execution code.
2025-11-14 14:18:50 +11:00
Sérgio Saquetim 4a951465cd DEV: Refactor watched words to use tracked properties and filtered model (#36010)
Replaced the use of computed properties with tracked properties and
added a separate `filteredWatchedWords` model to enable dynamic
filtering without altering the original dataset. Integrated
`TrackedArray` for better reactivity when managing arrays.

This improves code readability and ensures consistent state updates,
especially during bulk operations or filtering. Added new message bus
integration to efficiently handle updates after server-side word
uploads.
2025-11-13 19:56:52 -03:00
Sérgio Saquetim e7042c09b8 DEV: Modernize SelectKit to replace Ember extensions for native array methods (#36028)
Refactor `SelectKit` component to use native array methods and
`@trackedArray` instead of Ember-specific utilities like `pushObject`
and `objectAt`. This enhances maintainability and simplifies the code by
aligning it closer to modern JavaScript standards. Includes updates to
methods handling `mainCollection` and `errorsCollection` logic.
2025-11-13 19:56:09 -03:00
Gerhard Schlager 4e0f0a6702 DEV: Remove checklist client localization from Crowdin 2025-11-13 22:19:59 +01:00
Rafael dos Santos Silva 9bb15488bd FIX: use blank? check for role_arn validation (#36009)
Using blank? instead of truthiness check handles both nil and empty
strings, fixing the "Run test" on the LLM admin screen.
2025-11-13 16:00:19 -03:00
Penar Musaraj 3184ac4700 UX: Redirect to homepage after completing the wizard (#36002)
First step of multiple steps in improving the new site experience. This
will make sure that when users complete the wizard, they'll end up on
the homepage. (There is a link there to the admin guide, it's one of the
first few seeded topics.)
2025-11-13 13:20:21 -05:00
Derek Rushforth c10cf8d42f UX: Hide topic button on manage account page (#35721) 2025-11-13 08:40:42 -07:00
Roman Rizzi b6857e08d8 FEATURE: Cover all LLM features with evals (#35693) 2025-11-13 12:24:56 -03:00
Penar Musaraj d5e1fbd245 FIX: Validation when toggling checkbox (#35996)
Previously, the first check of a checkbox made sure the validation
passed. But unchecking the checkbox did not trigger the validation error
as expected.
2025-11-13 09:43:09 -05:00
Loïc Guitaut f1941ced4a DEV: Dump backtrace when a Pitchfork worker is about to timeout (#36021)
This is something we have for Unicorn, but it hadn’t been backported to
our Pitchfork config.
2025-11-13 15:18:07 +01:00
Ted Johansson 9a76339be6 DEV: Invert bulk action notification checkbox (#36016)
We want to reduce noise in notifications.

In this PR, we change the notifications from opt-out to opt-in when
performing bulk actions.

To reduce churn and regression risk, it uses the same param (`silent`)
to the back-end, so it's a UI only change.
2025-11-13 21:34:06 +08:00
Bryce Huhtala 6437d96652 FIX: Shift on hover for transparent buttons (#36011)
Follow-up to https://github.com/discourse/discourse/pull/35875.
Explicitly passes border and hover-border args into the btn() mixin for
btn-transparent, ensuring the border stays at `0`.

### Before / After:


https://github.com/user-attachments/assets/6a20029a-b1ee-4d45-b463-43381a5e8066
2025-11-13 08:19:48 -05:00
David Battersby f5af5d26ff FEATURE: separate chat emails from regular emails (#36018)
This change separates chat and other email notifications to give members
more fine-grained control over their notifications.

Includes the following changes:

- Move the Email Notifications setting from Chat preferences
(/preferences/chat) to Email preferences (/preferences/emails).

- Updates `UserOption.chat_email_frequency` description to:

> Email me when I am sent a chat direct message or group

- When `UserOption.chat_email_frequency` is set to `Only when away`,
members can receive email notifications about chat DMs / group chats
regardless of the `UserOption.email_level` value

Internal ref: /t/-/163898
2025-11-13 16:44:07 +04:00
Jordan Vidrine 49c49be5f8 FIX: Chat height fix (#36019) 2025-11-13 05:45:49 -06:00
Yuriy Kurant 5c8eb82c06 FEATURE: adds calendar_upcoming_events_default_view setting (#36014)
Adds a new admin calendar setting
`calendar_upcoming_events_default_view` to control the default view for
`/upcoming-events`.

### Details
Admins can now set the default Upcoming events view (`Day`, `Week`,
`Month`, or `Year`) in `Admin -> Plugins -> Calendar and Events >
Settings`.

<img width="892" height="218" alt="Calendar and Events - Settings"
src="https://github.com/user-attachments/assets/2a737bc4-7efc-4142-be98-9f84bf2ae7c3"
/>

Source:
https://meta.discourse.org/t/add-admin-setting-to-change-default-calendar-view-month-week-year/387389.
2025-11-13 19:19:13 +08:00
Ted Johansson 40035f2b84 DEV: Hide overly technical media optimization settings (#36012)
We're on a quest to simplify the admin/setup experience. Part of this is
hiding overly technical/expert-friendly settings.

This PR hides more media optimization settings. The settings are still
available from console/DB for power users.
2025-11-13 12:36:55 +08:00
Ted Johansson 8ca5fb706a DEV: Remove admin notices when destroying problem check trackers (#35976)
When a problem check is run with an invalid target, which can happen if
a target is dynamically removed from the list, we destroy the problem
check tracker.

This makes it so that we also clean up any associated admin notices when
this happens.

It also marks `target` as required. This is because we now use
`__NULL__` to indicate "no target". This allows us to clean up the Ruby
implementation a bit. (Context: this is required for uniqueness checks
to work, since PostgreSQL considers `NULL` values to be distinct.)
2025-11-13 10:34:28 +08:00
Jordan Vidrine f6b9e3352d UX: Correct previous fix (#36001) 2025-11-12 17:22:57 -06:00
Bryce Huhtala 78bd9352d4 UX: Add border css variables for button styles (#35875)
Adds six new CSS variables for the purpose of defining button types
(default, primary, danger, and success) that don't share the same border
property.

```
--d-button-default-border
--d-button-default-border--hover
--d-button-primary-border
--d-button-primary-border--hover
--d-button-danger-border
--d-button-danger-border--hover
--d-button-success-border
--d-button-success-border--hover
```
2025-11-12 15:23:55 -05:00
chapoi 1012bcfc7e UX: add exception for header indicator size (#36000)
Small fix for #35973
2025-11-12 14:23:26 -06:00
Isaac Janzen bb79b653b5 DEV: Include reaction data on the topic list (#35843)
### What does this do?
This PR adds reaction data for the first post to the
`TopicListItemSerializer`, enabling reactions to be displayed on topic
lists without requiring additional API calls.

### Why is this needed?
Previously, topic lists only showed basic topic metadata. To display
reactions on the first post of each topic, plugins would need to have
the frontend make separate API calls for each topic's first post,
causing N+1 queries. This change preloads all necessary reaction data
when the topic list is serialized.

### How does it work?

- Adds `op_reactions_data` to `TopicListItemSerializer`. I added
`ReactionsSerializerHelpers` to reuse as much of the existing logic as
possible.
- Adds a `include_discourse_reactions_data_on_topic_list` modifier
(default false) for giving plugins control over the injection of the new
data.
- Includes test coverage

### Usage

From within a topic list plugin outlet, the discourse-reactions can be
displayed like so:

```gjs
<DiscourseReactionsActions
   @post={{@topic.op_reactions_data}}
   @showLogin={{false}}
/>
```
2025-11-12 13:45:41 -06:00
Jarek Radosz 62942ee585 DEV: Fix javascript:update_constants task (#35994) 2025-11-12 20:01:29 +01:00
Jarek Radosz cb75b82a2c DEV: Update the PL holiday definition (#35998)
A followup to abd05f2d56, for extra
correctness (for dates before 2025)
2025-11-12 20:00:41 +01:00
Kris 1f389276ff UX: improve reviewable inline composer, clean up button consistency (#35997)
This improves the inline composer in the review queue for both legacy
and refresh. I've also updated "Revise post..." to more accurately say
"Request revision..." and removed the icon from the edit button, as it
was the only button with an icon.

Before:
<img width="1694" height="994" alt="image"
src="https://github.com/user-attachments/assets/04b72bb7-cd15-4a0c-bd05-fd82e768caee"
/>


After:
<img width="2152" height="1020" alt="image"
src="https://github.com/user-attachments/assets/c0dac5c3-859f-4b49-9b81-da75dd2d9c7d"
/>


Before:
<img width="220" alt="image"
src="https://github.com/user-attachments/assets/9ab747de-a98e-4025-a4b3-cea6b70eaeab"
/>


After: 
<img width="220" height="279" alt="image"
src="https://github.com/user-attachments/assets/2f0f4d1a-fb87-4e08-9c57-382850497adf"
/>
2025-11-12 13:58:17 -05:00
marstallandRafael Silva f8e94d979c FEATURE: Support AWS role-based auth for AWS Bedrock (#35872)
This PR modifies Discourse AI to provide an option for role-based auth
into Bedrock instances.

It creates a new provider_param in within aws_bedrock, called :role_arn.
If this provider_param is set, the AWSBedrock endpoint will use a
different calling pattern (sts.assume_role, etc.) to provide keyless
authentication.

<img width="455" height="311" alt="image"
src="https://github.com/user-attachments/assets/a9baa636-6768-4291-b759-d96bb77d71ef"
/>

---------

Co-authored-by: Rafael Silva <xfalcox@gmail.com>
2025-11-12 15:46:37 -03:00
Jarek Radosz 414faccdf5 DEV: Remove unnecessary resetNamespace (#35995)
It has no effect on root-level routes.
2025-11-12 19:06:41 +01:00
Manuel Kostka 6530cca478 FIX: Align z-index for ai-helper modals (#35966) 2025-11-12 11:30:54 -06:00
Keegan George 8b789c9306 FEATURE: Add support for uploads on translated posts (#35871)
## 🔍 Overview

This update allows for having uploads on localized posts. If no uploads
are made, translated posts will show the original uploaded image.
However, if a translator would like to upload a translated image, the
composer will now support an upload reference.

## 🔗 Relevant Links
As requested on Meta:

https://meta.discourse.org/t/translation-composer-missing-image-upload-support/386829


## 📹 Screen Recordings


https://github.com/user-attachments/assets/f01fdfde-c84b-46d8-a96d-a4641699b3b9
2025-11-12 08:55:21 -08:00
Régis Hanol ca3a2d2c88 FIX: don't clear reminder on deleted bookmarks (#35987)
When sending a bookmark notification and the user has opted to
automatically delete the bookmark, we should not be trying to clear the
reminder since the bookmark was just deleted.

Internal ref - t/146349
2025-11-12 17:47:07 +01:00
Jarek Radosz abd05f2d56 DEV: Change a holiday in PL calendar (#35992)
December 24th is now a work-free day. See:
https://www.gov.pl/web/family/free-christmas-eve-starting-from-next-year
2025-11-12 16:21:40 +01:00
chapoi 1c9be4e00d UX: Show chat indicator on mobile (#35973)
We overlooked the consequence of removing the chat icon in the header in
#35015 so this commit brings it back, in a different way.
On mobile only, the back button will save space to display the unread
indicator, if needed:

<img width="732" height="1568" alt="CleanShot 2025-11-11 at 15 53 50@2x"
src="https://github.com/user-attachments/assets/6ddff73b-3f5c-493b-ad44-ec130c8be491"
/>

As a consequence, there will be extra white-space between back-button
and channel title: this is intentional, unavoidable (alternative is
layout shift), and in line with dominating message apps.

This commit also consolidates the unread indicator styling a bit more.
2025-11-12 08:54:22 -06:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 8383f0259b Build(deps): Bump reline from 0.6.2 to 0.6.3 (#35948)
Bumps [reline](https://github.com/ruby/reline) from 0.6.2 to 0.6.3.
- [Release notes](https://github.com/ruby/reline/releases)
- [Commits](https://github.com/ruby/reline/compare/v0.6.2...v0.6.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-12 15:17:23 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> a1703021e8 Build(deps): Bump json from 2.15.2 to 2.16.0 (#35949)
Bumps [json](https://github.com/ruby/json) from 2.15.2 to 2.16.0.
- [Release notes](https://github.com/ruby/json/releases)
- [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md)
- [Commits](https://github.com/ruby/json/compare/v2.15.2...v2.16.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-12 15:17:01 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> e31ce8fbab Build(deps-dev): Bump rubocop-ast from 1.47.1 to 1.48.0 (#35950)
Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.47.1
to 1.48.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.47.1...v1.48.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-12 15:16:26 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> ff4f09a5d2 Build(deps-dev): Bump lefthook from 2.0.2 to 2.0.3 (#35953)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 2.0.2 to
2.0.3.
- [Release notes](https://github.com/evilmartians/lefthook/releases)
-
[Changelog](https://github.com/evilmartians/lefthook/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/evilmartians/lefthook/compare/v2.0.2...v2.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-12 15:16:06 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 77ae062360 Build(deps): Bump @rollup/browser from 4.53.1 to 4.53.2 (#35955)
Bumps [@rollup/browser](https://github.com/rollup/rollup) from 4.53.1 to
4.53.2.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.53.1...v4.53.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-12 14:57:55 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> dd02e25a6d Build(deps-dev): Bump @swc/core from 1.15.0 to 1.15.1 (#35932)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.15.0 to
1.15.1.
- [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.15.0...v1.15.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-12 14:49:18 +01:00
Jarek Radosz 83fd6153e9 DEV: Update lint-config and apply autofixes (#35991) 2025-11-12 14:48:49 +01:00
d10c1e57e8 DEV: Overhaul typechecking configuration (#35794)
- Switches to typescript 'composite project' mode for improved
organization & performance
- Generates declarations from core modules, and outputs to a new
`@discourse/types` package
- Introduces tsconfigs for core plugins, which leans on that new
`@discourse/types` package
- In future, we plan to publish this discourse-types package for other
themes/plugins to use

The motivation at this stage is primarily to improve editor
autocompletion. We provide absolutely no guarantees about the accuracy
or stability of the generated types.

For now, some issues have been resolved by adding manual `@type`
declarations.

In particular, extensionless imports of `.gjs` files are broken when
running in composite-project mode, so in those cases we have to add
manual `@type {import("./the-file.gjs").default}` declarations.
Unfortunately this failure does not show up in IDEs. We hope to get this
resolved soon.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
Co-authored-by: Chris Manson <chris@manson.ie>
2025-11-12 12:54:34 +00:00
Sérgio Saquetim eb6df9785b FIX: Handle edge case in UserPostsStream#findItems when loading (#35952)
Avoid throwing an error in `UserPostsStream#findItems` if already
loading or unable to load more items. This improves resilience and
prevents potential uncaught exceptions during certain edge cases in user
post streams.
2025-11-12 09:33:59 -03:00
Joffrey JAFFEUX a11f81fe83 DEV: removes IE fallback (#35990)
This is not necessary anymore.
2025-11-12 11:36:29 +00:00