Commit Graph

58963 Commits

Author SHA1 Message Date
d524bbd339 DEV: Convert groups page to components (#32279)
We need to reuse some of the groups UI in the admin dashboard. This is currently a bit hairy because it's using the old controller + routes + template style design.

This PR extracts to components, GroupCard, and GroupList, and shifts the logic in there.
2025-04-21 13:11:11 +08:00
e8997b6202 DEV: Add Settings tab to admin Badges page (#32251)
This change does two things:

Modernizes the admin badges UI implementation. (Routes + controllers → components + services.)
Adds a Settings tab to the new badges page.
For all intents and purposes, this change is a lift-and-shift modernization. The addition of the settings tab is trivial once that is covered.
2025-04-21 09:41:29 +08:00
1e0d773b54 DEV: duplicate scroll-top util function to lib and replace current usage with new path (#32367)
This was refactored from an actual Mixin some time back. This PR moves
the function to the lib folder and keeps the same logic/interface
otherwise.

We'll remove the mixin file once all non-core repos change to use the
new file.
2025-04-21 08:12:51 +08:00
e47b0996ed FIX: enable drafts dropdown on private categories (#32370)
Reinstates the draft dropdown on private category pages.
2025-04-18 17:38:35 +04:00
6c4e9dfbc8 DEV: Try fix composer rich text transcript spec (#32364)
This is to try fix this error by sending the keys
on the element itself:

```
Failure/Error: page.send_keys([PLATFORM_KEY_MODIFIER, "v"])

Selenium::WebDriver::Error::StaleElementReferenceError:
  stale element reference: stale element not found in the current frame
    (Session info: chrome=135.0.7049.84); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception
```
2025-04-18 15:52:35 +10:00
9b5ada304f UX: avoid auto-linking clash with code marks on rich editor (#32365)
Avoid auto-linking URLs within code marks

Avoid auto-linking URLs when there's a `` ` `` just before the matched
URL, assuming the user is about to type a closing `` ` `` to create a
code mark instead.
2025-04-18 01:11:59 -03:00
1c8646b48e DEV: Refactor forcing admin sidebar logic in hamburger nav mode (#32257)
This PR allows for other code to force the sidebar, but making the
language not admin-specific. There is a general problem to solve of "how
can I force the sidebar to appear, while keeping the hamburger menu in
the header as-is". This problem is solved for admin interface, but the
variable naming made it seem like the logic was directly tied to the
admin UI.

It is easy with this change, to have another sidebar manager force the
sidebar to be open for a route. Technically it was easy before, but it
would look like you were doing awful hacks.

---------

Co-authored-by: Isaac Janzen <isaac.janzen@discourse.org>
2025-04-17 22:36:38 -05:00
f06175b72d UX: prosemirror rich editor nodes cleanup / slightly better UX (#32361)
We don't want "ghost" `content` within mention/hashtag, as they're
already rendering their non-editable content on `toDOM`.

`atom: true` is not necessary for content-less nodes

Re-use existing heading node spec instead of re-creating.

A UX improvement from these changes is a better Cmd-Left/Home navigation
when these nodes begin a paragraph and the caret is after them.
2025-04-18 00:20:55 -03:00
2b4521d0b3 FIX: pasting img on rich editor could be double-processed (#32356)
Without the `useCapture` as `true` on this `ComposerUpload`'s
`addEventListener`, if the clipboard contained both a Files array and a
`text/html` item, the paste event would be captured by ProseMirror
before being captured by the `ComposerUpload` setup and its
`preventDefault` call.
2025-04-18 00:20:44 -03:00
492256e91e UX: Welcome bannner and search tweaks for mobile (#32362)
* Hides the welcome banner search in mobile, it's not necessary
  since there is the header search
* Fix an issue where the positioning of the search input for
  the header on mobile was affecting welcome banner search
* Make the welcome font a bit smaller and with less padding so
  it takes up less room on mobile

---------

Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>
2025-04-18 12:26:03 +10:00
ec1f43f9ca DEV: Delete old admin page action button component (#32347)
Followup a879bcdc356d4e691fd217abd34a9f9a2022539c
2025-04-18 09:38:12 +10:00
4c26679b2d DEV: fix form template flaky (#32360) 2025-04-17 19:54:38 -03:00
bdca369288 UX: don't decrease composer monospace font on mobile (#32358)
I think this is causing iOS to zoom in on the composer in some
scenarios, and we don't want that:


![image](https://github.com/user-attachments/assets/b4b22d25-c3f8-4da5-91d0-1b1940150a89)
2025-04-17 17:44:52 -04:00
cd805d0d8f DEV: Revert "FIX: Flaky test for FormTemplatesController (#32351)" (#32359)
This reverts commit 4cd7ca677f69a18ab680c4b0ecac4a0d583d533b.
2025-04-17 18:39:26 -03:00
2dac94d99f FIX: remove mixed declarations from header.scs (#32357)
Follow-up to a0eeb83, this fixes the mixed declarations error
2025-04-17 15:43:40 -04:00
a0eeb831d3 REFACTOR: merge mobile/desktop header styles into /common (#32320)
This eliminates the `/mobile` and `/desktop` `header.scss` files and
moves the relevant CSS under `common/header.scss` using `.mobile-view`
and breakpoints.

I was also able to eliminate some redundant and unused styles in the
process and move a couple more general styles to `discourse.scss`
2025-04-17 14:57:28 -04:00
12c5392b38 UX: Header search tweaks (#32354) 2025-04-17 11:32:19 -05:00
fd9d0d11b4 UX: auto focus emoji picker input on mobile (#32353)
Previously this behavior was only on desktop.
2025-04-17 18:03:28 +02:00
4cd7ca677f FIX: Flaky test for FormTemplatesController (#32351) 2025-04-17 10:23:58 -05:00
72f9714ddc FEATURE: Implement tag group selection in dropdown and multi-select for topic creation and preview when using Form Templates (#32108)
Adds support for a tag-chooser in form templates. It supports single tag
and multi tags. The source of the displayed tags has to be a tag_group
name.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-04-17 08:38:03 -05:00
ff334fde8e UX: header search mobile support - follow up (#32306)
### Changes made

#### Styling
1. added `4px` spacing between search input and cancel button
2. increased cancel button size (with padding) to match input height
3. decreased search panel padding by 1/2 from 16px to 8px
4. animation show/hide changed (from vertical to horizontal) and made it
quicker (300ms->200ms)
5. set html unscrollable when search panel is open

#### Dev
1. changed `data-test-` value to be consistent with other element's
attrs values
2. clear search action tag changed from `<a>` to `<DButton>`
2025-04-17 20:01:47 +08:00
918aa0fbec DEV: Add :sidekiq_job_error DiscourseEvent (#32307)
This commit adds a `:sidekiq_job_error` event which is
triggered when an error is encountered while running a Sidekiq job. The
intent of this change is to complement the `:sidekq_job_ran` event which
can be used with the `:sidekiq_job_error` event to calculate the error
rate for each job.
2025-04-17 15:41:58 +08:00
63f7755123 FIX: Unclaim reviewables when finished. (#32346)
When a reviewable is auto-claimed, this actually claims all reviewables in a given topic, rather than just the specific post that the reviewable is about. Particularly for sites that require all posts to be reviewed, this can quickly result in many reviewables being unintentionally claimed by the first moderator to review a post in a given topic.

Unfortunately, due to `ReviewableClaimedTopic` being originally built to claim by topic, we can't fully fix this without significant re-architecture. In the mean time, however, we can ensure that reviewables are unclaimed once they've been handled, so that the next reviewable from a topic won't be automatically claimed.
2025-04-17 16:28:27 +10:00
530f2f13af FIX: Make the 'Keep Message Deleted' reviewable option work (#32345)
When a flagged chat message has already been deleted, we offer an option
in the review queue to agree with the flag and keep the message deleted.
However, this option is currently broken due to a missing implementation
for the option.

Internal topic: t/152203.
2025-04-17 07:35:08 +03:00
a69a304f11 FEATURE: allow edit custom flags (#32344)
Allow admins to edit user custom flags. Because changing
name/description will update name/description for old reviewables,
warning has to be displayed.

Still, system flags can never be edited or deleted (only disabled).
2025-04-17 12:31:52 +08:00
f6eb2e083c DEV: Resolve flaky test due to regexp match (#32343)
The test being fixed in this commit was flaking with the following
error:

```
Capybara::Ambiguous:
  Ambiguous match, found 2 elements matching visible css ".stream-topic-title .title a[href*='/2']"
```

The regexp match on the `href` attribute has the potential to match
multiple elements if both urls contain the `/#{topic.id}` substring. For
example, both `/t/-/2/2` and `/t/-/1/2` will satisfy the regexp.
2025-04-17 09:32:22 +08:00
6028363de2 FIX: Remove hint for browser search shortcut (#32330)
Followup 735bef9ea0d497ae7e04bd4a104bd86e928fc472

Remove the tip in search for users to press Ctrl+F
again to do browser search, as this is no longer relevant
2025-04-17 10:22:40 +10:00
b724181bdf DEV: Update verbiage around remove password modal, swap button for a link (#32338)
Simplified the language around remove password to be more clear, swapped out the button for a link.
2025-04-16 14:37:54 -05:00
3d689bbbc2 DEV: Raise exception for deprecations in core stylesheets (#31894) 2025-04-16 16:36:41 +01:00
fec1ba0d73 DEV: Fix scss deprecation warning (#32325) 2025-04-16 11:34:30 -04:00
cb64b37070 UX: Add visual variation to theme screenshot placeholder (#32077)
This update adds randomized SVG placeholder designs for themes without
screenshots. Each placeholder pulls from the theme’s color palette to
give a better visual hint of what the theme might feel like.

There are a few different styles:
1. Envelope-style gradient – uses `tertiary`, `quaternary`, and
`highlight`
2. Soft blur gradient – uses `tertiary`, `quaternary`, and `highlight`
3. Mesh – uses `tertiary` and `secondary`
4. Layered waves – uses `tertiary`, `quaternary`, `highlight`, `danger`,
and `success`

The style is randomly picked per theme, so the grid looks more varied by
default.

<img width="1109" alt="image"
src="https://github.com/user-attachments/assets/5ede0ecf-a1e4-46c0-9fd2-bee4b6c672c2"
/>


Internal: /t/149935

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2025-04-16 05:21:45 -06:00
2da0804ef5 DEV: Drop wasm type override in nginx config (#32332)
This is already included in nginx's default set, and is currently
causing this message to be printed:

> nginx: [warn] duplicate extension "wasm", content type:
"application/wasm", previous content type: "application/wasm" in
/etc/nginx/conf.d/discourse.conf:4
2025-04-16 10:27:36 +01:00
b3389a4cc3 PERF: Set JOBS=1 for low memory build environment (#32326)
This restores the fix in ae2bc240af434168aeebe73d550b1c979ca3a29b
2025-04-16 10:14:23 +01:00
a6e35b0225 DEV: use native promise (#32331) 2025-04-16 10:17:02 +02:00
9b351614ea FIX: Set X-Robots-Tag header to prevent indexing of /safe-mode (#32329)
This change adds the `X-Robots-Tag` header to the `/safe-mode` response, discouraging search engines from including the page in their index.
2025-04-16 16:51:32 +10:00
8ccb66a44a FEATURE: Release admin search for all sites (#32327)
This commit removes the experimental setting controlling
admin search and releases it for all admins. This search
can be triggered with Ctrl+/ or Cmd+/

For more information see
https://meta.discourse.org/t/introducing-comprehensive-admin-search/360157
2025-04-16 16:26:53 +10:00
c7d400eda2 FEATURE: Implement Form Template Preview (#32111)
![imagen](https://github.com/user-attachments/assets/db5cf334-6e92-40b6-b93a-5cfa12882e8f)
2025-04-15 23:52:02 -05:00
a6a85a0241 Build(deps): Bump ffi from 1.17.1 to 1.17.2 (#32322)
Bumps [ffi](https://github.com/ffi/ffi) from 1.17.1 to 1.17.2.
- [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ffi/ffi/compare/v1.17.1...v1.17.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-16 00:38:34 +02:00
30f328067c Build(deps): Bump version_gem from 1.1.6 to 1.1.7 (#32321)
Bumps [version_gem](https://gitlab.com/oauth-xx/version_gem) from 1.1.6
to 1.1.7.
-
[Changelog](https://gitlab.com/oauth-xx/version_gem/blob/main/CHANGELOG.md)
-
[Commits](https://gitlab.com/oauth-xx/version_gem/compare/v1.1.6...v1.1.7)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-16 00:38:21 +02:00
9145acce80 UX: Remove z-index (#32319) 2025-04-15 16:27:17 -05:00
e9b6dbe316 DEV: Passthrough attributes on TopicList component (#32318) 2025-04-15 21:27:40 +01:00
09747898d1 FIX: Fix meta data content modifier state leak (#32316)
It was using `<<` that caused the SiteSetting to get modified

Updated the spec to use the same pattern as other modifiers and used
`next` to return the correct value of the modifer
2025-04-15 14:32:35 -03:00
47a6a24372 UX: Adjust user-field labels (#32317) 2025-04-15 12:24:14 -05:00
3af7410264 DEV: Skip meta_data_content specs (#32315)
State seems to be leaking into other specs. Minimal repro:

```
bin/rspec --order defined spec/helpers/application_helper_spec.rb:783 spec/lib/wizard/wizard_builder_spec.rb:38
```

```
Failures:

  1) Wizard::Builder introduction should not prefill default site setting values
     Failure/Error: expect(description_field.value).to eq("")

       expected: ""
            got: " - modified by plugin"
```
2025-04-15 17:02:17 +01:00
375a36e2ef Don't require password to create users with previous authentication (#32201)
Don't require password to create users with previous authentication in
the session, regardless of email/email verification during user creation

Before my changes we were calling `user.password_required!` in
`UserAuthenticator.authenticated?` based on whether authentication
session data contained a matching email address and email verified
externally. I believe `authenticated?` is intended for our own email
validation during the activation process, but shouldn't be a gate for
password requirement.

Even when we were setting `user.password_required`, then during user
creation we were creating random passwords to get around the blank
password restriction when creating accounts with external auth.

After my change we can remove the random password creation because we no
longer require a password when the session has previous authentication
info at all.

Looks like this extra password requirement may have been introduced as a
side effect during a previous refactor of `UserController` here:
51eff92170
Before that change, password requirement was simply based on whether
session[:authentication] existed, but after that change it was based on
the email/email_valid fields as well.
2025-04-15 10:35:49 -05:00
f3d3c61754 PERF: Reuse existing core JS build where possible (#32311)
Building the Discourse JS app is very resource-intensive. This commit
introduces an `assemble_ember_build` script which will check the
existing content of the `dist/` directory and re-use the core build if
possible. Plugins will always be rebuilt.

For now, this functionality is only useful for multi-stage (i.e.
non-standard) Discourse deployments. But in future, this script may be
extended to pull the contents of the `dist/` directory from a remote
location.
2025-04-15 16:18:22 +01:00
02c5dd439b DEV: Add a post_owner_changed event (#32312)
This allows plugins to hook onto this event when post owner changes.
2025-04-15 22:26:44 +08:00
351a295846 DEV: Fix failing test after a rename (#32314) 2025-04-15 17:05:06 +03:00
b3bcc2c1d3 DEV: Fix github build (#32313) 2025-04-15 16:31:20 +03:00
0b8df4b833 UX: Use 'unused' instead of 'active' for components (#32284)
This commits changes the language for components that aren't used on any themes to be "used/unused" instead of "active/inactive" throughout the new components listing page.
2025-04-15 16:12:20 +03:00