3831 Commits

Author SHA1 Message Date
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
Joffrey JAFFEUX
6a50b3d4b4
FIX: removes blank spacing in message actions (#30697)
This is a regression of https://github.com/discourse/discourse/pull/28277
2025-01-10 17:34:22 +01:00
Joffrey JAFFEUX
b96a9b9896
FIX: simplify body scroll lock on iOS (#30696)
This will have the following advantages:
- removes a very annoying bug which was making text selection super hard on iOS
- removes the flashing of header when transitioning from disable to enable body scroll lock
2025-01-10 17:13:48 +01:00
Penar Musaraj
07e5f8907e
DEV: Consolidate mobile positioning strategies on mobile and iPad (#30241)
This removes some longstanding Safari iOS positioning hacks and refactors the mobile positioning strategy across Safari, Chrome and Firefox. See PR descriptions for more details. 

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-01-10 11:00:15 -05:00
Kelv
8719235cfd
DEV: update deprecated icon name archive to box-archive in chat plugin (#30687) 2025-01-10 12:59:56 +08:00
Kris
c99a8dcfe7
Revert "UX: use font with more glyphs for discobot certificates" (#30681)
This reverts commit 55914bf9a3086570e21db8eb04347f27d54a1392.
2025-01-09 18:56:47 -05:00
Kris
d9c992bfdd
UX: follow-up sidebar variable fixes for c398933 (#30676) 2025-01-09 15:53:29 -05:00
David Taylor
69ec6d29d7
DEV: Resolve this-property-fallback deprecation in chat test (#30669) 2025-01-09 10:17:18 +00:00
Joffrey JAFFEUX
40f7941f2b
FIX: emoji-picker minor improvements (#30645)
- uses emojiSearch to ensure we have the same result than autocomplete when filtering emojis (for example search aliases were not working correctly because of this)
- reset the visible sections when clearing filter to ensure we are not attempting to display all the emojis at once which would be slow
- prevents flashing of the full emoji list before showing filtered results
- correctly reset recent favorites and only show them when used
2025-01-08 22:10:50 +01:00
Kris
55914bf9a3
UX: use font with more glyphs for discobot certificates (#30646) 2025-01-08 13:44:09 -05:00
Natalie Tay
6dd306be55
DEV: Update a defensive test which case is no longer possible (#30640)
Introduced in https://github.com/discourse/discourse/pull/30263, it is also causing flaky tests.
2025-01-08 21:06:04 +08:00
Joffrey JAFFEUX
21c8376679
DEV: removes non needed special case (#30638)
Now that we correctly await for the modal to close, we dont need to special case and disable focusTrigger, the flow will now be:

- click an element of the menu
- wait for modal to close
- focus trigger
- trigger action, which will eventually open a modal and attempt to focus the first item
2025-01-08 11:59:16 +01:00
Joffrey JAFFEUX
6740a340ca
DEV: unifies emoji picker (#28277)
The chat emoji picker is renamed emoji-picker, and the old emoji-picker is removed.

This commit doesn't attempt to fully rework a new emoji-picker but instead tries to migrate everything to one picker (the chat one) and add small changes.

Other notable changes:
- all the favorite emojis code has been mixed into one service which is able to store one state per context, favorites emojis will be stored for all topics, and for each chat channel. Meaning that if you always use a specific emoji in a channel, it will only show as favorite emoji in this channel.
- a lot of static code has been removed which should improve initial load perf of discourse. Initially this code was around to improve the performance of the emoji picker rendering.
- the emojis are now stored, once the full list has been loaded, if you close and reopen the picker it won't have to load them again.

List of components:

- `<EmojiPicker />` will render a button which will open a dropdown
- `<EmojiPickerContent />` represents the content of the dropdown alone, it's useful when you want to render a picker from an action which is not the default picker button
- `<EmojiPickerDetached />` just a simple wrapper over `<EmojiPickerContent />` to make it easier to use it with `this.menu.show(...)`

---------

Co-authored-by: Renato Atilio <renatoat@gmail.com>
2025-01-08 11:41:36 +01:00