34731 Commits

Author SHA1 Message Date
Kris
bbea7c3b11
REFACTOR: move desktop and mobile composer stylesheets into common (#31936)
This moves CSS from mobile/compose.scss and desktop/compose.css into
common/compose.scss and removes some old unused CSS in the process.

In addition:

* Prevents the grippie div from rendering on mobile, rather than hiding
the div with CSS
* Prevents the composer education messages from rendering on mobile,
rather than hiding them with CSS
* Wraps the `#draft-status` container with a condition instead of its
children, preventing the empty div from rendering when it's not used
* Adds a missing `btn-transparent` class to the mobile controls toggle
2025-03-25 16:09:09 -04:00
Kris
aa8a5ebd1e
DEV: remove list-controls wrapper on tags index (#32002)
This `.list-controls` wrapper on the tags index has no specific styles
applied, and can easily pick up styles of the actual `.list-controls`
container on topic lists when the class is used in themes... so it's
more harmful than helpful (it's also not a list?).

Before:

![image](https://github.com/user-attachments/assets/ac32d4b2-e0be-422e-90f4-d4066304eb00)

![image](https://github.com/user-attachments/assets/4157d7d8-b4f1-4bde-acde-f08f544a23ea)


After (no visual changes):

![image](https://github.com/user-attachments/assets/7cbc9ce3-82b7-46c7-9c47-3b4086f84bae)

![image](https://github.com/user-attachments/assets/ec040df8-8b99-4c6b-95ff-01319c194931)
2025-03-25 15:54:10 -04:00
Penar Musaraj
6aaddcf381
FEATURE: enable full page login by default (#31771)
This switches the signup/login UI to the full page experience by
default. This has been in use by many sites for multiple months and we
have ironed out many fixes in the meantime.

The `full_page_login` setting is also marked for removal in about
1.5mths, by the end of April 2025.
2025-03-25 13:43:51 -04:00
Joffrey JAFFEUX
8fc2b74bf0
DEV: exposes parentName and name in onSet (#32000)
This allows more flexibility for custom behaviours.

Example usage:

```gjs
@action
onSet(value, { set, name }) {
  set(name + ".0.baz", value * 2)
}

<form.Object @name="something" as |object|>
  <object.Field @name="foo" @title="Foo" @onSet={{onSet}} as |field|>
    <field.Input />
  </object.Field>
</form.Object>
```
2025-03-25 18:20:36 +01:00
David Taylor
b29e0b6e1b
DEV: [gjs-codemod] convert admin files to gjs
Updated using `@embroider/template-tag-codemod`, plus some manual fixups.
2025-03-25 16:59:21 +00:00
David Taylor
b203954060
DEV: [gjs-codemod] merge js and hbs 2025-03-25 16:59:13 +00:00
David Taylor
9f9282e070
DEV: [gjs-codemod] renamed js to gjs 2025-03-25 16:59:06 +00:00
David Taylor
596db5966c
DEV: [gjs-codemod] renamed hbs to gjs 2025-03-25 16:58:57 +00:00
Robert
94ee3554da
DEV: add plugin outlet to desktop & mobile Topic List Item after badges (#31998)
There is no current plugin outlet on the Topic List which allows one to
attach additional UI after the title without messing up the badge
display.

We can’t use `topic-list-after-title` because that will render before
the badge which looks untidy:



![](b29d5add40.png)

... and we can’t use`topic-list-before-category` because that’s not
always rendered when we drill into a Category.

The solution is a new plugin outlet located after the badge is rendered.
This needs to be on both the desktop and mobile flavours.

See discussion here:
https://meta.discourse.org/t/locations-plugin/69742/1144?u=merefield
2025-03-25 16:45:36 +00:00
Jordan Vidrine
fe19a0aa0c
DEV: Make styling bookmarks easier (#31979) 2025-03-25 11:02:11 -05:00
Amanda Alves Branquinho
df412608c8
DEV: Split 2fa logic from account activation (#31974)
- This change separates the logic that handles 2fa flow, from the one
that deals with the user after it is authenticated.
2025-03-25 10:56:40 -03:00
Alan Guo Xiang Tan
3cf9f81552
DEV: Unksip flaky changing email system tests (#31991)
This commit unskips 3 flaky system tests and gives up on asserting that
redirecting is done correctly. This is because we have invested
considerable effort into this and cannot figure it out. The redirect is
tested by the client side anyway so there is still some test coverage.
2025-03-25 09:09:50 -04:00
Martin Brennan
e99ed81586
DEV: Serialize theme_id and colors for user selectable color palettes (#31972)
We currently have `user_color_schemes` serialized on the preloaded
`Site` object, but it's very lightweight, only having an ID and name.
It would be useful for some themes and also the user Interface
preferences tab to be able to access the colors for the color scheme,
as well as the theme it belongs to.

This commit expands the serializer to include these extra attributes.
This `user_color_schemes` key is already cached as a fragment, so this
shouldn't be too much extra burden to send to the client.
2025-03-25 16:31:28 +10:00
Martin Brennan
a14472606c
FEATURE: Tight lists by default on rich composer (#31969)
Tight lists are lists that look like this:

* Item 1
* Item 2
* Item 3

Loose lists look like this:

* Item 1

* Item 2

* Item 3

There is a place for the latter, but the former is more
common default behaviour for writing apps and widgets, so
we are overriding the prosemirror default to use tight lists.

Eventually we will have a shortcut or other special behaviour
to switch between the list styles.
2025-03-25 14:36:47 +10:00
Osama Sayegh
1a4e09a23e
UX: Apply changes live when editing currently active palette (#31874)
When editing a color palette via the new page introduced in
https://github.com/discourse/discourse/pull/31742, it should apply the
color changes for the admin making the change automatically upon save.

Internal topic: t/148628/12.
2025-03-25 06:42:23 +03:00
Arkshine
423191ea24
UX: Adjust code editor height when maximized (#31971)
Meta:
https://meta.discourse.org/t/issue-with-custom-css-save-button-on-smaller-screens/358505

With the editor maximized, this PR adjusts the height by considering the
new info banner (#31561) and the navbar with `Show advanced` enabled
(even without banner, the height needed adjustments).

The info banner is forced to scroll to contain the height, especially on
mobile.

Before:

![IiOWqPj3eO](https://github.com/user-attachments/assets/723aee77-d10b-4ec6-87e1-95984039b6a0)

![KmJA54V2H8](https://github.com/user-attachments/assets/568dc6ad-3dba-4829-87c9-0283bd685862)

After:

![d3GlykKDLE](https://github.com/user-attachments/assets/3955a094-91f7-4a11-a463-567e6f168897)

![cwzKPVc294](https://github.com/user-attachments/assets/b23fa5a6-97d1-468a-8f4a-e0bbb03b8a87)
2025-03-24 17:24:44 -04:00
Kris
505699c198
UX: adjust border radius for reply-where buttons (#31978)
These are *technically* buttons, but are much larger and have multi-line
content, so if you apply a border-radius via `--d-button-border-radius`
that tries to make rounded buttons... it doesn't work great here.

A case where normal buttons are fine (6rem radius) 


![image](https://github.com/user-attachments/assets/914170c3-3751-4939-841a-24e6a445cbb5)

but these big buttons have too much content to pull it off well, the
same border radius is too extreme


![image](https://github.com/user-attachments/assets/e00d076d-c555-42c1-9b15-0fa462bc5eaa)

the border radius variable we have for more general content areas
(`--d-border-radius`) generally doesn't work with a fully round radius,
so it should work better here most of the time:


![image](https://github.com/user-attachments/assets/9b2f509d-d0ef-46d9-898a-9b4bdf34f1a2)
2025-03-24 16:23:03 -04:00
David Taylor
b4afe124b7
DEV: Remove raw-hbs from autocomplete implementation (#31957)
We intend to replace this JQuery autocomplete implementation soon. But
before that, we'd like to drop the raw-hbs compilation/runtime system.
Therefore, this commit does a 1:1 conversion of the autocomplete
templates to vanilla JS. They're fairly small/simple, so they're still
fairly readable.
2025-03-24 19:44:07 +00:00
Kris
a79f8dbce0
DEV: apply pm border radius to topic map (#31976)
This applies the pm border radius (optional theme variable) to the pm
topic map as well

before:


![image](https://github.com/user-attachments/assets/b62b8791-b8d7-49c5-b4f8-03614b7187dc)


after: 


![image](https://github.com/user-attachments/assets/0d0dcf62-f43a-4409-8504-9ecc937775c6)
2025-03-24 15:22:32 -04:00
Kris
332bb6c958
UX: improve nav fade css (#31975)
Concerns this little fading scroll affordance in the horizontal overflow
nav:


![image](https://github.com/user-attachments/assets/3d59896c-faf4-4550-9fcb-62ce4e31cecd)

The parent container of the user nav has an optional
`--d-content-background` variable applied, and adding this for the nav
means that if a theme author uses `--d-content-background` the nav will
match automatically. When `--d-content-background` is not set, we fall
back to `--secondary` which is the default background.

I also realized that we don't need RGB values here since we're simply
fading from a solid color to transparent.
2025-03-24 15:14:56 -04:00
Roman Rizzi
9bc394191c
DEV: TopicListItemSerializer tells if topic is among the top 100 hottest topics (#31935) 2025-03-24 11:55:14 -05:00
Natalie Tay
af03873d37
DEV: Allow loading topic associations on /categories (#31954)
`/categories` sometimes returns accompanying topics under certain site
settings. The `CategoryList` currently allows preloading for topic
custom fields via `preloaded_topic_custom_fields`, but not for topics
themselves.

This addition is required for
https://github.com/discourse/discourse-solved/pull/342.
2025-03-24 17:40:15 +08:00
Krzysztof Kotlarek
9db89c20f7
FEATURE: send email to deleted user (#31947)
When a user post is flag as spam and the moderator deletes the user, we
should send email to the affected user.
2025-03-24 14:45:25 +08:00
Gary Pendergast
b77d0f7589
FEATURE: Sync Reviewable Status (#31901)
When multiple admins are working in the review queue, it's quite easy for two people to try and handle the same reviewable at the same time. This change addresses the two major situations where this can occur.

The `ReviewableClaimedTopic` model has been extended to allow the system to mark a reviewable as claimed as soon as the first moderator starts handling the reviewable, even when the `reviewable_claiming` setting is disabled. This ensures that reviewable actions with client-site activity (for example, `agree_and_suspend`) will lock the reviewable before another moderator starts working on it.

When someone handles handles a reviewable, we now use `MessageBus` to inform other moderators that it's changed. If any of the other moderator have that reviewable open (either individually, or on the list screen), it will automatically refresh that data.
2025-03-24 14:27:18 +11:00
Ted Johansson
b4085c7b50
DEV: Support target in problem check problem constructor (#31922)
We didn't have support in the #problem constructor for multiple targets, forcing developers to manually construct a Problem instance. This involves a lot of details and is error prone.

This PR supports passing an optional target argument to the constructor. This will be passed on to the translation_data method to generate the correct message as well.
2025-03-24 10:10:41 +08:00
chapoi
e7c3abb94b
UX: Add missing border-radius variable (#31952)
The search result panel didn't have the new-ish border-radius variable
attached yet.
2025-03-22 15:13:02 +01:00
Jordan Vidrine
6784314fa9
DEV: Remove span tag from outlet (#31961) 2025-03-21 16:10:54 -05:00
David Taylor
b26e0c0a33
PERF: Skip lazy-loading images in composer preview (#31955)
Safari does not reload lazy images smoothly, which causes a lot of
flickering in the composer preview while typing.
2025-03-21 14:54:45 +00:00
Kris
edb6758110
FIX: tag revisions need an empty wrapper (#31938)
follow-up to b4f9626984667133a2a1f656109d154214dbe47a

the previous commit removed an intentionally empty wrapper, which
aligned the diff when there's only an addition


Before (tag aligned to the left, associated with the wrong version):

![image](https://github.com/user-attachments/assets/cacf5fc0-8020-460b-a596-e65acab31c27)


After (tag aligned right, associated with the new revision):

![image](https://github.com/user-attachments/assets/3ea14fd1-d871-493b-acec-60ad8c3d530d)
2025-03-21 09:27:16 -04:00
David Battersby
5c05b352fd
FIX: redirect user activity drafts route (#31949)
When logged in and visiting another user's drafts page, we should
redirect back to the current user drafts page.

For non auth users, we can redirect back to the forum `/latest` page.
2025-03-21 15:30:31 +04:00
Ella E.
f08d171809
UX: Show upload progress percentage for better feedback (#31923)
[image-upload2.webm](https://github.com/user-attachments/assets/a57798a0-d5de-4879-ae6b-6dccea6e45ff)
2025-03-20 20:02:59 -06:00
Osama Sayegh
f7f7642ae0
UX: Improve naming for anonymous mode settings (#31832)
This PR renames a couple of settings related to anonymous mode:

1. `allow_anonymous_posting` → `allow_anonymous_mode`. This setting is
used as a switch for the entire anonymous mode feature, so it makes
sense to give it a generic name that better reflects what the setting
does.
2. `allow_anonymous_likes` → `allow_likes_in_anonymous_mode`. The new
name is clearer and will match a new setting that we'll add to allow
anonymous users to post in chat.

Internal topic: t/148088.
2025-03-21 04:54:06 +03:00
Arkshine
dd0a6bd188
FIX: Bookmark search input can't be cleared with backspace with ?q= present (#31919)
Meta:
https://meta.discourse.org/t/cant-erase-the-bookmark-search-input/357861/4

> When we fill in the bookmark search input and send the request, then
we can’t delete the input’s content.

After removing the last character, the `searchTerm` getter is called. At
this point, `_searchTerm` is empty.
However, `this._searchTerm || this.q` will treat the empty string as
_falsy_, and the `q` value is displayed instead.
It makes it impossible to clear the input.

To fix this, we check specifically on the initial state of
`_searchTerm,` which is _undefined_, to include an empty string as a
valid value.

Note: because of `@computed`, the issue is not triggered when the
content is selected and deleted.
2025-03-21 09:50:05 +08:00
Kelv
3522867fac
DEV: refactor usage of buffered-content mixin (#31926)
Refactors the use of the buffered-content mixin to native getters on the
dependent classes.

This mixin previously provided a cached wrapper around an instance of
BufferedProxy and added 2 convenience methods aliasing BufferedProxy
methods.

### Main changes:
* Use of the`@cached` decorator to maintain parity with the previous
version of `this.buffered` to make sure we only refresh the buffered
proxy if the dependent property changes.
* _Not entirely sure if @cached + @dependentCompat is more performant
than just using `@computed`_

* Use of the`@dependentCompat` decorator to ensure backwards
compatibility of the getter with computed properties - we will leave
refactoring of those somewhere down the road as that would greatly
increase the scope of this PR

* `applyChanges` / `discardChanges` are the same as
`applyBufferedChanges` / `discardBufferedChanges` for BufferedProxy
2025-03-21 09:06:26 +08:00
dependabot[bot]
ea8d5140e3
Build(deps-dev): Bump message-bus-client from 4.4.0 to 4.4.1 (#31944)
Bumps [message-bus-client](https://github.com/discourse/message_bus)
from 4.4.0 to 4.4.1.
-
[Changelog](https://github.com/discourse/message_bus/blob/main/CHANGELOG)
-
[Commits](https://github.com/discourse/message_bus/compare/v4.4.0...v4.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-21 09:01:23 +08:00
David Taylor
579eda6b66
DEV: Move dialog DOM handling from service to component (#31925)
Accessing a component-rendered DOM element from a service is not ideal,
and can lead to timing issues. We've attempted to work around this using
`afterRender`, but it's still not ideal.

This commit moves the `A11YDialog` setup into a modifier. Now the
service only stores state, and the component renders things based on
that state. This is much more in line with Ember norms, and should be
much more robust.

Test adjustments are because the dialog element is now only rendered
on-demand, rather than being present in the DOM all the time. This
brings dialog inline with our Modal system.
2025-03-21 08:59:23 +08:00
Alan Guo Xiang Tan
871356f547
UX: Improve UX of 2FA token submission page (#31918)
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.
2025-03-21 08:49:12 +08:00
Martin Brennan
832ed8ce74
UX: Fix various search shortcut UX issues (#31903)
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.
2025-03-21 09:20:58 +10:00
chapoi
712302c020
UX: add mini z-index to welcome banner to fix overflowing result pane… (#31927)
…l opacity hickup

Fixing the opacity issue caused by the slight delay animation
2025-03-20 19:13:47 +01:00
Joffrey JAFFEUX
94e5630ec3
DEV: adds declarative options to object/container (#31934)
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`.
2025-03-20 14:58:54 -03:00
David Taylor
38872b5b9b
FEATURE: Introduce warning banner for Safari 15 deprecation (#31928)
Ref https://meta.discourse.org/t/safari-15/358131
2025-03-20 15:03:24 +00:00
David Taylor
5f8a183abf
FIX: Stop non-rgb header background colors crashing DiscourseHub (#31929)
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.
2025-03-20 13:56:07 +00:00
Joffrey JAFFEUX
7f9a0bb2a7
FIX: prevents fields in Object to re-render (#31916) 2025-03-20 08:32:22 +01:00
Martin Brennan
897d34132e
FIX: Add value transformers for welcome banner and search (#31917)
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.
2025-03-20 15:37:42 +10:00
dependabot[bot]
eef5ced7b7
Build(deps-dev): Bump sinon from 19.0.2 to 19.0.4 (#31914)
Bumps [sinon](https://github.com/sinonjs/sinon) from 19.0.2 to 19.0.4.
- [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/v19.0.2...v19.0.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-20 09:06:54 +08:00
Kevin Hwang
0cdbd40866
FIX: Increase uploads.origin column length to 2000 to accommodate longer S3 pre-signed URLs for user uploads. (#31803)
The current limit is too small for the way Discourse currently stores a
pre-signed S3 URL for each upload in the form of:

```
https://{bucketname}.s3.dualstack.{region}.amazonaws.com/original/1X/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=XXXXXXXXXXXXXXXXXXXX%2FYYYYMMDD%2F{region}%2Fs3%2Faws4_request&X-Amz-Date=YYYYMMDDTHHMMSSZ&X-Amz-Expires=xxxxxx&X-Amz-SignedHeaders=host&X-Amz-Security-Token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```

The problem here is that this URL, without the S3 bucket name and AWS
region portion of the URL, is already nearly 1000 chars long.

If you have an even slightly longer bucket name or region, it will
easily go over 1000.

---

The more proper fix would be not to store these "template" S3 pre-signed
URLs in the `origin` column to begin with.

S3 pre-signed URLs aren't meant to be persisted (they're by nature
"one-time" use, scoped to a short window), and they have to be
re-generated for each user request anyway, because they have a maximum
validity of 7d (in practice Discourse generates them with a lifetime of
300s), so the value stored in the `origin` column is more of a
"template" that gets discarded and a real pre-signed URL generated
on-the-fly each time a user comes anyway. So the value in the `origin`
column isn't even doing anything.

The proper way would be to store the S3 bucket name, region, and object
key, which is compact, and the three pieces of info from which it is
sufficient to generate pre-signed URLs each time a user requests.
2025-03-20 09:05:35 +08:00
Bianca Nenciu
bdc30ca3a0
FIX: Force pagination only if more than 1000 subcategories (#31507)
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.
2025-03-20 00:12:14 +02:00
Renato Atilio
bd92b050cf
UX: editor-specific getCaretCoords to position emoji picker on autocomplete's more (#31884)
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.
2025-03-19 18:55:41 -03:00
Renato Atilio
2a73387029
FIX: paste url on rich editor with partial paragraph selected (#31906)
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
2025-03-19 17:47:08 -03:00
Joffrey JAFFEUX
51569a7901
DEV: ensures rows and collections are full width (#31907) 2025-03-19 17:00:46 +01:00