2022 Commits

Author SHA1 Message Date
301f27caaa DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03: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
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
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
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
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
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
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
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
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
a868c8225f FIX: removes shift which is not necessary anymore (#32979) 2025-05-28 20:07:05 +02:00
ee14a81573 Update translations (#32939) 2025-05-27 22:11:24 +02:00
8efd99da9e FEATURE: Improve emoji diversity rendering (#32909)
This change polishes the emoji diversity rendering behaviour in the emoji pickers. When a user changes their diversity setting, that setting will now be applied to favourites, chat default reactions, and in the  emoji picker section selectors.

If an emoji was previously stored with a skin tone in favourites or default reactions, the stored skin tone won't be overridden.
2025-05-27 11:34:24 +10:00
1c1300d0e7 FIX: back to forum button should lead to forum and not chat (#32913)
Similar fix to https://github.com/discourse/discourse/pull/32911

Meta:
https://meta.discourse.org/t/doc-sub-category-back-to-forum-loop/367513/15
2025-05-27 08:43:47 +08:00
487f610fc1 DEV: add user email to chat summary mailer (#32917)
Pass user email rather than relying on enrichment when sending summary
emails.
2025-05-26 19:19:16 +04:00
fc9703a92b FIX: allows zooming of images in chat (#32891) 2025-05-23 21:33:50 +02:00
b15c1d28c9 DEV: Introduce experimental viewport-based mobile mode (#32859)
Introduces the viewport_based_mobile_mode experimental site setting.
When enabled, user-agent-based mobile/desktop detection will be replaced
with viewport-width logic. 'mobile mode' is enabled for any viewport
less than our 'sm' breakpoint (40rem, or 640px at default font size).

When this mode is enabled, mobile/desktop toggle buttons are hidden,
since they are non-functional.

Tests are also updated to use a consistent method for force-enabling the
legacy mobile mode. All state is now stored in `lib/mobile`, and the
`Site` model references that via a getter.
2025-05-23 13:01:04 +01:00
9ead2e6720 PERF: Introduce lazyHash and update PluginOutlet calls to use it (#32823)
This is a more efficient version of `{{hash`, where the values are only evaluated when they're actually accessed. Also enables a new lint rule which will ensure `{{hash` is not reintroduced on PluginOutlets
2025-05-22 12:07:22 +01:00
f0fcac1243 DEV: Refactor Chat::LookupChannelThreads to follow best practices
- use `model` where possible
- extract threads fetching logic to its own action
- refactor specs to follow current guidelines/best practices
2025-05-22 12:06:54 +02:00
58d14b075d FEATURE: trigger an event when chat channel is trashed (#32844)
Required for this PR:
https://github.com/discourse/discourse-livestream/pull/55
2025-05-22 09:48:32 +05:30
ae4ee7754f DEV: Update linting (#32836) 2025-05-21 12:02:52 +02:00
f2ed537559 Update translations (#32815) 2025-05-20 17:33:42 +02:00
746c332df3 DEV: simplify test to remove flaky part (#32790)
This test is about testing that we can set notification_level, which it
does correctly. The rest of the spec was testing some undefined behavior
which is flaky.
2025-05-19 09:47:12 +08:00
df37ef5774 DEV: flaky spec (#32781)
Attempts to not use within to make this spec less flaky.
2025-05-17 15:32:45 +02:00
c74a49d7e7 DEV: attempts to use capybara choose (#32779)
Im not convinced this will fix the flakyness, but this is better
anyways.
2025-05-17 15:31:52 +02:00
2e4076f586 DEV: standardise toasts duration (#32741)
Toasts can now have two durations:
- `short` -> 3000ms
- `long` -> 5000ms

For backwards compatibility integer values still work but will display a deprecation message in the browser console.
2025-05-15 14:59:37 +02:00
231b3943d3 UX: simplify admin search, make more accessible (#32733)
This simplifies the admin search and adds some basic accessibility

Simplification: 
* Removes the filters for now, both in the modal and full-screen 
* Removes the link to full-screen from the modal
* Simpler input placeholder text
* Positioned to sit higher on the page, similar to a command palette 

Accessibility: 
* Results (or lack of) announced for screenreaders after query 

Bonus: 
* Makes the modal input sticky on scroll 
* Combined some styles shared between this and the chat menu (modifier +
k) under a `--quick-palette` class



Before:

![image](https://github.com/user-attachments/assets/0af2d741-e870-4ad2-b305-57dc4afc3946)


After:


![image](https://github.com/user-attachments/assets/a8492aed-03c7-4d73-a3d3-ae89834b82bc)

---------

Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
2025-05-15 16:31:03 +10:00
e806cfbe1f Update translations (#32703) 2025-05-14 14:34:07 +02:00
5883085af3 DEV: Replace all @breakpoint with @viewport.* (#32649) 2025-05-12 12:52:45 +01:00
52b79012e9 DEV: revert long press changes (#32668)
These changes have been made for playwright as it was hard to test a
long press even on playwright given `click` won't trigger `touchstart`
even with `isMobile:true` and `hasTouch:true`. You have to use `tap`,
but you don't have the `delay` option on tap, so you can't make it a
long tap.

Sadly this code is apparently not working correctly on Android 15. This
commit will revert the modifier to what it was before and is relying on
native JS to trigger the fake long press in specs, which seems to work
nicely.

This commit also attempts to centralize the actions on messages in page
objects to avoid code duplication.
2025-05-09 18:58:42 +02:00
58009fb0e7 DEV: Fix small issues in the Glimmer Post Stream (#32656)
- When using the Glimmer Post Stream, ensure the status wrapper is only
rendered for mentions of users with a status set.
This prevents an empty wrapper from adding a small blank space at the
end of the mention.

- Ensures the post's user field in initialized with the
`avatar_template` in the PostStream to prevent missing avatar on small
actions

- Fix an issue where the path would be incorrectly linked on small
actions

- Fix an issue where the relative timestamp would be incorrectly
displayed in wiki posts
2025-05-09 12:17:28 -03:00