3964 Commits

Author SHA1 Message Date
David Taylor
9e7384298b
DEV: Introduce postcss minmax transform (#31885)
This will auto-transform media query range syntax like `width < 100px`
into the more-widely-supported min/max-width syntax
2025-03-18 19:28:52 +00:00
Discourse Translator Bot
464da9a4fb
Update translations (#31875) 2025-03-18 15:08:14 +01:00
Alan Guo Xiang Tan
f09c8f61c8
DEV: Fix flaky automation system test (#31867)
This commit updates `PageObjects::Pages::Automation#update` to check
that the button is not disabled before clicking the button.

### Reviewer notes

Instances of flakiness:
1.
https://github.com/discourse/discourse/actions/runs/13864294630/job/38801362996
2.
https://github.com/discourse/discourse/actions/runs/13392214535/job/37402368070
2025-03-18 15:13:59 +08:00
Alan Guo Xiang Tan
1fea45eb0f
DEV: Skip flaky test (#31849)
The test has been flaking in CI with the following message:

```
Failure/Error: measurement = Benchmark.measure { example.run }

  expected: "draft"
       got: ""

  (compared using ==)

[Screenshot Image]: /__w/discourse/discourse/tmp/capybara/failures_r_spec_example_groups_chat_composer_draft_when_loading_a_channel_with_a_draft_loads_the_draft_458.png

~~~~~~~ JS LOGS ~~~~~~~
~~~~~ END JS LOGS ~~~~~

./plugins/chat/spec/system/chat_composer_draft_spec.rb:31:in `block (3 levels) in <main>'
```
2025-03-17 10:39:22 +08:00
Jordan Vidrine
31aa2b3783
UX: Remove bg color on presence indicator (#31835) 2025-03-14 11:31:33 -05:00
Renato Atilio
ba4ffd6836
FIX: replace positive lookbehind on checklist inputrule (#31827)
Not supported on iOS Safari <= 16.3
2025-03-14 07:31:21 -03:00
Martin Brennan
019b22c376
FIX: Incorrect chat DM group user count (#31813)
When creating a DM to a group in chat, we show
a count of users for that group if the number of
users exceeds SiteSetting.chat_max_direct_message_users.

However, we were also counting bot users here, we should
only be counting human users, this led to confusion because
the chat group count was different from the one on
e.g. /g/:group_name
2025-03-14 11:40:30 +10:00
Joffrey JAFFEUX
2503e95900
FIX: ensures chat context is given to emoji picker (#31794)
This was preventing favorites emojis to work correctly as it was using
topic context. No tests for now as it's a very specific behavior hard to
test with acceptance test and a system spec seems heavy for this.
2025-03-13 10:36:01 +01:00
Joffrey JAFFEUX
1f2043de4e
DEV: removes code block enter edge case (#31773)
This was causing some confusion and now that we have the chat preference
to send with enter or metakey+enter it's even more confusing.

If your setting is send on enter, you need to use shift+enter for a new
line, even in codeblocks. If your setting is meta+enter you need to use
enter in the codeblock for a new line, meta+enter will send as expected.
2025-03-12 18:01:00 +01:00
David Taylor
1d0d7ddbb5
DEV: [gjs-codemod] convert first batch of files to gjs
Updated using `@embroider/template-tag-codemod`, plus some manual fixups.

Co-authored-by: Jarek Radosz <jarek@cvx.dev>
2025-03-12 08:54:04 +00:00
Renato Atilio
623f02aff6
FEATURE: add details (plugin) rich editor extension (#31718)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds `details` and `summary` nodes, parsers, and serializers, and a
click handler to toggle the `open` attribute.

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2025-03-11 20:15:32 -03:00
Renato Atilio
968b851c1b
FEATURE: add spoiler (plugin) rich editor extension (#31717)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds `spoiler` and `inline_spoiler` nodes, parsers, and serializers, and
a click handler to toggle its blurriness in the editor.
2025-03-11 20:13:52 -03:00
Renato Atilio
7e23096d5e
FEATURE: add check (plugin) rich editor extension (#31716)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `check` node, parser, and serializer, and an input rule to
convert when typing `[]`/`[ ]`/`[x]`
2025-03-11 20:13:44 -03:00
Renato Atilio
049e65ffe2
FEATURE: add poll (plugin) rich editor extension (#31715)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `poll` node, parser, and serializer.
2025-03-11 20:13:27 -03:00
Renato Atilio
d1870d4811
FEATURE: add local-dates (plugin) rich editor extension (#31714)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds `local_date` and `local_date_range` nodes, parsers, and
serializers.
2025-03-11 20:13:09 -03:00
Discourse Translator Bot
d3c68ef1a7
Update translations (#31747) 2025-03-11 17:47:42 +01:00
Joffrey JAFFEUX
4433a72083
DEV: attempts to fix flakey drawer spec (#31749)
The setup was happening after the page has loaded which could lead to
inconsistent results.
2025-03-11 14:57:35 +01:00
Krzysztof Kotlarek
54771b5949
FIX: remove admin_sidebar_enabled_groups setting (#31693)
Old no sidebar admin panel is deprecated and admin sidebar is not
experimental anymore. Therefore, old setting should be deleted.
2025-03-11 11:41:38 +11:00
Jarek Radosz
25048b5a8d
DEV: Update lint-configs and rubocop-discourse (#31728)
…and autofix issues

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-03-10 19:52:19 +01:00
Alan Guo Xiang Tan
19acb61834
DEV: Remove unnecessary require (#31727)
`DistributedMutex` is eager loaded in production/test and autoloaded in
development.
2025-03-10 16:56:56 +08:00
Sam
50310ea96d
FEATURE: improve post_created_edited automation triggers (#31694)
- Allow deciding if we include or exclude sub categories
- Allow filtering to only look at PMs or Topics
- Allow selection of multiple categories
- Migrations to carry all data into new structure

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-03-08 08:18:30 +11:00
David Battersby
914543dbb9
FIX: dont allow channel non-members to write messages in threads (#31697)
Prevents channel non-members from seeing the composer in threads. Since
they do not have the correct permissions to post within the channel, we
should show the join channel CTA in place of the chat composer.
2025-03-07 15:50:30 +04:00
Krzysztof Kotlarek
4bb1e0d113
FIX: loop detection works as expected and does not need logging (#31686)
Logging creates impression that something is not working while
everything is working as expected.
2025-03-07 16:41:29 +11:00
Kris
1b95a8e1e0
DEV: replace zero width space character in chat typing indicator (#31675)
We were using a zero width space added by CSS here, but have run into
occasional encoding issues for some reason? a couple people have
reported getting this instead of an empty space:


![image](https://github.com/user-attachments/assets/da39b5f5-61b0-423c-ae3e-18169e4f2f71)

I can't repro the issue, but we can avoid it by removing this space in
CSS — setting the container height to `1em` along with `line-height:
normal` should make it consistent with the height of the text within.

In the blame it seems this static height on the container was added
after the pseudo hack, and achieves the same goal when I test it across
a Firefox/Chrome/Safari
2025-03-06 15:53:50 -05:00
Joffrey JAFFEUX
fb76696f45
UX: removes per channel context of favorites emojis (#31671)
This was confusing users.
2025-03-06 16:07:58 +01:00
Jarek Radosz
28e00d9bfe
DEV: Update lint-configs and autofix issues (#31620)
This updates us to Prettier 3.x
2025-03-05 01:20:16 +01:00
Discourse Translator Bot
b467fe1347
Update translations (#31617) 2025-03-04 16:12:11 +01:00
Jarek Radosz
3aa383a4de
UX: Tweak footnote button styling (#31595)
1. remove the margin (it's displayed inline with text, so having a left
margin didn't make sense)
2. use em unit in min-height
3. slighty tighten the button (inline padding 0.5em -> 0.4em) so it's
more proportional
2025-03-04 01:24:27 +01:00
Joffrey JAFFEUX
d38acc5df1
DEV: discourse-emojis gem (#31408)
This commit moves most of emoji logic into the discourse-emojis gem:
https://github.com/discourse/discourse-emojis/

Most notably:
- images are now symlinked from the gem
- the gem provides path to the json files

Search aliases have also been made asynchronous and memoized. When you
will search for an emoji we will now load the aliases and store the list
for future use.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-03-03 13:09:08 +01:00
Ted Johansson
c0bbff598a
FEATURE: Allow admins to access group chats (#31440)
In #31366, we added the ability for admins to remove people from group chats. However, that only works as long as the admin is already in the group chat.

For forum-side group messages, admins can join any of them at will. This PR extends that same ability to chat for parity.
2025-03-03 09:20:13 +08:00
Martin Brennan
bf287b4560
FIX: Duplicate error for chat messages for upload-only messages (#31539)
This commit fixes an issue where if you tried to post
2 chat messages in quick succession which only contained
uploads (both `message` fields would be `""`), then we
would show the "You posted an identical message too recently."
error.

We should not do this for upload-only messages, they
are not identical messages.
2025-02-27 17:17:36 +10:00
Martin Brennan
e92e05b22e
FIX: Error when leaving group DM channel (#31537)
Followup b5147a4634f0fd5c98262f949a8c766bfd73d290

When we aliased `leave` to `remove` and renamed
the method in `DirectMessageChannel` in the previous
commit, this inadvertantly caused an error when
unfollowing group channels in the channel list.

When clicking the X in the channel list, we hit
ChannelsCurrentUserMembershipFollowsController for the
current user and the channel, which is supposed to only
unfollow the channel for all channel types including DMs.

Group DMs have a different Leave behaviour vs Unfollow.
Leaving the channel altogether is done from the channel
settings page, the "Leave channel" button, and that
deletes the user's membership and DM user record from that
channel.

So, we were trying to do the leave channel behaviour in the
unfollow channel controller, which was returning the wrong
record for the serializer (a User not a Membership)

This fixes the issue and removes a bit of delegate/alias indirection
which was making the code a bit harder to fllow and search, even
though it was more succinct. Also adds missing specs that would
have caught this regression.
2025-02-27 14:26:07 +10:00
Maxim Evtush
a9928e8a71
Update LICENSE (#31217)
Updated the copyright in the LICENSE file to match with https://github.com/discourse/discourse-plugin-skeleton/blob/main/LICENSE

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-02-27 00:16:59 +01:00
Joffrey JAFFEUX
699541af75
FEATURE: limits post created edited trigger to a group (#31523)
This commit allows admins to limit the post created/edited trigger
execution to a specific post user group.

It's for example useful if you want to auto tag all the topics created
by member of a specific group.
2025-02-26 10:52:40 +01:00
Martin Brennan
ed1543455d
FIX: Allow oneboxes with no description (#31518)
This behaviour was allowed in
cb82dce86a
but then inexplicably removed a few months later in
https://github.com/discourse/onebox/pull/448, but showing
title-only oneboxes is valid. The original Meta topic that
this was discussed in was
https://meta.discourse.org/t/abc-news-not-oneboxing-due-to-missing-description/155933
.

This commit re-introduces allowing this behaviour to avoid the need for
a plugin,
c.f. https://meta.discourse.org/t/allow-title-only-onebox/354306

For example
<https://en-americas-support.nintendo.com/app/answers/detail/a_id/67660>

This commit also unhides onebox descriptions in chat, it's not
clear why they were ever hidden in the first place
2025-02-26 13:16:51 +10:00
David Taylor
1d7663d63c
FEATURE: Allow chat incoming webhooks to work without .json extension (#31497)
This provides a slightly nicer-looking URL, and also helps when external
systems have strict validations on the webhook URL.
2025-02-25 15:04:57 +00:00
Discourse Translator Bot
61d8cce569
Update translations (#31501) 2025-02-25 15:11:27 +01:00
Joffrey JAFFEUX
3d5a1858e5
FIX: exclude bots of inaccessible/unreachable mentions (#31458)
It will prevent to show a notice saying the bot is not part of the
channel.

---------

Co-authored-by: Martin Brennan <mjrbrennan@gmail.com>
2025-02-25 10:19:51 +01:00
Osama Sayegh
3a8e078116
FIX: Use []() Markdown syntax for links instead of <> for narrative bot (#31496)
In one of the discourse narrative bot tutorial steps, we show the user a
few links and ask them to copy one and paste it in a reply to teach them
about oneboxes. In order to prevent the links from getting oneboxed in
the bot's post, we enclose them in `<>` which makes the links render
as-is without oneboxing.

However, if an admin attempts to customize via site texts the tutorial
step about onebox, the links enclosed in `<>` get removed completely
from the step content because they're interpreted as HTML tags when the
text override goes through sanitization (see [relevant
code](424da95128/app/models/translation_override.rb (L73-L74))).

To prevent that, this commit changes the default content for the onebox step
to use the `[]()` syntax which doesn't get sanitized and also doesn't
get oneboxed.

Internal topic: t/147912.
2025-02-25 11:51:15 +03:00
Martin Brennan
4eed96f511
FIX: Discobot onebox step sometimes not working (#31472)
This issue was found via Discobot. In part of the tutorial
for Discobot, it asks for a URL on one line so it can demonstrate
how oneboxes work.

The way it does this when the user replies is to cook the
post raw and check if there is a cached onebox for the URL
in the post. However, if you reply really fast to Discobot
with the URL without waiting for the onebox to appear in the
composer preview, it's not cached by the time we do this
check in the Discobot code.

This commit fixes the issue by following a more simplified
approach, where we check for the existence of one of the
following links from the onebox instructions:

```
https://en.wikipedia.org/wiki/Inherently_funny_word
https://en.wikipedia.org/wiki/Death_by_coconut
https://en.wikipedia.org/wiki/Calculator_spelling
```

This will fall down if someone customizes the onebox
step text, or if the user uses a different link instead,
but we are willing to accept that risk at this time to simplify things.
2025-02-25 12:41:37 +10:00
Jarek Radosz
3d2a6322d0
DEV: Update lint-configs and auto-fix issues (#31485) 2025-02-24 23:32:31 +01:00
David Battersby
44aa0eda27
UX: add automation script description for pm sender (#31478)
Adds a description to highlight the need for sender to have correct
permissions when sending PM. Without the correct permissions the PM is
not sent and a message is added to the site logs.
2025-02-24 15:54:41 +04:00
David Battersby
342ab6f082
FIX: delayed chat summary email (#31255)
Updates the chat summary email to account for:

- unread mentions in category channels (same as before)
- unread direct messages (now excluding threads)
- unread watched thread replies (for both channels and DM channels)

We have also reduced the window from 1 week down to 1 day for all 3
criteria. The DM unreads query is now properly selecting the first
unread message within the window (rather than the first message
regardless of read status).
2025-02-24 14:25:52 +04:00
Discourse Translator Bot
122e1384bc
Update translations (#31470) 2025-02-24 15:11:55 +11:00
Joffrey JAFFEUX
cb257ff658
DEV: allows to add a draft without persisting it (#31457)
On chat setup we get the initial state of drafts for the current users,
we need to add them to the drafts manager, but we don't need to store
them again on the backend.

This commit adds a persist (boolean) parameter to the
`ChatDraftsManager.add` service which when set to true will only add the
draft on the frontend and not send it to the backend.

No test, as the behavior is already tested and unchanged, this is only a
performance improvement.
2025-02-22 01:29:12 +01:00
David Taylor
c22ce1385f
DEV: Remove unneeded -webkit prefixes from css (#31448)
Now we have autoprefixer, we don't need to do this manually
2025-02-21 14:48:20 +00:00
Gary Pendergast
d0881e6fef
FEATURE: Type reactions in chat (#31439)
This change allows you to add a reaction to the most recent message, by sending a reaction message.

A reaction message can be formatted as `+{emoji}` (eg, `+❤️`), or as `+{emoji_code}` (eg, `+❤️`).
2025-02-21 17:43:28 +11:00
Martin Brennan
e26a1175d7
FEATURE: Initial version of experimental admin search (#31299)
This feature allows admins to find what they are
looking for in the admin interface via a search modal.
This replaces the admin sidebar filter
as the focus of the Ctrl+/ command, but the sidebar
filter can also still be used. Perhaps at some point
we may remove it or change the shortcut.

The search modal presents the following data for filtering:

* A list of all admin pages, the same as the sidebar,
   except also showing "third level" pages like
   "Email > Skipped"
* All site settings
* Themes
* Components
* Reports

Admins can also filter which types of items are shown in the modal,
for example hiding Settings if they know they are looking for a Page.

In this PR, I also have the following fixes:

* Site setting filters now clear when moving between
   filtered site setting pages, previously it was super
   sticky from Ember
* Many translations were moved around, instead of being
   in various namespaces for the sidebar links and the admin
   page titles and descriptions, now everything is under
   `admin.config` namespace, this makes it way easier to reuse
   this text for pages, search, and sidebar, and if you change it
   in one place then it is changed everywhere.

---------

Co-authored-by: Ella <ella.estigoy@gmail.com>
2025-02-21 11:59:24 +10:00
Joffrey JAFFEUX
a77d469eeb
UX: close thread panel with a single escape (#31426)
Before this commit we were requiring two escapes:
- one to un-focus composer
- one to close panel
2025-02-21 00:10:02 +01:00
Joffrey JAFFEUX
7aac73126c
UX: triggers upload dialog on doubleclick (#31425)
When making a double click on the [+] button next to the chat composer,
the upload dialog will now be displayed.

No test as it's hard to test with capybara and is not an important
behavior.
2025-02-20 21:08:59 +01:00