3855 Commits

Author SHA1 Message Date
Jarek Radosz
be513ed9a3
DEV: Fix all mixed-decls sass deprecations (#31343)
```
WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls
```
2025-02-13 23:58:19 +01:00
David Taylor
8d709aeb9c
DEV: Introduce DecoratedHtml component and use for discourse-banner (#31305)
Eventually, this new component will be used everywhere that we render
'decorated' HTML (e.g. all posts and chat messages). It takes the best
bits from our main widget-based post rendering and re-creates it in a
more ember-native way. For example:

- The HTML is first rendered in a detached DOM, so that requests for
images/iframes/etc. are not triggered until after the decoration

- HTML generation and decoration is done in a helper (i.e. during the
'render' phase of the runloop). I think that's the 'most Ember
compatible' way for us to do this. It means that components added via
`renderGlimmer` will be rendered in the same runloop, and it means that
things like `schedule("afterRender")` will work exactly as expected.

- HTML will be re-rendered and re-decorated whenever the `@html` or
`@decorate` arguments change

- BUT, `untrack` is used to ensure that reactive state accessed inside
the decorate function will not trigger a re-render. This is mostly for
compatibility with existing decorators, and we may want to make
reactivity opt-in in future

- A self-contained `renderGlimmer` system is included. This will allow
`helper.renderGlimmer` to be used for any content in these components.
Implementing it in a self-contained way rather than using the service
means that the component will work ok in unit tests, and that rendered
components will show up in the right place in the Ember inspector.

This commit only introduces the new component in DiscourseBanner.
Followups will introduce it elsewhere.
2025-02-13 12:20:52 +00:00
David Taylor
f5c2a4dbbd
DEV: Drop experimental enable_diffhtml_preview setting (#31306)
This was intended to provide a better UX for interactive elements in the
composer preview. However, the morphing strategy has irreconcilable
conflicts with our `decorateCooked` API, and so we have been unable to
enable this by default.

Going forward, we're focussing efforts on the WYSIWYG composer to
provide this kind of smooth UX, so we're dropping the
`enable_diffhtml_preview` approach.
2025-02-12 15:58:30 +00:00
Discourse Translator Bot
e925f9b7e8
Update translations (#31276) 2025-02-11 16:43:08 +01:00
Ted Johansson
b46718f628
DEV: Move a plugin related system spec to footnote plugin (#31230)
In a previous PR, I introduced this system spec that checks that a sidebar link is auto-generated for certain plugins.

This causes problems, because the core test suite can be run with plugins either enabled or disabled, causing flaky tests.
2025-02-07 11:58:55 +08:00
Osama Sayegh
284e708e67
FEATURE: Dark/light mode selector (#31086)
This commit makes the
[color-scheme-toggle](https://github.com/discourse/discourse-color-scheme-toggle)
theme component a core feature with improvements and bug fixes. The
theme component will be updated to become a no-op if the core feature is
enabled.

Noteworthy changes:

* the color mode selector has a new "Auto" option that makes the site
render in the same color mode as the user's system preference
* the splash screen respects the color mode selected by the user
* dark/light variants of category logos and background images are now
picked correctly based on the selected color mode
* a new `interface_color_selector` site setting to disable the selector
or choose its location between the sidebar footer or header

Internal topic: t/139465.

---------

Co-authored-by: Ella <ella.estigoy@gmail.com>
2025-02-07 03:28:34 +03:00
Jarek Radosz
7ec9885454
DEV: Enable and fix more stylelint rules (#31200)
* `color-no-invalid-hex`
* `unit-no-unknown`
* `declaration-block-no-duplicate-custom-properties`
* `block-no-empty`
* `selector-type-no-unknown`
* `selector-pseudo-element-no-unknown`
* `scss/double-slash-comment-whitespace-inside`
* `font-family-no-missing-generic-family-keyword`
* `function-linear-gradient-no-nonstandard-direction`
2025-02-05 20:03:56 +01:00
Jarek Radosz
39b1ac91b8
DEV: Merge duplicated css (#31167)
Fixes `no-duplicate-selectors` stylelint rule.
2025-02-05 18:42:55 +01:00
Jarek Radosz
5b5899b543
UX: Update bot-indicator styling (#31108)
Before/After

<img width="334" alt="Screenshot 2025-02-01 at 12 05 39"
src="https://github.com/user-attachments/assets/6939c586-3166-42e8-aa71-1062b282eeb8"
/> <img width="334" alt="Screenshot 2025-02-01 at 12 06 38"
src="https://github.com/user-attachments/assets/506f460a-7f85-418d-bd5d-b7cecd26abac"
/>
2025-02-05 12:44:50 +01:00
Ted Johansson
bb12f8275d
DEV: Only include custom admin UIs in the plugins index tabs (#31192)
In the current admin index page, all plugins show up as tabs. This includes plugins with auto-generated config routes.

This changes the tabs to include only plugins with custom UIs.
2025-02-05 15:02:46 +08:00
Gary Pendergast
f439bf14cc
DEV: Refactor the Automation Plugin UI to match admin UI guidelines (#31060)
This change updates the Automation plugin to make use of the `use_new_show_route` plugin flag, as well as generally updating the UI to match current admin UI guidelines. Notable changes include:

- Moving template/router/controller files to make use of the `admin.adminPlugins.show` route.
- Changing the URIs from `/admin/plugins/discourse-automation` to `/admin/plugins/automation`, to match the `PLUGIN_NAME`.
- Adding UI wrappers around the New/Edit forms, and polishing the list of defined automations.
2025-02-05 14:34:15 +11:00
Renato Atilio
0e61565b2b
FEATURE: introduce a ProseMirror editor (#30815)
This is the first in a series of PRs to introduce a
ProseMirror-based
WYSIWYM editor experience
alongside our current textarea Markdown editor.

Behind a hidden site setting, this PR adds a toggle to the composer
toolbar, allowing users to switch between the two options.

Our implementation builds upon the excellent ProseMirror and its
non-core Markdown
module, using the
module's schema, parsing, and serialization definitions as the base for
further Discourse-specific features.

An extension API is included to enable further customizations.

The necessary extensions to support all Discourse's core and core
plugins features **will be implemented in subsequent PRs**.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-02-04 14:37:18 -03:00
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