Commit Graph
373 Commits
Author SHA1 Message Date
Natalie Tay 3bb19668d2 UX: Use inline title editor instead of composer when editing translation (#36847)
This commit undoes the work here
https://github.com/discourse/discourse/pull/36099 and here
https://github.com/discourse/discourse/pull/36817, (and prevents the
need for https://github.com/discourse/discourse/pull/36836) to favour
the inline title editor.



https://github.com/user-attachments/assets/d7444ed7-dd62-40b0-862b-509787e81f56
2025-12-24 00:56:36 +08:00
Régis Hanol 8830c1bb32 FIX: API key scopes display and navigation issues (#36844)
Two issues were occurring with the admin API keys page:

1. Clicking "Edit" on an API key in the list failed to navigate properly
because the full apiKey object was passed to the route instead of just
the ID.

2. Viewing an API key with scopes would error when a scope's
allowed_parameters was null/undefined, as the template tried to call
`get` on a nullish value.

**BEFORE**

https://github.com/user-attachments/assets/a1c3a54f-7d26-4498-95e3-fd734b2e9a61

**AFTER**

https://github.com/user-attachments/assets/d560a189-566f-4f85-a76a-266b9ac95bed
2025-12-23 17:56:12 +01:00
Kris a42d691838 UX: fix edit reason button position when localization is enabled on small screens (#36839)
Minor follow-up to https://github.com/discourse/discourse/pull/36837

This fixes wrapping of the post edit reason button when post
localization is enabled too


Before (the ℹ️ button wraps): 
<img width="996" height="158" alt="image"
src="https://github.com/user-attachments/assets/a6857ade-7c22-4621-9753-496968d6a4a4"
/>
<img width="996" height="198" alt="image"
src="https://github.com/user-attachments/assets/3616cfa5-ae08-4571-a532-a02f727fd64b"
/>


After: 
<img width="982" height="102" alt="image"
src="https://github.com/user-attachments/assets/70fc8a19-eeed-405e-aee5-7b4617059821"
/>
<img width="994" height="198" alt="image"
src="https://github.com/user-attachments/assets/2ae4557c-2967-424e-a82e-545285797653"
/>
2025-12-23 10:26:05 -05:00
Sam 62f797c3de FIX: Plus encoding (+) was not handled correctly in onebox and UI (#36822)
Two bugs: 

1. The UI for Add link was over ambitious and over encoding / under
encoding URLs. The main fix is using URL here which we use elsewhere in
Discourse to do the encoding.

2. The Onebox system was encoding `+` which is a valid query param sub
component.
2025-12-23 14:32:22 +11:00
Régis Hanol 6a11ded0c8 UX: Prevent header search flash when welcome banner is visible (#36834)
The IntersectionObserver callback is asynchronous, which means
`welcomeBannerSearchInViewport` remains `false` for a brief moment after
the welcome banner renders. This causes the header search to flash
briefly before being hidden.

Add a synchronous viewport check using `isElementInViewport()`
immediately after setting up the observer. This sets the correct initial
state before the first async callback fires.

Ref - t/171300
2025-12-22 18:09:38 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 808ced37c0 DEPS: Bump moment-timezone from 0.5.45 to 0.6.0 (#36833)
Bumps [moment-timezone](https://github.com/moment/moment-timezone) from
0.5.45 to 0.6.0.
- [Release notes](https://github.com/moment/moment-timezone/releases)
-
[Changelog](https://github.com/moment/moment-timezone/blob/develop/changelog.md)
-
[Commits](https://github.com/moment/moment-timezone/compare/0.5.45...0.6.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-22 16:52:57 +00:00
small-lovely-cat 7fe38ebaba FIX: Disable load_more_replies button until more replies are loaded (#36816)
In PR #35136, a debounce logic is added to the reply button. However, a
similar issue occurs in the "load_more_replies" button as well.

This commit fix the issue by adding disable logic to the
`load_more_replies` button, so that the button is also disabled when
loading, and this issue is solved.

Before:


https://github.com/user-attachments/assets/7700a70d-3d8d-4837-8286-1f3bb8fc3006

After:


https://github.com/user-attachments/assets/f12bc001-d9c9-46d6-93a0-2f57d8e1584a
2025-12-22 11:41:31 -05:00
Natalie Tay e39c0d5d96 FIX: Only save post if post content changed when editing title (#36817)
This bug happens when a user is attempting to update topic metadata
while viewing a post.

When updating the topic's tags, `editPost()` calls both `Topic.update()`
and `post.save()`. The topic saves fine, but the `post.save()` is
unnecessary since content didn't change and can fail with permission
errors in certain contexts (e.g. viewing a translated topic).


Meta topic:
https://meta.discourse.org/t/editing-title-category-tags-brings-up-full-editor-saving-says-you-are-not-permitted-to-view-the-requested-resource/391459
2025-12-22 11:49:57 +08:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1c55c72586 Build(deps): Bump immer from 11.0.1 to 11.1.0 (#36821)
Bumps [immer](https://github.com/immerjs/immer) from 11.0.1 to 11.1.0.
- [Release notes](https://github.com/immerjs/immer/releases)
- [Commits](https://github.com/immerjs/immer/compare/v11.0.1...v11.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-21 22:31:05 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> af423edaf7 Build(deps): Bump @rollup/browser from 4.53.5 to 4.54.0 (#36820)
Bumps [@rollup/browser](https://github.com/rollup/rollup) from 4.53.5 to
4.54.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.53.5...v4.54.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-21 22:29:51 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 405c03869f Build(deps-dev): Bump sinon from 21.0.0 to 21.0.1 (#36818)
Bumps [sinon](https://github.com/sinonjs/sinon) from 21.0.0 to 21.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
-
[Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v21.0.0...v21.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-21 22:25:47 +01:00
Jordan Vidrine 9cc884d289 UX: Add animations to closing DMenu content (#36737) 2025-12-19 14:17:53 -06:00
Jordan Vidrine d8e24b999e UX: fix placement of "new new" menu (#36808) 2025-12-19 11:02:23 -06:00
Natalie Tay a6462a110c FIX: Also show the 'post language indicator' when the post gets updated to translated content (#36806)
When a post is translated, we immediately replace the content based on
the user's language, but miss out updating the language indicator.

This commit fixes that.
2025-12-20 00:57:57 +08:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 2fb8658d09 Build(deps-dev): Bump @swc/core from 1.15.5 to 1.15.7 (#36793)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.15.5 to
1.15.7.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/swc-project/swc/compare/v1.15.5...v1.15.7)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-19 15:40:20 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 57a117f457 Build(deps-dev): Bump ember-cli-deprecation-workflow from 3.4.0 to 4.0.0 (#36792)
Bumps
[ember-cli-deprecation-workflow](https://github.com/ember-cli/ember-cli-deprecation-workflow)
from 3.4.0 to 4.0.0.
- [Release
notes](https://github.com/ember-cli/ember-cli-deprecation-workflow/releases)
-
[Changelog](https://github.com/ember-cli/ember-cli-deprecation-workflow/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/ember-cli/ember-cli-deprecation-workflow/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-19 15:39:36 +01:00
Régis Hanol 7bdb407894 FIX: Restore bold usernames on the about page (#36803)
The changes introduced in PR #36482 broke username
styling by swapping the content between `.username` and `.name` spans
based on the `prioritizeNameInUx` setting. This caused usernames to lose
their bold styling since CSS targets elements by class name, not
content.

This fix removes the custom AboutPageUser component and reuses the
existing UserInfo component instead. UserInfo handles name priority
correctly by using a `--name-first` CSS modifier class to change visual
order via flexbox, while keeping the username content in the `.username`
span where the bold styling is applied.

The page object for system specs is updated to detect which display mode
is active by checking for the `--name-first` class, then mapping the
span contents accordingly.

Ref - https://meta.discourse.org/t/391706

**BEFORE**

<img width="1510" height="1293" alt="2025-12-19 @ 11 36 13"
src="https://github.com/user-attachments/assets/56e1460e-30e9-41a4-92f7-c49bf9c3b9da"
/>

**AFTER**

<img width="1510" height="1293" alt="2025-12-19 @ 11 36 06"
src="https://github.com/user-attachments/assets/c92d165d-edaa-47e1-97fb-c6518ed3bbfe"
/>
2025-12-19 14:54:20 +01:00
Natalie Tay 72c572f6c0 DEV: Remove warning indicating category.find is called with non-int (#36782)
All components (approx 57 instances) that use the following type of
setting in their `settings.yml`...

```
setting_name:
  type: list
  list_type: category
```

... will have the following warning shown.

```
Category.findById called with a string ID
```

This warning is not very useful, as it is already mitigated directly
below by doing a `id = parseInt(id, 10);`.

Originally introduced here:
https://github.com/discourse/discourse/pull/26342
2025-12-19 17:07:08 +08:00
Bryce Huhtala f3d4568b5b UX: Add render check for multi-select caret icon (#36796)
Prevents a console error when the icon is null due to max item
validation being reached.

[Related meta
topic](https://meta.discourse.org/t/svg-icon-missing-error-with-dropdown-settings-in-theme-object-settings-when-max-input-is-reached/391708/2)

### Before / After

<img width="1516" height="955" alt="image"
src="https://github.com/user-attachments/assets/dad7cee2-93d0-4559-a28b-bffcc4c87b70"
/>
2025-12-18 19:19:00 -05:00
Martin Brennan bcc76705a9 UX: Minor what's new card improvements (#36797)
* Add spacing between month groups
* Make month title bigger than item title
2025-12-19 10:06:49 +10:00
Kris 59d53dc18a UX: add admin sidebar icons for preinstalled plugins (#36764)
Currently all our preinstalled plugins use the default "gear" icon from
fontawesome — this PR adds unique icons for each of them using a new
plugin API method, `setAdminPluginIcon()`. Plugins without an icon
defined will still fall back to the gear icon.


Before:
<img width="250" alt="image"
src="https://github.com/user-attachments/assets/06b5c6e7-0aae-44f8-b8ee-1486b98bfc6b"
/>


After: 
<img width="250" alt="image"
src="https://github.com/user-attachments/assets/46d45d4b-6c75-4473-ae53-1a0e71c4d6fb"
/>
2025-12-18 16:39:00 -05:00
Sérgio Saquetim 4d05bf8a68 DEV: Refactor deprecation workflow to support notify-admin handler (#36759)
Revised the deprecation handling to introduce a new `notify-admin`
handler, replacing the previous `CRITICAL_DEPRECATIONS` approach. This
ensures a more flexible and maintainable configuration while preserving
admin notifications for key deprecations.

Updated tests and validation logic to reflect the new `notify-admin`
behavior, including compatibility checks to prevent invalid handler
combinations such as `notify-admin` with `silence`. Also streamlined
handler naming by replacing `counter` with `count` for consistency.
2025-12-18 15:15:02 -03:00
Penar MusarajandNatalie Tay 3baf375056 UX: Use English as language label where appropriate (#36762)
PR makes two changes: 

- replaces "English (US) with "English" everywhere
- in the language switcher dropdown, it replaces "English (UK)" with
"English" if that variant of English is the only one enabled

"English (US)" is needlessly geo-specific. Given it is the default
language, using "English" as the label is shorter and clearer. It still
differentiates from "English (UK)" when choosing the interface language
for users (or in admin UIs):

<img width="500" alt="CleanShot 2025-12-17 at 17 38 32@2x"
src="https://github.com/user-attachments/assets/abd7674c-2b72-4e5c-8543-050b7812c743"
/>

And the PR also strips `(UK)` from the language switcher list when
"English (UK)" is the only English variant enabled. This is a bit hacky,
but it lets us have cleaner UX (especially for countries like Canada,
Australia, where sites may opt for `en_GB` as their default) while
keeping the necessary technical separation between English and English
(UK) in admin and user preference screens.

---------

Co-authored-by: Natalie Tay <natalie.tay@gmail.com>
2025-12-18 13:10:23 -05:00
Joffrey JAFFEUX b0ef129930 FIX: legacy-array-like-object in listTags (#36775)
We were filtering directly a `ResultSet` instead of calling `content`
first.

This commit also adds test to cover the part of the listTags which was
incorrect and was not found when adding this deprecation.
2025-12-18 15:45:42 +01:00
Régis Hanol 6a7825baf3 FIX: Add local date support in poll options and improve rich editor date formatting (#36718)
This change enables local dates to render properly in poll options and
improves how dates are displayed in the rich editor.

What changed:

- Rich editor now displays localized, human-friendly dates (e.g., "Today
at 2:30 PM") instead of raw date strings ("2021-01-01 12:00:00") by
using LocalDateBuilder
- Poll options can now include local dates that are properly decorated
and interactive
- Added keyboard shortcut (Cmd/Ctrl+Shift+.) to insert current date
markup in poll option inputs
- Extracted reusable utilities: formatLocalDate for rendering and
generateCurrentDateMarkup for BBCode generation

How it works:

- New NULL_HELPER export in decorated-html provides a null-safe helper
object for contexts without a post/model, allowing HTML decorators to
work in poll options
- New Ember modifiers (decorate-cooked-content, decorate-poll-option)
apply decorators to poll content
- Tests updated to verify data attributes rather than text content,
since formatted dates vary by timezone

Internal ref - t/155024

**BEFORE/AFTER (markdown editor)**

<img width="1699" height="1327" alt="CleanShot 2025-12-16 at 11 59 22"
src="https://github.com/user-attachments/assets/ff9fbb2b-0f1b-41b7-b0fc-b59c73ed4e32"
/>
<img width="1699" height="1327" alt="CleanShot 2025-12-16 at 11 59 42"
src="https://github.com/user-attachments/assets/6b07beab-e864-4319-b97b-fe7abe2180e6"
/>

**BEFORE/AFTER (rich text editor)**

<img width="1699" height="1327" alt="CleanShot 2025-12-16 at 12 00 05"
src="https://github.com/user-attachments/assets/0f0e1a4b-0829-4e0e-94ac-90f16c4e52d5"
/>
<img width="1699" height="1327" alt="CleanShot 2025-12-16 at 11 59 52"
src="https://github.com/user-attachments/assets/d8db2e7a-c110-41bd-9fbf-b4af0f5de2c5"
/>
2025-12-18 13:30:42 +01:00
Régis Hanol a8e51fa832 UX: Sort admin sidebar plugin links alphabetically (#36674)
Plugins in the admin sidebar were displayed in an unpredictable order
based on load sequence. This makes it harder for admins to find specific
plugins, especially as the number of installed plugins grows.

Sort plugin links alphabetically by their translated display name, with
the internal plugin name as a secondary sort key for stability.

The sorting uses localeCompare for proper internationalization support.
2025-12-18 12:15:06 +01:00
Régis Hanol b66fca70d0 DEV: Add page-aware plugin APIs for saving user preferences (#36757)
Previously, plugins that needed to save user preferences on specific
preference pages had to either:

1. Manually register value transformers for
`preferences-save-attributes`
2. Use `modifyClass` to push fields to `saveAttrNames`

The second approach was broken because `saveAttrNames` is now a getter
that returns a fresh array each time, so pushed values were lost.

This commit introduces three new plugin APIs that handle the transformer
registration automatically:

- `addSaveableUserOption(name, { page })` - for `user_options` table
fields
- `addSaveableUserField(name, { page })` - for `user_fields` table
fields
- `addSaveableCustomFields(page)` - ensures `custom_fields` object is
saved on a page (auto-deduplicates across plugins)

The `{ page }` option specifies which preferences page triggers saving:
"account", "emails", "interface", "notifications", "profile",
"tracking", etc.

Also updates bundled plugins to use the new APIs:
- chat: `addSaveableUserOption` with `{ page: "emails" }` for email
frequency
- discourse-ai: `addSaveableUserOption` with `{ page: "interface" }`
- discourse-assign: `addSaveableUserOption` with `{ page: "tracking" }`,
`addSaveableCustomFields` with `"notifications"`
- discourse-policy: `addSaveableUserOption` with `{ page: "emails" }`
- discourse-rewind: `addSaveableUserOption` (no page, custom prefs page)

Deprecates `addSaveableUserOptionField` in favor of
`addSaveableUserOption`.

Ref - https://meta.discourse.org/t/391509

Follow up to ee1a1c7219
2025-12-18 10:58:16 +01:00
Régis Hanol 01eb7874a1 UX: Warn moderators before they lock themselves out of a category (#36663)
When moderators with `moderators_manage_categories` enabled change
category permissions, they could accidentally remove their own access,
requiring admin intervention to fix.

This adds a client-side confirmation dialog that warns moderators before
saving permission changes that would lock them out. If confirmed, the
changes are saved and the user is redirected to the home page.

Changes:
- Add `_wouldLoseAccess()` check in edit-category controller that
compares new permissions against the user's group memberships
- Show confirmation dialog via `dialog.yesNoConfirm()` before saving
- Redirect to home page after confirmed save (since user can no longer
access the category edit page)
- Fix `onSelectGroup` to properly set `group_id` for custom groups by
looking up from `site.groups` (was only working for auto groups)

Here's how the confirm dialog looks like

<img width="1606" height="1043" alt="CleanShot 2025-12-12 at 17 12 55"
src="https://github.com/user-attachments/assets/86e255dc-fa5c-4fde-8c86-3d3b0e03ce89"
/>


Ref - https://meta.discourse.org/t/390978
2025-12-18 09:47:27 +01:00
Régis Hanol d29f6a76b2 FIX: strip quotation marks from names in quote BBCode (#36666)
When "display name on posts" is enabled and "prioritize username in UX"
is disabled, quoting a user with quotation marks in their display name
(e.g., `John "The Dev" Smith`) breaks the quote markdown:

    [quote="John "The Dev" Smith, post:1, topic:2"]

The BBCode parser's regex `"([^"]+)"` stops at the first `"` inside the
name, capturing only `John ` instead of the full name.

Alternatives considered:

- Backslash escaping (`\"`): Would require updating the parser regex to
support escape sequences and adding unescape logic. Adds complexity and
risks breaking existing quotes.

- URL encoding (`%22`): Requires decoding when rendering. Using
`decodeURIComponent` on user input creates XSS risk. A safe decoder that
only decodes specific characters adds complexity and attack surface for
minimal benefit.

The simplest solution is to strip quotation marks from names when
building the quote BBCode. This is safe (no user input decoding), simple
(no parser changes), and the minor cosmetic loss in the quote
attribution is an acceptable trade-off.

The `stripQuotationMarks` function is defined alongside the existing
`QUOTATION_MARKS` array in bbcode-block.js to keep related logic
together and avoid duplication.

Ref - https://meta.discourse.org/t/391153
2025-12-18 09:46:31 +01:00
Alan Guo Xiang Tan 4023187af8 FIX: Edit sidebar tags navigation model "selected" filter not working (#36765)
What is the problem?

When a user does not have any tags configured to be displayed in the
sidebar, selecting the "selected" filter in the edit sidebar tags
navigation model was not displaying an empty state. Instead, it
displayed all the tags even though those tags were unselected.

The above behaviour is due to the fact that the client side was not
properly setting the `only_tags` param for the request to the
`/tags/list.json` endpoint
when the user has not selected any tags in the modal. As a result, the
endpoint ended up returning all the tags that are visible to the user.

What is the fix?

On the client side, we just have to avoid fetching tags when we already
know that the user has not selected any tags.
2025-12-18 10:34:48 +08:00
Martin Brennan 49f93d3177 FIX: Live update upcoming change body classes (#36748)
Followup 2fdc9af28e

We need to take into account the admin changing client
site settings, which sends a MessageBus evvent to the
client to update the siteSettings service. We need to
both:

* Update siteSettings.currentUserUpcomingChanges to keep it
  in sync
* Use siteSettings[name] in upcomingChangeBodyClasses to
  ensure we always have the latest calculated value for
  the classes

This commit fixes both issues and adds a related system spec.
2025-12-18 10:30:06 +10:00
Sérgio Saquetim 528786e6be DEV: Replace computed macros with getters in PostStream (#36758)
Refactor `PostStream` by replacing Ember's computed macros (`@or`,
`@and`, `@not`, `@equal`) with native getters and `@dependentKeyCompat`.
This modernizes the codebase to align with current Ember conventions and
improves readability and maintainability. No functional changes
introduced.
2025-12-17 17:54:57 -03:00
Kris 662ffc931b UX: show currently selected locale in header dropdown (#36756)
Follow-up to
https://github.com/discourse/discourse/commit/b6480f2fd14bac0f63b7e32e87634fefb869f286

Adds a selected state to the current locale 
<img width="300" alt="image"
src="https://github.com/user-attachments/assets/776d5c10-a488-4f1d-abc9-59997825b788"
/>

Also fixed a few minor style inconsistencies with other header menus
2025-12-17 13:25:01 -05:00
Sam 2b40b2396d DEV: clear plugin document title counters (#36743)
Previously we were not clearing title counter notification callbacks on
cleanup in test
this could lead to getting flakes (and progressively slower acceptance
tests) as we keep adding
adding more and more Title counters.

The title counter is an interface that lets plugins add counts to title.
2025-12-17 12:07:52 +11:00
Sérgio Saquetim 04d95b5b83 FIX: Address race condition in PostStream while loading posts (#36744)
Convert `findPostsByIds` and `loadIntoIdentityMap` to async functions in
`PostStream` to resolve a race condition when loading posts. This
ensures proper sequencing of asynchronous operations and improves
reliability in loading post data.

This PR addresses the issue reported in
https://meta.discourse.org/t/the-web-page-continuously-loads-previous-posts-and-automatically-scrolls-up-quickly/391192

There are no tests added because I can't find a way to reliably
reproduce the issue in tests and verify it's properly fixed.
2025-12-16 22:06:16 -03:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> ec7c662d93 Build(deps): Bump @rollup/browser from 4.53.4 to 4.53.5 (#36732)
Bumps [@rollup/browser](https://github.com/rollup/rollup) from 4.53.4 to
4.53.5.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.53.4...v4.53.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-17 00:28:55 +01:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 1795d3008b Build(deps-dev): Bump vitest from 4.0.15 to 4.0.16 (#36733)
Bumps
[vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)
from 4.0.15 to 4.0.16.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
-
[Commits](https://github.com/vitest-dev/vitest/commits/v4.0.16/packages/vitest)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-17 00:27:33 +01:00
Sérgio Saquetim 26a619e508 DEV: Use importSync for setupDeprecationCounter in bootstrap (#36734)
Refactor `discourse-bootstrap.js` to use `importSync` when loading
`setupDeprecationCounter`, improving module dependency handling. This
ensures the code gracefully handles environments where the deprecation
counter module is unavailable.
2025-12-16 20:14:47 -03:00
Kris b6480f2fd1 UX: update header language switcher style (#36738)
This updates the language switcher to use the locale code instead of a
generic icon.

Before:
<img width="320" alt="image"
src="https://github.com/user-attachments/assets/6fc7a572-ed26-4ff9-a251-34d50651cca2"
/> <img width="250" alt="image"
src="https://github.com/user-attachments/assets/cf3d9eec-0b85-44da-be8c-b25f26a4bc31"
/>


After: 

<img width="250" alt="image"
src="https://github.com/user-attachments/assets/93007330-fbb6-474d-afec-1ca144c004c8"
/>

<img width="250" alt="image"
src="https://github.com/user-attachments/assets/e0e64b21-d86e-4c7a-bd3b-f49b1e6d4b9d"
/>
2025-12-16 18:08:56 -05:00
726fc21187 DEV: Enforce deprecation-free tests for preinstalled plugins/themes (#36445)
This PR implements stricter deprecation handling that enforces
deprecation-free tests for core and preinstalled plugins, while allowing
custom (non-preinstalled) plugins and themes to have deprecations
without causing test failures.

### Key Changes

#### CI Workflow Improvements
- Split plugin system tests into separate CI targets: `core-plugins`,
`official-plugins`, and `chat`
- Enhance `bin/turbo_rspec` to accept comma-separated exclude patterns
via `--exclude-pattern`
- Simplify workflow configuration with default `shell: bash` and
consolidated environment variables

#### Plugin Classification & Detection
- Centralize official plugins list in `config/official_plugins.json` for
unified backend and frontend access
- Detect preinstalled plugins by checking for absence of `.git`
directory
- Add `isOfficial` and `isPreinstalled` metadata flags to plugin info
- Add `data-preinstalled` and `data-official` attributes to all plugin
and theme script tags for runtime identification

#### Deprecation Source Tracking
- Track deprecation sources (core, plugin, or theme) through template
map and resolver to attribute deprecations correctly
- Improve `source-identifier.js` to detect admin UI plugin files in both
development and production environments
- Add source information to deprecation messages for better debugging

#### Test Infrastructure
- Modify `raise-on-deprecation` test helper to skip errors for custom
(non-preinstalled) plugins and themes
- Add `EMBER_RAISE_ON_DEPRECATION` environment variable to control
deprecation throwing behavior in Rails tests
- Automatically set `EMBER_RAISE_ON_DEPRECATION` for core and
preinstalled plugin/theme specs in `rails_helper.rb`
- Improve deprecation summary output for system specs with test/spec
origin tracking

#### Deprecation Workflow Enhancements
- Add `dont-throw` handler for selective deprecation bypassing in test
fixtures without raising errors
- Add `dont-count` handler for preventing deprecation counting in
specific scenarios (e.g., test fixtures)

#### Deprecation Fixes
- Fix pending deprecations across core plugins (chat, data-explorer,
discourse-subscriptions, gamification, house-ads, reactions,
rss-polling, styleguide)
- Update import paths and remove deprecated patterns
- Migrate deprecated Handlebars templates to JavaScript API

### Testing Strategy

With these changes:
- **Core and preinstalled plugins** must pass all tests without any
deprecations
- **Custom plugins and themes** can have deprecations without failing
tests
- Test fixtures can use `dont-throw` and `dont-count` handlers when
testing deprecation behavior itself
- System specs automatically configure deprecation enforcement based on
test file location

---------

Co-authored-by: David Taylor <david@taylorhq.com>
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2025-12-16 17:48:29 -03:00
moin-Jana 52802b3a90 UX: localize badge form section titles (#36729)
Adds missing localization keys for badge form section titles reported in
https://meta.discourse.org/t/badges-form-section-titles-are-not-translatable/342200



### Before:
<img width="977" height="834" alt="before_not_key"
src="https://github.com/user-attachments/assets/257b4ec4-3e0c-4b0d-b91f-376822932e0c"
/>

### After:
<img width="977" height="834" alt="after_with_key"
src="https://github.com/user-attachments/assets/a9cba2d6-93bc-444f-b43c-c9de8f231432"
/>
2025-12-16 21:27:43 +01:00
chapoi 38ad240540 UX: add ids to badge section titles (#36725) 2025-12-16 20:10:22 +01:00
Régis Hanol b9e6c29871 FIX: use event timezone for Google Calendar export (#36727)
When clicking "Add to Google Calendar" for an event with a specific
timezone, the generated UTC times were incorrect. The code was parsing
the date string using the user's local timezone instead of the event's
timezone.

For example, an event at 18:30 in a UTC+2 timezone would be incorrectly
converted as if it were 18:30 in the user's local timezone (e.g.,
UTC-4), resulting in a 6-hour error in the Google Calendar URL.

The fix passes the event's timezone to `_formatDateForGoogleApi` and
uses `moment.tz()` to parse dates in the correct timezone before
converting to UTC. Also cleaned up the date formatting to use moment's
format() method instead of regex replacement.

Internal ref - t/162288
2025-12-16 19:05:55 +01:00
Penar Musaraj fd8fd1674a DEV: Ensure new-feature-item renders without a title (#36728)
This is used in a private plugin to show a preview. That plugin's tests
regressed due to this change.
2025-12-16 12:51:12 -05:00
Kris f6e08ec9af FEATURE: create tags inline on the /tags route (#36645)
This adds an auto-expanding input to the /tags route that allows admins
to create new tags and creates a new bulk_create tag service

<img width="2240" height="528" alt="image"
src="https://github.com/user-attachments/assets/7e6de5cf-0f35-4869-a677-a9fac8845b60"
/>

<img width="2210" height="784" alt="image"
src="https://github.com/user-attachments/assets/b6207679-85f5-4683-966f-578710666c1a"
/>
2025-12-16 11:25:14 -05:00
Isaac Janzen 27f3bda4c6 DEV: Revert Object Setting upload changes (#36708) 2025-12-16 09:40:44 -06:00
Alan Guo Xiang Tan 63fea13f35 UX: Prevent HorizontalOverflowNav component from scrolling viewport (#36715)
Whenever the `HorizontalOverflowNav` component is rendered, we call
`scrollIntoView` on the current active element to ensure that the link
which is currently active will be shown to the user. However, we were
calling `scrollIntoView` with the `container` option defaulting to `all`
which impacts all scrollable containers.

Per mozilla docs,

> All scrollable containers are impacted (including the viewport).

This is not ideal as it can cause unintended scrolls on the viewport
thus resulting in a bad UX. To resolve this, this commit adds the
`container:
"nearest"` option when we call `scrollIntoView` which ensures that only
the nearest scrollable container to the active element is impacted.

This problem was discovered while I was looking at review queue index
page and noticed that my scroll position was always lost when new
reviewable items are added to the page. It turns out that the review
queue index page renders the `reviewable-refresh/item.gjs` component
which then renders the `horizontal-overflow-nav.gjs` component.
2025-12-16 16:51:19 +08:00
d85becccef FEATURE: respect user presence when chat is on screen (#36652)
Handle, timeout of user so we stop reading and scrolling when user is in
background or no longer active

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: David Taylor <david@taylorhq.com>
2025-12-16 17:23:32 +11:00
Kris 21a628ac06 UX: prevent title edit icon from wrapping onto its own line (#36709)
This prevents the edit icon from wrapping onto its own line, which is
extra bothersome on desktop because it's invisible until hover! I've
removed the whitespace from the template between the icon and title, and
added a new span, which has `white-space: nowrap;`

Before:
<img width="700" alt="image"
src="https://github.com/user-attachments/assets/212a2262-a281-45d8-8ad5-6103e4e73f1c"
/>

(on hover)
<img width="700" height="326" alt="image"
src="https://github.com/user-attachments/assets/17fff736-923c-4a44-b561-36f6e5804d69"
/>



After (pencil will always wrap with the last word): 
<img width="700" alt="image"
src="https://github.com/user-attachments/assets/2690c1f6-7262-4189-bf34-49407f78b5d9"
/>
<img width="700" alt="image"
src="https://github.com/user-attachments/assets/ae2c4aca-f39c-4e2a-8612-9cc22f697dbc"
/>
2025-12-15 18:41:56 -05:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 5c634f6e96 Build(deps): Bump @rollup/browser from 4.53.3 to 4.53.4 (#36703)
Bumps [@rollup/browser](https://github.com/rollup/rollup) from 4.53.3 to
4.53.4.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.53.3...v4.53.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 23:09:25 +01:00