Commit Graph
9989 Commits
Author SHA1 Message Date
Penar Musaraj f3c41af772 DEV: Refactor image compression for iOS (#32652) 2025-05-09 09:51:30 -04:00
Ted Johansson abee294616 DEV: Expose show_additional_about_groups to client (#32660)
We just added this site setting to be used for switchover as we merge a theme component into core. However, as it wasn't marked client: true, the theme component cannot read it. 🤦
2025-05-09 13:36:57 +08:00
Ted Johansson b97d1c63f0 DEV: Add a flag to facilitate merging about groups into core (#32657)
We are merging the add-groups-to-about theme component into core. As per protocol, we'll use a hidden site setting to facilitate the switchover.
2025-05-09 10:00:50 +08:00
David Taylor 713fa8874a FIX: Purge ExtraLocalesController cache correctly for multisite (#32654)
When Translation Overrides are changed, a message is sent on the
`/i18n-flush` channel to ensure all running unicorns flush their caches.
This message is not received in a database-specific context, so running
`ExtraLocalesController.clear_cache!` was only affecting the default
site in a multisite cluster. This commit updates it to flush caches for
all sites.
2025-05-08 23:52:45 +01:00
Keegan George 6154fa6b45 FEATURE: Add translations to posts (#32564)
## 🔍 Overview
This update adds the ability for users to manually add translations to
specific posts. It adds a 🌐 icon on the post menu where you can click to
add translations for posts.

It also introduces a new site setting:
`content_localization_debug_allowed_groups` which is convenient when
debugging localized posts. It adds a globe icon in the post meta data
area along with a number of how many languages the post is translated
in. Hovering over the icon will show a tooltip with access to editing
and deleting the translated posts.

## 📸 Screenshots
<img width="1234" alt="Screenshot 2025-05-07 at 13 26 09"
src="https://github.com/user-attachments/assets/9d65374d-ee3e-4e8b-b171-b98db6f90f23"
/>
<img width="300" alt="Screenshot 2025-05-07 at 13 26 41"
src="https://github.com/user-attachments/assets/6ee9c5e6-16ed-4dab-97ec-9401804a4ac8"
/>
2025-05-08 10:40:36 -07:00
David Taylor cf2f1ac5ee FIX: Link to browser support section of website (#32647) 2025-05-08 14:52:24 +01:00
Osama Sayegh 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
Krzysztof Kotlarek 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
Discourse Translator Bot c411f4930d Update translations (#32595) 2025-05-06 11:29:38 -04:00
Osama Sayegh 25dfc64b39 FEATURE: Add color palette list selection to new UI (#32379)
Follow-up to https://github.com/discourse/discourse/pull/31742

This commit adds a color palettes list to the new color palette edit page
that was introduced in the linked PR to allow navigating between color
palettes. It reuses the same UI that we already have in the legacy color
palette UI (`/admin/customize/colors`), but we may redesign the page in
the future.
2025-05-05 05:12:50 +03:00
Ted Johansson 3492819c19 DEV: Don't allow context-free system post destruction (#32523)
There are instances of posts being deleted by system_user where the context is left blank in the staff action logs, leading to confusion about why exactly they have been deleted.

This change deprecates using the PostDestroyer as system_user without providing a context, and adds a context to all call sites currently missing it in core. Plugins to be done after this is merged.
2025-05-05 09:58:29 +08:00
Ella E. ffa406b0b1 UX: Add more info to theme cards (#32334)
Demo:
<img width="1431" alt="Screenshot 2025-05-02 at 2 24 41 pm"
src="https://github.com/user-attachments/assets/c8ec824e-25df-4efc-a4be-c774a2a97896"
/>
<img width="1480" alt="Screenshot 2025-05-02 at 2 24 32 pm"
src="https://github.com/user-attachments/assets/a4020283-9b6d-4f5e-a8c2-72b7608a6026"
/>

Mobile:
<img width="424" alt="Screenshot 2025-05-02 at 2 25 29 pm"
src="https://github.com/user-attachments/assets/af68669a-7bb4-46dc-92ab-6ecc7a3f3842"
/>
<img width="421" alt="Screenshot 2025-05-02 at 2 25 36 pm"
src="https://github.com/user-attachments/assets/961d9f5c-8010-4c5f-a319-6e356b088667"
/>
2025-05-05 09:06:05 +08:00
Penar Musaraj 82d84af6b0 Revert "DEV: Show login-required screen in root route (#32350)" (#32562)
This reverts commit 10df7fdee0.
2025-05-02 11:50:43 -04:00
Krzysztof Kotlarek 4e3d9d88ea FIX: shorten search everything to search (#32544)
`Search everything` was a bit too big.
2025-05-01 09:42:38 -04:00
Krzysztof Kotlarek 07a4ffdf58 UX: display search input and open modal on click (#32508)
In this PR we hide search input.

https://github.com/discourse/discourse/pull/32485

However, search input is much more intuitive. Therefore, input was
brought back and opens modal on click. In addition, search link was
removed.
2025-05-01 10:12:12 +08:00
moin-Jana 63a35d6ca7 UX: Fix post stream setting description mentions post menu (#32250)
In https://github.com/discourse/discourse/pull/31375, the
glimmer_post_stream_mode_auto_groups setting was added. While
translating, I noticed its description is identical to the one for
glimmer_topic_list_mode - both say "post menu implementation". I assume
this was actually meant to refer to the "post stream" instead? Since
glimmer_post_stream_mode uses "post stream implementation", I expected
this setting - also related to the post stream - to follow the same
wording.

I had also mentioned this on Crowdin about two weeks ago, but didn’t get
a reply.
2025-04-30 12:37:39 -04:00
Penar Musaraj 10df7fdee0 DEV: Show login-required screen in root route (#32350)
This changes means that login-required sites will show a splash screen
on `/`. Users heading to `/login` or `/signup` will see the respective
forms.
2025-04-30 12:32:18 -04:00
David Taylor e7450cc6da DEV: Migrate from sprockets to propshaft for assets (#32475)
We are no longer using any of the transpilation/bundling features of
Sprockets. We only use it to serve assets in development, and then
collect & fingerprint them in production. This commit switches us to use
the more modern "Propshaft" gem for that functionality.

Propshaft is much simpler than Sprockets. Instead of taking a
combination of paths + "precompile" list, Propshaft simply assumes all
files in the configured directory are required in production. Previously
we had some base paths configured quite high in the directory structure,
and then only precompiled selected assets within the directory. That's
no longer possible, so this commit refactors those places (mostly
plugin-related) to use dedicated directories under
`app/assets/generated/`.

Another difference is that Propshaft applies asset digests in
development as well as production. This is great for caching & dev/prod
consistency, but does mean some small changes were required in tests.

We previously had some freedom-patches applied to Sprockets. Some of
those had to be ported across to Propshaft. We now have three patches:

1. Skip adding digest hashes to webpack-generated chunks (which are
already digested, and referred to from other js files)

2. Avoid raising errors for missing assets in test mode. We don't always
compile assets before running basic RSpec tests.

3. Maintain relative paths for sourcemap URLs, so that files don't need
to be recompiled depending on their CDN path

Significant refactors are made to the `assets.rake` and `s3.rake` tasks,
which rely on implementation details of Sprockets/Propshaft.
2025-04-30 08:59:32 +01:00
Discourse Translator Bot 97bcbe1716 Update translations (#32510) 2025-04-30 07:59:22 +10:00
Penar Musaraj 4e760f7b79 FIX: don't error when no filter is set in discovery heading (#32516)
In some rare cases, plugins can add nav items without a filter. For
example, the ActivityPub plugin does this. The recent change in
https://github.com/discourse/discourse/pull/32422 results in a JS error
on those pages, see report in
https://meta.discourse.org/t/list-of-activitypub-followers-of-a-tag-actor-not-shown-on-discourse-meta/363971

This fixes the issue.
2025-04-29 11:40:11 -04:00
Martin Brennan ed1e0e30f2 DEV: Remove full_page_login setting (#32189)
We are making this the only option for our login/signup
pages on April 29th, 2025, per

https://meta.discourse.org/t/introducing-our-new-fullscreen-signup-and-login-pages/340401.

This commit removes the `full_page_login` setting and any logic
around it, as well as deleting the old login and signup modals,
and removing leftover problem checks and settings from the database.
2025-04-29 10:40:40 +02:00
Ted Johansson 54ac9bd7b8 Revert "DEV: Remove the word tags from adobe_analytics_tags_url" (#32490)
Need the script to migrate existing settings to come together with this.
🙏
2025-04-28 22:46:28 +08:00
Kris ed608e3ac5 A11Y: use singular tag in accessible category_tag string (#32492)
We don't do tag intersections when filtered to a category, so these can
always be singular

follow-up to
https://github.com/discourse/discourse/commit/ca658a8bb093c82410927d1fa29e5ef1940260b7
2025-04-28 10:37:55 -04:00
Discourse Translator Bot 303b4bfbae Update translations (#32216) 2025-04-28 13:41:04 +02:00
David Taylor 931fa723eb DEV: Replace break_string.js with CSS in embedded view (#32488)
This JS was used to wrap long usernames. Nowadays in core, we use a
simpler `word-break: break-all;` pattern, so it makes sense to use the
same simplification in the embedded comments view.
2025-04-28 10:47:27 +01:00
David Taylor c62a4a4759 PERF: Compile main locale bundles just-in-time (#32335)
Previously all locale bundles would be built & compressed during
assets:precompile. For most sites, only one of these languages was
actually used, so this is fairly wasteful.

This commit moves the main locale bundle into the
ExtraLocalesController, which has recently undergone many improvements
to make it more efficient. This allows locale files to be bundled "just
in time" when they're first accessed.

Now that brotli level=6 is enabled for these assets in our nginx config,
this change should have no impact on the locale bundle size.
2025-04-28 10:31:27 +01:00
Ted Johansson 3b9d9f5893 DEV: Remove the word tags from adobe_analytics_tags_url (#32484)
The word tags is just filler here, and conflates the search results when searching for tag-related site settings.
2025-04-28 17:08:41 +08:00
Krzysztof Kotlarek e3b35ff2a5 FIX: remove sidebar filter (#32485)
Remove sidebar filter in favour of search.

In addition:
- Search was moved up just below Dashboard;
- Do not perform search when filter is empty;
- Display "no results".

![Screenshot 2025-04-28 at 12 37
38 pm](https://github.com/user-attachments/assets/d8cabbca-2a26-413b-abfc-5ae143ff8da6)
![Screenshot 2025-04-28 at 12 37
59 pm](https://github.com/user-attachments/assets/fbae4b8d-60a2-414e-bf40-86e8c50538e6)
![Screenshot 2025-04-28 at 12 38
12 pm](https://github.com/user-attachments/assets/e04371cd-392e-48eb-91c9-21a3d8fc44c0)
2025-04-28 15:57:29 +08:00
Natalie Tay 3146142c2e DEV: Create topic and post localization resources (#32440)
This commit adds

- `topic_localization` containing its topic, a locale, title, and
fancy_title
- `post_localization` containing its post, a locale, raw, cooked, the
associated post's version
- and also APIs to add them

Reviewer note: We may ask ourselves "why create separate models instead
of one that is generic?" but the different localizable models may be
vastly different. For example in posts we only have raw that we need to
translate, and topics we have only title, but for categories we have
name and description. Then, we may ask ourselves "why not create a
polymorphic one that takes in model and column name?" and then we end up
with the same thing as what we have currently which is custom fields
(which is a mess in itself). Also, when replacing the untranslated
content to the translated one, we may find it easier to just `join` +
`coalesce` on the dedicated table - it would be a much simpler query
than polymorphism.
2025-04-28 12:16:14 +08:00
Kris ca658a8bb0 A11Y: add H1 tags for screenreaders on discovery routes (#32422)
Over the years we've received multiple pieces of feedback around our
lack of meaningful H1 tags on our topic lists.

This adds an `<H1>`, hidden with `.sr-only`, for screenreaders that
describes the content of our discovery routes. I've tried to keep these
structured in a way that's somewhat consistent and uses natural
language.

The translations could probably be more efficiently structured, but I
think we need a good amount of flexibility here for translators to
change the sentence structure.

Ultimately this means people using screenreaders will know which page
they're on while navigating headings... and without having to parse
through our navigation.

For example (made visible to demonstrate):


![image](https://github.com/user-attachments/assets/ae397317-b167-44b9-9dfa-79ddd8f9dfda)


![image](https://github.com/user-attachments/assets/fbdb8c49-03ed-40af-ae21-c7eb841f3d3e)


![image](https://github.com/user-attachments/assets/8f36da9d-04cb-4c6b-a4c3-baffbecc64e5)


![image](https://github.com/user-attachments/assets/fc9f3f8d-35a1-4953-84cf-337a00077e26)
2025-04-25 15:08:37 -04:00
Martin BrennanandRenato Atilio e3c3cfe083 UX: Unhide the rich_editor site setting (#32455)
This will show the experimental rich_editor setting and admins
can turn it on for their site. It is still marked experimental
because there are some features missing, but it works well for
95% of cases.


---------

Co-authored-by: Renato Atilio <renato@discourse.org>
2025-04-25 15:00:21 -03:00
David Taylor c38b50994d PERF: Enable brotli in NGINX (#32333)
This enables on-the-fly brotli compression at level 4 for all responses
which we currently gzip. This level should provide slightly improved
file sizes when compared to gzip, as well as slightly faster processing
times. This is the [level which Cloudflare
use](https://blog.cloudflare.com/results-experimenting-brotli/) for
dynamic responses.

When compared to our existing gzip level-5 configuration, our own
experiments confirm that it provides slightly faster compression, with
slightly smaller file sizes.

For static assets which are cached by CDNs/browsers, we use brotli level
6 for an even better compression ratio.
2025-04-24 15:45:13 +01:00
Keegan George 10c817fab5 FEATURE: Set category localizations in category settings (#32412)
This update is a follow-up to https://github.com/discourse/discourse/commit/b0ab1b23214ec8377dbac5defa118e6a2427edf4, where we now allow localizations for a category to be set in the category settings UI.
2025-04-24 10:48:35 +08:00
Kris f9273ddcb7 A11Y: add aria-label to reply count link in topic list (#32402)
At the moment the reply count is labelled by the topic list's header
column, which is good — but we don't actually describe what the link
does, so it's a little ambiguous.

This adds an aria-label to describe the behavior "jump to first post" so
it will be read as:

"n replies, jump to first post" 

This provides better coverage for link-to-link navigation because it
both describes the number and the function.
2025-04-22 15:22:52 -04:00
Natalie Tay b0ab1b2321 FEATURE: Show translated category names from localizations table if they exist for the user locale (#32380)
This PR adds category localization support to core.

- Depends on https://github.com/discourse/discourse/pull/32378
- Creates the required table `category_localizations`
- Makes use of the site category cache to display localized categories
- Supports name and description
- This does not yet include /categories page. (coming in a next PR)

## Before

<img width="1089" alt="Screenshot 2025-04-21 at 4 31 43 PM"
src="https://github.com/user-attachments/assets/9e49b21b-b16a-43d2-9b16-0fd0324a21ca"
/>

## After

<img width="1085" alt="Screenshot 2025-04-21 at 4 32 42 PM"
src="https://github.com/user-attachments/assets/7bfa21a2-6df2-4cdf-a00a-d044c3526a40"
/>
2025-04-22 15:13:19 +08:00
Ted Johansson 2e5f11cc16 DEV: Remove Other admin section (#32392)
Over the past couple of weeks we've been adding Settings tabs to a lot of admin sections, to categorize some of the previously uncategorized site settings.

Now that all that is done, we can remove the Advanced > Other section, which used to contain them.
2025-04-22 11:58:16 +08:00
Ted Johansson 1d7b08f2e1 DEV: Add dedicated admin groups page (#32377)
Previously, clicking "Groups" on the admin dashboard would bring you to the public groups page. Historically, the public and admin actions have been mixed together on that page.

This is a bit of a frustrating experience when working on the admin dashboard, and also prevented us from adding a "Settings" tab for group-related site settings.

This PR adds an "admin groups" page, which is just an exact copy of the public groups index for now. This allows us to add the "Settings" tab, and lets us gradually work un disentangling the public- and admin parts of groups.
2025-04-22 11:23:25 +08:00
Ted Johansson 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
Juan David Martínez CubillosandJoffrey JAFFEUX 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
Alan Guo Xiang Tan 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
Krzysztof Kotlarek 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
Martin Brennan 6028363de2 FIX: Remove hint for browser search shortcut (#32330)
Followup 735bef9ea0

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
Chris Alberti 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
David Taylor 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
Martin Brennan 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
Juan David Martínez Cubillos 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
Osama Sayegh 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
Joffrey JAFFEUXandJordan Vidrine 59ec86933a DEV: DMultiSelect (#32240)
The `DMultiSelect` component provides a customizable multi-select
dropdown with support for both mouse and keyboard interactions.

![Screenshot 2025-04-10 at 15 40
26](https://github.com/user-attachments/assets/277619db-6e56-4beb-8eda-f76360cd2ad8)

### Parameters

#### `@loadFn` (required)
An async function that returns the data to populate the dropdown
options.

```javascript
const loadFn = async () => {
  return [
    { id: 1, name: "Option 1" },
    { id: 2, name: "Option 2" },
  ];
};
```

#### `@compareFn`

A function used to determine equality between items. This is
particularly useful when working with complex objects. By default, `id`
will be used.

```javascript
const compareFn = (a, b) => {
  return a.name === b.name;
};
```

#### `@selection`
An array of pre-selected items that will be displayed as selected when
the component renders.

```javascript
const selection = [
  { id: 1, name: "Option 1" },
  { id: 2, name: "Option 2" },
];
```

#### `@label`
Text label displayed in the trigger element when no items are selected.

```javascript
@label="Select options"
```

### Named Blocks

#### :selection
Block for customizing how selected items appear in the trigger.

```javascript
<:selection as |result|>{{result.name}}</:selection>
```

#### :result
Block for customizing how items appear in the dropdown list.

```javascript
<:result as |result|>{{result.name}}</:result>
```

#### :result
Block for customizing how errors appear in the component.

```javascript
<:error as |error|>{{error}}</:error>
```

### Example Usage

```javascript
<DMultiSelect
  @loadFn={{this.loadOptions}}
  @selection={{this.selectedItems}}
  @compareFn={{this.compareItems}}
  @label="Select options">
  <:selection as |result|>{{result.name}}</:selection>
  <:result as |result|>{{result.name}}</:result>
  <:error as |error|>{{error}}</:error>
</DMultiSelect>
```

Co-Authored-By: Jordan Vidrine
<30537603+jordanvidrine@users.noreply.github.com>

---------

Co-authored-by: Jordan Vidrine <30537603+jordanvidrine@users.noreply.github.com>
2025-04-15 14:56:57 +02:00
Ted Johansson fc6aaa3e49 DEV: Wizard step tweaks (#32304)
This makes two tweaks to the setup wizard:

1. Move the branding (site logo) step to after styling (look & feel).
2. Remove the corporate (your organization) step.
2025-04-15 13:53:01 +08:00
Martin Brennan 735bef9ea0 UX: Remove Ctrl+F search shortcut (#32281)
This commit removes the Ctrl+F search shortcut, which hijacks the
browser search shortcut in Discourse. We are doing this because there
has been many years of complaints around this behaviour, and now that
we have the new header search it has become even more annoying.

We originally added this because we lazy load posts in a topic, and it
might not have been immediately clear to users that they are not
searching
all the posts in the topic when pressing Ctrl+F. However, that was 10+
years
ago, most people are very familiar with lazy loading now, it doesn't
make sense
to keep this additional hijack for this one topic use case.

Search is still accessible by pressing the `/` shortcut.
2025-04-15 15:14:54 +10:00