Commit Graph
60470 Commits
Author SHA1 Message Date
David Taylor 4217e8f430 DEV: Run tests workflow for all commits on main (#34139)
This github workflow is now part of the pipeline to tests-passed, so we
need to run it on every commit that lands. We can continue skipping
tests for PRs that only touch certain paths
2025-08-07 15:29:17 +01:00
Jordan Vidrine f6a1648713 UX: Fix old syntax (#34138) 2025-08-07 09:21:03 -05:00
Natalie Tay f4e08421ae DEV: Use localizable concerns across post, topic, categories (#34137)
This is the first in the series and helps prepare us for crawler_view.
Existing tests should cover the use of these concerns.

/t/160415
2025-08-07 22:12:01 +08:00
Joffrey JAFFEUX c242814f84 PERF: limit the number of upcoming dates generated (#34134) 2025-08-07 15:40:06 +02:00
Jordan Vidrine d0f10e9c41 UX: Do not target topic-list-item data elements in bg color definition (#34136) 2025-08-07 08:36:30 -05:00
Régis Hanol 61b0a3730b FIX: show loading spinner when redirecting to discourse connect (#34135)
On "slow" computers and/or in production builds of the client-side
application, the redirection to discourse connect (via window.location)
might happen _after_ the login/signup route is done loading and the
login/signup template is being shown.

Since when discourse connect is enabled, no other auth "provider" is
allowed, we "flashed" a screen that indicated there was no "login
method" configured.

In order to fix this, we rely on the "isRedirectingToExternalAuth"
boolean and ensure it's set to "true" when discourse connect is enabled.

This is unfortunately ~~impossible~~ very hard to test as it depends on
how fast the browser running the test is...

The only way I was able to reproduce this issue locally was to throttle
both the CPU and network in Chrome's performance tab.

<img width="861" height="156" alt="Screenshot 2025-08-07 at 13 43 09"
src="https://github.com/user-attachments/assets/de02be42-9ce8-4253-8c9c-fd9784a9bb65"
/>

---

I also renamed `isRedirecting` to `#isRedirecting` to better indicate
this is a private variable.

---

**BEFORE**


https://github.com/user-attachments/assets/568052d9-70eb-4d27-8d59-a4b67ae6d8ac

**AFTER**


https://github.com/user-attachments/assets/f51ee3f4-3322-4fc8-8e9b-6195413bba12
2025-08-07 15:12:55 +02:00
Selase Krakani f0e59d89a5 DEV: Add new user_options column to intermediate DB schema (#34124)
Regenerate intermediate DB schema to reflect newly added `user_options`
column
2025-08-07 12:55:48 +00:00
Jordan Vidrine 456c345fed UX: Category header restyle (#34081) 2025-08-07 07:18:56 -05:00
David TaylorandJarek Radosz 351d3d4eb9 FIX: Make theme live-reload safer (#34133)
In production, reloading CSS files before loading new JS is risky, and
can lead to surprising UI flickering/breakage. This commit updates theme
CSS 'file-change' notifications to trigger a reload on next navigation,
just like regular core updates.

In development mode, CSS will still be refreshed 'live'.

Also adds the 'common' target to the list of refreshed CSS bundles,
which will improve the experience in development mode.

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2025-08-07 13:10:42 +01:00
Kris c30b070e72 FIX: Update logic for displaying admin palette warning (#34121)
Follow-up to
https://github.com/discourse/discourse/commit/7a9cf9356e486cf3eb6a2c2bf6cd6927a6ef59e4,
`_initialUserColorSchemeId` no longer exists — we can simplify to only
showing this warning if the admin isn't using the default theme

<img width="700" alt="image"
src="https://github.com/user-attachments/assets/b32617e6-be1c-4238-847b-0e03f04204d9"
/>
2025-08-07 07:40:20 -04:00
David Taylor 1c782ac0d4 FIX: JS/HBS connectors in themes (#34130)
Followup to aa2fb29fa6
2025-08-07 12:39:06 +01:00
Loïc Guitaut eb09733391 FIX: Catch possible PG exception from Chat::AutoJoinChannels (#34132)
Currently, it can happen that the `Chat::AutoJoinChannels` service
raises a `PG::UniqueViolation` error. This is probably due to a race
condition. That exception is not rescued, leading to 500s.

This PR wraps the main step inside a `try` block and also inside a
`lock` block.
2025-08-07 12:50:22 +02:00
Linca 7d838842bf FEATURE: Make staff action logs export respect the filter (#34113)
On the Admin > Logs & Screening page, the Export button never applied
the current page's filters. For older websites, viewing large exported
logs may cause lag.

This commit makes the Export button respect the current page's filters,
reducing the size of exported staff action logs and improving
consistency.
2025-08-07 16:25:16 +08:00
Sam 0466f51081 FIX: event scheduler could create dupe record (#34127)
This ensures it is impossible to create duplicate event date records and cleans up entire history
2025-08-07 16:14:32 +10:00
Krzysztof Kotlarek 8aa45fbbfa Revert "FEATURE: theme default option in user interface" (#34125)
Reverts discourse/discourse#34110
2025-08-07 10:45:15 +08:00
Krzysztof Kotlarek 4a604f0a7c FEATURE: theme default option in user interface (#34110)
Before the "theme default" option appeared conditionally, which caused
confusion. For example, it was shown when the theme was using a color
scheme that was not user-selectable. If the scheme was selectable, then
a specific scheme like "Merigold" was preselected. If the theme changed
default schemes, that change was not reflected on the user interface.

Therefore, it would be better to always have the "Theme default" option,
which would have `-1` id. It means that the user's color scheme will
always follow theme defaults.

<img width="400" height="221" alt="Screenshot 2025-08-06 at 10 07 40 am"
src="https://github.com/user-attachments/assets/e3d3588d-1d4a-4e95-9c10-925e48c4a58b"
/>
2025-08-07 09:05:06 +08:00
Gary Pendergast 3c7d4f67bc DEV: Clean up the new Reviewable Refresh components (#34112)
This change adds documentation and unit tests for the new `ReviewableCreatedBy` and `ReviewableTopicLink` components, as well as the `newReviewableStatus` function.
2025-08-07 08:52:04 +10:00
Sérgio Saquetim 4013d1ffb8 DEV: Improve user handling and access in post components (#34013)
This pull request improves how user properties are managed and accessed
in post-related components and models. Notable improvements include:

- The `Post` model now provides a cached `user` property, ensuring a
consistent and up-to-date user object using relevant post fields,
instead of relying on `user` being set directly or via the `PostStream`.
- Components such as `PostAvatar` and `PostMetaDataPosterName` now
consistently reference the `user` property, improving reliability and
reducing the risk of missing or inconsistent user data.
- User context is more accurately passed to value transformers and
plugin outlets, ensuring that avatar and name rendering logic always
receives the correct user information.
- The `GroupPostSerializer` now includes the `user_id` attribute,
improving API consistency.
- Test cases have been updated to work with the new user property
approach, removing direct creation of user objects on posts and instead
relying on post fields.
- The `discourse-reactions` plugin was updated to align with the new
user property logic, ensuring reaction-related user data is accessed
consistently.

Overall, these changes improve data integrity, reduce the risk of
rendering errors due to user data inconsistencies, and streamline how
user information is passed through Discourse post-related features.
2025-08-06 17:00:34 -03:00
David Taylor b479f89572 DEV: Update concurrency for publish-assets to match tests (#34114)
This job only runs on `main`, so we don't want to cancel existing runs
when new commits land. This config now matches the behavior of
`tests.yml` on `main`
2025-08-06 12:02:56 +01:00
David Taylor 25904ea6e9 UX: Render emojis consistently on 404 page (#34115)
We were transforming emoji codes for 'popular' topics, but not 'recent'
topics
2025-08-06 11:14:23 +01:00
Régis Hanol ced043be3c FIX: 'destination_url' cookie handling (#33072)
Since the introduction of dedicated login and signup pages (as opposed
to modals), we've been seeing reports of issues where visitors aren't
redirected back to the "page" they were at when they initiated the
_authentication_ process.

Since we have a bazillion of ways a user might authenticate
(credentials, social logins, SSO, passkeys, discourse connect, etc...),
it's really hard to know what a change will impact.

The goal of this PR is to "simplify" the way we handle this "redirection
back to origin" by leveraging the use of a single `destination_url`
cookie set on the client-side.

The changes remove scattered cookie-setting code and consolidate the redirection logic to ensure users are properly redirected back to their original page after authentication.

- Centralized destination URL cookie management in routes and authentication flows
- Removed manual cookie setting from various components in favor of automatic handling
- Updated test scenarios to properly test the new redirection behavior
2025-08-06 10:09:01 +02:00
chapoi fea4d73787 UX: fix width on hidden-upload-field on the admin backup btn (#34103)
The hidden-upload-field input exceeds the parent width, which causes
horizontal scrollbars in certain situations

<img width="1848" height="1542" alt="image"
src="https://github.com/user-attachments/assets/d142760e-4a86-4480-83a5-b0964068d3e5"
/>

This commit makes sure it does not exceed the width of the button.

Alas, it's not a generalised solution for all instances, as there is no
way to select the variety of parent elements that would need to get
`position:relative`
2025-08-06 10:08:29 +02:00
Linca 4e304e7130 FEATURE: Add date range selector to staff action log (#33959)
This commit implements a date-time range selector to staff action log in
admin page, making it easier to filter and analyze the data.
Additionally, it allows to apply the date-time picker to the exported
file as well, reducing the exported file size.
2025-08-06 15:27:28 +08:00
Gary Pendergast 15b8b3b073 DEV: Clean up a couple of flaky theme customization specs. (#34109)
The `hides unecessary sections and buttons for system themes` spec was still be flaky after the previous fix. It seems like the `system?` method was not being properly stubbed on the theme object we have in the spec, so now it stubs all Theme objects, so that the corresponding theme object created in the Playwright thread will also be stubbed.

I've also tweaked the `cannot edit js, upload files or delete system themes`, the test was wrong, I suspect it was only passing when the checks managed to all run before the page loaded.
2025-08-06 11:42:22 +10:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 0ad996b4f5 Build(deps): Bump core-js from 3.44.0 to 3.45.0 (#34093)
Bumps
[core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js)
from 3.44.0 to 3.45.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
-
[Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/zloirock/core-js/commits/v3.45.0/packages/core-js)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-06 02:11:43 +02:00
Jordan VidrineandJarek Radosz dbc14ffbf2 DEV: Markup refactor (#34098)
This PR:

- removes DButton from being needed in the filter-tip list
- simplifies some of the CSS as well.
- normalized the font sizes in the tip list

|before|after|
|--|--|
|<img width="1956" height="796" alt="CleanShot 2025-08-05 at 09 17
51@2x"
src="https://github.com/user-attachments/assets/c4fca721-3c23-4535-93e2-9da5cf80b763"
/>|<img width="1976" height="924" alt="CleanShot 2025-08-05 at 09 17
17@2x"
src="https://github.com/user-attachments/assets/03dcf528-bd75-42b4-a651-b5fa122eff43"
/>|

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2025-08-06 08:58:38 +10:00
Sam 949645d190 DEV: attempt to de-flake concurrent spec (#34087)
Note, if this does now work we may have to simply skip in CI

Concurrent tests depend on timing of background threads and if scheduler
is overwhelmed stuff can take inconsistent amounts of time.
2025-08-06 08:57:42 +10:00
Kris 383760759b FEATURE: Add toggle for PM gists to Discourse AI (#34107)
This allows gists to appear in PM inboxes as well, and adds a spec for
gists (didn't have one previously).

The PM and public topic list gist preferences are stored separately, as
there may be cases where you'd want one and not the other.

<img width="2222" height="916" alt="image"
src="https://github.com/user-attachments/assets/f9792e30-ab65-452b-b8e1-7407d9d181e2"
/>
2025-08-05 16:22:54 -04:00
Jordan Vidrine d197e4e824 DEV: Apply styles to all category boxes (#34106) 2025-08-05 15:08:15 -05:00
David Taylor 2cdd4be030 DEV: Resolve d-toast.duration deprecation in bulk-topic-actions (#34104) 2025-08-05 19:47:03 +01:00
Kris f044719517 UX: Horizon theme, fix d-toc class on smaller screens (#34105)
Follow-up to
https://github.com/discourse/discourse/commit/7404e3f526fee93471a39a7f62cbb87bc76214ab,
The new `grid-template-columns: auto 8em;` style is too specific and was
overriding this on mobile, moving the query fixes it

Before: 
<img width="400" alt="image"
src="https://github.com/user-attachments/assets/7ea096f5-d9f7-4cce-b254-54e365060a33"
/>


After: 
<img width="400" alt="image"
src="https://github.com/user-attachments/assets/519e8689-abb3-4fe9-b196-4da85507766b"
/>
2025-08-05 14:30:27 -04:00
Sérgio Saquetim c6782e8434 DEV: Ensure user status tracking in poster-name is updated (#34086)
This commit refactors how user status is tracked in the `poster-name`
component. The previous implementation used lifecycle hooks and a custom
refresh method to start and stop tracking the user's status. The new
approach leverages the `helperFn` pattern to directly manage tracking
based on the component's lifecycle and its user argument. This change
improves reliability and code clarity, ensuring user status is tracked
and cleaned up appropriately without manual refresh logic.
2025-08-05 14:34:51 -03:00
chapoi 19fbb8295d UX: expose shift buttons for lists on touch-devices (#34102)
Meta request.

Makes sense to expose the buttons on touch-devices, otherwise it gets
very tricky to use.

| Before | After |
|--------|--------|
| <img width="1126" height="798" alt="CleanShot 2025-08-05 at 18 56
24@2x"
src="https://github.com/user-attachments/assets/f81f9213-1e5a-4b6e-bb85-0922faa1016f"
/> | <img width="1126" height="798" alt="CleanShot 2025-08-05 at 18 55
55@2x"
src="https://github.com/user-attachments/assets/da167903-dbc6-41ea-8d56-208949d9227c"
/> |
2025-08-05 18:59:05 +02:00
Roman Rizzi 7624d71ec5 FIX: 'custom' prefix was removed. Cleanup llm_report's model field (#34099) 2025-08-05 13:11:40 -03:00
benjandBennett Dungan 72e4e53fda FEATURE: add option to hide IP addresses from moderators (#33682)
# Hide IP Addresses from Moderators When `moderators_view_ips` is
Disabled

## Summary 
Feature Request Link -
https://meta.discourse.org/t/option-to-hide-ip-addresses-from-moderators/207715/51
This PR implements a feature to **hide IP addresses from moderators**
when the `moderators_view_ips` site setting is disabled. Previously,
moderators could view IPs in multiple locations across the admin UI.
This update ensures that IP addresses are visible to moderators when the
setting allows it.

## Changes Implemented  

### Backend Updates
- **Added `moderators_view_ips` site setting** in `site_settings.yml`
- **Updated `CurrentUserSerializer`** to include `can_see_ip` field
based on the user’s role and site setting.
- **Modified `AdminUserSerializer`** to restrict IP address visibility.
- **Updated `UsersController`** to prevent IP addresses from being
included in API responses.
- **Restricted IPs in `ScreenedIpAddressesController`** by throwing
`Discourse::InvalidAccess` if the user lacks permission.

### Frontend Updates
- **Hid "Screened IPs" tab** in `/admin/logs` when `moderators_view_ips`
is disabled.
- **Blocked direct access to `/admin/logs/screened_ip_addresses`** for
unauthorized users.
- **Updated `user-index.hbs` and `logs.hbs`** to conditionally hide IP
fields.

### UI Screenshots

New option for Admins in the Admin Security settings dashboard:
![Screenshot 2025-02-21 at 5 32
00 PM](https://github.com/user-attachments/assets/5b315434-7724-4cb9-a3dc-d88750df00a6)


Moderator's view before:
![Screenshot 2025-02-21 at 5 25
41 PM](https://github.com/user-attachments/assets/0fb269e2-db40-488b-b11d-8bdfbe2a5245)
Moderator's view after:
![Screenshot 2025-02-21 at 5 26
59 PM](https://github.com/user-attachments/assets/efb848b0-1d7f-4ec9-8238-d8ee4eddbbe1)

Moderator's view before:
![Screenshot 2025-02-21 at 5 23
52 PM](https://github.com/user-attachments/assets/226e6d63-df3e-45d0-833f-de52593a086e)
Moderator's view after:
![Screenshot 2025-02-21 at 5 23
15 PM](https://github.com/user-attachments/assets/af313af2-2329-46d1-827d-290243c320e5)

---------

Co-authored-by: Bennett Dungan <bennettdungan@gmail.com>
2025-08-05 10:09:02 -05:00
Rafael dos Santos Silva c2dfc495f6 FEATURE: Make HyDE optional in AI search (#34074) 2025-08-05 11:50:16 -03:00
Kris 37ebaf4c3c DEV: merge post-action-feedback CSS into common file (#34080)
Concerns this button feedback

<img width="190" height="152" alt="image"
src="https://github.com/user-attachments/assets/805a9258-2130-4e2e-99d4-50d9638c825b"
/>



This change is pretty straightforward, the desktop css includes all
styling for the `.post-action-feedback-alert`, so that can be simply
moved to common. The mobile alert was removed by
https://github.com/discourse/discourse/pull/31375 (because we open a
link modal instead)... so the mobile styles aren't actually applied
anywhere (no plugins either).
2025-08-05 10:44:26 -04:00
Jordan Vidrine 9bd4ac4ba8 UX: Sidebar changes & css cleanup (#34097) 2025-08-05 09:38:08 -05:00
Jordan Vidrine c9e3a3122c UX: subcategory image tweaks (#34083) 2025-08-05 08:47:14 -05:00
chapoi 4ffef9cd9f UX: use success colour for solved icon in topic list (#34092)
For increased clarity when scanning the topic list

| Before | After |
|--------|--------|
| <img width="678" height="243" alt="CleanShot 2025-08-05 at 09 57 01"
src="https://github.com/user-attachments/assets/72e25e99-40a2-4b3b-94c8-6cdedb006fef"
/> | <img width="678" height="243" alt="CleanShot 2025-08-05 at 09 56
41"
src="https://github.com/user-attachments/assets/b31c1b87-8620-4db2-9c4e-b1f1be038f73"
/> |
2025-08-05 15:36:16 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> eeecbe4ffd Build(deps-dev): Bump capybara-playwright-driver from 0.5.6 to 0.5.7 (#34096)
Bumps
[capybara-playwright-driver](https://github.com/YusukeIwaki/capybara-playwright-driver)
from 0.5.6 to 0.5.7.
-
[Commits](https://github.com/YusukeIwaki/capybara-playwright-driver/compare/0.5.6...0.5.7)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-05 15:08:50 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 0c3d386b98 Build(deps-dev): Bump annotaterb from 4.17.0 to 4.18.0 (#34095)
Bumps [annotaterb](https://github.com/drwl/annotaterb) from 4.17.0 to
4.18.0.
- [Changelog](https://github.com/drwl/annotaterb/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/drwl/annotaterb/compare/v4.17.0...v4.18.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-05 15:00:15 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 37423e39ee Build(deps-dev): Bump rubocop from 1.79.1 to 1.79.2 (#34094)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.79.1 to
1.79.2.
- [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.79.1...v1.79.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-05 14:59:24 +02:00
chapoi 7404e3f526 UX: Horizon > apply small styling fixes for discotoc plugin (#33826)
Reset the `.container .post` grid to default, so the discotoc area isn't
too cramped. [only applies when the discotoc plugin is active]
Also applies some fixes (mini reposition + removal/reduction of
border-radius) to the timeline toggle button.

<img width="1128" height="780" alt="CleanShot 2025-07-24 at 16 56 38@2x"
src="https://github.com/user-attachments/assets/b3d8d37f-44e0-4ba1-b21a-68788a573d6f"
/>

⬇️ 

<img width="1128" height="780" alt="CleanShot 2025-07-24 at 16 55 15@2x"
src="https://github.com/user-attachments/assets/143aa58d-d578-4d77-a861-de45f3cd5fcc"
/>
2025-08-05 14:10:25 +02:00
Martin Brennan 37d1849de6 UX: Resize dmenu width for filter on window resize (#34091)
Since we don't have native floatkit/dmenu functionality (yet) to
make the menu stick to the width of the element, this is a
stopgap solution to make sure the menu stays the same width
as the filter input whether resizing the window or hiding/showing
the menu.
2025-08-05 17:44:06 +10:00
Natalie Tay c61a6f83e7 FEATURE: Localize topic titles in notifications and bookmarks (#34059)
Localizes topic titles in these areas
- user notification
- bookmarks

This commit also updates the user notification bookmark list to use fancy
title instead of title, similar to the other user notification tabs.
2025-08-05 12:12:22 +08:00
Jordan VidrineandMartin Brennan acf3d73e63 UX: Add category badges to category filter tip results (#34078)
This PR adds category badges to be shown in the filter tips menu.

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2025-08-05 13:46:18 +10:00
Krzysztof Kotlarek 025f5ba1e1 DEV: temporarily disable flaky color palette spec (#34088) 2025-08-05 11:27:55 +08:00
Kelv c648160d3f DEV: use floatkit autocomplete for chat composer (#33980)
This PR ports the floatkit-based autocomplete system to chat composer
under a site setting, providing consistent UX across both regular and
chat composers.

### Key Changes

* Adds floatkit_autocomplete_chat_composer setting (defaults to true)
* Adds `fixedTextareaPosition` option and
`createVirtualElementAtTextarea` to DAutocompleteModifier to allow for
positioning of the autocomplete menu relative to the whole textarea
bounds instead of following the cursor - this is better for chat UI &
aligns with current behaviour
2025-08-05 10:43:58 +08:00
Martin Brennan c3e4dd4db6 DEV: Convert FilterTips to use DMenu and refactor components (#33999)
* Use DMenu for the filter tips UI
* Move the input, filtering, and DMenu into the same
`FilterNavigationMenu` component to avoid input event listener
shenanigans
* General renaming, refactors, adding comments
* Move searching/suggestion logic for specific types of filter out into
`FilterSuggestions` lib to avoid cluttering the component
2025-08-05 12:10:40 +10:00