Commit Graph

34580 Commits

Author SHA1 Message Date
9f51f64803 FEATURE: add table rich editor extension (#31153)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `table` node and its descendants – `table_head`, `table_body`,
`table_row`, `table_header_cell`, `table_cell` –, its Markdown
serializing/parsing logic, and a plugin to use the first body **row** of
a head-less table as the **header** when pasting `text/html`.
2025-03-04 11:45:19 -03:00
225f90b1c9 FEATURE: add strikethrough rich editor extension (#31152)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `strikethrough` mark, its Markdown serializing/parsing logic, and
a `~~text~~` input rule.
2025-03-04 11:42:42 -03:00
ddcbffc8c6 FEATURE: add quote rich editor extension (#31151)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `quote` node, its Markdown serializing/parsing logic, and a
plugin to select the node when the quote header is clicked.
2025-03-04 11:39:54 -03:00
7210d29c18 FEATURE: add link rich editor extension (#31150)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Replaces the ProseMirror's default `link` mark to support
Discourse-specific features, its Markdown serializing/parsing logic, a
`[caption](link)` input rule, and a plugin to auto-linkify URLs when
they're pasted as `text/plain` or `text/html`.
2025-03-04 11:37:09 -03:00
18a639916b FEATURE: add image rich editor extension (#31146)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds an `image` node, its Markdown serializing/parsing logic, and a
plugin to auto-resolve `upload://hash` short urls.
2025-03-04 11:34:19 -03:00
6168636de8 FEATURE: add emoji rich editor extension (#31144)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds an `emoji` node, its Markdown serializing/parsing logic, and input
rules for `:emoji:`s and `:-)` emoticon replacements.

[prosemirror-markdown's
heading](99b6f0a6c3/src/schema.ts (L30))
only allows `(text | image)*` content, we override it to allow `inline*`
to be compatible with all our inline (including emoji) nodes.
2025-03-04 11:31:47 -03:00
5a21f74716 FEATURE: add mention rich editor extension (#31142)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `mention` node, its Markdown serializing/parsing logic, and a
`@mention` input rule.
2025-03-04 11:20:44 -03:00
b43e465669 FEATURE: add hashtag rich editor extension (#31141)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds a `hashtag` node, its Markdown serializing/parsing logic, and a
`#hashtag` input rule.
2025-03-04 10:56:25 -03:00
02e471cc2a DEV: bump discourse-emojis 1.0.30 (#31609)
This update bring a few renames to avoid long names.
2025-03-04 14:53:47 +01:00
519be0f0b8 FEATURE: add underline rich editor extension (#31139)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds an `underline` mark, its Markdown serializing/parsing logic, an
`[u]` input rule, and a (Ctrl/Cmd)-U keymap.
2025-03-04 10:37:36 -03:00
7d4e4e9422 Revert "DEV: Add rake task to bulk delete posts" (#31607)
Breaks the build. Need to update the spec.
2025-03-04 20:54:03 +08:00
1c4d2db0ea DEV: Remove password validation mixin (#31579)
This removes the PasswordValidation mixin that is no longer used
anywhere else.
2025-03-04 18:44:37 +08:00
42c4427cb1 DEV: Add rake task to bulk delete posts (#31576)
This PR adds a destroy:posts rake task that can be used to hard-delete a list of posts. Useful for dealing with large amounts of spam that has been soft deleted and needs to go.

Notes:

Works on both non-deleted and soft-deleted posts. (We might want to change this to work on only soft-deleted posts?)
Works exclusively on post IDs. We can't mix topic and post IDs as they might clash, and we have no way of resolving that ambiguity.
Accepts either a rake-style array of IDs or, more conveniently, you can pipe the argument in through STDIN.
Added a confirmation step since it's a fairly destructive operation.
2025-03-04 17:29:38 +08:00
06a0108a52 DEV: Store selected API key scope mode in the database table (#31601)
Currently, after creating an API key, there is no way in the UI to see what scope the key has. To do this we need to first store the selected scope mode when creating a new key.

In this PR we:

- Convert scope_mode from a transient attribute to a database backed enum.
- Ship the possible values through the javascript:update_constants rake task instead of hard coding in front-end.

In follow-up PRs we will:

- Backfill existing API keys based on their associated api_key_scopes records.
- Start showing the scope mode in the UI.
2025-03-04 16:41:43 +08:00
9abeff460c FEATURE: Display the Watched Words that caused a post to be flagged. (#31435)
When a post is flagged due to matching watched words, it can be difficult to know what you're looking for, particularly if you have a lot of watched words built up over a long period of time.

This change stores the list of matched words, and later displays them in the review queue, listing which Watched Words were responsible for the flag. Because watched words can change, this is recorded at the time the post is flagged. For posts that were flagged prior to this feature landing, it tries to guess the relevant words based on the current Watched Words set.
2025-03-04 17:22:12 +11:00
b329eac79a FIX: Handle href admin sidebar links better (#31575)
Admin sidebar links can have either a `href` or a
`route`, and the admin search was not handling
this properly. Also, we should always use `getURL()`
on the href in case the link is internal, for subfolder
sites.

This is hard to test right now, I plan on adding more extensive
links for admin-search-data-source in another PR.
2025-03-04 13:38:49 +10:00
879faa82b3 DEV: Add value transformer for admin reports show query params (#31597)
## 🔍 Overview
This update adds a new value transformer to the `queryParams` property
on the `AdminReportsShowController`. This is necessary so that plugins
can add additional `queryParams` to the route and have it reflected when
the route is transitioned.
2025-03-04 13:33:08 +11:00
dbba838ef4 FEATURE: rebranded admin logos settings (#31554)
Redesigned page to update site logos. `AdminBrandingLogoFormComponent`
is attached to the old logos page and the new branding page. In the next
steps, branding will replace the logos page.

A new `AdminConfigAreaCardSection` component was added hidden and less
frequently used settings.

An image placeholder was also needed because many additional logos have
a fallback to the site logo.

Finally, `twitter_summary_large_image` was renamed to
`x_summary_large_image`.

Desktop
![localhost_4200_admin_config_branding
(4)](https://github.com/user-attachments/assets/b6ae5266-72f6-4582-b0ef-4d05545943e8)


Mobile
![localhost_4200_admin_config_branding(iPhone 12 Pro)
(3)](https://github.com/user-attachments/assets/bf329a5c-9ba0-4d88-b30d-e8f1feb02e31)
2025-03-04 12:51:27 +11:00
64683389a2 UX: rich text for review_process_description (#31594)
In this PR, information about the review process was added to the flag
modal - https://github.com/discourse/discourse/pull/31300

Admins would like to use HTML tags to customise it even more.
2025-03-04 10:34:02 +11:00
4ed7a88a94 UX: Fix notifications tracking buttons styling (#31592)
A follow up to c95c3c4311a7af461e23f18a2aad6f6e68414560
2025-03-03 23:33:49 +01:00
f2bf669dc2 DEV: aliases should be considered as existing (#31589)
Before this commit doing: `Emoji.exists?(some_alias)` would return
false. The only important thing in emoji is to never remove an emoji
code which has been used by users but changing the name of an emoji and
keeping old name as an alias should not break the application in any
way, this commit should ensure this is true.
2025-03-03 20:17:49 +01:00
85406d9475 DEV: Resolve flaky terser spec (#31588) 2025-03-03 18:40:44 +00:00
49902a0cc3 FIX: Correct translation key for admin color palettes page heading (#31587) 2025-03-03 20:12:55 +03:00
454dd1ea51 DEV: Change glimmer_topic_list_mode to enabled by default (#31585)
https://meta.discourse.org/t/343404
2025-03-03 18:07:15 +01:00
d456e83adc DEV: bump discourse-emojis gem (#31583)
This should fix an issue with a 100 emoji alias. 100 should now be
considered as the top level emoji name and hundred_points an alias.

Other renames are also part of this gem bump: sweat_smile, grin, ...
2025-03-03 17:39:55 +01:00
4a05f3198d Build(deps-dev): Bump @ember/render-modifiers from 2.1.0 to 3.0.0 (#31569)
Bumps
[@ember/render-modifiers](https://github.com/emberjs/ember-render-modifiers)
from 2.1.0 to 3.0.0.
- [Release
notes](https://github.com/emberjs/ember-render-modifiers/releases)
-
[Changelog](https://github.com/emberjs/ember-render-modifiers/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/emberjs/ember-render-modifiers/compare/v2.1.0...v3.0.0)

---------

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-03-03 16:58:56 +01:00
8165de9483 Build(deps-dev): Bump @swc/core from 1.11.4 to 1.11.5 (#31571)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.4 to
1.11.5.
- [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.4...v1.11.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:29:06 +01:00
6da6809014 Build(deps): Bump @faker-js/faker from 9.5.0 to 9.5.1 (#31573)
Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 9.5.0 to
9.5.1.
- [Release notes](https://github.com/faker-js/faker/releases)
- [Changelog](https://github.com/faker-js/faker/blob/next/CHANGELOG.md)
- [Commits](https://github.com/faker-js/faker/compare/v9.5.0...v9.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:06:03 +01:00
7cbd7ad39c Build(deps): Bump core-js from 3.40.0 to 3.41.0 (#31572)
Bumps
[core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js)
from 3.40.0 to 3.41.0.
- [Release notes](https://github.com/zloirock/core-js/releases)
-
[Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/zloirock/core-js/commits/v3.41.0/packages/core-js)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:05:35 +01:00
077393fb59 Build(deps-dev): Bump ember-async-data from 1.0.3 to 2.0.0 (#31570)
Bumps
[ember-async-data](https://github.com/tracked-tools/ember-async-data)
from 1.0.3 to 2.0.0.
- [Release
notes](https://github.com/tracked-tools/ember-async-data/releases)
-
[Changelog](https://github.com/tracked-tools/ember-async-data/blob/main/CHANGELOG.md)
- [Commits](https://github.com/tracked-tools/ember-async-data/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-03 16:03:31 +01:00
80625f6c1c DEV: explicit json for emojis/search-aliases (#31582)
Adds `.json` a suffix everywhere and makes it clear that's it's a json
route.

Also adds a missing spec for this endpoint and updates the underlying
discourse-emojis gem for better symlinking
2025-03-03 15:21:16 +01:00
1bd61630ef UX: Simplify admin theme editor (#31561)
- Hide seldom-used fields behind an 'advanced' checkbox. This replaces
the old 'only show edited' checkbox, since the number of fields shown by
default is now so small that 'only show edited' isn't useful.
Mobile/desktop targets are included in that list because we now
recommend people use CSS breakpoints for handling different device
sizes.

- Update names & descriptions of fields to be more descriptive

- Show the descriptions of fields at the top of the editor. Previously
they were only shown as tooltips.

Before:
<img width="1109" alt="SCR-20250228-lunn"
src="https://github.com/user-attachments/assets/8faebba1-39c1-491a-b236-411cfb6d9c74"
/>

After, default view:
<img width="1102" alt="SCR-20250303-kayr"
src="https://github.com/user-attachments/assets/1e483845-613f-44d6-83d6-ade628251fe5"
/>

After, advanced view:
<img width="1122" alt="SCR-20250303-kazn"
src="https://github.com/user-attachments/assets/45b8933d-2271-42ba-b5b4-81b326709adb"
/>
2025-03-03 12:20:11 +00:00
d38acc5df1 DEV: discourse-emojis gem (#31408)
This commit moves most of emoji logic into the discourse-emojis gem:
https://github.com/discourse/discourse-emojis/

Most notably:
- images are now symlinked from the gem
- the gem provides path to the json files

Search aliases have also been made asynchronous and memoized. When you
will search for an emoji we will now load the aliases and store the list
for future use.

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2025-03-03 13:09:08 +01:00
a5c21a92b2 UX: Add recommended image size for category logos (#31574)
This adds a description to the category logo image fields that informs users of the recommended image aspect ratio and minimum size to upload.
2025-03-03 20:53:36 +11:00
5c4c8b81eb DEV: prevent sass mixed declarations warning (#31577)
Prevents deprecation warning of sass mixed declarations. We should move
declarations above nested styles.

We get the following message from logs:
```
DEPRECATION WARNING [mixed-decls]: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.
```

For more info see:
https://sass-lang.com/documentation/breaking-changes/mixed-decls/
2025-03-03 12:10:56 +04:00
081a0159d8 UX: search dropdown layout improvements (#31568)
This change improves the alignment and placement of the search spinner
and icons (ie. clear search / advanced search). Having a fixed width on
desktop prevents the search field from changing width when the loading
icon is toggled.
2025-03-03 09:36:53 +04:00
8615fc6cbb DEV: Add a user agent to all HTTP requests that Discourse makes. (#31555)
This change standardises the `User-Agent` header that Discourse will send when talking to other sites.

`Discourse.user_agent` is now the authority on what the user agent value should be. For Onebox requests, this changes the user agent from their existing value to match the new value (unless overridden).

For all other requests, `Net::HTTPHeader` is monkey-patched to add a default `User-Agent` header when one hasn't been provided.
2025-03-03 16:32:25 +11:00
8325d42e56 FEATURE: Experimental admin search refinements round 1 (#31441)
Followup e26a1175d7c33746bddbc858ad89e68cc14beefe

Adds extra functionality and tests for the admin search modal.

* Show third level plugin config pages in search, e.g.  AI Usage
* Remember last used search filters
* Allow navigating search results with keyboard, using tab or up/down
and enter to go to result
* Add a placeholder beneath search input to tell the admin what to do
* Add a full page search at `/admin/search` which can be reached from
pressing Enter on the search input
* Add specs for modal and full page search
* Change admin sidebar filter "no results found" to point to full page
search
* Add keyboard shortcut help to modal for admin search
2025-03-03 13:56:07 +10:00
176ee0bf60 DEV: Add posts_controller_create_user modifier (#31562)
Add `posts_controller_create_user` modifier to modify which user is associated with the post creation.
2025-02-28 15:11:12 -06:00
c95c3c4311 DEV: correct class on trigger of notifications-tracking (#31560)
If we have a custom content for a `DMenu` trigger the `DButton` has no
way to know there's text in this custom content so it will output the
"no-text" class on the `DButton`. The correct way to fix this is to use
our own `DButton` and the `@triggerComponent` so we can fully replace
the behavior and set the correct classes.
2025-02-28 21:07:33 +01:00
dfb9418da0 DEV:add outlet wrapper for user summary topic (#31546)
- Add an outlet wrapper for user summary topic
2025-02-28 16:33:22 -03:00
cbdd28321e DEV: Add app event triggers for interface color changes (#31558) 2025-02-28 12:08:42 -04:00
56a0b17b12 Introduce a new plugin outlet (#31542)
Adds a new plugin outlet below the `flagging.review_process_description`
customizable text.

The customizable text only accepts plain-text. This plugin outlet would
allow developers to add additional description with any rich-text
content they need, such as paragraphs and links.
2025-02-28 10:52:31 -05:00
5312550bf9 A11Y: read who liked/read a post when count clicked (#31549)
This change adjusts the markup and aria tags so that the like and read
counts on posts will read who liked/read when clicked. Previously this
content was inaccessible to screen readers.


![image](https://github.com/user-attachments/assets/d205eb9a-ffa9-4955-8191-7a0411b23c46)

This change required: 

* Keeping the empty containing divs present and adding `aria-live` tags
(if the `aria-live` tag isn't initially present in the DOM, it will not
read changes to the content within)
* Adjusting some styles to avoid extra margin from the empty div (added
a conditional class to add the margin back when expanded)
* Cleaned up the aria tags, we don't need to hide the "liked this" text,
as it will be read naturally after the usernames like "username1,
username2, liked this" This allows us to remove the screenreader only
description.
* Removed "Click to view" from the button label, the interactivity is
inherent because the screenreader identifies it as a button
2025-02-28 09:15:04 -05:00
3efbd95ad8 FEATURE: add search field to header (#31447)
Adds a search field to the page header on desktop that is controlled by
a site setting (within Search).

The search field toggles back to the search icon (magnifying class) when
the header is minimized (ie. scrolling in topics) and restores to the
field again when header is no longer minimized.

On mobile the search experience is still the same.
2025-02-28 12:47:09 +04:00
edd413a71a Build(deps-dev): Bump @swc/core from 1.11.1 to 1.11.4 (#31550)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.1 to
1.11.4.
- [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.1...v1.11.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-28 00:06:42 +01:00
17b42d9786 UX: Evenly distribute nav-space for drop-downs & buttons (#31545) 2025-02-27 16:03:32 -06:00
fb98ced782 DEV: add scope param to user_confirmed_email event (#31394)
EmailToken.confirm is called in a number of contexts (hence the need for
the `scope`) and this is sometimes needed in `user_confirmed_email`
callbacks to distinguish those contexts.
2025-02-27 14:53:06 -05:00
29fd411800 A11Y: retain focus on highlighted post to avoid scroll jump (#31547)
Here we correctly focus a mid-stream post for screenreaders so they know
where to start, but once focus is removed NVDA becomes unmoored and will
jump back up the post stream to a previous post if someone tries to
navigate with the arrow keys.

Retaining the focus prevents this and shouldn't have any major
side-effects.

Tested using Chrome and NVDA
2025-02-27 14:31:55 -05:00
7fc946af4c A11Y: add aria-hidden="true" wrapper around zero width space character in buttons (#31544)
The zero width space added here as a layout fix seems to get noticed by
screenreaders (tested in NVDA) and gets "read" as text.

This means that instead of falling back to the button title, which is
the normal behavior for textless buttons, the screenreader reads the
blank space. This results in buttons like the post controls being read
simply as "button" with no other description.

Wrapping the space in `aria-hidden` corrects this, and results in the
button title being read properly.
2025-02-27 12:51:10 -05:00