2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-10-03 17:21:20 +08:00
Commit graph

61292 commits

Author SHA1 Message Date
Alan Guo Xiang Tan
109212127a
FIX: Clicking on subject in admin email logs broken (#35030)
This was a regression introduced in
f0069a4fab where clicking on an email
log's subject link did not open a modal that displays the details of the
incoming email.

In this commit, the following changes were also made:

1. Make all `admin-email-logs/*` routes inherit from the same parent
route.
   Having two different parent routes doing the same thing was probably
   something that was missed in the refactor previously.
2025-10-01 10:04:27 +08:00
David Taylor
844a1607cb
DEV: Resolve deprecated route names in rss-polling (#35084)
Some checks failed
Licenses / run (push) Has been cancelled
Linting / run (push) Has been cancelled
Migration Tests / Tests (push) Has been cancelled
Publish Assets / publish-assets (push) Has been cancelled
Tests / core backend (push) Has been cancelled
Tests / plugins backend (push) Has been cancelled
Tests / core frontend (Chrome) (push) Has been cancelled
Tests / plugins frontend (push) Has been cancelled
Tests / themes frontend (push) Has been cancelled
Tests / core system (push) Has been cancelled
Tests / plugins system (push) Has been cancelled
Tests / themes system (push) Has been cancelled
Tests / core frontend (Firefox ESR) (push) Has been cancelled
Tests / core frontend (Firefox Evergreen) (push) Has been cancelled
Tests / chat system (push) Has been cancelled
Tests / merge (push) Has been cancelled
2025-09-30 22:07:07 +01:00
David Taylor
347a8c96b7
DEV: Clear caches properly in admin_color_palette_config_area_spec (#35087)
This resolves the flaky spec we're seeing on
`system/admin_color_palette_config_area_spec.rb:157`

`--bisect` minimal repro was:

```
bin/rspec './spec/system/admin_color_palette_config_area_spec.rb[1:9,1:12]' --tag ~type:multisite --order random:3906
```
2025-09-30 22:06:55 +01:00
Penar Musaraj
ca87a301af
FIX: Translate string in search 404 page (#35090) 2025-09-30 16:30:00 -04:00
Jordan Vidrine
132e15760f
UX: Remove love background on hover (#35089) 2025-09-30 15:26:07 -05:00
Jordan Vidrine
be4b3dbe9f
UX: Fix hover effect on heart icon in double-like button (#35086) 2025-09-30 14:34:38 -05:00
Sérgio Saquetim
480a24e754
DEV: Replace deprecated Ember's native array any with some (#35010)
Replaces deprecated usage of the Ember's native array extension `.any()`
function with `.some()` across several JavaScript files in the project.
This is a purely refactoring change intended to modernize the codebase
to follow current JavaScript standards.

**Main Changes:**

* Replaced .any() with .some() for array handling in 25 instances across
various files.
* Updated deprecation workflow to handle the any() and related
deprecations explicitly.
2025-09-30 15:49:13 -03:00
Sérgio Saquetim
74b2103d23
DEV: Replace deprecated Ember's array replace with native splice (#35019)
* Replace uses of Ember’s deprecated array extension .replace with
native .splice, using TrackedArray where reactivity is needed
(components and tests)
* Modernize TopicController computed properties to getters with
@dependentKeyCompat to preserve reactivity without Ember array
extensions
* Adjust history modal action signature to destructure the argument as
[bodyDiff]
* Add a deprecation-workflow entry for
discourse.native-array-extensions.replace to improve logging
* Add an Ember 6.6.0 patch to ensure isMutableArray excludes native
arrays, preventing false detection as MutableArray
2025-09-30 15:31:19 -03:00
David Taylor
60382d812a
DEV: Update invite spec for DST handling (#35079)
The invite system uses the inviter's timezone to determine the
expiration time (see
0dd1ee2e09)

Now that DST change is less than 90 days away for me, the spec started
failing locally. We should update the spec to use the inviter's
timezone, just like core's own logic
2025-09-30 19:18:09 +01:00
David Taylor
13820a307b
DEV: Resolve flaky system/composer/category_templates_spec.rb:431 (#35077)
We need to ensure that the upload is finished before we create the new
topic
2025-09-30 19:17:57 +01:00
Renato Atilio
9fba48486d
FIX: topic pagination overflow with deleted posts (#35081)
Uses the topic's pre-calculated `posts_count` instead of
`highest_post_number` to determine if the pagination overflows and
should return a 404.
2025-09-30 14:36:12 -03:00
Selase Krakani
9e85544f72
DEV: Add support for converting and importing topic_allowed_users (#35040)
This adds converter(Discourse-only, for now) and importer steps for
`topic_allowed_users`
2025-09-30 17:01:38 +00:00
Blake Erickson
d501952f25
DEV: Move convert video job to upload after create (#35013)
This moves the logic for creating the convert_video job to the upload
after_create hook so that we ensure there is an upload_id. When this
logic
was in the s3 store and direct to s3 uploads was enabled the convert
video job
would never fire because we didn't have an upload_id.
2025-09-30 10:58:07 -06:00
Joffrey JAFFEUX
e61dbabcc4
DEV: more resilient get_rgb_color (#35080)
There are two parts to get this right:
- wait for the element
- wait for the element to have the color we expect

This should correctly handle this.
2025-09-30 18:56:12 +02:00
Joffrey JAFFEUX
78a00e8414
FIX: force update size on full calendar (#35075)
We are not sure of the reasons but there are multiple similar (yet not
exactly the same) reports of resizing issues with calendar causing this
exact same `width: 0` state we have experienced.
2025-09-30 18:13:42 +02:00
chapoi
5fa95b69e4
UX: Post notices part 2 (#35049)
Addition to #34988: 
* we also need to apply the new styling to the returning-user
* we need to keep the custom (= official) notices
* added a different background to the official notice
* update the settings copy to make this difference clear
2025-09-30 09:02:09 -06:00
Discourse Translator Bot
5fbadcc2ec
Update translations (#35065) 2025-09-30 16:06:14 +02:00
David Taylor
0d6227d0bc
FIX: Topic footer dropdown/anonymousOnly null handling (#35072)
Followup to 813b494730
2025-09-30 14:58:52 +01:00
Jarek Radosz
1a6bf7d0a7
DEV: Remove obsolete register_svg_icon checks (#35067) 2025-09-30 15:51:44 +02:00
Jarek Radosz
60dadd2166
DEV: Remove unnecessary freeze calls (#35064)
All those files have `# frozen_string_literal: true`
2025-09-30 15:36:16 +02:00
dependabot[bot]
1ef5d7e0f2
Build(deps-dev): Bump webpack from 5.101.3 to 5.102.0 (#35053)
Bumps [webpack](https://github.com/webpack/webpack) from 5.101.3 to
5.102.0.
- [Release notes](https://github.com/webpack/webpack/releases)
-
[Commits](https://github.com/webpack/webpack/compare/v5.101.3...v5.102.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-09-30 14:45:53 +02:00
dependabot[bot]
c19739f481
Build(deps): Bump the fullcalendar group with 4 updates (#34686)
Bumps the fullcalendar group with 4 updates:
[@fullcalendar/core](https://github.com/fullcalendar/fullcalendar/tree/HEAD/packages/core),
[@fullcalendar/daygrid](https://github.com/fullcalendar/fullcalendar/tree/HEAD/packages/daygrid),
[@fullcalendar/list](https://github.com/fullcalendar/fullcalendar/tree/HEAD/packages/list)
and
[@fullcalendar/timegrid](https://github.com/fullcalendar/fullcalendar/tree/HEAD/packages/timegrid).


Updates `@fullcalendar/core` from 6.1.18 to 6.1.19
- [Release notes](https://github.com/fullcalendar/fullcalendar/releases)
-
[Changelog](https://github.com/fullcalendar/fullcalendar/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/fullcalendar/fullcalendar/commits/v6.1.19/packages/core)

Updates `@fullcalendar/daygrid` from 6.1.18 to 6.1.19
- [Release notes](https://github.com/fullcalendar/fullcalendar/releases)
-
[Changelog](https://github.com/fullcalendar/fullcalendar/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/fullcalendar/fullcalendar/commits/v6.1.19/packages/daygrid)

Updates `@fullcalendar/list` from 6.1.18 to 6.1.19
- [Release notes](https://github.com/fullcalendar/fullcalendar/releases)
-
[Changelog](https://github.com/fullcalendar/fullcalendar/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/fullcalendar/fullcalendar/commits/v6.1.19/packages/list)

Updates `@fullcalendar/timegrid` from 6.1.18 to 6.1.19
- [Release notes](https://github.com/fullcalendar/fullcalendar/releases)
-
[Changelog](https://github.com/fullcalendar/fullcalendar/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/fullcalendar/fullcalendar/commits/v6.1.19/packages/timegrid)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-30 14:44:24 +02:00
Jarek Radosz
e372355fd0
DEV: Clean up scope resolution operators in plugins (#34979)
Co-authored-by: Loïc Guitaut <loic@discourse.org>
2025-09-30 14:36:34 +02:00
Osama Sayegh
dbc7942111
DEV: Add plugin outlet to components config area and data-theme-id to themes grid (#35006)
These are needed for adding custom elements to the page and targeting
specific themes with CSS in plugins.
2025-09-30 15:05:08 +03:00
Selase Krakani
e70b60ff7f
DEV: Add support for converting and importing topics (#34767)
This adds converter(Discourse-only, for now) and importer steps for
`topics`.
2025-09-30 11:52:22 +00:00
Joffrey JAFFEUX
c909c79b28
FIX: uses css selector to ensure we use waiters (#35063) 2025-09-30 13:01:36 +02:00
Natalie Tay
32c440aa47
UX: Update strings for filter (#35062)
```
Filter topics by in personal lists
```
to
```
Filter topics in personal lists
```

Thanks to ghpijffers on crowdin.
2025-09-30 17:25:33 +08:00
Joffrey JAFFEUX
521500f8b7
FIX: correctly replace emojis in bookmark reminder (#35061)
- The menu item logic was incorrect as it was bypassing replacing emoji
if we already had a `safeString` object but in this case the emojis had
not been replaced yet. We now have the superior `replaceEmoji` pattern
which will handle this complexity correctly.

- `replaceEmoji` was not called in `bookmark-list`
2025-09-30 11:16:05 +02:00
David Taylor
e797bb5d5f
DEV: Improve turbo_rspec and flaky-test output (#35059)
1. Use relative paths instead of absolute. This will make the commands
portable to other machines, and matches the out-the-box behavior of the
regular rspec command

2. Strip out some 'infrastructure' ENV and params from the
rerun_command, so that it's easier to copy/paste and run locally
2025-09-30 10:01:58 +01:00
Joffrey JAFFEUX
d04089c49f
DEV: adds support for disabled in select-kit (#35037)
If you row has `disabled` as property it will be used to disable the
row.
2025-09-30 10:48:35 +02:00
dependabot[bot]
8870c67d08
Build(deps): Bump the prosemirror group across 1 directory with 2 updates (#33719)
---
updated-dependencies:
- dependency-name: prosemirror-model
  dependency-version: 1.25.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prosemirror
- dependency-name: prosemirror-view
  dependency-version: 1.40.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: prosemirror
...

Signed-off-by: dependabot[bot] <support@github.com>

> **Note**
> Automatic rebases have been disabled on this pull request as it has
been open for over 30 days.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Renato Atilio <renato@discourse.org>
2025-09-30 10:33:58 +02:00
dependabot[bot]
ee0b9a3953
Build(deps): Bump postcss-js from 5.0.0 to 5.0.1 (#35052)
Bumps [postcss-js](https://github.com/postcss/postcss-js) from 5.0.0 to
5.0.1.
- [Release notes](https://github.com/postcss/postcss-js/releases)
-
[Changelog](https://github.com/postcss/postcss-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss-js/compare/5.0.0...5.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-30 10:31:26 +02:00
David Taylor
425124d7b1
DEV: Skip loading login/signup controller when redirecting (#35043)
Loading the controller and its template causes a request to `hp.json`,
which can then trigger a race condition with `/session/csrf.json` if an
external auth is in-progress. This commit updates the redirect behavior
so that the the `beforeModel` hook never resolves, and therefore the
transition remains in a pending state until the redirect updates
`window.location`.

This also improves the UX, since there is no need for a flash of a
loading spinner. Instead, the normal route transition animation will
keep running until the redirect is complete.
2025-09-30 09:05:26 +01:00
David Taylor
9eed5b1c89
DEV: Ensure prebuilt assets are compiled for the beta tag (#35060)
Our current release process involves pushing two commits to `main`
simultaneously. The first is tagged `beta`, and then the second begins
the new `-latest` cycle for the next beta version. Since they're pushed
together, GitHub only triggers a single 'push' event for the most recent
commit.

This commit updates the publish-assets workflow so that it's also
triggered when the `beta` tag is attached to a new commit. That'll
ensure that assets are built & published for that specific commit, which
is accessible via the `beta` tag and the version-specific tags.
2025-09-30 09:04:27 +01:00
Martin Brennan
ac1d0e38ce
DEV: Properly clean up global setting overrides in specs (#35058)
In the `SiteSettingExtension`, when calling
`SiteSetting.send(:setting_name, value)`,
if the setting counts as a global one, we add it to the list of hidden
and shadowed site settings in memory. However, when using the
`global_setting` helper in specs, we were not cleaning up these
overrides after the spec finished, leading to potential flakiness
in tests that rely on the visibility of site settings.

The fix is to just remove the setting from the hidden and shadowed
list after the spec is done.
2025-09-30 17:44:41 +10:00
Charles Lechasseur
14ee6bd67d
FIX: Avoid returning duplicate voters from /polls/voters.json endpoint (#34433)
When fetching voters from the `/polls/voters.json` API endpoint, each
page after the first has an extra voter (the last one from the previous
page). This causes duplicate voters to be returned if loading multiple
pages. This PR fixes the off-by-one error that causes this. (This fix
has initially been proposed by Rob Mackenzie.)

The PR also fixes an issue that could cause non-deterministic ordering
of results from that API; however, I have not been able to craft a test
to reproduce the issue, so the fix is theoretical.

Reported here:
https://meta.discourse.org/t/polls-voters-json-returning-duplicate-users-across-paged-requests/376636
2025-09-30 15:06:01 +08:00
Alan Guo Xiang Tan
a3018bafa9
Bump version to v3.6.0.beta2-latest 2025-09-30 10:39:08 +08:00
Alan Guo Xiang Tan
d63a24313a
Bump version to v3.6.0.beta1 2025-09-30 10:39:07 +08:00
Roman Rizzi
49558abd9e
SECURITY: AI helper suggestions based on a topic should check user has access to it 2025-09-30 10:09:49 +08:00
Gerhard Schlager
2b6675f064
SECURITY: Use nonce-based restrictions during restore 2025-09-30 10:09:46 +08:00
Martin Brennan
6aae74d082
SECURITY: Rich editor chat transcript XSS
When quoting from a channel or a thread, the title
of the channel and the title of the thread could be
an XSS vector when CSP is disabled.
2025-09-30 10:09:43 +08:00
Alan Guo Xiang Tan
e2fd3e32d9
DEV: Add missing e2e tests for viewing admin email logs (#35033) 2025-09-30 09:02:30 +08:00
Martin Brennan
cc0e2fe00b
DEV: Add basic system spec for discourse-reaction on post (#35029)
Covers default reactions,
`discourse_reactions_experimental_allow_any_emoji`,
`discourse_reactions_enabled_reactions`, and interaction with the
`emoji_deny_list` setting from core.

---------

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2025-09-30 10:29:34 +10:00
dependabot[bot]
c8997edcdf
Build(deps-dev): Bump lefthook from 1.13.4 to 1.13.5 (#35050)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.13.4
to 1.13.5.
- [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.13.4...v1.13.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-30 02:13:39 +02:00
Kris
a7d77e4229
UX: remove <b> tag from move post modal to avoid double-bolding (#35048)
Some checks are pending
Licenses / run (push) Waiting to run
Linting / run (push) Waiting to run
Migration Tests / Tests (push) Waiting to run
Publish Assets / publish-assets (push) Waiting to run
Tests / core backend (push) Waiting to run
Tests / plugins backend (push) Waiting to run
Tests / core frontend (Chrome) (push) Waiting to run
Tests / plugins frontend (push) Waiting to run
Tests / themes frontend (push) Waiting to run
Tests / core system (push) Waiting to run
Tests / plugins system (push) Waiting to run
Tests / themes system (push) Waiting to run
Tests / core frontend (Firefox ESR) (push) Waiting to run
Tests / core frontend (Firefox Evergreen) (push) Waiting to run
Tests / chat system (push) Waiting to run
Tests / merge (push) Blocked by required conditions
When a bold font is used within a `b` tag, some browsers will apply a
faux bold that's *too* bold — since we're already applying a bold
font-weight in CSS we don't need these `b` tags anyway

too bold:
<img width="400" alt="image"
src="https://github.com/user-attachments/assets/731dee00-d3bd-41a2-9c19-c6104c9edcf5"
/>
2025-09-29 17:27:39 -04:00
Keegan George
ad21ae98ff
FEATURE: Bulk select posts and delete drafts (#34972)
## 🔍 Overview

This PR adds bulk selection functionality to the PostList component and
implements optimized bulk deletion for the drafts page. Users can now
select multiple drafts and delete them all at once with a single network
request, significantly improving performance and user experience.

The implementation includes:
- A new reusable bulk selection system for PostList components
- Optimized bulk delete endpoint that reduces network requests by 90%
- Comprehensive bulk controls UI with select all/clear all functionality
- Shift+click range selection similar to topic lists
- Complete test coverage for all new functionality

##  More details

**Bulk Selection System**

The PostList component now supports optional bulk selection through
these new parameters:

- `@bulkSelectEnabled={{true}}` - Shows checkboxes next to each post
- `@bulkSelectHelper={{helper}}` - Manages selection state (use
`PostBulkSelectHelper`)
- `@bulkActions={{actions}}` - Array of bulk action objects for the
dropdown menu

**Usage Example:**
```gjs
import Component from "@glimmer/component";
import { action } from "@ember/object";
import didUpdate from "@ember/render-modifiers/modifiers/did-update";
import PostBulkSelectHelper from "discourse/lib/post-bulk-select-helper";

export default class MyComponent extends Component {
  bulkSelectHelper = new PostBulkSelectHelper(this);

  constructor() {
    super(...arguments);
    // Initial updatePosts call
    this.updateBulkSelectPosts();
  }

  @action
  updateBulkSelectPosts() {
    if (this.shouldEnableBulkSelect && this.args.posts) {
      this.bulkSelectHelper.updatePosts(this.args.posts);
    }
  }

  get showBulkSelectHelper() {
    return this.shouldEnableBulkSelect ? this.bulkSelectHelper : null;
  }

  get bulkActions() {
    return [
      {
        label: "delete_selected",
        icon: "trash-can", 
        action: this.handleBulkDelete,
        class: "btn-danger"
      }
    ];
  }

  <template>
    <PostList 
      @posts={{@posts}}
      @bulkSelectEnabled={{this.shouldEnableBulkSelect}}
      @bulkSelectHelper={{this.showBulkSelectHelper}}
      @bulkActions={{this.bulkActions}}
      {{didUpdate this.updateBulkSelectPosts @posts}}
    />
  </template>
}
```

**Performance Optimization**

The drafts page now uses a new bulk delete endpoint (`DELETE
/drafts/bulk_destroy`) that:
- Processes multiple drafts in a single HTTP request instead of N
individual requests
- Uses database transactions for atomic operations (all-or-nothing)  
- Reduces database queries from 2N to 2 total queries
- Validates draft sequences upfront to fail fast on conflicts

**Technical Implementation**

- `PostBulkSelectHelper`: New helper class for managing selection state
with support for individual selection, range selection (shift+click),
and bulk operations with reactive posts tracking
- `PostListBulkControls`: New component providing selection count,
select all/clear all buttons, and bulk actions dropdown
- Enhanced PostList and PostListItem components with conditional bulk
selection UI
- Updated user-stream component to use optimized bulk deletion with
automatic selection cleanup
- Comprehensive styling with responsive design

**API Changes**

- New controller action: `DraftsController#bulk_destroy`
- New route: `DELETE /drafts/bulk_destroy`
- New JavaScript method: `Draft.bulkClear(drafts)`
- Enhanced `PostBulkSelectHelper` with `updatePosts()` method for
reactive data updates
- Fully backward compatible - existing single delete functionality
unchanged

**Testing**

- 9 new controller specs covering bulk deletion edge cases, validation,
and API access
- 11 integration tests for PostList bulk selection functionality  
- 10 system specs for end-to-end drafts page bulk selection workflows
- All existing tests continue to pass

## 📹 Screen Recording


https://github.com/user-attachments/assets/2d5a9b38-f1cb-43ee-88ac-285b71083612
2025-09-29 12:47:54 -07:00
Sérgio Saquetim
813b494730
DEV: Replace deprecated Ember's array filterBy with filter (#35018)
Replaces Ember's deprecated `filterBy` with the native JavaScript method
`filter`. This aligns with modern JavaScript practices, improves code
clarity, and prepares for future deprecations.

Changes involve various components, controllers, and models across the
codebase.
2025-09-29 16:42:38 -03:00
David Taylor
9633079d4c
DEV: Fully revert @swc/core to 1.13.5 (#35046)
Follow-up to e81e3bebff, which missed the
version in the nested package.
2025-09-29 20:13:21 +01:00
David Taylor
ab07d11425
UX: Enable 'viewport based mobile mode' by default (#35036)
https://meta.discourse.org/t/384280

Co-authored-by: Sérgio Saquetim <1108771+megothss@users.noreply.github.com>
2025-09-29 19:46:52 +01:00
Kris
809aecdee6
UX: improve AI translations chart colors in dark mode (#35042) 2025-09-29 14:38:22 -04:00