This commit updates the 2FA token submission page to disable the submit
button when the 2FA token is not valid and to also set the submit button
to be in the loading state after the submit button has been clicked.
The UX issues were discovered while I was investigating a flaky test
which has been unskipped in this commit as well. I am not sure if this
will completely resolve the flakiness but we have to unskip it to know
if it continues to be flaky.
Now we have the search input showing in a few
different configurations:
* Welcome banner
* Header field
* Header icon
And we can get to the search with both `/` and
`Ctrl+F` shortcuts. These configurations can
be used together, and we need to focus on the right
search input at the right time.
This commit fixes the shortcuts not working
or showing the wrong thing in some cases,
and adds a comprehensive system spec for all
the variants.
We often need to be able to change the format of a container and to
change the flex-direction, this is now possible through two properties:
`<form.Container @format="large">`
`<form.Container @direction="column">`
On top of this `Object` has now a similar behavior to `Collection`. It
will be displayed as flex, add gap between children and accepts
`...attributes`.
Ideally we would add support for color spaces like okclh to the app, or
have some method for converting them to rgb automatically. But for now,
this will stop the app crashing completely.
We want to give some themes more control over
the default experience in core. To this end, this
commit adds value transformers for these
site settings:
* enable_welcome_banner
* search_experience
This way, themes can give a different value to
what has been set in core.
This can be potentially confusing, a follow up PR
may refactor this a bit so there is a more direct
correlation between the setting and the transformer
so we could show a warning in the site setting page
for example.
Commit f1700ca58929bcbfad23565861d1d3084ae1b3f8 ensures that categories
are loaded lazily, in pages, if the number of visible categories is over
1000. This affected the list of subcategories on the category page too.
The logic has been changed to only paginate if the number of categories
that would have been returned is grater than 1000. For example, if there
is a parent category filter, pagination will only be enforced if the
number of subcategories is over 1000.
Uses `getCaretCoords` from the text manipulation implementation to rely
on each editor's strategy to get the caret (left,top) positions.
This is mostly to fix an issue on Safari, where the virtual element
approach doesn't work, but also improves the emoji picker positioning
when triggered from autocomplete in the Markdown editor.
Fixes an incorrect logic on `transformPasted` that was causing a
`TypeError: Cannot read properties of null (reading 'marks')` when only
part of a paragraph was selected.
Adds tests
Before this commit form-kit couldn't represent this shape of data:
`[1,2,3]`, it could only represent: `[{value: 1}, {value: 2}]`.
The above data can now be expressed with this form:
```gjs
<Form @data={{hash foo=(array 1 2 3)}} as |form|>
<form.Collection @name="foo" as |collection|>
<collection.Field @title="time" as |field|>
<field.Input @type="number" />
</collection.Field>
</form.Collection>
</Form>
```
Follow-up to https://github.com/discourse/discourse/pull/30953
This PR is a partial revert of the linked PR — it changes the "Themes
and components" link in the admin sidebar back to the legacy
`/admin/customize/themes` page and adds the themes list/sidebar back to
the left hand side of the page. The new `/admin/config/customize/` route
is still available, but it's not linked from anywhere. When accessing
the new page and then navigating to a theme, the old components (e.g.
the themes list) of the page are hidden. This allows us to iterate on
the new page and improve until we're more ready to make it available
more widely.
Both tests being unskipped here failed previosly with the following
error:
```
Failure/Error: expect(page).to have_current_path("/u/#{user.username}/preferences/account")
expected "/u/confirm-new-email/f42a416fcbca40d66788d65a8837ad49" to equal "/u/bruce306/preferences/account"
./spec/system/email_change_spec.rb:49:in `block (2 levels) in <main>'
```
The error indicates that the transition was not successful and I
suspect that it may be due to the use of the `/my` route prefix which
is just a nice to have and not necessary.
We currently limit the number of characters in the bar-separated list of auto-membership e-mail domains. We want to make this configurable through site settings.
After this change, we limit the length of each individual domain, and enable the number of domains to be configured through a hidden site setting.
The original limit is there to prevent DoS, since a TEXT column can take up to 1Gb. With this new limit we're still at a maximum of around 10kb.
We have this rule in
https://meta.discourse.org/t/formatting-text-in-discourse-documentation-and-uis/324637:
> Do not use a period for the following:
>
> Tooltips, image captions, or other UI elements with only one sentence
However, this looks strange on some admin pages because we also show
a "Learn more..." link after the header description, which kind of
runs on into the link.
This commit adds a separator after the link to address this issue.
The change made in #31854 introduced a regression when editing groups, preventing saving when no auto membership e-mail domains are entered.
This change fixes that and adds a system test.
Avoids autocompleting or applying mention/emoji/hashtag/any input rules on
rich editor inline code.
There's also a refactor on how the params are passed to input rules – we
now use the same params from plugins, keeping it more consistent.
Follow up to e4401e587e98ac4020c2c4fd965e227146cf33d4.
In the previous change, when serialising a Reviewable post, we were appending the title to the post content whilst checking for watched word matches. This append action was acting upon the object itself, rather than just a copy of the string, causing the UI to display the title appended twice to the content.
Fortunately, since it was only happening in the serialiser, the incorrect data was never stored in the database, it was only happening when viewing the review queue.
When performing an action in the review queue, this change makes two improvements:
- The buttons on the reviewable item are disabled, so you can't accidentally multi-click.
- A toast is displayed when the action is complete, as a success indication.
Fixes the custom homepage crawler output to include links to the site's
top menu.

This also provides a way to override that content via a plugin. Example
usage in a `plugin.rb` file:
```
register_html_builder("server:custom-homepage-crawler-view") do |c|
"<div>override</div>"
end
```
This reduces some duplicate color assignment to tags and rolls them up
under a common css var
```css
:root {
--tag-text-color: var(--primary-high);
}
.extra-info-wrapper {
--tag-text-color: var(--header_primary-high);
}
```
This also makes the tag separator color consistent with the tag color,
by setting it to `--tag-text-color`
Ultimately we have 3 tag text color states (this appeared to be
consistent across all tag styles):
* Default: primary-high
* Header: header__primary-high
* Visited topic in the topic list: primary-medium
Previously we were showing a loading spinner, but the old user list
persisted so the spinner was often off the bottom of the screen. This
commit updates the `users` list to be a getter, so it's always perfectly
in-sync with the `_results` set. That means no users will be shown while
a new list is being loaded, so the spinner is more visible.
https://meta.discourse.org/t/load-spinner-missing-from-dynamic-pages/357525/4
This reverts commit 992bdf173ad8ad25764c0a89132bc35df4c81f12.
This change was causing issues in a [third party
plugin](https://meta.discourse.org/t/events-plugin):
https://meta.discourse.org/t/events-plugin/69776/869
```
Uncaught Error: Could not find module `discourse/mixins/singleton` imported from `discourse/plugins/discourse-events/discourse/models/provider`
at loader.js:247:1
at h (loader.js:258:1)
at u.findDeps (loader.js:168:1)
at h (loader.js:262:1)
at u.findDeps (loader.js:168:1)
at h (loader.js:262:1)
at requireModule (loader.js:24:1)
at y (app.js:170:18)
at b (app.js:193:19)
at app.js:156:29
at g.start (app.js:167:1)
at HTMLDocument.<anonymous> (start-app.js:5:7)
at discourse-boot.js:13:12
at discourse-boot.js:1:1
```
Currently we allow for 2 theme screenshots to be specified,
with a lightweight spec to allow both a light and dark
version of the screenshot. However, we were not storing this
screenshot name anywhere, so we would not be able to use it
for light/dark switching.
This commit fixes that issue, and also does some general refactoring
around theme screenshots, and adds more tests.