24487 Commits

Author SHA1 Message Date
Ella E.
32704c42d0
UX: Update banner image field to use help text (#30666)
### What's changed?
- Add support for`@helpText` in the FormKit component.
- Updated the about config page to replace `@description` with
`@helpText` for the banner image field

### Before
<img width="525" alt="image"
src="https://github.com/user-attachments/assets/e8cdcca7-1b46-406f-8b6b-815e65dd5d9c"
/>

### After
<img width="256" alt="image"
src="https://github.com/user-attachments/assets/8656b866-5654-4f67-8515-f58a7b2b14c0"
/>


Internal: /t/138358/2
2025-02-10 19:48:31 -07:00
Martin Brennan
f95464ba81
Revert "UX: Hide inner site settings sidebar if admin sidebar enabled (#31047)" (#31267)
This reverts commit 91e9c1c81343990d5ebbb3a3bb7c68ec4445d610.

After feedback, for now we are reverting this change. This is not
permanent, the settings sidebar will be removed again, after we:

* Visually group the settings the same way as the sidebar does
  on All Settings
* Add more settings pages to the main admin sidebar to cover the ~250
  settings not yet represented there
2025-02-11 12:47:40 +10:00
Kris
08b8439e21
DEV: add transformer for default category view setting (#31264)
This allows us to set custom values here, like "Voting" from the topic
voting plugin:
https://github.com/discourse/discourse-topic-voting/pull/232
2025-02-10 16:48:11 -05:00
Kris
1d8cdfd5e0
UX: fix horizontal group nav on mobile (#31259)
This fixes the "all groups" link on mobile, follow-up to 50136ee

Before 


![image](https://github.com/user-attachments/assets/c6044ee6-3740-47a7-a006-239980bd7605)


After


![image](https://github.com/user-attachments/assets/9d090046-3131-4a9b-a21c-06c6a47c322b)
2025-02-10 11:43:00 -05:00
Amanda Alves Branquinho
e433be9f61
DEV: Add optional callback in notification dropdown action (#31257)
Modify the component UserNotificationDropdown to receive a function that
will be called after an user is ignored.
2025-02-10 13:26:19 -03:00
Kris
50136ee4e6
UX: switch group pages to horizontal nav (#31243)
This gets group pages on the same horizontal nav patterns as the user
profile pages. These pages need some more adjustments in general, but
this is a good start!

Before: 

![image](https://github.com/user-attachments/assets/2eaf5504-030f-4c91-a794-f66808fe0576)

![image](https://github.com/user-attachments/assets/5a726208-56ec-437c-8e53-c6edcd2ce772)


After:

![image](https://github.com/user-attachments/assets/f621c371-ac2c-4ab7-af18-d836bcec4c74)

![image](https://github.com/user-attachments/assets/c9eee57e-3e30-4ccb-82a2-29327dae5404)


Before: 

<img
src="https://github.com/user-attachments/assets/b58f1994-8ef8-4a67-9b37-bfee428c343b"
width="350" />

After:

<img
src="https://github.com/user-attachments/assets/013b1af6-ddb9-4a93-bcfe-37b2a9760d8b"
width="350" />
2025-02-10 10:38:31 -05:00
Ted Johansson
3d11e3ca10
DEV: Require at least one scope for API key granular mode (#31253)
Currently, if creating an API key in "granular" mode, and not selecting any scopes, a globally scoped API key is created. This can be surprising and is not ideal. Having a key with no scopes isn't useful in the first place, so this PR adds client- and server side validations to check that at least one scope is selected if using "granular" mode.
2025-02-10 13:22:08 +08:00
Penar Musaraj
54a52e5691
DEV: Improve checking for selected text (#30967)
After you've selected and deselected text, `selection.rangeCount` will
return `true` on future events. Checking for `selection.toString` is
more robust.

Followup to f1bdd86a8c9bec03b962167c37963b1d11d0e5ea
2025-02-07 12:13:39 -05:00
Isaac Janzen
6595b11e25
DEV: Add composer-service-cannot-submit-post transformer (#30903)
- Add `composer-service-cannot-submit-post` transformer to allow for disabling submit based on custom conditions
- Add tests for transformer
- Add a couple helpful appEvents, that plugins can use add custom error popups to plugin-defined fields.
2025-02-07 10:27:26 -06:00
Jan Cernik
42447770bf
FIX: Automatic auth flow with full page login/signup V3 (#31072)
This adds back the fixes from
https://github.com/discourse/discourse/pull/30928 that were reverted by
https://github.com/discourse/discourse/pull/30960.
2025-02-07 10:40:45 -05:00
David Battersby
891d8fe574
UX: use icon for create topic btn on mobile (#31237)
Updates the create topic button to be icon only (mobile) due to screen
space restrictions. The icon is also updated to make it easier to
understand what the button does, even when there is no text.
2025-02-07 18:20:19 +04:00
David Battersby
dc86ebe97a
UX: omit date in user stream for small action posts (#31236)
This change makes it possible to render the action code from small
action posts (ie. close topic etc) without the relative date. This is
applied in the user stream items to prevent duplication of dates.
2025-02-07 17:31:07 +04:00
David Battersby
79041cc1a6
UX: user stream alignment fix for likes (#31234)
Small alignment fix for user stream items on desktop, following changes
made in #31122

We currently have a combination of `post-list-item` and
`user-stream-item` classes within these pages, so I've also applied some
shared styles to these elements to provide a more consistent layout.
2025-02-07 17:28:31 +04: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
Kris
8c968c588c
FIX: Correct typo in property name for save button component (#31221)
`disabled` -> `disable` to match:
 

0e61565b2b/app/assets/javascripts/discourse/app/components/composer-container.hbs (L238)
2025-02-06 14:24:09 -05:00
Osama Sayegh
c6bbbd0608
FIX: Set the correct state of the dark mode checkbox user preference (#31214)
This commit fixes a bug in the "Dark Mode" checkbox in the interface user
preferences where the checkbox state doesn't appear in the disabled
state if the user disables dark mode.

This happens because when rendering the checkbox, we check the relevant
user options field within the controller's `init` method, but at that
point in the controller's life cycle, the `user_option` object isn't
available. What we should do instead is move this check to the route's
`setupController` method where the `user_option` object is available and
we can set the correct state on the controller.

https://meta.discourse.org/t/-/349976 (private topic)
2025-02-06 20:31:37 +03:00
Kris
3e4929fd7e
DEV: add topic-footer-button class to all topic footer buttons (#31209)
While working with some themes, I noticed that all of these buttons
don't have the `topic-footer-button` class, so it can't really be used
effectively. The admin menu, bookmark button, and reply button were all
missing it. This adds the class.


![image](https://github.com/user-attachments/assets/3d374896-5d45-445a-9970-1d3f3f4f06de)
2025-02-06 12:23:47 -05:00
Kris
a38a1393b5
DEV: Fix syntax for outletArgs in header component (#31220)
The parenthesis were causing minimized to return undefined
2025-02-06 11:32:33 -05:00
Angus McLeod
fe4c33323f
DEV: Add topic-map plugin outlet wrapper (#31168) 2025-02-06 10:59:53 -05:00
Ella E.
d4e3595a07
FIX: Adjust badge selector for proper nesting in plugin list (#31218)
This PR fixes an issue where badges weren’t displaying correctly due to
improper CSS targeting.

/t/147165
2025-02-06 04:26:07 -07:00
Ted Johansson
af43f6135e
FIX: Only include custom plugin config routes in tabs for old show page (#31213)
Same as #31192, but for plugins that are not yet converted to the new show page. 🙏
2025-02-06 10:03:01 +08:00
Krzysztof Kotlarek
c5bead4369
FEATURE: show flag description along with additional reason (#31210)
Currently, the description is hidden when an additional reason field
appears on the flag modal. It can contain important guidance and
therefore should never be hidden.

<img width="671" alt="Screenshot 2025-02-06 at 9 59 42 am"
src="https://github.com/user-attachments/assets/97629059-f346-4696-b720-9a9da3faf8f8"
/>
2025-02-06 12:47:31 +11:00
Martin Brennan
1ab5bc2bad
UX: Remove enable_quote_copy site setting (#31191)
This setting was introduced a year ago for
51016e56dd99a9ad4bd82cdc6c0cf968754c70ed, which was
formerly a design experiment.

In practice on our hosting, noone has ever disabled this
setting, and it's for a useful feature. There is no
point keeping it.


![image](https://github.com/user-attachments/assets/97418e7e-2311-4ba0-bf18-41f3f55ab001)
2025-02-06 10:31:10 +10:00
Penar Musaraj
b9d4c57f07
UX: Fix HTML showing in delete user button (#31201)
Also rewords it to clarify the action. And ensures both `delete` buttons
get the `btn-danger` class.
2025-02-05 16:28:10 -05: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
Kris
5b8b534267
UX: fix layout of invite modal errors (#31199)
Flex is causing odd wrapping for errors with multiple elements within.

Before: 

![image](https://github.com/user-attachments/assets/73f30c46-ef44-48ef-b249-e955c2ce71e1)

After:

![image](https://github.com/user-attachments/assets/454f2857-3eb5-4fc6-a7f3-752a0d2a3add)
2025-02-05 13:33:52 -05:00
Kris
553a8851ab
UX: left-align dropdown menu button text (#31198)
When dropdown button text wraps onto multiple lines, it's centered. It
should be left-aligned instead.

Before: 

<img
src="https://github.com/user-attachments/assets/64db1e0c-8dc0-4e26-8b07-fea938498f80"
width="250"/>

After:

<img
src="https://github.com/user-attachments/assets/7f4c1795-291a-4772-bdb0-f848f3904aa4"
width="250"/>
2025-02-05 12:43:13 -05:00
Jarek Radosz
39b1ac91b8
DEV: Merge duplicated css (#31167)
Fixes `no-duplicate-selectors` stylelint rule.
2025-02-05 18:42:55 +01:00
Joffrey JAFFEUX
4a7a9efbb9
FIX: correctly check for hasData in admin-report (#31197)
Using length is not working on javascript objects and this would always
be falsey.

```
const test = { foo: 1 };
test.length // undefined
```
2025-02-05 17:19:33 +01:00
Osama Sayegh
bb91561b9e
FIX: Propagate pointerdown events on DMenu trigger when the menu isn't expanded (#31104)
Stopping propagation when a `DMenu`'s trigger is clicked could prevent
another floating UI element, e.g. the search menu in the header, from
closing when clicking outside of it. We call `stopPropagation` on the
event to allow more clicks within a `DMenu`'s trigger without it getting
closed, so we shouldn't stop the event propagation if the `DMenu` hasn't
been expanded yet.
2025-02-05 18:01:37 +03:00
Kris
0da3349513
UX: fix wrapping of topic map links with counter (#31184)
Due to a change with how the link counter renders (as a pseudo element)
the grid layout in the topic map link modal regressed slightly with long
links


before: 

![image](https://github.com/user-attachments/assets/f7ea022c-62f9-44da-a575-4e7f46d31985)


after:
<img
src="https://github.com/user-attachments/assets/1c955593-beae-4795-9d90-9a50fd7646dd"
width="500">
2025-02-05 08:28:22 -05:00
Jarek Radosz
b839d09dfb
DEV: Fix declaration-block-no-shorthand-property-overrides (#31166) 2025-02-05 12:36:21 +01:00
David Battersby
5f0c21d906
UX: multiple drafts menu improvements (#31195)
This change includes the following updates:

- Rename view all to view all drafts
- Remove view all link from drop-down when all drafts are displayed in
the menu
- Different icon for draft topics and PMs (adds envelope for PMs)
- Disable drop-down when New Topic button is disabled (private
categories etc)
- Improve drafts drop-down loading (no longer disables the trigger btn
on click)
2025-02-05 15:19:13 +04: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
Krzysztof Kotlarek
5eb7d6d9c0
FEATURE: Gracefully handle unhandled reviewables (#31118)
Plugins like for example AI or Akismet create reviewable items. When the
plugin is disabled, then we cannot properly handle those items.

In that situation, we should display warnings about unhandled types.
Instruct admin to reenable plugins. In addition, we should allow the
admin to delete all pending reviews from disabled plugins.
2025-02-05 14:38:45 +11:00
Ted Johansson
f01c0c9740
DEV: Remove deprecated plugin config nav mode option (#31157)
In #31012 we deprecated this nav mode option when registering a plugin in a backwards compatible way.

We have now removed its use in all relevant plugins and should be ready to completely remove it from core.
2025-02-05 09:41:40 +08:00
Joffrey JAFFEUX
5ccd6391d8
FIX: correct mobile height of badge and ownership modals (#31187) 2025-02-05 00:25:03 +01:00
Kris
0cb27f433a
A11Y: fix post control button contrast issue for WCAG colors (#31177)
We had a little regression here: 

Before:


![image](https://github.com/user-attachments/assets/f486ac9b-3c68-4a89-be3d-38e0144669e8)


After: 


![image](https://github.com/user-attachments/assets/4ecbefab-01ce-44e0-8f16-25a5360da0b7)

Upon closer inspection, a lot of the post control styles here are no
longer necessary, as the contrast is fine without them:


![image](https://github.com/user-attachments/assets/f16193bb-4079-43e8-9924-c2e02016a815)
2025-02-04 15:17:29 -05:00
Kris
8a83f6997b
UX: ensure all children of .with-topic-progress are clickable (#31176)
This is a follow-up to 71eb2f6cda9ad8a69ba1ae7d506440c3ff0bc9cb, we have
outlets in this wrapper too — so best to re-enable pointer events on all
immediate children of the disabled wrapper.
2025-02-04 14:51:54 -05: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
OsamaSayegh
416ec83ae5
SECURITY: Limit /inline-onebox to 10 URLs at a time 2025-02-04 13:32:53 -03:00
David Taylor
6d0173c9bd
SECURITY: Ensure user-stream topic titles are always escaped correctly
In core, `escapeExpression` was being applied during the model loading phase. However, plugin consumers of the UserStreamItem component were not necessarily doing the same.

This commit moves the emoji-replacement logic (which also safely handles escaping) into the component template, so that it is safe-by-default, regardless of how it's used by plugins.
2025-02-04 13:32:49 -03:00
Penar Musaraj
b89cf9b443
SECURITY: Disable access to "activate-account" route for existing users 2025-02-04 13:32:38 -03:00
Blake Erickson
14d1d11536
SECURITY: Sanitize video placeholder urls
Make sure video placeholder urls are valid. An error message is
displayed instead of an infinite loading spinner after clicking play.
2025-02-04 13:32:20 -03:00
Joffrey JAFFEUX
8ad34862e4
DEV: adds includeNone param to form-kit select (#31162)
This option allows to force the presence of none when a value is
selected.
2025-02-04 11:46:24 +01:00
David Battersby
294ed87a6f
UX: restore shared sidebar link for posts and drafts (#31159)
While introducing the new drafts dropdown menu component, we also made
some changes to how the sidebar link works for Drafts. However, after
following user feedback and internal discussions we decided to revert
back to the shared link approach that combines My Posts and My Drafts.
2025-02-04 14:40:18 +04:00
David Taylor
acad83199e
DEV: Make api version optional (#31160)
We'll be making this change more deeply soon. For now, this is the
minimum change required to a this version-free syntax work under
Discourse 3.4.0.
2025-02-04 10:19:04 +00:00
David Taylor
50337a7595
DEV: Pin pnpm to v9 (#31158)
pnpm 10 changed the lockfile syntax slightly, so we need to keep
everyone using v9 until we handle the upgrade.
2025-02-04 09:18:15 +00:00
Joffrey JAFFEUX
1a8b5b9d42
FIX: better standalone checkbox support (#31130)
Before this commit it was complicated to render a `Checkbox` outside of
a `CheckboxGroup` as you would get no title, no description, no optional
hint and not tooltip.

This commits makes all of this possible by adding a special case for
checkboxes, and sharing code for tooltips and optional hint.

This commit also uses this opportunity to refactor part of the code to
use curryComponent and reduce code duplication.
2025-02-04 09:58:00 +01:00
David Battersby
41ce3d868e
UX: improve drafts list (#31122)
Improves the layout for the drafts list page, including the addition of
icons to represent the content type.

Internal ref: /t/129117
2025-02-04 11:42:17 +04:00