Commit Graph

59373 Commits

Author SHA1 Message Date
588f1d4a42 FEATURE: allow minimizing composer when no text (#32880)
This change updates the minimize button to always minimize the composer
so we don’t inadvertently delete user input.

Internal ref: /t/129123
2025-05-23 18:06:01 +04:00
92312eec7b FIX: Fix category title link to update when category changes, add tests (#32840)
The component was importing `@ember/component` but not marking the
category arg as tracked. Changed to `@glimmer/component` so the category
arg is tracked, and cleaned up the rest of the component to match.

Related to [this issue on
meta](https://meta.discourse.org/t/category-headers-missing-the-titles/361954).

Apparently a few customers with themes using the CategoryTitleLink
component got hit with the category title not updating correctly when
the category changed.
2025-05-23 08:51:30 -05:00
aa77c45576 REFACTOR: move mobile list-controls.scss to common (#32862)
This creates a new `/common/base/list-controls.scss` file and pulls
relevant styles from `_topic_list.scss` into it along with the mobile
`list-controls.scss`
2025-05-23 09:50:06 -04:00
c0b76d1c64 DEV: signup/login spec cleanup (#32867) 2025-05-23 09:17:37 -04:00
80df219fef A11Y: Update accessible headings for more flexible translations (#32863)
Follow-up to ca658a8bb093c82410927d1fa29e5ef1940260b7

The original attempt at this wasn't flexible enough for some languages
where adjectives may depend on context, so this requires more
translation but allows for full context in each string

Discussed here:
https://meta.discourse.org/t/translating-filter-in-headings-for-discovery-routes/363520
2025-05-23 09:15:44 -04:00
b4990ccb71 DEV: Compile and serve rtl versions of theme CSS (#32881) 2025-05-23 13:48:57 +01:00
b15c1d28c9 DEV: Introduce experimental viewport-based mobile mode (#32859)
Introduces the viewport_based_mobile_mode experimental site setting.
When enabled, user-agent-based mobile/desktop detection will be replaced
with viewport-width logic. 'mobile mode' is enabled for any viewport
less than our 'sm' breakpoint (40rem, or 640px at default font size).

When this mode is enabled, mobile/desktop toggle buttons are hidden,
since they are non-functional.

Tests are also updated to use a consistent method for force-enabling the
legacy mobile mode. All state is now stored in `lib/mobile`, and the
`Site` model references that via a getter.
2025-05-23 13:01:04 +01:00
c880aa78ce FIX: Avoid double redirect after installing a theme (#32876)
Clearing of params is now happening in the addTheme callback in the call site. Calling it in the component in willDestroy results in a double redirect which breaks the redirection to the components tab.
2025-05-23 16:53:45 +08:00
a24bd6789c Build(deps-dev): Bump ruby-prof from 1.7.1 to 1.7.2 (#32872)
Bumps [ruby-prof](https://github.com/ruby-prof/ruby-prof) from 1.7.1 to
1.7.2.
-
[Changelog](https://github.com/ruby-prof/ruby-prof/blob/master/CHANGES)
-
[Commits](https://github.com/ruby-prof/ruby-prof/compare/1.7.1...1.7.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-23 16:24:04 +10:00
Sam
c1b0e8b30b DEV: track client ids published to message bus (#32878)
Allow tracking of client ids published to message bus. 

Required for when you are targeting publishing at a single browser
2025-05-23 14:23:50 +10:00
49f6f5d083 UX: rich editor checklist undoable input rule (#32877)
Removes the rich editor checklist input rule `undoable: false`, which is
not needed.

Making it undoable allows a backspace to undo the input rule conversion,
so we can go from a check to a `[]` again
2025-05-23 14:20:27 +10:00
01969e49f0 DEV: Improve tests for composer by checking for visibility (#32874)
This is a follow up to 6da091a2b1aa4940fdfb6c42ed0c59fea17ab7e3
2025-05-23 10:05:26 +08:00
10f8dba819 Revert "UX: Refactor the edit topic title UI" (#32873) 2025-05-22 20:07:19 -05:00
6cda3c728a DEV: refactor select-kit utils mixin to property-utils lib (#32665)
Follow up to refactoring the generic utils mixin used in select-kit
components in https://github.com/discourse/discourse/pull/32594.

This PR follows a different approach as the util functions related to
properties here aren't easily extracted without a major change to the
interface due to the dependency on `this.selectKit`. These util
functions are instead declared on the prototype with a class decorator
which ensures the same behaviour is maintained without relying on a
mixin.

It's largely a lift-and-shift with some minor refactoring of the
conditional logic to reduce nesting and improve readability of the
functions.
2025-05-23 09:03:10 +08:00
368900555d UX: re-add similar topics styles (#32866)
Before

![image](https://github.com/user-attachments/assets/f83e1d17-32f6-42a8-b7f8-21c1bf500136)

After

![image](https://github.com/user-attachments/assets/a81f7ddc-4001-47b4-b913-246d066673cc)
2025-05-22 16:53:35 -03:00
6da091a2b1 FIX: fullscreen composer regression (#32864)
Undoes the CSS nesting done inadvertently on
https://github.com/discourse/discourse/pull/32843.

Everything below `.fullscreen-composer` shouldn't be nested within
`.similar-topics`.
2025-05-22 16:24:42 -03:00
1a5377cf93 DEV: Add ability to hide shortcut in title (#32860)
## 🔍 Overview
This update add an _optional_ attribute to the `toolbar.addButton()` API
so that we can conditionally hide the shortcut showing up in the title.

Although for most cases, showing the shortcut in the title is fine. For
complex uses of `toolbar.addButton` where it triggers a menu, it isn't
ideal. For example, in Discourse AI, the toolbar API is used to show a
menu for the AI composer helper. The shortcut in the API is used to
trigger the proofreading item, but not necessarily for all other items.
As such, we want the shortcut hidden in the title.

## 🛠️ Usage

```diff
        withPluginApi((api) => {
          api.onToolbarCreate((toolbar) => {
            toolbar.addButton({
              id: "smile",
              group: "extras",
              name: "smile",
              icon: "far-face-smile",
              title: "cheese",
              shortcut: "ALT+S",
+              hideShortcutInTitle: true,
            });
          });
        });
``` 

### ← Before

Title shows:

> Cheese (Ctrl + Alt + S)

### → After

Title shows:

> Cheese
2025-05-22 09:36:48 -07:00
3867c879ab DEV: Make outletArgs available as regular arguments (#32819) 2025-05-22 14:55:28 +01:00
e2fe5671ed DEV: Resolve mixed-decls misconfiguration (#32858)
Marking mixed-decls as silenced & fatal simultaneously is causing a
warning "Ignoring setting to silence mixed-decls deprecation, since it
has also been made fatal"

The intention is for it to be silenced for themes/plugins, but fatal for
core.
2025-05-22 13:52:20 +01:00
9ead2e6720 PERF: Introduce lazyHash and update PluginOutlet calls to use it (#32823)
This is a more efficient version of `{{hash`, where the values are only evaluated when they're actually accessed. Also enables a new lint rule which will ensure `{{hash` is not reintroduced on PluginOutlets
2025-05-22 12:07:22 +01:00
f0fcac1243 DEV: Refactor Chat::LookupChannelThreads to follow best practices
- use `model` where possible
- extract threads fetching logic to its own action
- refactor specs to follow current guidelines/best practices
2025-05-22 12:06:54 +02:00
3e8c293fe9 Build(deps): Bump snaky_hash from 2.0.1 to 2.0.2 (#32853)
Bumps [snaky_hash](https://github.com/oauth-xx/snaky_hash) from 2.0.1 to
2.0.2.
-
[Changelog](https://github.com/oauth-xx/snaky_hash/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/oauth-xx/snaky_hash/compare/v2.0.1...v2.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 12:02:07 +02:00
03ea73c550 Build(deps-dev): Bump @swc/core from 1.11.24 to 1.11.29 (#32850)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.24 to
1.11.29.
- [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.11.24...v1.11.29)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 12:01:25 +02:00
e1984f886e FIX: forgotten background (#32857) 2025-05-22 12:00:52 +02:00
1fcb3a8b33 DEV: Port install theme button modal to new themes page (#32834)
We recently added a new themes and components page. We didn't port over the code that enables the Install theme button on Meta. It works by looking for certain query parameters and opening a special version of the install modal.

This PR is a lift-and-shift of that code from the old themes page.
2025-05-22 17:24:37 +08:00
5458e6ad2e FIX: Themes and components page title (#32856)
We removed a duplicate translation key, but it was being used here. Update the title token to use the canonical one.
2025-05-22 16:27:34 +08:00
11a0ad933a DEV: do not convert (tm) and (TM) to emoji (#32713)
This regressed because with recent emojis changes, the base name is now
`trade_mark` and not `tm`. `tm` is just an alias emoji.
2025-05-22 10:26:23 +02:00
0a156380cb UX: new styling for composer tips (#32843)
* Removed backgound from composer tips popup
* Added more spacing
* Made links the default link colour, so it's clear they are links.
* Applied `d-border-radius-large` var



![CleanShot 2025-05-21 at 17 26
14@2x](https://github.com/user-attachments/assets/2fbdcdce-5a51-4e71-8b85-c66aaf9aa257)

![CleanShot 2025-05-21 at 17 25
47@2x](https://github.com/user-attachments/assets/c52dfe70-d5b9-4c89-8b04-810a599281ac)

![CleanShot 2025-05-22 at 09 20
23@2x](https://github.com/user-attachments/assets/9f469d6c-498d-45f1-a6d5-450b7e20f264)
2025-05-22 09:22:12 +02:00
84179ec51a Build(deps): Bump drb from 2.2.1 to 2.2.3 (#32852)
Bumps [drb](https://github.com/ruby/drb) from 2.2.1 to 2.2.3.
- [Release notes](https://github.com/ruby/drb/releases)
- [Changelog](https://github.com/ruby/drb/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/drb/compare/v2.2.1...v2.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 16:48:43 +10:00
206dff5e13 FIX: bring back sidebar filter (#32837)
In this PR, filter was removed and replaced by search.

#32485

However, moderator should still be able to filter sidebar. Also, plugins like doc-category should have filterable sidebar.
2025-05-22 13:44:25 +08:00
386553d98b Build(deps-dev): Bump rubocop from 1.75.6 to 1.75.7 (#32851)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.75.6 to
1.75.7.
- [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.75.6...v1.75.7)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-22 12:42:10 +08:00
58d14b075d FEATURE: trigger an event when chat channel is trashed (#32844)
Required for this PR:
https://github.com/discourse/discourse-livestream/pull/55
2025-05-22 09:48:32 +05:30
93e1ba365f DEV: Use ampersand for themes and components admin section (#32855)
We use ampersand to concatenate sidebar sections, e.g. Login & authentication, Logs & screening, etc.

This updates Themes & components to have the same.
2025-05-22 11:08:51 +08:00
2b6efa56f3 DEV: Add site description to crawler homepage view (#32845)
In some cases, Google crawlers don't output the meta description but
rather they output the first bit of text in the UI. Sometimes that is a
mix of table headings, topic titles and excerpts, which don't reflect
the site's mission. Adding the description to the homepage header might
help.

Internal ticket t/154372
2025-05-22 08:33:59 +10:00
b3a39ccdf6 UX: Update unsaved changes popup (#32849)
This PR slightly updates the unsaved changes popup in the admin panel.

# New
| desktop | mobile | 
|--|--|
| ![CleanShot 2025-05-21 at 16 18
18@2x](https://github.com/user-attachments/assets/923468a5-49a3-431c-823f-b5e2b67b0585)|
![CleanShot 2025-05-21 at 16 20
30@2x](https://github.com/user-attachments/assets/297f7804-2fe0-431b-9091-4d914618481b)|


# Old

| desktop | mobile | 
|--|--|
| ![CleanShot 2025-05-21 at 16 18
32@2x](https://github.com/user-attachments/assets/d471aef4-df89-450c-ab3f-d11781959cf8)
| ![CleanShot 2025-05-21 at 16 19
33@2x](https://github.com/user-attachments/assets/6db7f98f-93a5-4aeb-8e43-167da445fddd)
|
2025-05-22 08:11:39 +10:00
3b0889facd DEV: Add jsDiff dependency (#32833)
For use in Discourse AI
(https://github.com/discourse/discourse-ai/pull/1355)
2025-05-22 07:22:11 +10:00
52c6c852df DEV: new topic map outlet and header participant flexibility (#32826)
Header: 
* Allows optional avatar size for header participant component (for
reuse elsewhere)

Topic map:
* Adds a new `topic-map-participants-after` outlet
* Removes an `!important`
2025-05-21 09:59:57 -04:00
ae395dab3c UX: fix overflow name in usercard (#32838)
![CleanShot 2025-05-21 at 10 16
44@2x](https://github.com/user-attachments/assets/76640201-e153-43a9-9205-06d33621e1ce)
⬇️ 
![CleanShot 2025-05-21 at 10 16
35@2x](https://github.com/user-attachments/assets/a61e8524-f504-4b5d-8acb-82c65c08177a)
2025-05-21 15:25:14 +02:00
ae4ee7754f DEV: Update linting (#32836) 2025-05-21 12:02:52 +02:00
94e653af08 FEATURE: Also localize topic excerpts (#32839)
Currently, topic excerpts are not localized.

This commit adds the excerpt column into topic_localization and displays the
localized excerpt if present.
2025-05-21 17:49:27 +08:00
b7fcc0e854 DEV: Fix state leak in test (#32835)
```
rspec --seed 52075 spec/models/site_spec.rb spec/lib/freedom_patches/translate_accelerator_spec.rb

Randomized with seed 52075
....................................................F

Failures:

  1) translate accelerator plugins loads plural rules from plugins
     Failure/Error: self.locale_no_cache = value

     I18n::InvalidLocale:
       :foo is not a valid locale
     # ./lib/freedom_patches/translate_accelerator.rb:254:in 'I18n.locale='
     # ./spec/lib/freedom_patches/translate_accelerator_spec.rb:118:in 'block (3 levels) in <main>'
```

This is because setting `I18n.config.available_locales` is equivalent to
hard coding the
locales for the entire process. It should not be set so that `I18n` will
fallback to `backend.locales`.
2025-05-21 16:33:53 +08:00
02bc561db3 DEV: allows to pass @currentWhen to NavItem (#32825)
Some cases are more complex than the default behavior of
`this.router.isActive(this.args.route)`, in this case you can give use
`@currentWhen` on your `NavItem` component.

Example:

```gjs
get isItCurrent() {
  return true;
}

<template>
  <NavItem @i18nLabel="test" @currentWhen={{this.isItCurrent}} />
</template>

<template>
  <NavItem @i18nLabel="test" @currentWhen="foo" />
</template>

<template>
  <NavItem @i18nLabel="test" @currentWhen="foo.show foo.index" />
</template>
```

No test as I can't write a component test for this as it relies on the
router.
2025-05-21 09:31:47 +02:00
66e210b41c Build(deps-dev): Bump webpack from 5.99.8 to 5.99.9 (#32827)
Bumps [webpack](https://github.com/webpack/webpack) from 5.99.8 to
5.99.9.
- [Release notes](https://github.com/webpack/webpack/releases)
-
[Commits](https://github.com/webpack/webpack/compare/v5.99.8...v5.99.9)

---------

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-05-21 09:19:16 +02:00
945a214e46 Build(deps-dev): Bump puppeteer-core from 24.8.2 to 24.9.0 (#32828) 2025-05-21 07:09:04 +02:00
cab2e1a8d5 Build(deps-dev): Bump mime-types-data from 3.2025.0514 to 3.2025.0520 (#32832)
Bumps [mime-types-data](https://github.com/mime-types/mime-types-data)
from 3.2025.0514 to 3.2025.0520.
-
[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.0514...v3.2025.0520)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 10:37:43 +08:00
bacf120559 Build(deps-dev): Bump hashdiff from 1.1.2 to 1.2.0 (#32830)
Bumps [hashdiff](https://github.com/liufengyun/hashdiff) from 1.1.2 to
1.2.0.
-
[Changelog](https://github.com/liufengyun/hashdiff/blob/master/changelog.md)
-
[Commits](https://github.com/liufengyun/hashdiff/compare/v1.1.2...v1.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 10:37:23 +08:00
11ee8e4fd5 Build(deps-dev): Bump rails-dom-testing from 2.2.0 to 2.3.0 (#32829)
Bumps [rails-dom-testing](https://github.com/rails/rails-dom-testing)
from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/rails/rails-dom-testing/releases)
-
[Commits](https://github.com/rails/rails-dom-testing/compare/v2.2.0...v2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 10:37:10 +08:00
823fcc333d Build(deps-dev): Bump zeitwerk from 2.7.2 to 2.7.3 (#32831)
Bumps [zeitwerk](https://github.com/fxn/zeitwerk) from 2.7.2 to 2.7.3.
- [Changelog](https://github.com/fxn/zeitwerk/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fxn/zeitwerk/compare/v2.7.2...v2.7.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-21 10:36:46 +08:00
1eba96a75f DEV: Remove branding and styling steps from wizard (#32797)
https://github.com/discourse/discourse/pull/32797
2025-05-21 09:46:49 +08:00
5c041a14ba UX: Close admin search modal immediately when result is selected (#32811)
Previously it was relying on the default Modal behavior, which is to
close **after** the next route transition.
2025-05-21 08:09:15 +10:00