Commit Graph
4427 Commits
Author SHA1 Message Date
Jarek RadoszandLoïc Guitaut a54e3208cb DEV: Hand-pick Rails/WhereNot autofixes (#35117)
We can't enable `Rails/WhereNot` lint/autofix, because it would break
code that uses mini_sql instead of AR (which rubocop, and tbh also we,
can't easily differentiate)

Those are safe because they either:
* are executed in AR model scope definitions
* are clearly chained starting from a AR model
* are less-clearly chained, but still can be traced to a AR model/scope

---------

Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-10-03 13:29:22 +02:00
Loïc Guitaut 0c41ff0680 DEV: Move more data into the server session (#35145)
Now that `ServerSession` can store arbitrary data, we can move some more
data into it.

This patch moves some data related to authentication into it, as
sometimes that kind of data can be pretty big.
2025-10-03 10:20:32 +02:00
Joffrey JAFFEUX ba7fbd6d9c FIX: notification reminder is deleted with bookmark (#35141) 2025-10-03 08:34:19 +02:00
chapoiandMartin Brennan 759fc04041 UX: rework button classes (#34882)
Context: The `btn` mixin is used for every functional button, but this
includes button elements that are not, or should not be, styled like our
default or primary buttons.

To change how this works this commit:
* stripped down the mixin to the bare essentials, mainly limiting to the
properties that use variables.
* moved most things into the `btn` class
* moved some things into specific descriptive classes (default, danger,
success) such as border-radius
Example of button that does not need a border-radius and would benefit
from this:
<img width="464" height="184" alt="CleanShot 2025-09-19 at 12 56 04@2x"
src="https://github.com/user-attachments/assets/e908b2cf-971f-4c1f-aade-7492bad2f89c"
/>

* Deprecated…
  * FlatButton component
* btn-active: we should use the proper pseudoclass :active or a –-active
modifier in code if we need it
* btn-text: every button by default is a btn-text. We already have a
class to indicate when it isn’t (no-text)
* fixed btn-link property to make DButton component behave like an
inline link (no padding, link-styling)
* Since I moved styling from .btn, ths means every button now needs a
specific declaration. So I’ve added btn-default where necessary.
* Fixed btn-flat hover effect: The difference between btn-flat and
btn-transparent was getting very ambiguous. I’ve fixed the hover effect
for btn-flat so that the distinction is:
<img width="1094" height="408" alt="image"
src="https://github.com/user-attachments/assets/addf56a9-1f61-463d-abd9-5028a3b88fad"
/>
* Changed the custom icon colour from header icons so it follows the
normal btn-flat styling, the way the sidebar icon already was doing.
(Consistency)


**Other small button-related change along the way**
What | BC | AC |
|----| ----|--------|
Inconsistent save/cancel colours | <img width="1720" height="1084"
alt="CleanShot 2025-09-19 at 15 31 40@2x"
src="https://github.com/user-attachments/assets/227289c3-6ded-4633-868d-6e33c32d83c3"
/> | <img width="1720" height="1084" alt="CleanShot 2025-09-19 at 15 30
56@2x"
src="https://github.com/user-attachments/assets/b23f96c9-04f3-40ea-9fba-2be59eae8e64"
/> |

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2025-10-02 13:32:36 -06:00
Natalie Tay bc1abd00eb UX: Always apply discoveries padding regardless of viewport (#35154)
This selector is not used in mobile.


https://github.com/user-attachments/assets/cfc67f7c-64a7-4f97-a224-41f7a1cd7db8

Related: https://github.com/discourse/discourse/pull/35005
2025-10-03 01:12:38 +08:00
Roman Rizzi 349de971c3 FIX: Don't link seeded LLMs on the features page (#35151)
<img width="470" height="196" alt="Screenshot 2025-10-02 at 1 23 45 PM"
src="https://github.com/user-attachments/assets/6641e851-8737-437d-969a-bf89d27ef232"
/>
2025-10-02 13:55:09 -03:00
Roman Rizzi 1537f2caab FIX: Use persona's allowed groups for AI helper's custom prompts access (#35150) 2025-10-02 13:40:52 -03:00
Martin Brennan 28a58a764b Revert "FIX: notification reminder is deleted with bookmark (#35069)" (#35138)
This reverts commit 74c60fef17.

There are still some outstanding questions about bookmark notification
behaviour.
2025-10-02 17:56:51 +10:00
Kris c972bfa239 FIX: show AI gists in mobile messages (#35124)
The outlet used previously doesn't render when there's no category (in
message topic lists) so here I'm moving it to an outlet that does. Also
added a spec to check for this case.



Before:
<img width="400" alt="image"
src="https://github.com/user-attachments/assets/831cd17f-db6b-49d8-a2eb-88a668854e2b"
/>
 
 
 
After:
<img width="400" alt="image"
src="https://github.com/user-attachments/assets/f1e5c672-ca0f-4b84-9241-c0211f12c5e7"
/>
2025-10-01 14:11:25 -04:00
Loïc Guitaut 2676c70572 Revert "DEV: Move more data into the server session" (#35115)
Reverts discourse/discourse#35009
2025-10-01 16:44:43 +02:00
Yuriy Kurant eae2370424 FIX: hides redundant chat icon on mobile chat routes (#35015)
### Chat in Mobile view

In order to reduce visual noise in mobile view, there is no need to show
chat icon in header, once user has already chat open.

|Before|After|
|---|---|
|<img width="456" height="199" alt="Screenshot 2025-10-01 at 17 16 29"
src="https://github.com/user-attachments/assets/6d124a79-4a0a-4edd-913a-43a0cfa05623"
/>|<img width="442" height="198" alt="Screenshot 2025-10-01 at 17 16 06"
src="https://github.com/user-attachments/assets/052a2f78-574e-4d35-aff4-264f54f2fb15"
/>|
2025-10-01 22:34:15 +08:00
Loïc Guitaut 066d3a1abc DEV: Move more data into the server session (#35009)
Now that `ServerSession` can store arbitrary data, we can move some more
data into it.

This PR moves some data related to authentication into it, as sometimes
that kind of data can be pretty big.
2025-10-01 15:00:48 +02:00
Joffrey JAFFEUX 74c60fef17 FIX: notification reminder is deleted with bookmark (#35069)
Prior to this fix a user could delete a chat bookmark but the
notification reminder if it had already fired would still show in
notifications.
2025-10-01 11:58:31 +02:00
Régis Hanol e171530e14 FIX: post voting comments editing UX (#35108)
was showing up inconditionnaly even if you didn't have the permissions
to edit other people's comments.

This was only a UX issue as the server is doing the correct check.

The issue was the `hasPermission` method which wasn't a getter so it
wasn't checked for all the instances of the post comments but rather
once.

Also added some acceptance tests to ensure we don't regress.

Internal ref - t/163347
2025-10-01 11:31:19 +02:00
Discourse Translator Bot 73664e3a69 Update translations (#35104) 2025-10-01 11:08:49 +02:00
Joffrey JAFFEUX 730a1ea9ec UX: hide time in month view on mobile (#35107)
We have limited space and removing the time in this case allows to have
more space for the text of the event.
2025-10-01 11:00:43 +02:00
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