20478 Commits

Author SHA1 Message Date
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
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
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
Martin Brennan
91e9c1c813
UX: Hide inner site settings sidebar if admin sidebar enabled (#31047)
This experiment hides the list of categories in the inner
sidebar for the main site settings page if the admin sidebar
is enabled. It also defaults the list of settings to "All"
instead of a specific category.

Our theory here is that people who use this page are using
it to find an exact setting, not to go through the categories
one by one. Our admin sidebar also has several groups of important
settings already too, so that can be used for browsing.

Finally, the input on the page focuses when you load it, so
filtering is faster.
2025-02-04 09:24:03 +10:00
Jordan Vidrine
585c2b9ed3
UX: Replace href cancel with DButton (#31138) 2025-02-03 16:24:53 -06:00
dependabot[bot]
fe9086fdfa
Build(deps): Bump ember-template-imports from 4.2.0 to 4.3.0 (#31111)
Bumps
[ember-template-imports](https://github.com/ember-template-imports/ember-template-imports)
from 4.2.0 to 4.3.0.
- [Release
notes](https://github.com/ember-template-imports/ember-template-imports/releases)
-
[Changelog](https://github.com/ember-cli/ember-template-imports/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/ember-template-imports/ember-template-imports/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-03 19:56:12 +01:00
David Taylor
c982593088
DEV: Warn admins about topic-list deprecations (#31136) 2025-02-03 18:35:35 +00:00
David Taylor
c731a918e5
DEV: Mark topic-list-columns transformer as mutable (#31127)
`topic-list-columns` expects consumers to mutate the DAG, not return a
new one. This change means that themes/plugins do not need to remember
to `return columns` when using the transformer.

Also removes the exception when someone returns a value to a mutable
valueTransformer. This is essential for backward-compatibility.
2025-02-03 17:57:58 +00:00
David Taylor
a8e10521c3
DEV: Use transformed useMobileLayout value in topic-list/item (#31128) 2025-02-03 17:57:44 +00:00
Jarek Radosz
e55d00d405
DEV: Update content-tag to 3.1.1 (#31131) 2025-02-03 17:59:41 +01:00
Kris
a6fb065924
UX: clean up post action menu styles, fix issues, add variables (#31100)
Related to
https://meta.discourse.org/t/double-button-inconsistencies-post-menu/349845

This does some general clean up...

* **Moves shared mobile/desktop styles into /common** 
We had some mobile hover states for some reason, and desktop hover/focus
states can be moved to common and gated with `.discourse-no-touch`...
this means we're applying them on capabilities rather than device type
  
* **Adds some `-d-post-control-` variables to make theming easier** 
Theme authors can replace the variables without worrying about selector
specificity
  
* **Removes an overridden fade-out class from likes**
  We were overriding the effect here anyway 
  
* **Fixes a janky hover transition effect on the like button**
   This was being incorrectly inherited from another button
  
...and fixes some issues

* **Corrects border radius on double buttons (likes, flags)** 
   

![image](https://github.com/user-attachments/assets/e3bf45b4-3d72-4858-94b1-dad41ff3e274)

* **Corrects double button height issues for flags**

   

![image](https://github.com/user-attachments/assets/eb5624ea-f434-43b6-8ffc-de9baf1fa0fd)


* **Adjusts the flag count to avoid the lumpy circle CSS problem**

   

![image](https://github.com/user-attachments/assets/7c0d85bc-7d72-4b99-ab1a-ec45bab05750)
   
* **Removes lingering post-tap focus/hover states on mobile by applying
`.discourse-no-touch` and `focus-visible`**

Tested both glimmer and legacy.
2025-02-03 09:31:17 -05:00
Kelv
80fdb6f2e6
DEV: refactor username validation mixin to helper class (#31107)
This PR refactors the use of the UsernameValidation mixin to a helper
class for the SignupController component. We'll extend this to the
CreateAccount modal and InvitesShowController in follow-up PRs.
2025-02-03 22:27:45 +08:00
Joffrey JAFFEUX
c8ccf79545
FIX: supports height/preview form-kit composer (#31121)
- `@height` was supported but not working correctly, this is now fixed
and tested
- `@preview` was not supported, we would always hide the preview in form
kit. You now have control over this, default `false`.
2025-02-03 12:56:20 +01:00
Régis Hanol
b11fd010fe
UX: move "hide profile" checkbox to profile tab (#31095)
This moves the "hide my public profile" checkbox from the
/my/preferences/interface > other section into the top of the
/my/preferences/profile section.

Internal ref - t/146570
2025-01-31 17:04:20 +01:00
Joffrey JAFFEUX
853564f859
FIX: reset the delete automatic group tooltip (#31094)
Prior to this change the tooltip would forever stay even after changing
a group until you hard refresh the page.

No test as it's a very niche behavior and we have a todo to have
multiple other improvements at this codepath.
2025-01-31 16:21:19 +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
Joffrey JAFFEUX
3978f45ca3
DEV: pass owner instead of services (#31090)
Passing the owner allows section class to access services without having
to pass each service instance one by one.
2025-01-31 10:34:17 +01:00
Joffrey JAFFEUX
8d38929a67
DEV: reduces duplication with curryComponent (#31073)
curryComponent allows us to pass an object as splatted arguments.
2025-01-31 10:21:14 +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
Krzysztof Kotlarek
ff32232834
FIX: Cannot manually add users to automatic groups (#31062)
Adding/removing users from automatic groups should not be possible.

Bug introduced in this PR
https://github.com/discourse/discourse/pull/30174

Before
<img width="1435" alt="Screenshot 2025-01-30 at 3 35 12 pm"
src="https://github.com/user-attachments/assets/a982bfb7-3597-4efb-82b8-c11a47493075"
/>

After
<img width="1391" alt="Screenshot 2025-01-30 at 3 34 47 pm"
src="https://github.com/user-attachments/assets/894a9319-94b9-4fad-bf99-e357b910a209"
/>
2025-01-31 12:12:42 +11: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
Blake Erickson
dfb64f9b84
FIX: Quoting videos can show a corrupted thumbnail (#31079)
This change ensures we use the base62 sha1 for videos when quoting
because this is what the composer is used to using. With a valid base62
sha1 the composer already knows how to fetch the placeholder image for
it.

Fallbacks have been created to continue to support the old way as well
as a fix for the old way so that the thumbnail continues to display when
quoting. These fallbacks are in place so that we don't have to rebake
all posts that contain videos. If we ever do that we may remove these
fallbacks.
2025-01-30 17:54:50 -07:00
Martin Brennan
95a759092e
UX: Show full total numbers in admin reports (#31061)
This commit updates the display of totals and table
rows for reports in the admin interface. Currently
we show abbreviated numbers for totals e.g. 2.1M
which is not helpful when you need accurate data.
We are also not adding locale-specific number separators
so the row numbers are hard to read e.g. 246999 instead
of 246,999.

This commit fixes both issues to improve the UX of reports
without having to export them.

**Before (totals)**


![image](https://github.com/user-attachments/assets/6958252d-f778-495d-b799-7ebe4e9f1366)

**After (totals)**


![image](https://github.com/user-attachments/assets/2b51580a-cd09-42cd-b713-3c5018fa6727)

**Before (rows)**


![image](https://github.com/user-attachments/assets/38d36236-1382-45b2-a3dc-5b267b122e39)

**After (rows)**


![image](https://github.com/user-attachments/assets/607997b7-7a46-452a-ab6e-368671445a06)
2025-01-31 09:55:05 +10:00
Jarek Radosz
d1c33076f3
DEV: Clean up TreeNode component (#31069)
1. use `constructor` instead of `didInsert`
2. remove non-existent `unregisterInputFieldObserver` arg usage
3. don't curry `@index` arg twice in `@onClick`
4. use `@bind`
5. use `concatClass`
6. `dIcon` -> `icon`
2025-01-31 00:50:43 +01:00
dependabot[bot]
dbdcd7cf67
Build(deps-dev): Bump @ember/test-helpers from 5.0.0 to 5.1.0 (#31078)
Bumps
[@ember/test-helpers](https://github.com/emberjs/ember-test-helpers)
from 5.0.0 to 5.1.0.
- [Release
notes](https://github.com/emberjs/ember-test-helpers/releases)
-
[Changelog](https://github.com/emberjs/ember-test-helpers/blob/master/CHANGELOG.md)
- [Commits](https://github.com/emberjs/ember-test-helpers/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-31 00:45:21 +01:00
David Taylor
7e6107aad7
PERF: Remove old fullscreen-detection code (#31075)
This code was calling `elementFromPoint` on every scroll event. This is
an expensive browser API, and also seems to trigger a premature 'paint'
event during initial render. This seems to trigger
cumulative-layout-shift metric problems, even though the shift was never
actually visible onscreen.

This workaround was added more than 7 years ago, and it seems like
`document.fullscreenElement` now correctly detects fullscreen youtube
embeds. So we should be able to remove the `elementFromPoint` call
without affecting any functionality.
2025-01-30 17:37:02 +00:00
David Taylor
eb6689b1e6
DEV: Add topic-list-item-style valueTransformer (#30727)
https://meta.discourse.org/t/346415/7
2025-01-30 17:10:33 +00:00
Neil Lalonde
0ef9abe0f0
DEV: add plugin outlet around new color palette button (#31054) 2025-01-30 10:11:19 -05:00
Penar Musaraj
23e58cd653
UX: remove animation for back button on mobile (#31048)
We're seeing drops in CLS performance and the animation of this element
may likely be the culprit. We can try removing and seeing if this is
indeed the issue.
2025-01-30 09:26:47 -05:00
dependabot[bot]
581c65a5f2
Build(deps): Bump ember-curry-component from 0.1.0 to 0.3.0 (#31074)
Bumps
[ember-curry-component](https://github.com/davidtaylorhq/ember-curry-component)
from 0.1.0 to 0.3.0.
-
[Commits](https://github.com/davidtaylorhq/ember-curry-component/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-30 13:49:46 +00:00
Joffrey JAFFEUX
d217e61411
DEV: finer format control on field title/description (#31071)
FormKit allows you to set `@format` on a field which will set the width
of the wrapping container of the control. However, title and
descriptions are out of this container. FormKit will now by default
applies the same format to title and description.

You can override this behavior by using `@titleFormat` and
`@descriptionFormat`.
2025-01-30 13:39:05 +01:00
Jarek Radosz
f945549123
DEV: Pass navigateToTopic action to topic-list-item outlet (#31068) 2025-01-30 13:06:05 +01:00
Joffrey JAFFEUX
c05c2c3667
DEV: supports tooltips in form kit (#31065)
Usage:

```javascript
// with a string
<Form as |form|>
  <form.Field @name="foo" @title="Foo" @tooltip="text" as |field|>
    <field.Input />
  </form.Field>
</Form>

// with a DTooltip component
<Form as |form|>
  <form.Field @name="foo" @title="Foo" @tooltip={{component DTooltip content="component"}} as |field|>
    <field.Input />
  </form.Field>
</Form>
```
2025-01-30 11:45:10 +01:00
Martin Brennan
42849851e6
FIX: Wizard preview fonts not loaded (#31064)
Followup 83cc97994fa73c19832fa1dc0a2ec790e6f29064

Fixes issues after a refactor in the linked commit.
We now pass `font` as an object to the preview JS
functions, so to get the proper font for the canvas
we need to do `font.label`.
2025-01-30 17:19:56 +10:00
Martin Brennan
092a892a48
UX: Fix tag revert rename 404 error (#31049)
Changing a tag name and reverting it to a previous tag name choice on
the same screen (meaning, without reloading the page) causes a 404
error.

Reproduction steps:

* Open an existing tag page https://your-discourse.com/tag/a
* Click the wrench, change the name and save
* Open edit again, revert the name to the original tag name
* 404 error

This was happening because of the way we find existing objects
in our store. Tags are using the name as the id/primary key
unlike other records in the UI. When we get the existing object
from the store we throw away the "new" ID, so we ended up with
the old tag ID on the existing object, which led to a 404. To
fix it we can just manually set the tag ID to what it is supposed
to be from params in the tag show route.

c.f.
https://meta.discourse.org/t/404-error-when-you-revert-a-tag-name-after-changing-it-without-reloading-the-page/342559
2025-01-30 10:06:55 +10:00
dependabot[bot]
0f7787c897
Build(deps-dev): Bump @swc/core from 1.10.11 to 1.10.12 (#31055)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.10.11 to
1.10.12.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/swc-project/swc/compare/v1.10.11...v1.10.12)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-30 00:19:02 +01:00
Joffrey JAFFEUX
92779a57d4
FIX: only validate length when value is set (#31053)
When using the following validation: `length:5,10`, if the field had no
value we would fail the validation which is incorrect. This commit
ensures we return early in this case and don't fail anymore. If you want
the same behavior you need to do: `required|length:5,10`
2025-01-29 20:23:52 +01:00
Joffrey JAFFEUX
718301cb1c
FIX: hide none on required fields with value (#31052)
Prior to this fix if a field was marked as required we would never show
the none option of the select, however, some forms come with default
values and in this case we would show the first choice of the select as
selected when it would actually be null. This commit ensures that in
this case we show none, and once you select a value, you can't go back
to none.
2025-01-29 19:34:47 +01:00
David Battersby
c64b5d6d7a
FEATURE: Multiple Draft Topics (#30790)
Allows users to save multiple topic and personal message drafts,
allowing more flexibility around content creation.

The "New Topic" button will now always start a fresh topic. Drafts can
be resumed from the drafts dropdown menu or using the "My Drafts" link
in the sidebar.

Since drafts require a unique `draft_key` and `user_id` combination, we
have updated the format of the draft key for both topics and personal
messages. They will now have a prefix like "new_topic_" or
"new_message_" with the timestamp of when the composer was first opened
appended.
2025-01-29 10:23:26 +04:00