3843 Commits

Author SHA1 Message Date
David Battersby
3d47a1268c
SECURITY: Ability to bypass disabling chat of users 2025-02-04 13:32:42 -03:00
Ted Johansson
503f9b6f02
DEV: Use default admin routes for plugins with settings (#30941)
This change adds a sidebar link for each plugin that fulfils the following criteria:

- Does not have an explicit admin route defined in the plugin.
- Has at least one site setting (not including enabled/disabled.)

That sidebar link leads to the automatically generated plugin show settings page.
2025-02-04 14:57:28 +08:00
Régis Hanol
7245292fe1
FIX: chat was enqueueing too many "chat summary" emails (#31133)
due to an issue with LEFT JOIN, we were enqueue a "chat summary" email
for every new messages in a channel, instead of for every new mentions 😬

This bloated the sidekiq queue with a lot of unecessary jobs as seen in

- https://meta.discourse.org/t/-/347197
- https://meta.discourse.org/t/-/346542

Thankfully, it wasn't sending those emails as the query for listing the
unread mentions and dms was correct when generating the chat summary
email.
2025-02-03 23:56:47 +01:00
Jarek Radosz
0ad05e022f
DEV: Fix unwanted stylelint changes, do cleanup (#31140) 2025-02-03 22:05:22 +01:00
Joffrey JAFFEUX
ab4ca0be6e
FIX: quote from thread in drawer mode (#31137)
Due to a recent regression the selection management was failing in
drawer mode for threads. We were not correctly setting the active
thread.

This commit fixes the issue and adds a spec.
2025-02-03 21:20:50 +01:00
Jarek Radosz
80d7075171
UX: Fix user-select regressions (#31129)
…and cases that didn't take webkit into account at all.
2025-02-03 18:14:11 +01:00
Discourse Translator Bot
8d810f9271
Update translations (#31123) 2025-02-03 16:37:54 +01:00
chapoi
58f75ed205
UX: allow msg select buttons to wrap (#31084)
Before
![CleanShot 2025-01-31 at 13 47
32@2x](https://github.com/user-attachments/assets/b23ead7a-0d2d-4e37-b7dd-89fc7e60959b)

After
![CleanShot 2025-01-31 at 13 47
51@2x](https://github.com/user-attachments/assets/633984f7-c989-4f82-ac31-91ef9f7acc30)
2025-02-01 03:41:39 +01:00
David Battersby
8ca2c14874
FIX: switch panel back to forum last known url (#31092)
Previously the return to forum link would automatically take you to the
forum homepage, however this was not intended functionality. We should
attempt to take the user to their last viewed forum page.

This change fixes a bug in how we determined what the destination link
should be.

Internal ref: /t/110508
2025-01-31 17:18:24 +04:00
Discourse Translator Bot
4e2a982e91
Update translations (#31035) 2025-01-31 10:48:44 +01:00
Martin Brennan
5bc7371192
FEATURE: Localization admin settings config page (#31085)
This commit adds a new Localization config page for
admins, as a basic filtered site setting page similar
to Legal and Notifications. Included settings are:

* default locale
* allow user locale
* set locale from accept langauge header
* onebox locale
* display local time in user card
* discourse local dates enabled
* support mixed text direction
* unicode usernames
* allowed unicode username characters
2025-01-31 12:55:30 +10:00
Martin Brennan
7fd9550f64
DEV: Change dIcon to icon in components (#31083)
Apparently `icon` is the preferred nomenclature
2025-01-31 10:55:31 +10:00
Sam
29e48a6478
DEV: remove experimental lightbox (#30973)
Experimental lightbox did not pan out, we are rolling it back so we can
start again from base principles.
2025-01-29 16:08:21 +11:00
Jarek Radosz
d455bf4365
UX: Fix mobile chat DM row layout (#31043) 2025-01-29 03:24:35 +01:00
Kris
f6c5eca485
DEV: add btn-default classes to buttons using default styling (#31039)
All of these buttons use our default grey background styling, but aren't
carrying the `btn-default` class, which makes them easier to target in
themes. This PR adds the class.
2025-01-28 15:40:34 -05:00
Ted Johansson
907db4d5fd
DEV: Remove plugin sidebar rendering fallback (#31012)
We used this flag for experimenting with admin plugin sidebars. We have now settled on a tabbed layout, and this is no longer needed.

This PR simply ignores the flag in a backwards-compatible way, so we can discontinue usage in plugins and then remove the backwards-compatibility in core.
2025-01-28 09:42:24 +08:00
Krzysztof Kotlarek
cfcc60f847
FEATURE: new fast_typing_threshold site setting (#30865)
Rename `min_first_post_typing_time` to `fast_typing_threshold` and
provide admin 4 options:
- disabled
- low - 1 second
- standard - 3 seconds
- high - 5 seconds

Related PRs:
- https://github.com/discourse/discourse-zoom/pull/112
2025-01-28 09:53:03 +11:00
Penar Musaraj
7303aded24
A11Y: Allow tabbing to members link in chat channel card (#31016) 2025-01-27 14:42:23 -05:00
Joffrey JAFFEUX
a52a8f4663
FIX: correctly closes panels in threads (#31013)
The following case was bugged:

- visit a thread in full page chat
- click channel title
- click back button in channel navbar
- 💥 you would have a channel with limited width as if there was
still the thread showing next to it, but it was empty
2025-01-27 16:34:56 +01:00
Renato Atilio
5d1c696240
UX: respect user locale when sending chat notices (#30996) 2025-01-27 10:53:13 -03:00
Joffrey JAFFEUX
83a47c36a5
DEV: implements model/afterModel/deactivate in drawer router (#29879)
These changes allow to load model when loading a screen of the drawer,
the underlying idea is to avoid having to rely on the global
`activeChannel`, this essentially makes each screen responsible for it's
data.

This change is also fixing a bug where clicking on a link routing to the
same screen of the drawer you are already on, would display a blank
drawer.
2025-01-27 11:03:15 +01:00
Joffrey JAFFEUX
2f3355695e
FIX: improves reliability of last visit line in chat (#30948)
This commit does several changes:

- it moves the ownership of the last message info to the channel instead
of storing it on the message, it avoids the need to iterate over every
messages
- makes an optimistic update of the last read message id
- adds a spec to confirm this behavior
2025-01-27 10:38:41 +01:00
Roman Rizzi
a1bbbbda02
DEV: Promote historic post_deploy migrations for core plugins. (#30987)
This commit promotes all post_deploy migrations which existed in
Discourse v3.3.0 (timestamp <= 20240717053710)
2025-01-24 11:47:03 -03:00
Joffrey JAFFEUX
2cff8c82e3
UX: adds chat send shortcut user preference (#30473)
Users can now decide if they want to send a message on:
- <kbd>enter</kbd>
- <kbd>meta + enter</kbd>

If you choose <kbd>meta + enter</kbd>, <kbd>enter</kbd> will add a
linebreak.

<img width="192" alt="Screenshot 2025-01-21 at 12 57 48"
src="https://github.com/user-attachments/assets/abfd6f8b-83b3-4e6f-be67-8f63d536ca8a"
/>
2025-01-22 13:17:45 +01:00
Joffrey JAFFEUX
a66e5ff728
FIX: ensures chat navbar is on top of content (#30923)
Since this change
6c3a7f2a67 (diff-48126857aeb1748fb1eb2500ca69b832212061db59d93ed61dde9fd5dcddf0c7)
we had various behaviours in different browsers as what should be at the
top was ambiguous. This commit ensures the navbar is one layer above the
content.
2025-01-22 11:48:02 +01:00
David Taylor
c266e4acb8
FIX: Enforce 'prefix' notation for media-query ranges (#30913)
"context" notation is not supported in iOS < 16.4, and we don't have any
post-processing on our CSS files which can automatically make that
conversion.

For now, changing the stylelint config to enforce the more-compatible
syntax, and updating all occurences.
2025-01-21 23:42:17 +00:00
Jarek Radosz
e98644fbc6
DEV: Replace remaining uses of query helper (#30019) 2025-01-22 00:25:03 +01:00
Jarek Radosz
8e31991613
DEV: Fix a warning in a chat spec (#30904)
```
Checking for expected text of nil is confusing and/or pointless
since it will always match. Please specify a string or regexp instead.
plugins/chat/spec/system/chat_message_interaction_spec.rb:51
```
2025-01-21 23:44:28 +01:00
Jarek Radosz
8c31f1aa5f
UX: Improve git/code oneboxes (#30822) 2025-01-21 14:20:36 -06:00
Discourse Translator Bot
f0d6e9758d
Update translations (#30898) 2025-01-21 15:55:30 +01:00
Joffrey JAFFEUX
6f11c82801
FIX: removes mousewheel edge case on messages (#30900) 2025-01-21 15:38:07 +01:00
David Taylor
df205c9290
UX: Remove loading="lazy" from avatars for improved UX (#30897)
Lazy loading images naturally causes a slight delay, because the browser
only starts to load them after laying out the DOM and checking whether
they're in the viewport. Plus, in Safari, re-rendering the DOM of a
lazy-loaded image always causes a brief flicker, even if the image is
already cached in the browser.

Lazy-loading is most beneficial on large one-off images which are often
rendered outside the viewport. That's frequently the case for images
which users share in topics. Avatars, on the other hand, are very small
images, they're very often above-the-fold, and the same avatar often
occurs many times on the same page.

Therefore, this commit removes `loading="lazy"` from avatars, which
should improve avatar load times in all browsers, and stop the flicker
in Safari.

---

Tapping logo to reload topic-list in Safari. Before: https://github.com/user-attachments/assets/242299f8-aa13-4991-b321-2f143603ed26

After: https://github.com/user-attachments/assets/5e5bfd28-3a78-40fd-af21-3d92e7b3ba8a
2025-01-21 14:06:45 +00:00
Jarek Radosz
184ec95d01
DEV: Don't nest deferring calls (#30449)
Each case simplified:

`next(() => later(() => ...))` -> "wait 0 ms then wait X ms"
`next(() => debounce(() => ...))` -> "wait 0 ms then wait X ms
(debounced)"
`next(() => scheduleAfter("render", ...))` -> "in the next (empty) run
loop, do the thing (after a no-op render step)"
2025-01-21 11:24:33 +01:00
David Taylor
d88ee33eb6
DEV: Introduce stylelint (#29852)
Stylelint is a css linter: https://stylelint.io/

As part of this change we have added two javascript scripts:

```
pnpm lint:css
pnpm lint:css:fix
```

Look at `.vscode/settings.json.sample` and `.vscode/extensions.json` for
configuration in VSCode.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-01-20 15:27:42 +00:00
Martin Brennan
dcb1e2a341
FEATURE: Chat thread inline oneboxes (#30834)
Previously if you linked to a chat thread inline, our oneboxer
did not have special handling for this, so the link would end
up with the text "Chat #channel-name" which is not ideal for a
thread.

This commit makes it so the thread onebox is in the format
"Thread title - #channel-name" if the thread title exists,
otherwise we show "Thread in #channel-name"
2025-01-20 10:08:38 +10:00
Joffrey JAFFEUX
36d380e349
FIX: re-adds favorite reactions on mobile (#30746)
This feature has been mistakenly removed in
6740a340ca

<img width="382" alt="Screenshot 2025-01-13 at 20 49 03"
src="https://github.com/user-attachments/assets/9710255d-3a1b-4e52-9acc-4e9c410db1b9"
/>
2025-01-17 13:24:52 +01:00
Joffrey JAFFEUX
b43140e021
DEV: sidebarActive is not used anymore (#30268)
This was used in the past to show a chat sidebar when the core sidebar
was not existing.
2025-01-17 12:30:43 +01:00
Joffrey JAFFEUX
f8d5a7873a
UX: makes smile the default emoji-picker icon (#30843)
discourse-emojis is used in chat only for message actions to show a
difference with the the other emojis so people don't think it's just the
smiley emoji.
2025-01-17 12:29:18 +01:00
Joffrey JAFFEUX
6c3a7f2a67
FIX: do not store 0 has min width for thead panel (#30818)
When we had no width stored for the side panel in the local storage,
essentially the computation would end up being:

```javascript
Math.min(null, 1000);
```

Which would output: 0. This commit ensures we have a default for store
width: MIN_PANEL_WIDTH. And also uses the same value in CSS and JS.

I had to change z-layers of chat-side-panel resizer as it was
interfering with system specs changing the notification level of a
thread, when trying to click the option in the dropdown, it would
instead click the resizer as it would appear on top of the dropdown.

Tried to write a test but couldn't get something reliable.
2025-01-16 16:03:35 +01:00
David Taylor
72f4588d3b
DEV: Do not trigger floatkit 'hover' for touch events (#30793)
When tapping something on a touch-enabled device, `mouseMove` events are
still fired, so floatkit would still be triggered even if configured for
'hover' only. For links, this would be particularly strange, because the
tooltip would appear for a split-second, before the page navigation
occured.

To avoid this problem, we can use the more-modern 'pointerMove' event,
and check the `pointerType` to exclude 'touch'
2025-01-16 12:36:47 +00:00
Joffrey JAFFEUX
f28eb5b0dc
FIX: ensures scrolls work in chat when touch is on text (#30817)
The stacking context fix we use in chat to avoid:
https://bugs.webkit.org/show_bug.cgi?id=262287 was causing this weird
behavior in chat where the scroll event wouldn't fire when the finger is
on text and not an empty area of the scrollable div.

This simplified implementation seems to work reliably and avoids the
issue.
2025-01-16 13:02:23 +01:00
Tomas Vavrda
bb920326c9
UX: Removed a redundant git pull statement from the docs (#30801)
`git pull` statement is now redundant and not needed
2025-01-16 11:13:51 +00:00
Martin Brennan
5bc522e836
FIX: Double trigger of close user menu (#30732)
When clicking the "new features" notification item for
admins that navigates to /whats-new, the user notification
menu was not closing. This was happening because inside
the UserMenu::Menu component, the `routeDidChange` event
was firing and calling `closeUserMenu()`, however this is already
called inside the `Header` component via `toggleHamburger()`.

This is _only_ happening for the "new features" notification
item, other items have already been destroyed and they do not get
the `routeDidChange` event. No idea why, but this fixes the issue
in a global way.
2025-01-15 10:38:08 +10:00
Discourse Translator Bot
496a739788
Update translations (#30765) 2025-01-14 16:19:49 +01:00
David Taylor
acde5c4337
DEV: Enable discourse-common-imports eslint rule (#30742)
Applies the autofix, which caught a few places that were missed in the
original find/replace

See https://github.com/discourse/lint-configs/pull/91
2025-01-13 16:01:34 +00:00
David Taylor
98fa42f2e2
DEV: Move discourse-common/config/environment to discourse/lib (#30738) 2025-01-13 15:29:26 +00:00
David Taylor
0ed4b09527
DEV: Move discourse-common/(utils|lib) to discourse/lib (#30733)
`discourse-common` was created in the past to share logic between the
'wizard' app and the main 'discourse' app. Since then, the wizard has
been consolidated into the main app, so the separation of
`discourse-common` is no longer useful.

This commit moves `discourse-common/(lib|utils)/*` into
`discourse/lib/*`, adds shims for the imports, and updates existing
uses in core.
2025-01-13 13:02:49 +00:00
Régis Hanol
1f483f48a0
FIX: remove complicated 'chat_duplicate_message_sensitivity' site setting (#30516)
And change the "formula" to check for duplicate messages to

- no duplicate check in 1:1 DMs
- only duplicate check in group DMs / channels, for posts made by the
same user, in the past 10 seconds

Internal ref - t/144262
2025-01-13 12:32:51 +01:00
David Battersby
0b3663a16a
DEV: fix flaky chat new message spec (#30731)
Ensures that visiting the route creates a new chat channel before
checking the new redirected url is using the last channel.
2025-01-13 17:01:08 +08:00
Kris
7c61bc5a09
UX: improve discobot certificate font language support (#30722) 2025-01-10 17:13:24 -05:00