Commit Graph
4411 Commits
Author SHA1 Message Date
David Taylor 844a1607cb DEV: Resolve deprecated route names in rss-polling (#35084) 2025-09-30 22:07:07 +01:00
Sérgio Saquetim 480a24e754 DEV: Replace deprecated Ember's native array any with some (#35010)
Replaces deprecated usage of the Ember's native array extension `.any()`
function with `.some()` across several JavaScript files in the project.
This is a purely refactoring change intended to modernize the codebase
to follow current JavaScript standards.

**Main Changes:**

* Replaced .any() with .some() for array handling in 25 instances across
various files.
* Updated deprecation workflow to handle the any() and related
deprecations explicitly.
2025-09-30 15:49:13 -03:00
Joffrey JAFFEUX 78a00e8414 FIX: force update size on full calendar (#35075)
We are not sure of the reasons but there are multiple similar (yet not
exactly the same) reports of resizing issues with calendar causing this
exact same `width: 0` state we have experienced.
2025-09-30 18:13:42 +02:00
Discourse Translator Bot 5fbadcc2ec Update translations (#35065) 2025-09-30 16:06:14 +02:00
Jarek Radosz 1a6bf7d0a7 DEV: Remove obsolete register_svg_icon checks (#35067) 2025-09-30 15:51:44 +02:00
Jarek Radosz 60dadd2166 DEV: Remove unnecessary freeze calls (#35064)
All those files have `# frozen_string_literal: true`
2025-09-30 15:36:16 +02:00
Jarek RadoszandLoïc Guitaut e372355fd0 DEV: Clean up scope resolution operators in plugins (#34979)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-09-30 14:36:34 +02:00
Charles Lechasseur 14ee6bd67d FIX: Avoid returning duplicate voters from /polls/voters.json endpoint (#34433)
When fetching voters from the `/polls/voters.json` API endpoint, each
page after the first has an extra voter (the last one from the previous
page). This causes duplicate voters to be returned if loading multiple
pages. This PR fixes the off-by-one error that causes this. (This fix
has initially been proposed by Rob Mackenzie.)

The PR also fixes an issue that could cause non-deterministic ordering
of results from that API; however, I have not been able to craft a test
to reproduce the issue, so the fix is theoretical.

Reported here:
https://meta.discourse.org/t/polls-voters-json-returning-duplicate-users-across-paged-requests/376636
2025-09-30 15:06:01 +08:00
Roman Rizzi 49558abd9e SECURITY: AI helper suggestions based on a topic should check user has access to it 2025-09-30 10:09:49 +08:00
Martin Brennan 6aae74d082 SECURITY: Rich editor chat transcript XSS
When quoting from a channel or a thread, the title
of the channel and the title of the thread could be
an XSS vector when CSP is disabled.
2025-09-30 10:09:43 +08:00
Martin BrennanandJarek Radosz cc0e2fe00b DEV: Add basic system spec for discourse-reaction on post (#35029)
Covers default reactions,
`discourse_reactions_experimental_allow_any_emoji`,
`discourse_reactions_enabled_reactions`, and interaction with the
`emoji_deny_list` setting from core.

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2025-09-30 10:29:34 +10:00
Sérgio Saquetim 813b494730 DEV: Replace deprecated Ember's array filterBy with filter (#35018)
Replaces Ember's deprecated `filterBy` with the native JavaScript method
`filter`. This aligns with modern JavaScript practices, improves code
clarity, and prepares for future deprecations.

Changes involve various components, controllers, and models across the
codebase.
2025-09-29 16:42:38 -03:00
David TaylorandSérgio Saquetim ab07d11425 UX: Enable 'viewport based mobile mode' by default (#35036)
https://meta.discourse.org/t/384280

Co-authored-by: Sérgio Saquetim <1108771+megothss@users.noreply.github.com>
2025-09-29 19:46:52 +01:00
Kris 809aecdee6 UX: improve AI translations chart colors in dark mode (#35042) 2025-09-29 14:38:22 -04:00
Discourse Translator Bot cb6a8a5cf1 Update translations (#35031) 2025-09-29 10:26:53 +02:00
Rafael dos Santos SilvaandNat a40149bd1b PERF: optimize translation progress dashboard with batch query (#34861)
Replace individual per-locale queries with a single query that
calculates completion progress for all locales at once.

This commit also removes methods off the `base_candidate` (used for
Categories and Topics as well) which are not used any more, as the
progress dashboard only shows progress for posts.

t/162846/4

---------

Co-authored-by: Nat <natalie.tay@discourse.org>
2025-09-29 13:32:40 +08:00
Joffrey JAFFEUX da02ab094b FIX: do not hide time when overflowing in month view (#35016) 2025-09-27 00:17:44 +02:00
Amanda Alves Branquinho 4e48d9dee8 DEV: Trigger event after user warning is created (#34997)
- Fire an event after the user warning is created to allow can allow
other plugins to hook into
2025-09-26 14:27:58 -03:00
Sérgio Saquetim 14fef6598c DEV: Replace deprecated Ember's array sortBy with sort (#34998)
This Pull Request introduces changes that replace the use of .sortBy
with .sort combined with compare from @ember/utils. This update aims to
modernize and standardize sorting operations throughout the codebase.

**Main Changes:**

* Replaced .sortBy with .sort and compare in various components,
controllers, and services to improve sorting practices.
* Updated sorting logic to handle optional chaining (?.) for increased
robustness.
* Adjusted sorting logic, including reversing, in some cases for more
clarity and correctness.
* Added a new deprecation workflow entry to handle sortBy deprecation
logs (discourse.native-array-extensions.sortBy).
2025-09-26 13:38:26 -03:00
Sérgio SaquetimandJarek Radosz ad3a2df0a4 DEV: Replace Ember's deprecated mapBy with standard .map (#34963)
Replaces usages of `mapBy` across the codebase with JavaScript's native
`.map`. This resolves deprecation warnings related to Ember's array
extensions and ensures compatibility with future Ember versions.

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2025-09-26 12:59:35 -03:00
Discourse Translator Bot c349298f45 Update translations (#35003) 2025-09-26 13:35:05 +02:00
Natalie Tay ff422c2d25 UX: Use search padding for discoveries (#35005)
It was looking weird on narrower desktops.
2025-09-26 17:00:44 +08:00
Jarek Radosz 08a741b817 DEV: Fix PostDestroyer deprecations in specs (#34986)
…and remove a stray `puts` in a spec
2025-09-26 09:53:17 +08:00
Jarek Radosz 0c7b731b93 DEV: Remove an obsolete poll migration task (#34990)
This was used over 10 years ago to manually migrate poll data from a
previous syntax (the task was added in
202b442b86)
2025-09-26 09:52:47 +08:00
Jarek Radosz 2773ee4963 DEV: Fix random typos (#34987)
September 2025 edition
2025-09-26 09:52:28 +08:00
Sérgio Saquetim e091b6e447 DEV: Replace deprecated reject and rejectBy with filter (#34974)
Refactor all instances of `reject` and `rejectBy` across the codebase to
use the native `filter` method paired with appropriate logic. Updates
include changes in models, components, and services.

This ensures compatibility with modern JavaScript standards and reduces
reliance on deprecated array extension methods.
2025-09-25 17:15:19 -03:00
Amanda Alves Branquinho 8cb364c78b DEV: Update user note to allow customization (#34913)
- Adds a transformer to allow subtitle addition to the user notes form
- Adds plugin outlet to allow customization of each note in the modal
form
- Rename a handler placement to place the avatar under the correct
outlet
2025-09-25 11:36:55 -03:00
Discourse Translator Bot fe31f25ed9 Update translations (#34976) 2025-09-25 16:05:27 +02:00
David Taylor 667f525292 DEV: Resolve flaky chat preferences spec (#34978) 2025-09-25 13:35:25 +01:00
Jarek Radosz 2c84945853 DEV: Normalize route and namespace setup in plugins (#34962) 2025-09-25 12:35:29 +02:00
David Taylor 6081bc2249 DEV: Standardize Ember route, controller and template naming (#34417)
For historical reasons, Discourse has a customized Ember resolver. This
had a much more fuzzy implementation of 'normalize' and 'findTemplate'
functions. This leniency meant that our file naming hasn't always
matched Ember conventions.

Standardizing our naming will make things easier to understand for
developers, and will make adoption of newer ecosystem tooling easier
(e.g. route-based bundle splitting in Embroider/vite)

This commit adds deprecations to the resolver when this leniency is
used, and uses a fully bespoke codemod to rename all of the affected
routes/controllers/templates in the Discourse core repository.
Backwards-compatibility is maintained for anyone looking up the old
names in the resolver.
2025-09-25 11:27:45 +01:00
Natalie Tay 1e1d71af62 FIX: Publish the topic instead of the post to refresh topic titles (#34961)
When a topic has its title is translated, we're not refreshing the topic
titles correctly. This PR fixes the channel we're publishing on.
2025-09-25 03:12:41 +08:00
Joffrey JAFFEUXandJarek Radosz e991d3b2ad FIX: ensures user notes routes are correctly defined (#34960)
A previous commit
https://github.com/discourse/discourse/commit/9b998f10ce2e4d655a26adce37db40d5b852be89
has been causing an error where routes were not defined.

This commit follows an established pattern and adds a spec to ensure
basic behavior is working correctly.

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2025-09-24 20:45:16 +02:00
Roman Rizzi c733d42ed7 FIX: Respect query language when searching for discoveries (#34958)
Additional changes:

- Increase timeout. Tool use could take some time.
- Instruct the LLM to rely more on inline links.
2025-09-24 15:40:51 -03:00
Sérgio Saquetim 5b031945f7 DEV: Replace the use of Ember's .findBy for native methods on arrays (#34557)
Use the native array `.find` instead of Ember's `.findBy` which was deprecated.
2025-09-24 15:32:13 -03:00
Roman Rizzi 491573a470 UX: Adjust welcome banner search-menu when there are AI discoveries (#34957)
<img width="1130" height="674" alt="Screenshot 2025-09-24 at 2 29 32 PM"
src="https://github.com/user-attachments/assets/37178332-ca04-407b-a9f7-0c97400be9bd"
/>


<img width="872" height="640" alt="Screenshot 2025-09-24 at 11 04 22 AM"
src="https://github.com/user-attachments/assets/e2b77770-06a9-40b6-8a28-599a42d5bf8f"
/>
2025-09-24 15:16:39 -03:00
Natalie Tay 1f663b0841 FIX: Also translate topic title if 'Translate Post' is on the first post (#34947)
Related: https://github.com/discourse/discourse/pull/34904

We should also translate topic titles.
2025-09-24 22:18:28 +08:00
Discourse Translator Bot e0b849beac Update translations (#34839) 2025-09-24 14:48:18 +02:00
Jarek Radosz 52e872961a DEV: Clean up requires (#34946)
1. remove unnecessary `.rb` filename suffixes from `require_relative`
calls
2. replace `require File.expand_path(File.dirname(__FILE__) + …` with
`require_relative`
3. remove `./` prefixes from `require_relative` calls
2025-09-24 12:00:22 +02:00
Jarek Radosz 9b998f10ce DEV: Define user-notes namespace earlier (#34933)
Defining it inside `after_initialize` meant that other plugins couldn't
always see it and interact with it during initalization.
2025-09-24 11:00:26 +02:00
Yuriy Kurant 3d0d277db3 UX: add welcome banner text color setting (#34657)
Add a `Welcome banner text color` setting that admins can use to adjust the color of the heading and subheading text on the welcome banner when they are using a background image.
2025-09-24 15:19:40 +08:00
Martin Brennan 7daea6d77d UX: Use admin table classes for Calendar Holidays list (#34942)
Followup a5730bfe2f

Apply admin table UI guidelines, and convert
AdminHolidaysListItem to a glimmer component.
2025-09-24 17:13:50 +10:00
Natalie Tay 1b013a2c21 UX: Update copy (#34944)
The toast shown needs copy update. 🥲
2025-09-24 13:41:12 +08:00
Martin Brennan e149be736b FIX: Force composer markdown mode in email template editing (#34668)
For now, we want to force the markdown mode for email template
editing for admins, as this is a niche area and doesn't much
benefit from RTE for now...we may want to revert this decision
in future and do a better solution here.

This commit also fixes an issue where, for templates like
system_messages.reviewables_reminder which have a `one` and
`other` key for their text body (and thus "multiple bodies"),
we were showing `object Object` in the editor. Instead, we
want to do the same thing we do for multiple subjects, which
is provide a link to site texts with the text:

> This email template has multiple bodies.

There is only one known case of this happening so far, but at least
this minimally handles the issue for now.
2025-09-24 14:28:28 +10:00
Jarek Radosz f0ef9c664b DEV: Fix chat user option extension enum check (#34917)
`chat_send_shortcut` enum doesn't have a `default` option, so this code
always ran, which could cause issues with autoloader
2025-09-23 20:30:47 +02:00
Roman Rizzi f5b10771d1 FIX: Limit tool usage in AI Discover (#34923) 2025-09-23 15:05:00 -03:00
Roman Rizzi 0a2100a6a7 FEATURE: Promote Discover to a dedicated feature. (#34846)
Discover - Our complimentary conversation search widget now features a
dedicated setting to enable it, and it no longer relies on the AI bot.
We also ship a default persona for it.
2025-09-23 14:01:45 -03:00
Keegan GeorgeandNat 768eb01c6b FEATURE: force refresh translations (#34904)
## 🔍 Overview
This update adds a button to the post translations menu. For automatic
translations created through Discourse AI, translation moderators will
be able to click a refresh translations button to re-translate a
specific post beyond the twice a day maximum.

##  More details
To achieve adding a new button to the core translations menu, a new
wrapper plugin outlet called: `post-menu-translations-dropdown` will be
used.

## 📷 Screenshots
<img width="264" height="202" alt="Screenshot 2025-09-22 at 14 08 41"
src="https://github.com/user-attachments/assets/f64132af-0648-4320-a509-10b2f3e8bdfd"
/>
<img width="853" height="172" alt="Screenshot 2025-09-22 at 14 08 48"
src="https://github.com/user-attachments/assets/9453eed4-79ed-4f85-866d-8473cf35074d"
/>

---------

Co-authored-by: Nat <natalie.tay@discourse.org>
2025-09-24 00:14:36 +08:00
SamandMartin Brennan a5730bfe2f DEV: clean up events settings (#34856)
- rename from calendar -> calendar and events
- fix config for plugin to show a tab for settings

still needs some CSS adjustments but mostly there

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2025-09-23 08:48:07 +10:00
Joffrey JAFFEUX b8e86ceb23 FIX: disable category calendar when post event are disabled (#34897)
Disabling post event with category events set would cause an error when
visiting the category, this commit ensures it's not the case and adds a
test for it.

Also added tests to ensure we correctly render category calendar in
different outlets as the before-topic-list-body one was broken.
2025-09-22 17:05:19 +02:00