Commit Graph

59152 Commits

Author SHA1 Message Date
e16634ac6d UX: improve image uploader setting control layout (#32626)
This improves the new image uploader controls layout — this matches the
layout the uploader uses in other contexts (user profile, logo config
area)


Before:

![image](https://github.com/user-attachments/assets/a669e4ef-0bd8-4fc4-af5a-c1f31e65fbfb)


After: 

![image](https://github.com/user-attachments/assets/105184ea-a4b6-47a5-999c-40347f2b71f6)
2025-05-07 13:19:54 -04:00
44a1848ed9 DEV: remove deps (#32628)
Users won't be able to use video locally but we think it's not necessary
for now. This could also cause permissions errors on CI as deps require
sudo to be installed.
2025-05-07 19:09:42 +02:00
153ee0eb9f UX: Include custom text field description in signup form (#32624)
Reported in
https://meta.discourse.org/t/signup-instructions-arent-showing-for-text-custom-user-fields/359935?u=rishabh
2025-05-07 13:05:48 -04:00
a1cc27bc01 DEV: Add PostFlag value modifiers (#32622) 2025-05-07 11:59:09 -05:00
d98a0105ad DEV: Raise errors in playwright install (#32623) 2025-05-07 18:31:18 +02:00
930eeb1890 DEV: add create-topic-label value transformer (#32621)
On mobile we remove the create topic button label:


![image](https://github.com/user-attachments/assets/18dfb2e1-c7fc-4253-b24e-ba95d8533855)

and we don't have a great way to add it back
(https://meta.discourse.org/t/new-topic-button-hidden-text/364902)

this will allow the translation to be set for both mobile and desktop
like this:

```js
import { apiInitializer } from "discourse/lib/api";

export default apiInitializer((api) => {
  api.registerValueTransformer("create-topic-label", ({ value, context }) => {
    return context.defaultKey;
  });
});
```


![image](https://github.com/user-attachments/assets/7e1200f0-e8fc-4966-9693-310b3fad3682)


and also grants the flexibility to have a custom labels for mobile and
desktop
2025-05-07 12:01:44 -04:00
183546c2a1 UX: Various improvements to the new color palette page (#32597)
This commit makes various changes and improvements to the new color palettes
page that was introduced in
https://github.com/discourse/discourse/pull/32379. Specifically, it:

* Removes the ‘Logos and fonts’ banner
* Removes the icon from the palette names in the list
* Moves the ‘new’ button to the top of the palette list
* Excludes theme-owned color palettes from the color palettes page since
these will be editable directly from the theme page
* Makes the name the primary text if a color has no description
* Adds a button next to the name field to save just the name
* Adds a ‘Delete’ button alongside the existing ‘Duplicate’ button
* Adds a ‘Revert’ button to change a modified color back to its default
value (based on the base palette of the palette)
2025-05-07 17:53:50 +03:00
6455e75da1 DEV: Add locale for topics (#32619)
Similar to https://github.com/discourse/discourse/pull/32526.

Reviewer note: There had been some deliberation if we should just take
the `topic.first_post.locale` instead of having a `topic.locale`.
Ultimately, titles may be of a different language of the post itself,
and secondarily in some cases it could be faster without having to load
the first_post at all.
2025-05-07 22:25:58 +08:00
61de461412 DEV: Refactor lazy-video initialization for Glimmer compatibility (#32599)
Modernizes the renderGlimmer API to use Glimmer components, replacing
deprecated ember-cli-htmlbars templates. Adds deprecation warnings for
invalid parameters and improves compatibility with the new Glimmer Post
Stream API.
2025-05-07 10:47:02 -03:00
5de93abbaa DEV: Remap legacy breakpoints to new rem versions (#32530) 2025-05-07 13:20:13 +01:00
25bb2ea2ab DEV: ensures trace/video is configured after driver (#32617)
Order matters and was the source of oddities.
2025-05-07 13:00:41 +02:00
03f3e84ce5 DEV: move file instead of rewriting it (#32616)
It was not working locally and should just be less wasteful.
2025-05-07 10:31:12 +02:00
a2c3adc90e DEV: remove load-more mixin (#32557)
Follow up from https://github.com/discourse/discourse/pull/32285 and
https://github.com/discourse/discourse/pull/32363.

Removes the load-more mixin file.
2025-05-07 16:19:17 +08:00
addaa03192 DEV: uses local playwright chromium for now (#32613)
We have had multiple issues while using the chrome channel:
- super slow start of the spec, I can confirm I don't have it on
chromium
- more risk of different failures between local dev machines and CI

There was a test not working on chromium, as it doesn't have mp4 codecs
out of the box. I changed the spec to use webm instead and it's now
working correctly.

This commit also fixes a bug with the video/trace paths which were
incorrect, and also makes another test less flakey with uploads event
though Im not very clear on what is going on here, we need to dig this.

We now need to figure out a way to have this on the test image, but this
is for now a better solution.
2025-05-07 10:17:25 +02:00
b16fb6a60b FIX: Ensure hashtag_lookup falls back to system user if post user is deleted (#32466)
`hashtag_lookup` fails if called with a deleted user's ID. This change
defaults to system user if the user does not exist.
2025-05-07 15:49:49 +10:00
dcc0eff0c7 DEV: remove theme_download_screenshots site setting (#32612)
Enable theme screenshots to everyone

![Screenshot 2025-05-07 at 10 21
48 am](https://github.com/user-attachments/assets/263cc256-c6c6-49ed-bb9b-0ddff9bb1ecb)
2025-05-07 12:09:20 +08:00
3a8c8dfddb FIX: Don't enforce strict loading on anon user main record (#32590)
Chat is currently broken in local development if anonymous mode is enabled in site settings. This is happening after #32416. One of the strict_loading directives in ChannelFetcher is trickling down to an anonymous user check.

We don't need to enforce strict_loading on this 1-to-1 association that's only used in a few code paths, so mark it as strict_loading: false on the User model.
2025-05-07 09:46:07 +08:00
18bbfa87ed DEV: replace select-kit utils mixin methods with input-utils lib (#32594)
This PR replaces the set of methods related to validation and
normalization of input values in the select-kit utils mixin with simple
exported functions from a input-utils lib file.

We maintain the `_normalize` method on the select-kit component because
there are external repos dependent on that part of the interface.

We'll replace the remainder of the mixin with another utils lib file in
a separate PR.
2025-05-07 09:25:52 +08:00
bff638888c FIX: improvements for admin search (#32574)
Instead of simple match keywords, search login was a bit enhanced by calculating score.

20 points if item label starts with searched phrase. This is to prioritize automation when auto is typed;
10 points for each exact word matches keywords. This is to prioritize discourse-ai when ai is typed;
5 points if matches fallback to original phrase match.
In addition, stop showing loading sign when modal is opened.
2025-05-07 09:23:19 +08:00
d39401a190 Build(deps-dev): Bump capybara-playwright-driver from 0.5.5 to 0.5.6 (#32607)
Bumps
[capybara-playwright-driver](https://github.com/YusukeIwaki/capybara-playwright-driver)
from 0.5.5 to 0.5.6.
-
[Commits](https://github.com/YusukeIwaki/capybara-playwright-driver/compare/0.5.5...0.5.6)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-07 01:58:03 +02:00
31ad00a1c2 Build(deps): Bump version_gem from 1.1.7 to 1.1.8 (#32608)
Bumps [version_gem](https://gitlab.com/oauth-xx/version_gem) from 1.1.7
to 1.1.8.
-
[Commits](https://gitlab.com/oauth-xx/version_gem/compare/v1.1.7...v1.1.8)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-07 01:57:54 +02:00
35cfd0dc89 Build(deps-dev): Bump mime-types-data from 3.2025.0402 to 3.2025.0506 (#32606)
Bumps [mime-types-data](https://github.com/mime-types/mime-types-data)
from 3.2025.0402 to 3.2025.0506.
-
[Changelog](https://github.com/mime-types/mime-types-data/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/mime-types/mime-types-data/compare/v3.2025.0402...v3.2025.0506)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-07 01:57:27 +02:00
652492ea38 Build(deps-dev): Bump webpack from 5.99.7 to 5.99.8 (#32605)
Bumps [webpack](https://github.com/webpack/webpack) from 5.99.7 to
5.99.8.
- [Release notes](https://github.com/webpack/webpack/releases)
-
[Commits](https://github.com/webpack/webpack/compare/v5.99.7...v5.99.8)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Discourse CI <ci@ci.invalid>
2025-05-07 01:23:13 +02:00
3f070bd76f DEV: Fix typo in tests workflow (#32611) 2025-05-07 07:15:49 +08:00
7597423337 Build(deps-dev): Bump esbuild from 0.25.3 to 0.25.4 (#32604)
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.25.3 to 0.25.4.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.25.3...v0.25.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-07 00:40:42 +02:00
91e31f8859 Build(deps-dev): Bump puppeteer-core from 24.8.0 to 24.8.1 (#32603)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from
24.8.0 to 24.8.1.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
-
[Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v24.8.0...puppeteer-core-v24.8.1)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Discourse CI <ci@ci.invalid>
2025-05-07 00:40:17 +02:00
91e4f2c81d Build(deps-dev): Bump playwright from 1.51.0 to 1.52.0 (#32601)
Bumps [playwright](https://github.com/microsoft/playwright) from 1.51.0
to 1.52.0.
- [Release notes](https://github.com/microsoft/playwright/releases)
-
[Commits](https://github.com/microsoft/playwright/compare/v1.51.0...v1.52.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-07 00:40:00 +02:00
475354bd13 Build(deps): Bump @babel/standalone from 7.27.1 to 7.27.2 in the babel group (#32600)
Bumps the babel group with 1 update:
[@babel/standalone](https://github.com/babel/babel/tree/HEAD/packages/babel-standalone).


Updates `@babel/standalone` from 7.27.1 to 7.27.2
- [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.27.2/packages/babel-standalone)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-07 00:39:46 +02:00
90cb152d94 DEV: Add FlagActionType value transformers (#32598)
Add 

-  "flag-description"
- "flag-custom-placeholder"
- "flag-formatted-name"

value transformers
2025-05-06 15:16:06 -05:00
a80017ff6a DEV: add fallback for calling helper.widget decorating cooked content when using the Glimmer Post Stream (#32585)
This commit adds a basic fallback to prevent errors for extensions accessing
`helper.widget` when using `api.decorateCookedElement`.

The purpose of the fallback is provide access to `.widget.attrs`and
`scheduleRerender()` which are common scenarios.

Since the call to the callback happens only when rendering the auto mode
of the Glimmer Post Stream can't detect the existence of these
customizations. The PR also adds a deprecation notice in the console.
2025-05-06 14:13:45 -03:00
e06bbdf77b Revert "FIX: Stop non-rgb header background colors crashing Discourse… (#32477)
…Hub (#31929)"

This reverts commit 5f8a183abf24d0f54f7334d19152a09e9ae241c6. The issue
has been resolved in the latest version of the DiscourseHub app. (Will
merge this once that version goes through Apple review.)
2025-05-06 12:21:59 -04:00
c411f4930d Update translations (#32595) 2025-05-06 11:29:38 -04:00
3d06536bda Build(deps-dev): Bump puppeteer-core from 24.7.2 to 24.8.0 (#32568)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from
24.7.2 to 24.8.0.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
-
[Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v24.7.2...puppeteer-core-v24.8.0)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Discourse CI <ci@ci.invalid>
2025-05-06 16:27:39 +02:00
7b622b7dcb DEV: Move admin backups page to Advanced section (#32593)
We have gradually moved the pages out of the Account section in the admin sidebar. This moves the last one, Backups, to the Advanced section, and entirely removes Account.
2025-05-06 19:51:30 +08:00
b6aad28ccf DEV: replace selenium driver with playwright (#31977)
This commit is replacing the system specs driver (selenium) by
Playwright: https://playwright.dev/

We are still using Capybara to write the specs but they will now be run
by Playwright. To achieve this we are using the non official ruby
driver: https://github.com/YusukeIwaki/capybara-playwright-driver

### Notable changes

- `CHROME_DEV_TOOLS` has been removed, it's not working well with
playwright use `pause_test` and inspect browser for now.

- `fill_in` is not generating key events in playwright, use `send_keys`
if you need this.

### New spec options

#### trace

Allows to capture a trace in a zip file which you can load at
https://trace.playwright.dev or locally through `npx playwright
show-trace /path/to/trace.zip`

_Example usage:_

```ruby
it "shows bar", trace: true do
  visit("/")

  find(".foo").click

  expect(page).to have_css(".bar")
end
```

#### video

Allows to capture a video of your spec.

_Example usage:_

```ruby
it "shows bar", video: true do
  visit("/")

  find(".foo").click

  expect(page).to have_css(".bar")
end
```

### New env variable

#### PLAYWRIGHT_SLOW_MO_MS

Allow to force playwright to wait DURATION (in ms) at each action.

_Example usage:_

```
PLAYWRIGHT_SLOW_MO_MS=1000 rspec foo_spec.rb
```

#### PLAYWRIGHT_HEADLESS

Allow to be in headless mode or not. Default will be headless.

_Example usage:_

```
PLAYWRIGHT_HEADLESS=0 rspec foo_spec.rb # will show the browser
```

### New helpers

#### with_logs

Allows to access the browser logs and check if something specific has
been logged.

_Example usage:_

```ruby
with_logs do |logger|
  # do something

  expect(logger.logs.map { |log| log[:message] }).to include("foo")
end
```

#### add_cookie

Allows to add a cookie on the browser session.

_Example usage:_

```ruby
add_cookie(name: "destination_url", value: "/new")
```

#### get_style

Get the property style value of an element.

_Example usage:_

```ruby
expect(get_style(find(".foo"), "height")).to eq("200px")
```

#### get_rgb_color

Get the rgb color of an element.

_Example usage:_

```ruby
expect(get_rgb_color(find("html"), "backgroundColor")).to eq("rgb(170, 51, 159)")
```
2025-05-06 10:44:14 +02:00
55f09ed73f Revert "DEV: Update workflow concurrency controls to use github.ref_name (#32524)" (#32592)
This reverts commit 427d4d2b53fcddf771e450ebaa3dbf5140c9fb7a.

This prevents us from knowing which commit broke the build. Revert for
now while we figure out a better solution.
2025-05-06 15:43:57 +08:00
d3fd65dcf1 DEV: replace select-kit tags mixin with tag-utils service (#32509)
This PR replaces the use of the tags mixin for select-kit components
with a tag-utils service instead.

Main changes:
1. Remove methods needed to set selectKitOptions key `allowAny` from the
service, this was largely unnecessary since 3 out of 4 components using
the mixin already defined their own selectKitOptions `allowAny` (which
would override the mixin version), and the last component
`mini-tag-chooser` overrode the _value_ with its own `allowAnyTag`
property.
2. Remove all state from service and decouple from whole components by
explicitly requiring that any dependent property/callback be passed in
as arguments to the methods (so anything relying on `this` or
`context`). `site` and `siteSettings` are explicitly injected as
services into the tag-utils service as well for access to their
properties.
3. `_transformJson` needs to be passed into the service as a callback
that acts on the component, and I chose the `@bind` decorator for this.
`@action` doesn't work too well here as it results in subtle timing
errors where later on in the cycle, this results in setting properties
on destroyed components.
2025-05-06 14:38:55 +08:00
90dd91c6a1 FIX: Badge not showing as disabled when it is (#32591)
In the /admin/badges view, badges are showing as enabled even when they are verifiably disabled in the database.

This is happening because the defaults (needed to render the "new badge" form) are overwriting the actual value.

Since the enabled default is only used for "new badge" form, move it to the route where the other "new badge" defaults are being set.
2025-05-06 14:15:25 +08:00
25e4bc597e DEV: Helper methods for post localization (#32529)
Adding helper methods for post localization within `Post` model for fluency.
2025-05-06 14:13:43 +08:00
Sam
c8d6dd2a92 FIX: key optimized images on format (#32575)
Previous to this change when we used to specify format it could get an
image
in the incorrect format.

Also... allows image magick to decode svg

---

There remains a bug where the crop / resize information is not stored in
optimized images
this means that sometimes when asking for a cropped image you may get a
resized one.
2025-05-06 14:40:51 +10:00
ca581cd933 Build(deps-dev): Bump rspec-mocks from 3.13.3 to 3.13.4 (#32587)
Bumps [rspec-mocks](https://github.com/rspec/rspec) from 3.13.3 to
3.13.4.
-
[Changelog](https://github.com/rspec/rspec/blob/rspec-mocks-v3.13.4/rspec-mocks/Changelog.md)
-
[Commits](https://github.com/rspec/rspec/compare/rspec-mocks-v3.13.3...rspec-mocks-v3.13.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-06 12:01:24 +08:00
ec3401c788 Build(deps-dev): Bump rubocop from 1.75.4 to 1.75.5 (#32588)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.75.4 to
1.75.5.
- [Release notes](https://github.com/rubocop/rubocop/releases)
-
[Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop/compare/v1.75.4...v1.75.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-06 12:01:11 +08:00
ed830c94f3 DEV: Remove iOS 18 media optimization check (#32581)
We already have a site setting for iOS and the feature doesn't work
reliably, no need for the extra check.
2025-05-06 13:49:45 +10:00
a20aaecb1f UX: composer starts with allowPreview default false (#32589)
The rich editor is loaded asynchronously, so when `allowPreview` starts
as `true`, if we're opening the composer for the 1st time, ProseMirror
dependencies will be loaded async and while the rich editor is fully
loaded, the composer animates from having a preview to not having one,
shrinking in width.

This changes the `allowPreview` to be default `false`, so the animation
never happens – when the default composer editor is set to the Markdown
editor, it'll instantly and synchronously set the tracked property,
before any animation kicks in.
2025-05-06 12:11:54 +10:00
7cebd41015 FIX: autocomplete being cut on rich editor (#32586)
The `.ProseMirror-container` is scrollable, and it being `position:
relative` cuts mentions/hashtags/etc autocompletes. Removing it _should_
be safe and `.d-editor-textarea-wrapper` (a name we should change
eventually btw...) becomes the new anchor for absolute positioning.

Before

![image](https://github.com/user-attachments/assets/21463af7-14e2-489d-bec2-f0763f2f4fab)

After

![image](https://github.com/user-attachments/assets/c86a394a-4dc0-4131-be29-2987f417cef6)
2025-05-06 09:46:22 +10:00
dad3927362 UX: link to /new-invite in quick start guide (#32580)
The `/my/invited` page is kind of jarring to send a new admin to? 

Before, directs to `/my/invited`



![image](https://github.com/user-attachments/assets/11b75c5c-d613-4861-bb94-13d1a5fe892c)


After, `/new-invite` (opens the modal on the homepage) 


![image](https://github.com/user-attachments/assets/5534fa5c-6819-44af-8c4c-525bfba54e89)
2025-05-06 09:05:01 +10:00
cbb1787220 DEV: Remove select kit animation (#32582) 2025-05-05 14:40:17 -05:00
54faff1608 DEV: Add a missing path to the stylesheet watcher (#32579)
A followup to https://github.com/discourse/discourse/pull/31416

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-05-05 19:31:39 +02:00
49e3b5be76 Bump version to v3.5.0.beta5-dev 2025-05-05 12:58:30 -04:00
133b230ed9 Bump version to v3.5.0.beta4 v3.5.0.beta4 2025-05-05 12:58:30 -04:00