Commit Graph
2110 Commits
Author SHA1 Message Date
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
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
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
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
Discourse Translator Bot 5fbadcc2ec Update translations (#35065) 2025-09-30 16:06:14 +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
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
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
Discourse Translator Bot cb6a8a5cf1 Update translations (#35031) 2025-09-29 10:26:53 +02: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
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
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
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
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
Discourse Translator Bot e0b849beac Update translations (#34839) 2025-09-24 14:48:18 +02: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
Alan Guo Xiang Tan 0ba2b0d44b DEV: Skip flaky system test (#34895)
Failing even on reruns on CI:
https://github.com/discourse/discourse/actions/runs/17905331817/job/50905399086
2025-09-22 14:00:59 +08:00
Joffrey JAFFEUX 0df3a82849 DEV: fix flakey spec (#34875)
It doesn’t appear this expectation is necessary and it was causing
random failure as sometimes we will have an error from promotheus in the
log totally unrelated:

```
expected block to not output to stderr, but output "E, [2025-09-19T07:16:59.199016 #2050] ERROR -- : Prometheus Exporter, failed to send message Connection refused - connect(2) for \"localhost\" port 9405\n"
```


/t/-/149729
2025-09-19 11:40:15 +02:00
Kelv 547d99e3b4 DEV: remove toggles for switching between jquery & floatkit autocomplete (#34867)
We've had the new floatkit-based autocomplete live in various parts of
Discourse for about a month now, and it's stable enough for us to remove
the site setting letting admins revert to the jquery-based autocomplete
library which is now deprecated.
2025-09-19 14:50:04 +08:00
David Battersby 532d656d17 FEATURE: disable chat DM threads by default (#34840)
Previously we introduced threads in Chat DMs in #29170 - however setting
the default to false seems like a better fit.

This will take effect for all new DM chats initiated, existing chats are
not changed but threads can still be turned off manually within each
channel's settings.
2025-09-17 16:52:13 +04:00
Joffrey JAFFEUX cebc0d4131 UX: adds a start new dm link when no dms present (#34820)
Prior to this commit we would show the collapsible DMs section which has
a [+] on hover to start a DM but it was not very nice visually and also
had low affordance.

The new empty DMs state:

<img width="275" height="77" alt="Screenshot 2025-09-16 at 09 07 57"
src="https://github.com/user-attachments/assets/99976dfd-44ec-40f8-a6d1-c0d15f550524"
/>
2025-09-17 08:18:31 +02:00
Discourse Translator Bot ccf379900d Update translations (#34804) 2025-09-15 10:47:22 +02:00
Joffrey JAFFEUX 0436fc8034 PERF: do not fetch thread data when we have it (#34799)
Prior to this fix we would fetch thread data even if it was present in
the bus data, that's already unnecessary work in a normal situation but
that's even worse when a user is coming back to their computer as we
will have to catchup multiple new threads at once.

Also ensures we correctly await fetching data from server when
necessary.

No test as there are not behavior change.
2025-09-15 07:49:14 +02:00
Joffrey JAFFEUX 61e838781e FIX: ensures quick reactions usage shows in frequently (#34798)
Prior to this change we would have different context for quick reactions
and for channels this commit just move everything into one context which
is less surprising.
2025-09-15 07:48:22 +02:00
Discourse Translator Bot 3a8a9f27ce Update translations (#34745) 2025-09-12 16:17:25 +02:00
Alan Guo Xiang Tan 435ae4c5f3 DEV: Skip a broken spec (#34742)
When visiting a channel's members info route directly, the add member
button will always be shown because the logic to show the button assumes
that chat messages have been loaded. Skip for now while we figure out a
fix.
2025-09-05 11:32:29 +08:00
Discourse Translator Bot 06b9718717 Update translations (#34723) 2025-09-04 12:27:34 +02:00
Charles Lechasseur 0fa180beed FIX: In chat messages, filter uploads by UserUpload, not by Upload.user (#34596)
When creating or updating a chat message, uploads attached to the
message are filtered so as to only keep uploads created by the message
creator using `Upload.user`. This field, however, only points to the
_original_ user that created the upload, but since uploads are
de-duplicated, other users might have also uploaded the file. This PR
fixes this by looking at the `UserUpload`s instead (as suggested by
@SamSaffron).

Reported here: https://meta.discourse.org/t/chat-upload-bug/379253
2025-09-01 20:06:27 +10:00
Discourse Translator Bot 7f07453157 Update translations (#34633) 2025-08-29 17:24:43 +02:00
Joffrey JAFFEUX a96ace858e FIX: client based chat message timestamp (#34592)
Uses the timestamp at the moment where the user hits send for the
created_at value of the chat message. This should ensure very consistent
ordering.

The implementation is simple:
- collects the timestamp and send it in the request (client_created_at)
- if client_created_at is present and valid, set it as created_at when
creating the message

I suspect that we could end up in a situation where a message is routed
to a slower worker and even if sent before an other message could end up
being persisted before the first message which would cause ordering issues.
2025-08-28 10:21:19 +01:00
Joffrey JAFFEUX 17d6cb2111 FIX: supports html entities in chat (#34591) 2025-08-28 07:34:24 +02:00
Jarek RadoszandDavid Taylor 06f841da08 DEV: Update Ember to 6.6.0 (#34460)
This upgrade does not include any breaking changes for Discourse
themes/plugins. Two of the three deprecations in Ember 6 (array
prototype extensions, component-template resolution) have already been
polyfilled in Discourse. The third (action helper/modifier) is
polyfilled in this commit.

Performance testing shows a 2-3% improvement in Discourse rendering
time, thanks to upstream performance fixes in the glimmer-vm since the
regressions in the Ember 5.x series.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-08-27 16:48:40 +01:00
David Battersby 9bf6db72da FIX: prevent group chat when cannot see group members (#34571)
This change prevents the user from starting a group chat with groups
when the current user does not have permission to view the group's
members.

The group is omitted from both the default list and results list when
searching.

Internal ref: /t/-/145343
2025-08-27 14:54:47 +04:00
Discourse Translator Bot 0d4ca82c91 Update translations (#34568) 2025-08-27 11:00:03 +02:00
Gary Pendergast c333888e01 DEV: When chat is full page, scroll user cards with the avatar (#34556)
When a user card is rendered, there are two phases: first, where a
placeholder is created, then after the user card data is retrieved, the
data is inserted into the user card structure.

This causes an issue where, if the placeholder is too close to the
bottom of the viewport, and there's a lot of data being inserted into
the user card, then the user card will be partially rendered outside of
the viewport, resulting in odd scrolling behaviour.

To address this issue, this change makes use of float-kit's ability to
auto-update the position of the user-card. There are three relevant UX
changes from this:

- When the avatar is close to the bottom of the viewport, the
placeholder renders below the avatar, and the final user card is much
bigger, the user card will jump from being below the avatar, to above
the avatar.
- The user card follows the avatar when the chat window scrolls.
- When the avatar scrolls out of view, the user card is hidden.
2025-08-27 17:00:48 +10:00
Joffrey JAFFEUX 5adc33ae29 FIX: use CDN url for chat (#34541) 2025-08-26 18:04:25 +02:00
Gabriel Grubba 4782dc9cdf Revert "FIX: use CDN url for chat" (#34540)
Reverts discourse/discourse#34507

Previews are broken, the CDN URL is incorrect
2025-08-26 11:24:51 -03:00
SamandJoffrey JAFFEUX 8cf83a6104 FIX: use CDN url for chat (#34507)
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-08-26 13:59:59 +10:00
Sérgio Saquetim 95a95a492b DEV: Deprecate Site.mobileView/desktopView during initialization (#34122)
This commit introduces deprecation warnings for accessing Site.mobileView or
Site.desktopView during application initialization to prevent
layout-related errors and improve code reliability.

The changes include:

* Added deprecation warnings for Site.mobileView and Site.desktopView
access during the initialization phase.
* Updated multiple plugins and components to avoid these deprecated
calls during startup.
* Refactored initialization logic across discourse-ai, discourse-chat,
discourse-calendar, discourse-reactions, discourse-assign,
discourse-subscriptions, and discourse-user-notes plugins
* Improved error prevention by discouraging early access to
view-dependent properties before the application is fully initialized
* Enhanced code maintainability by establishing clearer boundaries
between initialization and runtime phases

This deprecation helps prevent subtle bugs that can occur when
components try to determine the view type before the application context
is properly established, leading to more robust plugin initialization
patterns.
2025-08-25 16:49:52 -03:00
Loïc Guitaut ca81e8a5b2 DEV: Unify ListChannelMessages/ListChannelThreadMessages behaviors
We recently updated `Chat::ListChannelThreadMessages` to take an option
so its `max_page_size` could be configured.

This behavior should be consistent between
`Chat::ListChannelThreadMessages` and `Chat::ListChannelMessages` since
they’re basically doing the same thing.

This patch updates the behavior of the `Chat::ListChannelMessages`
service.
2025-08-25 13:48:02 +02:00
chapoi c6b2949d64 UX: remove chat and message buttons on currentUser profile (#34513)
Remove the rendering of the chat and message CTA when viewing your own
profile.
They serve little purpose, add to confusion, and take up valuable above
the fold space on mobile.

| Before | After |
|--------|--------|
| <img width="690" height="1490" alt="CleanShot 2025-08-25 at 11 47
24@2x"
src="https://github.com/user-attachments/assets/7d3539b6-5599-448b-b610-00adcacaf28b"
/> | <img width="690" height="1490" alt="CleanShot 2025-08-25 at 11 46
47@2x"
src="https://github.com/user-attachments/assets/1c0b4512-693d-4e39-b1ae-3ee30375e127"
/> |
2025-08-25 12:04:29 +02:00
Discourse Translator Bot 9c429cd00e Update translations (#34510) 2025-08-25 11:43:23 +02:00
Discourse Translator Bot e44347414a Update translations (#34482) 2025-08-22 17:11:31 +02:00
Discourse Translator Bot 7d3bfe978e Update translations (#34436) 2025-08-21 11:02:39 +02:00