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.
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`
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.
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.
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
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.
## 🔍 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
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.
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
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.
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.
We use ampersand to concatenate sidebar sections, e.g. Login & authentication, Logs & screening, etc.
This updates Themes & components to have the same.
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
Currently, topic excerpts are not localized.
This commit adds the excerpt column into topic_localization and displays the
localized excerpt if present.
```
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`.
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.