34259 Commits

Author SHA1 Message Date
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
Alan Guo Xiang Tan
76ade65a26
DEV: Remove optimized_images_preloaded kwarg from FileStore::S3Store#update_upload_ACL (#31087)
The optimization is not required because `find_each` fetches records in
batches of 1000 and no upload record will have more than 1000 optimized
images.
2025-01-31 15:53:06 +08: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
Jean
ba1464a84e
FIX: Allow user directory searches to return more than 20 matching results (#31032)
This PR modifies the directory search logic so that searches by user
fields or name are no longer capped at 20 users
2025-01-29 11:02:42 -04: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
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
Martin Brennan
15838aa756
DEV: Convert AdminReport component to gjs (#31011)
This commit converts the `AdminReport` component, which is quite
high complexity, to gjs. After this initial round, ideally this
component would be broken up into smaller components because it is
getting quite big now.

Also in this commit:

* Add an option to display the report description in a tooltip, which
was
   the main way the description was shown until recently. We want to use
   this on the dashboard view mostly.
* Move admin report "mode" definitions to the server-side Report model,
inside a `Report::MODES` constant, collecting the modes defined in
various
   places in the UI into one place
* Refactor report code to refer to mode definitions
* Add a `REPORT_MODES` constant in JS via javascript.rake and refactor
  JS to refer to the modes
* Delete old admin report components that are no longer used
  (trust-level-counts, counts, per-day-counts) which were replaced
  by admin-report-counters a while ago
* Add a new `registerReportModeComponent` plugin API, some plugins
   introduce their own modes (like AI's `emotion`) and components and
   we need a way to render them
2025-01-29 10:33:43 +10:00
Martin Brennan
d8102cb532
FIX: Update AdminNotice details when problem check tracker changes (#31031)
We have many problem check trackers, and some of them
like `OutOfDateThemes` can have a message which has variable
data in it shown to admins. In this case, a list of themes
that need updating. Currently if you resolve one of these
out of date themes and refresh the list of problems, you
do not see any change.

This is happening because we are only updating the `details`
of the `ProblemCheckTracker` record, not the corresponding
`AdminNotice` record which is what is displayed to the admins
on their dashboard. This commit fixes the issue by updating the
details of the notice at the same time as the problem check
tracker details.
2025-01-29 09:44:20 +10: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
Penar Musaraj
dcac09ed32
DEV: Add proper error response when searching with an invalid page param (#31026)
Previously, for a search query with `page=11` or higher, we were quietly
returning the page 10 results. The frontend app isn't affected because
it sets its own limit to 10 pages, but still, this response from the
search endpoint does not make sense.

This change switches to returning a 400 error when the `page` parameter
is above the allowed limit (a max of 10).
2025-01-28 15:12:52 -05:00
Kris
7334cfb191
UX: add missing class to group bulk select button (#31038)
![image](https://github.com/user-attachments/assets/2004af31-254c-4dd2-a51d-10c0d69c7fdf)


This bulk-select button on group pages is styled like a default button,
but lacks the `btn-default` class, making it inconsistent to style in
themes
2025-01-28 14:39:07 -05:00
Jarek Radosz
9e3993dd64
DEV: Lock @glimmer/syntax to 0.93.1 (#31037)
Cross-ref:
https://github.com/discourse/discourse/pull/31003,
https://github.com/discourse/discourse/pull/31025,
https://github.com/discourse/discourse/pull/31033
2025-01-28 17:52:03 +01:00
Kris
f84a419ab6
DEV: add missing class to top replies button (#31024)
This button in the topic map has our default button styling, but misses
the btn-default class, making it inconsistent in themes


![image](https://github.com/user-attachments/assets/acdbdffa-e8df-4879-83f2-615f1cbf6b57)
2025-01-28 08:50:39 -05:00
Manuel Kostka
8d9b3467f3
DEV: Use CSS custom properties (#31034) 2025-01-28 08:50:13 -05:00
Martin Brennan
ed316b40a4
FIX: Hijack controller for topic move posts (#31029)
We have had reports of the topic post move endpoint
sometimes timing out, not necessarily with a large
number of posts, but between two topics that have a
large number of posts.

This buys us some time by `hijack`ing the controller,
which gives us 90 seconds instead of the Unicorn 30
seconds to do the work. At some point we may want to
do this in a background job.

c.f.
https://meta.discourse.org/t/moving-posts-to-a-long-topic-fails/347984
2025-01-28 16:27:30 +10:00
Kelv
a2db9f959a
DEV: add IDs of old deprecations to admin warning banner (#31027)
We are adding some old deprecations (deprecated since 2022 at least) to
the admin warning banner.
2025-01-28 12:56:38 +08:00
Michael Brown
6bf5883fd7 FIX: always search email logs including the cc: addresses
It seems from the original commit notes that this was only included as a query
optimisation, but doing so leads to confusion: https://meta.discourse.org/t/348688

Searching for outbound mail to an address should find that address regardless
of whether or not the mail type to search for is explicitly `group_smtp`.
2025-01-27 21:57:24 -05:00
Jarek Radosz
06d135872c
Revert "Build(deps): Bump @glimmer/syntax from 0.93.1 to 0.94.1… (#31025)
…(#31003)"

This reverts commit fa6b35b11594c2f68aaacc619c620a8f281897ee.
2025-01-28 12:45:22 +10: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
dependabot[bot]
90e4c3e2f7
Build(deps-dev): Bump @swc/core from 1.10.9 to 1.10.11 (#31019)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.10.9 to
1.10.11.
- [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.9...v1.10.11)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-28 00:19:43 +01: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
Kris
edb4be7c0f
A11Y: fix color issue with delete topic button in WCAG palette (#31023)
Reported here:
https://meta.discourse.org/t/wcag-high-contrast-color-palettes-for-low-vision/168795/30

Before: 


![image](https://github.com/user-attachments/assets/01ac2eca-0ccc-4220-bfa4-d0821f25aa84)


After: 


![image](https://github.com/user-attachments/assets/f7ebb673-1eec-4660-bb20-7e3c09e5464b)
2025-01-27 17:33:14 -05:00
Renato Atilio
7206a7182b
UX: re-check triggerRule to avoid autocomplete in code (#30961)
Re-checks triggerRule when navigating around with arrow keys and after
continued typing.

ref /t/-/23884
2025-01-27 18:55:24 -03:00
dependabot[bot]
a5f533667d
Build(deps): Bump the babel group with 2 updates (#31001)
Bumps the babel group with 2 updates:
[@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core)
and
[@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/core` from 7.26.0 to 7.26.7
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/babel/babel/commits/v7.26.7/packages/babel-core)

Updates `@babel/standalone` from 7.26.6 to 7.26.7
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/babel/babel/commits/v7.26.7/packages/babel-standalone)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 22:54:03 +01:00
Penar Musaraj
590c250239
A11Y: Show focus when tabbing to user menu items (bottom bar) (#31015) 2025-01-27 15:38:54 -05:00
dependabot[bot]
fa6b35b115
Build(deps): Bump @glimmer/syntax from 0.93.1 to 0.94.1 (#31003)
Bumps
[@glimmer/syntax](https://github.com/glimmerjs/glimmer-vm/tree/HEAD/packages/@glimmer/syntax)
from 0.93.1 to 0.94.1.
- [Release notes](https://github.com/glimmerjs/glimmer-vm/releases)
-
[Changelog](https://github.com/glimmerjs/glimmer-vm/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/glimmerjs/glimmer-vm/commits/HEAD/packages/@glimmer/syntax)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 20:48:34 +01:00
dependabot[bot]
bc051b4d0a
Build(deps-dev): Bump qunit from 2.24.0 to 2.24.1 (#31008)
Bumps [qunit](https://github.com/qunitjs/qunit) from 2.24.0 to 2.24.1.
- [Release notes](https://github.com/qunitjs/qunit/releases)
- [Changelog](https://github.com/qunitjs/qunit/blob/main/History.md)
- [Commits](https://github.com/qunitjs/qunit/compare/2.24.0...2.24.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 20:44:12 +01:00
Kris
85344b4b07
UX: sidebar "more" icon color fix (#31017)
Currently the vertical ellipsis is slightly darker than other sidebar
icons

Before: 

![image](https://github.com/user-attachments/assets/46f58bf0-681b-480a-b290-3ff1062a8c72)


After: 

![image](https://github.com/user-attachments/assets/5f84fa6b-111f-48c5-a501-c8cd2599dac7)
2025-01-27 13:47:45 -05:00
Kris
19aed18d4f
UX: hide user card focus until keyboard navigation begins (#31014)
When the usercard is opened, we manually assign focus to the first link
to capture focus, but this creates an undesirable focus ring for
visitors not relying on focus indicators for navigation.

With this update, the focus is assigned to the container rather than the
first link. This fulfills the goal of capturing focus within the user
card, but hides the focus ring until navigation within the card begins.

`tabindex="-1"` is necessary because this allows us to manually focus
the container (normally unfocusable) while removing it from the tab
order for subsequent navigation.

Before:


![image](https://github.com/user-attachments/assets/1da3a4bb-181b-4cf6-815b-66199757e300)



After:


![image](https://github.com/user-attachments/assets/dda06321-8558-46bf-b16b-dead68e48b92)

then on tab: 


![image](https://github.com/user-attachments/assets/c4cc3d7b-faaf-4bc0-a7c9-d6afef4c6009)

---------

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2025-01-27 12:34:04 -05:00