Commit Graph

4031 Commits

Author SHA1 Message Date
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
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
fa39af6526 FIX: prevents double load of automation.index (#32899)
Im not exactly sure of the reason, but I thought it was related to the
recent `addAdminPluginConfigurationNav`. I followed more closely what
has been made in chat for hooks and it seems to fix the problem.


/t/-/154466
2025-05-26 08:17:26 +02: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
49f6f5d083 UX: rich editor checklist undoable input rule (#32877)
Removes the rich editor checklist input rule `undoable: false`, which is
not needed.

Making it undoable allows a backspace to undo the input rule conversion,
so we can go from a check to a `[]` again
2025-05-23 14:20:27 +10: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
349d7df52b PERF: prevents N+1 on last_updated_by (#32817) 2025-05-20 17:07:37 +02:00
1a31769676 PERF: correctly use preloaded association (#32814) 2025-05-20 14:34:19 +02:00
0f35647c5d DEV: removes unnecessary lines (#32812)
Technically we want to follow DDAU but most of our usage in the code
base are just mutating `@checked`. This will eventually get converted to
form-kit but in the meantime we can just remove this bit of code as it's
doing two times the same thing and you could even end up in the
situation where they both fight for what is the correct value.
2025-05-20 14:03:14 +02:00
4c9384e50d PERF: fixes N+1 for automation plugin (#32810)
- Add a safeguard until we implement pagination for the index, it
ensures we won't try to load more than 500 automations ever.
- Includes the fields of the automation so we don't have an N+1 and also
filter them in ruby land instead of doing two additional queries
- Ensures a field object in the field serializer is capable to find the
loaded automation associated to it instead of trying to reload it
- Includes pending_automations to avoid an N+1
2025-05-20 12:24:07 +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
82ac698293 FIX: attempts to fix flaky in stat spec (#32784)
I suspect that by having an integer and not a float sometimes the value
we get is converted to 0.

This is the error we have atm:

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

  expected: 0.75
       got: 0.0

  (compared using ==)
```

This might not fix it, but it feels right to make this change.
2025-05-18 21:55:46 +02: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
46093eddf3 DEV: Bump linting dependencies and fix violations (#32682)
template-lint ignores added to workaround bug. Fix is pending release in https://github.com/ember-template-lint/ember-template-lint/pull/3248
2025-05-12 14:14:07 +01:00
5883085af3 DEV: Replace all @breakpoint with @viewport.* (#32649) 2025-05-12 12:52:45 +01:00
1fd843ced6 DEV: Deprecate boundDate and formatAge helpers (#32672) 2025-05-10 20:08:08 +02: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
0947a14284 DEV: correctly returns contract error (#32645)
If a user was using invalid values for the contract we would return
"Unexpected error", which is incorrect given we know the exact error.
The user will now get the following exception: "Page size must be less
than or equal to 50"
2025-05-08 14:30:02 +02:00
61de461412 DEV: Refactor lazy-video initialization for Glimmer compatibility (#32599)
Modernizes the renderGlimmer API to use Glimmer components, replacing
deprecated ember-cli-htmlbars templates. Adds deprecation warnings for
invalid parameters and improves compatibility with the new Glimmer Post
Stream API.
2025-05-07 10:47:02 -03:00
a80017ff6a DEV: add fallback for calling helper.widget decorating cooked content when using the Glimmer Post Stream (#32585)
This commit adds a basic fallback to prevent errors for extensions accessing
`helper.widget` when using `api.decorateCookedElement`.

The purpose of the fallback is provide access to `.widget.attrs`and
`scheduleRerender()` which are common scenarios.

Since the call to the callback happens only when rendering the auto mode
of the Glimmer Post Stream can't detect the existence of these
customizations. The PR also adds a deprecation notice in the console.
2025-05-06 14:13:45 -03:00
c411f4930d Update translations (#32595) 2025-05-06 11:29:38 -04:00