4063 Commits

Author SHA1 Message Date
301f27caaa DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
afc5d13c63 FEATURE: Text heading/paragraph menu in composer toolbar (#33461)
This PR introduces a heading/paragraph dropdown menu for  the
composer toolbar, that works for both the new rich text editor, and
the old markdown editor.

Features include:

* Dynamically changing the icon based on the heading level
* Checking the current heading level in the dropdown list
* Applying the same heading level to multiple selections

---------

Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Renato Atilio <renatoat@gmail.com>
2025-07-11 12:29:58 +10:00
620883cd13 DEV: Move discourse-reactions to core (#33538)
https://meta.discourse.org/t/373574

Internal `/t/-/156778`
2025-07-10 11:40:31 +01:00
0dcbbe0de4 DEV: Load admin JS bundles from plugins for staff users (#33540)
JS assets defined under `admin/` in plugins are compiled into a separate
bundle that should be loaded for staff users only, but we currently load
it for all users including normal users and anons. This is wasteful and
unexpected since it could cause errors if an asset in the admin bundle
of a plugin imports a module from the admin bundle in core (which
doesn't get loaded for non-staff users).
2025-07-10 07:39:11 +03:00
6bcb38f410 REFACTOR: consolidate empty states, add invite variant (#33455)
This consolidates various empty states to use a single `EmptyState`
component. I've also added a new state when there are no pending
invites.

I've moved the SVGs to stand-alone components in a `components/svg/`
directory. I believe these need to be embedded (rather than separate
`.svg` assets) because we're using color variables within.

Most of the `EmptyState` component is optional so it should be flexible.
An optional tip block is used for when we may need to utilize an action
instead of a link (as invites do).

The invite tip includes a prefix and suffix so translators can adjust as
needed for their locale.


The existing empty states should only change slightly... 

New

![image](https://github.com/user-attachments/assets/e85b38cb-82f9-408c-bca9-d01db1ff2b4e)


Unread

![image](https://github.com/user-attachments/assets/5546b8fa-8645-4568-a155-42155c0f4477)


Chat channels

![image](https://github.com/user-attachments/assets/80efe964-85cf-4054-aa4c-efdb0864b84b)


Plus the new invite state: 

![image](https://github.com/user-attachments/assets/e2708ba4-32e8-4e47-aa99-a712b45922f9)


These simpler empty states are also using the component now, it will now
be easy to enhance these with illustrations in the future as well.


![image](https://github.com/user-attachments/assets/30f8ee5e-7cb4-45f1-9652-bbd5b1c034de)



![image](https://github.com/user-attachments/assets/98e62785-4e1f-40c6-8c86-5f98391472a0)
2025-07-09 12:34:04 -04:00
6e7947949f Update translations (#33516) 2025-07-09 15:27:10 +02:00
848c0c2693 UX: remove topic status actions from composer more menu (#33369)
Removes the Toggle Unlisted and Toggle Whisper options from the composer
more menu.

Adds the Toggle Unlisted action the the top-left topic status dropdown


![image](https://github.com/user-attachments/assets/5dfb481b-7b46-4dc2-bfbf-a8c5579924ad)
2025-07-08 17:29:26 -03:00
a24107dd15 FIX: Escape URL when inserting/editing links in composer modal (#33501)
Fixes an issue where a URL like this:

```
https://meta.discourse.org/admin/site_settings/category/all_results?filter=discourse connect
```

Would appear to be broken when inserting into the composer via the
hyperlink modal. All we have to do is escape it before inserting,
and unescape before editing it in the modal.

Also in this commit I am renaming the InsertHyperlink modal to
UpsertHyperlink,
since it is used for both inserting and editing links.
2025-07-08 12:51:25 +10:00
d1446355e7 FIX: chat btn order on user profile (#33494)
A recent regression caused the incorrect order of the chat button which
makes the profile controls look visually incorrect.
2025-07-07 20:10:44 +04:00
4c7089f817 DEV: Deprecate external_system_avatars_enabled (#33436)
We want to deprecate the enabled/disabled toggle for this setting and rely entirely on the presence of a URL.

This change:

- Deprecates and hides the enabled/disabled setting.
- Updates all code paths and tests that rely on the old setting.
- Adds a migration that clears the URL if the enabled/disabled setting is set to false.
2025-07-04 16:02:04 +08:00
ebee4df8a1 DEV: Replace toolbar popup menu with DMenu (#33247)
This commit replaces the `toolbar-popup-menu-options`, which used
`select-kit` with a new implementation using `dmenu`.

---------

Co-authored-by: Renato Atilio <renato@discourse.org>
Co-authored-by: Martin Brennan <martin@discourse.org>
2025-07-03 09:57:16 +10:00
2ee7d055a2 UX: Shrink YouTube thumbnail in chat transcript (#33433)
This fixes an issue where the YouTube thumbnail was huge in a chat
transcript, like in this scenario:

* Share a link to a youtube video in channel A
* See it onebox at a reasonable size
* Grab a link to your message
* Share the link to your message in channel B (e.g. a DM to yourself)
*  See GIANT youtube image

This commit only fixes the issue visually though -- it does not apply
the LazyYoutube decorations that actually embed the video. We can do
this in a followup commit.
2025-07-03 07:51:59 +10:00
59367ac03f Update translations (#33409) 2025-07-02 22:36:37 +02:00
d92de3e4d0 FIX: Admin search not including plugin pages (#33356)
Followup 4fe85fdb53d32a4ceda2fffcadbf22d2cbf5de7e

It's not ideal, but currently the admin-sidebar modifies ADMIN_NAV_MAP,
and the admin search data source relies on this modification to include
plugin pages in search.

This commit removes the cloneJSON added in the previous one and adds a
test to ensure this doesn't regress.

A followup commit will do some refactoring to stop this behaviour of
modifying the global ADMIN_NAV_MAP.
2025-06-26 13:35:13 +10:00
32aec6fca7 FIX: Chat video thumbnails on iOS (#33349)
Turns out we do need the iOS check, not just the safari check.

Follow up to: #33199
2025-06-25 14:00:28 -06:00
5e8b92b789 UX: Updated gear to plus icon in discobot tutorial (#33343)
Discobot advanced tutorial needed the gear icon replaced by the new plus
icon.
Related to #32918
2025-06-25 12:07:23 +02:00
541c6cc1d7 Update translations (#33326) 2025-06-24 16:29:13 +02:00
f69dbcd2c1 FIX: Make Ctrl+K shortcut work consistently in RTE, and not always show chat channel switcher
Followup fb7fa2902cf685ee9d4002e5448b4817f2dbef98,
prevent opening the chat channel selector with Ctrl/Meta+K
in any inputs except the chat composer, most of the time you
do not want this, but especially in the topic composer.

In that case, you want the link insert modal to open.
2025-06-24 12:20:00 +10:00
e241de51cd FIX: correctly follow enable_emoji_shortcuts in chat (#33297)
Prior to this fix, this setting would have no effect in chat.
2025-06-23 17:42:24 +02:00
3fbb2954cb DEV: Refactor Chat::ListChannelMessages service a bit
- improve the contract a little
- use `model` where possible
- extract message existence logic to a dedicated policy, allowing easier
  testing.
- remove unused code
- refactor specs to follow current guidelines/best practices
2025-06-23 14:18:49 +02:00
00942ddffd FIX: Admin search labels doubled up with parent label (#33308)
Fixes an issue where the admin search results was showing
breadcrumbs with a double up of the parent label. For example,
we would show "Plugins > Plugins > AI > Usage" or
"Advanced > Advanced > Backups > Logs".

Also adds a missing translation for the chat incoming webhooks
page.
2025-06-23 16:21:29 +10:00
bb5c2e7a00 FIX: chat message inline onebox url target (#33288)
Chat inline onebox links should open in a new tab with the help of chat
decorators by appending the `target="_blank"` attribute. I suspect this
may have been accidentally broken during a refactor in #31309

The issue was that the element that we pass into the decorator has
changed, meaning that the selector in the decorator would never find
inline links in cooked messages.
2025-06-20 18:04:37 +04:00
f138f78f50 DEV: add channel hashtag style type (#33284)
Adds the missing `style_type` that is used to decorate hashtags in core.

All chat channels currently use an icon by default, so declaring the
style type on the channel hashtag data source makes this more complete.
2025-06-20 10:04:36 +04:00
c9425c93cc FIX: ensures empty fields don't store an empty array (#33274)
This is a follow-up to
299d28cb73
to apply it to more fields.
2025-06-19 20:46:48 +02:00
35d9688aa3 UX: Add tertiary-25 color variable (#33273) 2025-06-19 13:05:55 -05:00
299d28cb73 FIX: ensures empty tags field is not storing an empty array (#33270)
This would happen in the following scenario:
- select a tag
- save the automation
- unselect the tag
- save the automation

You would end up with a field having `[]` as value instead of `nil`.
This can cause issues in the logic of scripts and triggers as they might
consider the value as present.
2025-06-19 17:06:22 +02:00
af11b23309 FIX: add channel hashtag color when lazy load is disabled (#33269)
When category lazy loading was disabled, chat channel CSS classes were
not being inserted into the page markup. This meant that they would not
be styled correctly in the markdown editor preview.
2025-06-19 18:54:11 +04:00
4f2a8d39da FIX: correctly refreshes associated fields after update (#33246)
The `on_update` callback of triggers is called with previous fields and
new fields, values. However since a recent change:
https://github.com/discourse/discourse/pull/32810 this relationship is
cached and would cause previous fields to equal new fields. This commit
ensures we are refreshing the relationship before calling the
`on_update` callback.
2025-06-18 14:01:09 +02:00
0b6155a8d8 Update translations (#33235) 2025-06-17 23:07:42 +02:00
aab7b9fc68 DEV: Use imports for select-kit components & deprecate string lookups (#33219) 2025-06-17 10:40:46 +01:00
c00c522530 DEV: Adds hasNoPreferredMode to chat state manager (#33213)
This commit introduces a new property `hasNoPreferredMode` to the
chat state manager, which represents a user who has not purposely
set chat mode to drawer or full page, meaning they have no LocalStorage
value set.

This can be useful for themes to change the chat mode but only
if the user has no preference already.

c.f.
https://meta.discourse.org/t/full-screen-chat-as-default-for-collaboration-setup/369849
2025-06-17 13:22:42 +10:00
fb9343891c DEV: Rename codemodded class names (#33198) 2025-06-16 16:31:57 +02:00
2268f06b04 FIX: Chat video thumbnails in Safari (#33199)
When uploading videos in chat using Safari the thumbnail isn't being
displayed
so we need to trick the browser to by adding the timestamp property so
that it
will fetch the metedata the html5 video tag needs to render the
thumbnail.
2025-06-13 13:04:35 -06:00
3d9a05f9c0 UX: redirect message actions wheel event to channel (#33172)
When your mouse was over the message actions container, not only it
wouldn't scroll your channel, but it would scroll the whole page, this
redirect ensures we correctly scroll the scroller associated with this
message actions container.
2025-06-12 11:11:33 +02:00
25c62b184e Update translations (#33145) 2025-06-10 23:27:48 +02:00
512a31339a UX: composer toolbar changes (icon, style, placement) (#32918)
Changes the gear icon for the more menu to a circle-plus icon.

Changes the emoji icon to its outline version, to make it less similar
to the circle-plus icon.

Changes the styles (eg. icon sizes) of the toolbar, using a flexbox
instead of a grid, with some tweaks and animations to the toggle switch,
which occupies a smaller width now.

Removes the gray button-bar bottom border.

Moves the Insert Date/Time item to the more menu, and changes its icon
to a clock.

### Before, hovering more menu

<img width="758" alt="image"
src="https://github.com/user-attachments/assets/84d8f5aa-519e-40a2-ba44-d58d7294f6b0"
/>

### After, hovering more menu

![image](https://github.com/user-attachments/assets/b54eac09-9dd0-4b7f-b93c-82d452cc5ded)

---------

Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
2025-06-10 12:16:19 -03:00
b1f5d2e4b9 FIX: Stop blocking auto scroll on iOS (#33129)
Previously on iOS the chat would explicitly not scroll down to the bottom when a new message was added.
2025-06-09 15:00:06 -05:00
c1946425fa FIX: chat: shows placeholder instead of timer for empty chats (#33105)
For empty chats, a dummy message is created with `id=null` (an
unsaved Ember model). 

The timer or placeholder's display is determined by the message ID's presence now (not the `createdAt` prop).
2025-06-09 15:59:04 +08:00
efd01c18cf DEV: Modernize the remaining of the post stream to Glimmer components (#32653)
Co-authored-by: David Taylor <david@taylorhq.com>
2025-06-05 19:48:29 -03:00
f66339338e A11Y: SVG icons should be hidden unless a label is provided (#33059)
This is fairly minor because usually SVGs aren't focusable, but this
adds `aria-hidden='true'` to all SVGs by default unless either an
`aria-label` or `label` is provided. This gets reported to us in
automated tests from time to time.

So now:

1. SVG: `aria-hidden="true"` (new behavior, safe default when no label
is provided)
2. SVG with `label` param: `aria-hidden="true"` and `sr-only` label is
provided
3. SVG with `aria-label` param: `aria-hidden="false"` and `aria-label`
is provided
2025-06-04 08:21:36 -04:00
25e80511f7 UX: rich editor [details] caret hover and padding (#33057)
Improves the styles for the [details] caret pseudo-element on the rich
editor.

Additionally, having `summary` have no `pointer-events` is important so
Firefox doesn't mess with our caret positioning when clicking it.
2025-06-03 15:23:21 -03:00
8873a33b7a FIX: uses text selection when using hide details (#33049)
When hiding details if the user has currently a text selection we want
to use it as the content of the details element.

/t/-/154716/30
2025-06-03 19:53:45 +02:00
b08d5ad7b7 Update translations (#33052) 2025-06-03 17:37:13 +02:00
cd4b6b8fab DEV: allows chat thread sdk to query more messages (#32914)
The changes are:
- Chat Thread SDK can query up to 500 messages
- If you are above this number, we don't raise an error anymore but we
clamp it to 500
- The controller using this service is forced into the old limit of 50
to avoid abuses
2025-06-02 09:29:24 +02:00
8660630e01 UX: avoid presence layout shift (#33022)
The space reserved for presence was just slightly too short, which was
causing a layout shift when the indicator appears, this fixes it.


![image](https://github.com/user-attachments/assets/d729c941-09c2-42ec-8e26-11b598697c94)
2025-05-30 17:30:44 -04:00
a55ce02cb9 PERF: Remove <details> polyfill (#33020)
When we first introduced the `discourse-details` plugin, the `<details>`
element was not supported in all browsers, so this `display: none`-based
polyfill had to be used.

Nowadays, there is no need for this. And in fact, the `details[open] >
summary:first-of-type ~ *` selector is showing as our most expensive CSS
selector during repaints.

Removing this `display: none` also means that browser find-in-page will
now be able to correctly find content inside `<details>` in discourse.


![image](https://github.com/user-attachments/assets/e3d943f3-ec63-4c16-9096-44340a4f7df0)
2025-05-30 21:47:09 +01:00
Sam
2261d3711b FEATURE: allow customizing default timezone for email. (#32964)
1. Changes default email format to llll (eg: Tue, May 8, 2018 2:00 AM)
from 2018-05-08T00:00:00Z UTC which is not nice on the eyes
2. Adds `discourse_local_dates_email_timezone` which allows configuring
default timezone in emails
3. Improved help text on site settings (format / timezone)

---------

Co-authored-by: Gary Pendergast <gary@pento.net>
2025-05-29 14:17:37 +10:00
a868c8225f FIX: removes shift which is not necessary anymore (#32979) 2025-05-28 20:07:05 +02:00
0b65360094 FIX: Make post created/edited automation trigger regexes more specific (#32944)
- For `with_images`, ignore `<img>` tags representing emoji or a quote
avatar
- For `with_links` and `with_uploads`, exclude tags starting with the
letter "a" other than `<a>` (like `<aside>`)
- For `with_code`, the `<pre>` tag wasn't being detected because it was
expecting an extra char before the ">"
2025-05-27 15:40:00 -05:00
ee14a81573 Update translations (#32939) 2025-05-27 22:11:24 +02:00