Commit Graph

2001 Commits

Author SHA1 Message Date
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
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
c411f4930d Update translations (#32595) 2025-05-06 11:29:38 -04:00
b6aad28ccf DEV: replace selenium driver with playwright (#31977)
This commit is replacing the system specs driver (selenium) by
Playwright: https://playwright.dev/

We are still using Capybara to write the specs but they will now be run
by Playwright. To achieve this we are using the non official ruby
driver: https://github.com/YusukeIwaki/capybara-playwright-driver

### Notable changes

- `CHROME_DEV_TOOLS` has been removed, it's not working well with
playwright use `pause_test` and inspect browser for now.

- `fill_in` is not generating key events in playwright, use `send_keys`
if you need this.

### New spec options

#### trace

Allows to capture a trace in a zip file which you can load at
https://trace.playwright.dev or locally through `npx playwright
show-trace /path/to/trace.zip`

_Example usage:_

```ruby
it "shows bar", trace: true do
  visit("/")

  find(".foo").click

  expect(page).to have_css(".bar")
end
```

#### video

Allows to capture a video of your spec.

_Example usage:_

```ruby
it "shows bar", video: true do
  visit("/")

  find(".foo").click

  expect(page).to have_css(".bar")
end
```

### New env variable

#### PLAYWRIGHT_SLOW_MO_MS

Allow to force playwright to wait DURATION (in ms) at each action.

_Example usage:_

```
PLAYWRIGHT_SLOW_MO_MS=1000 rspec foo_spec.rb
```

#### PLAYWRIGHT_HEADLESS

Allow to be in headless mode or not. Default will be headless.

_Example usage:_

```
PLAYWRIGHT_HEADLESS=0 rspec foo_spec.rb # will show the browser
```

### New helpers

#### with_logs

Allows to access the browser logs and check if something specific has
been logged.

_Example usage:_

```ruby
with_logs do |logger|
  # do something

  expect(logger.logs.map { |log| log[:message] }).to include("foo")
end
```

#### add_cookie

Allows to add a cookie on the browser session.

_Example usage:_

```ruby
add_cookie(name: "destination_url", value: "/new")
```

#### get_style

Get the property style value of an element.

_Example usage:_

```ruby
expect(get_style(find(".foo"), "height")).to eq("200px")
```

#### get_rgb_color

Get the rgb color of an element.

_Example usage:_

```ruby
expect(get_rgb_color(find("html"), "backgroundColor")).to eq("rgb(170, 51, 159)")
```
2025-05-06 10:44:14 +02:00
edbd5e08f9 DEV: Refactor StartReply & StopReply services a bit
- Move some data transforming into contracts.
- Add some missing specs.
- Use the `try` step.
- Improve the `model` step a bit by allowing to catch any exception,
  and not only `ArgumentError`. We already had the mechanism to inspect
  which exception was caught.
2025-04-30 11:50:22 +02:00
21a7f31622 SECURITY: Enforce DM limits properly
When adding people to a DM, the ones already in the channel weren’t
taken into account when checking whether the maximum limit was reached.
2025-04-29 12:06:33 +08:00
303b4bfbae Update translations (#32216) 2025-04-28 13:41:04 +02:00
aafbde2080 DEV: Convert final hbs to gjs and enable require-strict-mode lint (#32473) 2025-04-26 10:48:43 +01:00
e41897a306 DEV: [gjs-codemod] Convert final core components/routes to gjs 2025-04-25 11:06:24 +01:00
e401d795c6 DEV: [gjs-codemod] merge js and hbs 2025-04-25 11:05:20 +01:00
2a47848453 DEV: [gjs-codemod] renamed hbs to gjs 2025-04-25 11:05:18 +01:00
a9ddbde3f6 DEV: [gjs-codemod] renamed js to gjs 2025-04-25 11:05:17 +01:00
fe12500767 UX: Do not let composer affect chat window height (#32423) 2025-04-24 09:32:28 -05:00
ed2740d0ca FIX: correctly reset panel when resizing window (#32437)
The problem is mainly that we also have a css animation made from js
which was setting a different width for the panel, so the `style.width =
"auto"` was not overriding this part. This animation happens in a parent
component after `didResizeContainer` is called, so it could be fine most
of the times, but the simpler change is to ensure, panel resize, or
window resize ends up in the same codepath so whatever the developer
decides to do in `didResizeContainer` hook will be applied in both
cases.

No test as it's fairly hard to test and would require a complex system
spec setup.

It avoids this situation where the side panel is larger than viewport
after window resize:
![Screenshot 2025-04-24 at 11 58
09](https://github.com/user-attachments/assets/8b58793a-32dc-4bc8-9989-7498e458c059)
2025-04-24 20:31:55 +10:00
4c443283cf UX: Border radius removal (#32424) 2025-04-23 16:38:59 -05:00
b888ec07cb UX: Chat more message actions adjustments (#32404) 2025-04-22 16:36:21 -05:00
1e0d773b54 DEV: duplicate scroll-top util function to lib and replace current usage with new path (#32367)
This was refactored from an actual Mixin some time back. This PR moves
the function to the lib folder and keeps the same logic/interface
otherwise.

We'll remove the mixin file once all non-core repos change to use the
new file.
2025-04-21 08:12:51 +08:00
6c4e9dfbc8 DEV: Try fix composer rich text transcript spec (#32364)
This is to try fix this error by sending the keys
on the element itself:

```
Failure/Error: page.send_keys([PLATFORM_KEY_MODIFIER, "v"])

Selenium::WebDriver::Error::StaleElementReferenceError:
  stale element reference: stale element not found in the current frame
    (Session info: chrome=135.0.7049.84); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception
```
2025-04-18 15:52:35 +10:00
530f2f13af FIX: Make the 'Keep Message Deleted' reviewable option work (#32345)
When a flagged chat message has already been deleted, we offer an option
in the review queue to agree with the flag and keep the message deleted.
However, this option is currently broken due to a missing implementation
for the option.

Internal topic: t/152203.
2025-04-17 07:35:08 +03:00
f03a6f3557 UX: Onebox & quote border radius (#32242) 2025-04-14 10:55:51 -05:00
7b2b08cf89 DEV: [gjs-codemod] Convert automation/styleguide/other to gjs
Co-authored-by: Jarek Radosz <jarek@cvx.dev>
2025-04-14 15:36:16 +01:00
3462113bd4 DEV: [gjs-codemod] merge js and hbs 2025-04-14 15:27:52 +01:00