20433 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
dependabot[bot]
89d358d811
Build(deps-dev): Bump jsuites from 5.8.5 to 5.9.0 (#31004)
Bumps [jsuites](https://github.com/jsuites/jsuites) from 5.8.5 to 5.9.0.
- [Release notes](https://github.com/jsuites/jsuites/releases)
-
[Changelog](https://github.com/jsuites/jsuites/blob/master/changelog.md)
- [Commits](https://github.com/jsuites/jsuites/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-27 16:38:50 +01:00
Renato Atilio
0d240308c8
FIX: reset bool site setting not updating checkbox (#30999) 2025-01-27 10:53:27 -03:00
Ted Johansson
ad8f9465c3
FIX: Minor i18n problems on admin webhooks pages (#31010)
This fixes two minor problems on the admin webhooks page.

- Wrong key used for edit button title in listing.
- Duplicated use of `i18n` leading to "en.Edit" in show page.
2025-01-27 13:46:35 +08:00
Martin Brennan
78a857931c
FEATURE: Improve wizard font selection and set Inter as default font for new sites (#30974)
This commit narrows down the list of fonts we offer
in our setup wizard and simplifies things to only
show a single font dropdown. This selection will then
set the `base_font` and `heading_font` site setting to
the same value.

For existing sites that may have set different values,
we will still show 2 dropdowns when visiting the wizard.

We are also changing our default font to the more modern
selection Inter, replacing Arial. Arial is very dependent
on system installed fonts, whereas Inter we can package
to everyone in Discourse.

Finally, for existing sites that have not changed their default
from Arial, we will keep that value via a migration so we do
not surprise site owners with a completely new font.
2025-01-27 11:29:55 +10:00
Kris
d2efdf5282
DEV: add missing button classes (#30997)
While updating a couple of themes I noticed some buttons were missing
`.btn-default`, which resulted in some inconsistent button styling
2025-01-24 16:33:06 -05:00
Sam
9cc99ef6db
FIX: double click on tag INPUT breaking expected behavior (#30975)
Double clicking on the INPUT for tag entry
was cause the INPUT to be selected but the
actual tag entry and lookup to be hidden

This adds special case handling
2025-01-24 13:36:35 -05:00
Rafael dos Santos Silva
5a94ceda54
FIX: /posts pagination uses ID not created_at (#30990) 2025-01-24 15:05:47 -03:00
Joffrey JAFFEUX
7ea2d3efe1
FIX: ensures category is rendered (#30988)
https://github.com/discourse/discourse/pull/30962 lost the rendering of
category in topic-label-content. This commit fixes it and adds a test to
ensure we render category and tags.
2025-01-24 16:28:54 +01:00
Kelv
084ed7a457
DEV: refactor components dependent on UsernameValidation to use related tracked properties and native inputs (#30946)
This will update properties that are used by the UsernameValidation
mixin to autotracking and also updates the use of Input component in
these templates to native inputs. This will help the refactor of the
mixin to a helper class that uses the modern Ember reactivity system.
2025-01-24 13:57:16 +08:00
Keegan George
5d4bb4b54e
UX: Improvements to posts route (#30968)
This update makes some small improvements to the posts route front-end.
Specifically, it adds a title to the page, and it improves the
positioning of expand/collapse caret.
2025-01-23 19:04:43 -08:00
Renato Atilio
a8c89cbc79
FIX: broken tada emoji on subfolder account activation (#30972) 2025-01-24 00:01:37 -03:00
Kelv
b195b1c8a6
DEV: raise error on deprecated icon name caught on JS in system and qunit tests (#30942)
This PR raises an error on any deprecated icon names being converted by
`icon-library.js`, which will result in any deprecated icons introduced
in JS-land to fail qunit/system tests.

We'll do the same for `svg_sprite.rb` once I've resolved pre-existing
deprecated icons in core/plugins that's caught by the same exception
logic.
2025-01-24 09:26:00 +08:00
Gary Pendergast
37d1212865
FIX: Show the correct message when no user export exists. (#30970)
Followup to 7fc8d74f3eed52116add452b5321b41e02e04499

We need to check that the user export data exists before creating a model, since having an empty model will cause the UI to incorrectly think there's a user export to display.

This change shows the correct message, instead.
2025-01-24 11:38:07 +11:00
Kris
aa90ba2992
UX: fix admin dashboard link and style regressions (#30969)
Heading link regression reported here:
https://meta.discourse.org/t/admin-panel-reports-in-the-community-health-section-are-no-longer-clickable/347631

Also noticed some style regressions
2025-01-24 10:23:34 +10:00
Gabriel Grubba
e78c937a5c
FIX: Which topic do you want to reply to rendering raw HTML (#30962)
Because of
2b63830496
`Which topic do you want to reply to rendering HTML` was rendering raw
HTML.

Added `htmlSafe` for now.

I'll work on testing for this feature.
2025-01-24 10:37:48 +11:00
Martin Brennan
1b9e2ff4f9
FEATURE: Add attribution to staff notice and rename functionality (#30920)
The name "Staff Notice" was not quite right since TL4 users
can also add these notices. This commit changes the wording to
"Official Notice".

In addition to this, currently you have to go look into the staff
action logs to see who is responsible for a notice. This commit
stores the ID of the user who created the notice, then shows this
information on each notice to staff users.

Finally, I migrated the ChangePostNoticeModal component to gjs.
2025-01-24 09:29:22 +10:00
Sérgio Saquetim
692fccb0d9
DEV: Add outlets in the top/bottom rows of the category latest topic item (#30890) 2025-01-23 20:06:15 -03:00
Gary Pendergast
7fc8d74f3e
FEATURE: Allow admins to export users (#30918)
The GDPR requires all users to be able to export their data, or request an export of their data. This is fine for active users as we have a data export button on user profiles, but suspended users have no way of accessing the data export function, and the workaround for admins to export data for suspended users involves temporarily unsuspending them, then impersonating the user to export the data as them.

Since suspended users no longer have access to their account, we can safely assume that the export request will be coming via a medium outside of Discourse (eg, email). This change is built with this workflow in mind.

This change adds a new "User exports" section to the admin user page, allowing admins to start a new export, and to download the latest export file.
2025-01-24 08:13:25 +11:00
Jan Cernik
3070b8eeae
FIX: Revert "Automatic auth flow with full page login/signup" (#30960)
This reverts commit 13f86c99eaa1eae781ad8c869fcea515436eade8.
It had issues with login-required sites. I will re-merge it with a fix soon.
2025-01-23 17:51:49 -03:00
Amanda Alves Branquinho
6aa492254f
DEV: Update glimmer menu to use value transformer (#30930)
- Use the `smallUserAttrs` function in the new glimmer menu  
- Replace the sugar syntax `@data` with `this.args` to fix tests
2025-01-23 16:25:21 -03:00
Keegan George
7b76d25946
DEV: Adopt post list component and new posts route front-end (#30604)
Recently we introduced a new `PostList` component (d886c55f63). In this update, we make broader adoption of this component. In particular, these areas include using the new component in the user activity stream pages, user's deleted posts, and pending posts page. This update also takes the existing `posts` route and adds a barebones front-end for it to view posts all in one page.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-01-23 10:20:45 -08:00
David Taylor
2b63830496
DEV: Only mark translations as htmlSafe for DButton (#30958)
If a consumer is passing in their own string to `@translatedLabel`, then
they should set it as `htmlSafe` themselves (if it is indeed safe)
2025-01-23 17:59:08 +00:00
Kris
097d987332
UX: add HTML class for composer preview to manage sidebar height (#30956)
This adds the class `composer-has-preview` to the HTML element when the
composer is opened and the preview is visible.

This allows us to adjust the sidebar height, so that the previewless
composer can overlap the sidebar and better utilize the available space.


Before:

![image](https://github.com/user-attachments/assets/8780f159-5d24-4ac0-8a4f-43a9b1665532)



After: 

![image](https://github.com/user-attachments/assets/baf69856-0ece-453f-aa0f-e7be9939af97)
2025-01-23 12:41:36 -05:00
Penar Musaraj
f1bdd86a8c
FIX: Allow touchmove in composer when there is a selection (#30957)
We stop propagating the `touchmove` event in the composer to ensure that
the page doesn't scroll inadvertently. We should only do this if no text
is selected, otherwise we block making changes to the text selection on
the `textarea` element.
2025-01-23 12:29:34 -05:00
marstall
2663cb86ae
FEATURE: add new hidden site setting to show full names in user card
adds a hidden site setting, "prioritize_full_names_in_ux", whose effect is to prefer full names in user-menu notifications

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2025-01-23 12:26:59 -05:00
Penar Musaraj
3801ccf7b0
FIX: Keep active state in sidebar button for category/tag hot routes (#30954)
Fixes issue reported in
https://meta.discourse.org/t/sidebar-links-loose-active-state-on-the-hot-list-filter/348468
2025-01-23 11:36:48 -05:00
David Taylor
26134b897a
DEV: Ensure sequential replaceText calls work correctly (#30951)
`replaceText` will replace some text, then call `selectText()` to
restore the cursor position. However, selectText was asynchronous, so
calling `replaceText()` multiple times in the same runloop iteration
would cause the cursor to jump to an unexpected place. This likely
explains some of the weird behavior we've seen with upload-markdown
replacement
2025-01-23 13:08:43 +00:00
Jan Cernik
13f86c99ea
FIX: Automatic auth flow with full page login/signup (#30928)
Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2025-01-23 08:43:07 -03:00
Jarek Radosz
474bfb5757
DEV: Add a context arg to after-topic-status outlet (#30940)
…so that plugins/themes can conditionally conditionally display their
topic-status icon (e.g. just on the topic list, or everywhere but the
header)
2025-01-23 04:21:31 +01:00