Commit Graph

59663 Commits

Author SHA1 Message Date
cb7d26fae5 DEV: change experimental_system_themes setting to list (#33230)
Before it was Boolean. 
The list is giving more control over which system themes should be
displayed.
2025-06-17 15:41:19 +08:00
da1de52a06 FIX: Wrong argument error in FileStore::S3Store#update_access_control (#33231)
This commit is a follow up to b02bc707dec12c607511d4a95c7d791f63131b49.
When the `s3_enable_access_control_tags` site setting is enabled,
calling `FileStore::S3Store#update_access_control` will result in a
argument error.
2025-06-17 15:18:14 +08:00
1a2b003d35 FIX: import Horizon system theme (#33229)
System themes were introduced here -
https://github.com/discourse/discourse/pull/32681

In this PR, Horizon is imported.
2025-06-17 14:03:38 +08:00
c00c522530 DEV: Adds hasNoPreferredMode to chat state manager (#33213)
This commit introduces a new property `hasNoPreferredMode` to the
chat state manager, which represents a user who has not purposely
set chat mode to drawer or full page, meaning they have no LocalStorage
value set.

This can be useful for themes to change the chat mode but only
if the user has no preference already.

c.f.
https://meta.discourse.org/t/full-screen-chat-as-default-for-collaboration-setup/369849
2025-06-17 13:22:42 +10:00
6ea31d32f0 DEV: Fix lograg logger and log_level not following rails log_level (#33218)
Before this change, we were relying on the `lograge`'s gem default
`log_level` of `info`. However, `lograge` should be following
`Rails.application.config.log_level` instead and this commits seeks to
correct that behaviour.
2025-06-17 09:59:58 +08:00
c5a38d3c2e Build(deps-dev): Bump lefthook from 1.11.13 to 1.11.14 (#33225)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.11.13
to 1.11.14.
- [Release notes](https://github.com/evilmartians/lefthook/releases)
-
[Changelog](https://github.com/evilmartians/lefthook/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/evilmartians/lefthook/compare/v1.11.13...v1.11.14)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 09:34:58 +08:00
6c049af5c4 FIX: ignore SiteSetting.max_image_size_kb for theme screenshots (#33215)
Theme screenshots have their validations:
https://github.com/discourse/discourse/blob/main/lib/theme_screenshots_handler.rb#L4

Therefore, validations in `UploadCreator` can be ignored. Currently, the
import of system themes is crashing when the value is too low for
`SiteSetting.max_image_size_kb` .
2025-06-17 08:58:37 +08:00
c84e1abd03 UX: reload the page when the default theme is changed (#33217)
When the default theme is changed, reload the page to present new theme
to the admin.


https://github.com/user-attachments/assets/d127ea36-6960-419e-820e-265321dad0cd
2025-06-17 08:58:27 +08:00
a513a1cfb7 UX: Make the theme title fully clickable + accessible (#33205)
### What I changed

- Wrapped the theme title and the pencil icon in a single `DButton` so
the whole thing is clickable
- Added ARIA stuff: heading role, level, and label to help screen
readers know it’s both a title and editable

### Why

Changed it so the entire title acts as the edit trigger, instead of just
the icon.

[Kapture 2025-06-13 at
16.34.12.webm](https://github.com/user-attachments/assets/c44049a0-bfd0-455a-94a3-fe9ec4d387ff)
2025-06-16 16:51:44 -06:00
2364d3ccd0 DEV: Add an InterpolatedTranslation component. (#33082)
A new `<InterpolatedTranslation>` component for interpolating components into translatable strings.

This change also includes a little bit of refactoring in the `i18n` library to make it easier to hook into.
2025-06-17 07:52:06 +10:00
81b851824f FIX: rich editor mention case sensitivity (#33222)
Ensures we match user names and group names with case insensitivity.
2025-06-16 17:50:31 -03:00
47287c888d DEV: updates discourse-emojis to 1.0.41 (#33220)
This will improve support for emojis with diacritics like piñata and côte d'ivoire:

-
8cb7010842
-
5ff5c72aa2
2025-06-16 20:01:06 +02:00
fb9343891c DEV: Rename codemodded class names (#33198) 2025-06-16 16:31:57 +02:00
c222627313 DEV: Allow using %{base_path} in theme setting descriptions (#33180)
This brings them in line with site setting descriptions
2025-06-16 15:04:00 +01:00
0c6c8e9ec7 FEATURE: add plugin outlet to category settings images tab (#33155)
Allows plugins and themes to inject custom content or UI extensions
specifically for the image settings of each category.
2025-06-16 14:55:36 +01:00
b63d5121d6 Build(deps-dev): Bump @swc/core from 1.12.0 to 1.12.1 (#33211) 2025-06-16 15:50:23 +02:00
2f6ac0ec2f Build(deps): Bump faraday-net_http from 3.4.0 to 3.4.1 (#33212) 2025-06-16 15:48:29 +02:00
4269eaf4d5 Build(deps-dev): Bump sinon from 20.0.0 to 21.0.0 (#33210) 2025-06-16 15:47:49 +02:00
b2f0dc7c72 FIX: make mentions autocomplete search prioritise exact matches for groups more (#33195)
The current way mentions are prioritised when trying to autocomplete
(with the `@` character in composer and some other search interfaces),
it's fairly easy for the list of suggestions to get crowded out by
seemingly unrelated suggestions as users that match on metadata are
prioritised in front of all groups.

The existing order of prioritisation:
1. All users that match (even partially) on usernames, names, metadata
2. Emails
3. Groups

This PR changes the order of prioritisation to favour the following in
order:
1. Exact match on User usernames
5. Exact match on Group names
6. Emails (this is kind of a special case, we don’t allow the ‘@’
character in usernames or group names anyway, but we do want to include
it here to easily adhere to the suggestion list limit)
7. Partial match on User usernames
8. Partial match on Group names
9. Exact match on User names
10. Partial match on User names
11. Users with matching metadata

Previously, a mention autocomplete with no matching entities would at
minimum return groups viewable by the user, this change also removes
that so it's a stricter autocomplete.
2025-06-16 16:38:13 +08:00
16f555b477 DEV: simplify composer mentions plugin code (#33174)
We recently added validation for mentions in rich text editor mode of
composer in #32879.

In an effort to eliminate potential edge cases for non-text nodes, I
have restored the input rules and simplified the approach used in the
plugin code.

This change means that Instead of finding and inserting mention nodes
within text while the user is typing, we let the input rules handle the
mention node creation part. This allows the plugin code to focus
entirely on validating nodes within the document.

As part of this change we introduced a new data attribute ("data-valid")
which will assume by default that mentions are valid and therefore be
"true", but will proceed to invalidate them by changing to false for
mentions that were not found. It also means that invalid mentions are
retained as mention nodes, whereas previously we would convert them to
text.
2025-06-16 11:58:12 +04:00
21182883ef FIX: Multiple video uploads in composer failed (#33216)
When uploading > 1 video in the composer, any upload after
the first one would fail silently, and not show anything in
the composer.

This was happening because we were removing uploads before the video
thumbnail callback was fired, but that had code like this `if
(this.#inProgressUploads.length === 0) { this.#reset() }`, which meant
that before the second upload was completely done we were resetting the
state.

Instead, we can remove the in progress upload file inside the video
thumbnail callback, which will ensure that the state is not reset
until all uploads are done.
2025-06-16 17:32:14 +10:00
b02bc707de DEV: Add setting to tag s3 objects enabling tag based access control policies (#32988)
This commit introduces a `s3_enable_access_control_tags` site setting
which,
when enabled, adds a `discourse:acl` tag with values `public` or
`private` to
S3 objects created by the application. The presence of the tags on S3
objects
enables bucket administrators to implement tag-based access control
policies, providing an alternative to
object ACLs which AWS now discourages.

The `discourse:acl` tag can be customized via the
`s3_access_control_tag_key ` site setting.
Values for `public` and `private` can also be customized via the
`s3_access_control_tag_public_value` and
`s3_access_control_tag_private_value ` site settings respectively.

### Reviewer Notes

To test it locally, run the following commands in your working discourse
directory:

1. `script/install_minio_binaries.rb`
2. Start a local minio server by running: `bundle exec rails runner
script/local_minio_s3.rb`
3. bundle exec rails runner "SiteSetting.enable_s3_uploads = true"
5. Start your development rails server with the following environment
variables: `DISCOURSE_ENABLE_S3_UPLOADS=true
DISCOURSE_S3_ENABLE_ACCESS_CONTROL_TAGS=true
DISCOURSE_BACKUP_LOCATION=s3`
2025-06-16 13:26:18 +08:00
7dd1b170fa DEV: Add new color palette page to admin sidebar navigation (#33214)
This commit makes the "Color palettes" link in the admin sidebar points to
the new color palettes page at `/admin/config/colors` instead of the
legacy one `/admin/customize/colors` if the experimental feature flag
for the improved color palette system is enabled.
2025-06-16 08:15:15 +03:00
862116a176 FEATURE: Add description to invites (#33207)
Add the ability to attach a description to an invite for easier organization.
2025-06-16 11:31:07 +08:00
b3894e8728 DEV: Change admin site settings filter to be route based (#33167)
The filtering is currently being done in the controller. This leads to weird things where the filter loop might already be initiated and we get double filtering, as well as the issue that we can't abort like we could with a route transition.

After this change we:

- Cache the site settings fetched from the server in the route instance.
- Hook up the controller to the query params.
- Use the query params to filter the model in the route.
2025-06-16 11:20:38 +08:00
290b435a72 FIX: Admin can edit the name even if enable_names is disabled (#33170)
There is a bug that when `SiteSetting.enable_names` is disabled, the
admin can click the pencil next to the user and successfully update the
name. However, the change is not saved as the action is blocked by the
guardian.

Meta:
https://meta.discourse.org/t/disabling-enable-names-makes-admin-act-strange/291912
2025-06-16 09:24:17 +08:00
249d9514c8 DEV: Import user title in generic_bulk 2025-06-15 15:56:36 +02:00
fb7fa2902c UX: suppress chat's Mod-K on rich editor (#33206) 2025-06-14 09:58:59 -03:00
d1932430c1 UX: Add classes to read/unread user menu messages items (#33203) 2025-06-13 16:47:28 -05:00
15ec15f2a5 UX: display URL on rich editor link toolbar (#33188)
Works better with changes from
https://github.com/discourse/discourse/pull/33187


![image](https://github.com/user-attachments/assets/cc69b796-6a2a-4461-b52b-bf9d94b43f06)


![image](https://github.com/user-attachments/assets/002a119f-3a18-41a3-8905-c0f461833c17)
2025-06-13 18:03:17 -03:00
777b80be6c UX: make all preference icons unique (#33202)
We repeat the user icon here, making the icons kind of pointless.

This changes the account and profile icons to potentially be a little
more useful.

Before:

![image](https://github.com/user-attachments/assets/2fce16fb-5ddf-4cd2-9053-c5a946f9500c)

After:

![image](https://github.com/user-attachments/assets/729962c9-c466-456a-95a6-04a767d95ed3)

Mentioned here:
https://meta.discourse.org/t/ux-improvements-on-header-dropdown-notifications/370110
2025-06-13 15:13:09 -04:00
2268f06b04 FIX: Chat video thumbnails in Safari (#33199)
When uploading videos in chat using Safari the thumbnail isn't being
displayed
so we need to trick the browser to by adding the timestamp property so
that it
will fetch the metedata the html5 video tag needs to render the
thumbnail.
2025-06-13 13:04:35 -06:00
bc4844cb93 FEATURE: allow date-based filters to accept a day count (#33197)
This allows date based filters to use a count of days as well as the
existing date string system (`YYYY-MM-DD`). This is convenient if you
want a dynamic list based on the current date, you could use:
`created-after:7` to return topics from the past week.

This will work for: 

 - created-before/after
 - activity-before/after
 - latest-post-before/after
 
This also makes filters consistent with our existing query params like
`?before=7`



This came up in:
https://meta.discourse.org/t/creating-a-custom-filter-homepage/370062
and is something that we mentioned internally while defining our domain
specific language for the /filter route, but never implemented.
2025-06-13 13:45:50 -04:00
038e511552 DEV: define CSS variables for button colors (#33162)
This adds sets of CSS button variables that can be overridden in themes.
This won't change any default styles, but just provides a less
problematic method of customization.

The current suggested way of doing this is with SCSS like so:

```scss
.btn-default {
  @include btn(
    $text-color: var(--tertiary),
    $bg-color: var(--secondary),
    $icon-color: var(--tertiary-high),
    $hover-text-color: var(--tertiary),
    $hover-bg-color: var(--tertiary-very-low),
    $hover-icon-color: var(--tertiary)
  );
}
```

The trouble with this is that it brings along _all_ the btn mixin
styles, so you also end up re-setting things like this, in addition to
changing colors:

```scss
.btn-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  // and also the colors 
}
```

That can problematic because it can override existing button styles
(e.g., if you already altered a single instance of margin). With these
new CSS custom properties, you can avoid this by doing:

```css
:root {
  --d-button-default-text-color: var(--tertiary);
  --d-button-default-text-color--hover: var(--tertiary);
  --d-button-default-bg-color: var(--secondary);
  --d-button-default-bg-color--hover: var(--tertiary-very-low);
  --d-button-default-icon-color: var(--tertiary-high);
  --d-button-default-icon-color--hover: var(--tertiary);
}
```

So now you can override the button colors without bringing along other
styles from the btn mixin.

I also removed an old `.btn.hidden` style, as we already apply
`!important` to the `.hidden` class elsewhere. Comments have also been
updated to pass our new linting rules.
2025-06-13 11:32:58 -04:00
5c932410ba FEATURE: sharing link to PWA renders url in title in new Topic to leverage core link expansion (#32631)
Discourse has a fantastic feature whereby when installed as PWA (on
Android or Windows), you can share content to that Discourse from other
apps and browsers.

Currently when sharing a link to a Discourse PWA, it pre-populates a
draft Topic body with the link.

Whilst this is really nice already, we can improve this further.
Currently, sharing a link to the body misses out on the auto-magic core
feature of pasting a link in the title which simultaneously hydrates a
title from the og tag and creates a one-box in the body.

This PR remedies this whilst carefully maintaining the current behaviour
for text shares.

Documentation for the standard is here:


https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/How_to/Share_data_between_apps

Demo of this working change is implemented in this plugin:

https://github.com/merefield/discourse-share-to-link-oneboxer

I added a test to check presence of share target in manifest endpoint.
2025-06-13 11:25:13 -03:00
fcaeaf09fa UX: few composer and toolbar style changes (#33187) 2025-06-13 10:46:08 -03:00
19c1932144 Revert "FIX: import Horizon system theme" (#33196)
Reverts discourse/discourse#33193
2025-06-13 14:32:45 +01:00
5392c4d851 Build(deps-dev): Bump mime-types-data from 3.2025.0603 to 3.2025.0610 (#33189)
Bumps [mime-types-data](https://github.com/mime-types/mime-types-data)
from 3.2025.0603 to 3.2025.0610.
-
[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.0603...v3.2025.0610)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-13 14:16:36 +02:00
db540d5a2b Build(deps-dev): Bump puppeteer-core from 24.10.0 to 24.10.1 (#33192)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from
24.10.0 to 24.10.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.10.0...puppeteer-core-v24.10.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-06-13 14:15:40 +02:00
fcf66dd8de DEV: Update URL for component-template-resolving deprecation (#33194) 2025-06-13 10:04:31 +01:00
7562bc2b15 FIX: import Horizon system theme (#33193)
System themes were introduced here -
https://github.com/discourse/discourse/pull/32681

In this PR, Horizon is imported.
2025-06-13 12:30:34 +08:00
2536768a43 FEATURE: system themes (#32681)
Introduction of system themes.  System themes are local themes which:
- Cannot be deleted;
- Cannot have “custom code” added, components only;
- Cannot have uploads;
- Cannot edit color palettes;
- Are updated on deploy, like core plugins.

This PR added the Foundation system theme, which is an empty theme like
Default. The Foundation theme will be added in the next PR.

In a development environment, when system theme files are
changed/added/deleted, the theme is reuploaded and the page is reloaded
to make it a good experience for the engineer working on improvements.

System themes are not visible until
`SiteSetting.experimental_system_theme` is enabled.
2025-06-13 10:36:31 +08:00
c6d926eee7 FEATURE: Clear bookmark reminders from bookmark menu (#33168)
This commit adds a new option in the bookmark menu for existing
bookmarks that allows users to clear the bookmark reminder without
having to delete the bookmark or edit it manually.
2025-06-13 10:37:08 +10:00
fbe754108f DEV: Try fix flaky search shortcut variation test (#33169)
We weren't checking for visibility enough before scrolling
I think
2025-06-13 10:06:54 +10:00
bd6cf79447 Revert "FIX: improves text selection of posts (#33143)" (#33190)
This reverts commit 876dbe66299a7f0d3df71ae9064890a79d228321.
2025-06-13 01:10:25 +02:00
7a9045fa86 DEV: Refactor flakey post stream spec (#33182)
Reorganized the post reply and edit test to mitigate flakiness
2025-06-12 19:26:49 -03:00
9f4ac9dbbf UX: Onebox margin-top of first child (#33088) 2025-06-12 13:47:08 -05:00
1b181d15d1 FIX: Include common_theme CSS in published pages (#33179)
Followup to 4d0a817f4040ed9dd11c87654e25df2b35f1d778


https://meta.discourse.org/t/published-page-css-not-showing-on-frontend/369642
2025-06-12 19:07:48 +01:00
0607c47597 DEV: Improvements to post language selector (#33178)
## 🔍 Overview
Sometimes users may overlook that there is a post translations selector
when writing posts. This could lead to the site's default locale being
used when a post is written in the user's preferred language.

This update ensures that:
- the user's `effective_locale` is used as the default for the
`PostLanguageSelector` in the composer
- when the user's `effective_locale` is not one of the
`experimental_content_localization_supported_locales`, we default to
blank so that the `post.locale` doesn't get set
- we also allow for setting a "none" option in the language selector for
cases where the user wants to post in a language that is not part of
`experimental_content_localization_supported_locales`

## 📷 Screenshots
<img width="216" alt="Screenshot 2025-06-12 at 07 03 56"
src="https://github.com/user-attachments/assets/651b9387-de57-408f-9445-92501bd47567"
/>
2025-06-12 08:10:57 -07:00
9bc8395575 UX: adjust bookmark hover and active states (#33177)
These were some old hover and active states, this updates to use the
proper color variables


Before (yellow active, blue hover):


![image](https://github.com/user-attachments/assets/f81afd39-0dca-49e3-b1e8-f44b2e035bdd)



![image](https://github.com/user-attachments/assets/013a8258-e6b6-49bf-8add-8ad57125de3b)



After (blue active, grey hover): 

![image](https://github.com/user-attachments/assets/081e9650-db71-49ce-bd7f-e5aebebdea84)


![image](https://github.com/user-attachments/assets/8e6fefaa-815b-4ebb-b111-dbebe7eaa93d)
2025-06-12 10:36:30 -04:00