Commit Graph

58454 Commits

Author SHA1 Message Date
1404a169ca FIX: Zlib may raise BufError during asset:precompile (#31398)
According to Zlib documentation, this is not a fatal error. In this case
we attempt to deflate the asset three times before giving up.

Sprockets will be replaced in the long term and this is an acceptable fix.
2025-03-07 09:08:06 +02:00
4bb1e0d113 FIX: loop detection works as expected and does not need logging (#31686)
Logging creates impression that something is not working while
everything is working as expected.
2025-03-07 16:41:29 +11:00
e87bfad23b Revert "DEV: Replace Rinku native gem with PrettyText" (#31692)
Reverts discourse/discourse#31557

This is causing excessive spacing due to the addition of empty `<p>`
tags. Revert first while we fix that.
2025-03-07 12:01:22 +10:00
e77e5bd3cc FIX: If a tag has a description, use it for the meta description. (#31689)
When a tag has a description defined, we should use that in the `<meta
name="description"...` tag on the tagged topic list page. This matches
the behaviour on the equivalent category pages.
2025-03-07 12:53:54 +11:00
245fc89dc0 FIX: Authenticated x.com oneboxes failing (#31690)
Fixes the same issue that
e9387e238c
did for twitter.com, but for x.com. Since they redirect
on our first FinalDestination call with onebox, the request
fails even with `twitter_consumer_secret` and `twitter_consumer_key`
settings set.
2025-03-07 11:18:02 +10:00
b9e037471e FEATURE: add typographer-replacements rich editor extension (#31182)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds input rules to support the same [custom typographer
replacements](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse-markdown-it/src/features/custom-typographer-replacements.js)
we support when cooking.
2025-03-06 20:56:55 -03:00
71303a509f FEATURE: add html-block rich editor extension (#31181)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds an `html_block` node and its parsing/serialization logic.

It's rendered as a code block with HTML syntax highlighting, and
serialized as-is to the Markdown output.
2025-03-06 20:52:18 -03:00
03429b0f8f FEATURE: add html-inline rich editor extension (#31180)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Adds an `html_inline` node for a subset for allowed HTML, its
parsing/serializing logic, and an input rule to auto-trigger the node
creation when a `<allowedtag>` is typed.

Not related to the above, but I also renamed the tests that don't define
a template from `gjs` to `js`.
2025-03-06 20:47:46 -03:00
a5cacde681 FEATURE: add code-block rich editor extension (#31179)
Continues the work done on
https://github.com/discourse/discourse/pull/30815.

Extends the ProseMirror-markdown `code-block` node by integrating our
existing HighlightJS pipeline for code highlighting and adding a node
view with a `<select>` to change the language of the block.

We're also adding the markdown paste extension, which handles converting
pasted text/plain to rich content if it contains Markdown.

---------

Co-authored-by: Martin Brennan <martin@discourse.org>
2025-03-06 20:43:33 -03:00
991379b9a4 Build(deps-dev): Bump redcarpet from 3.6.0 to 3.6.1 (#31509)
Bumps [redcarpet](https://github.com/vmg/redcarpet) from 3.6.0 to 3.6.1.
- [Release notes](https://github.com/vmg/redcarpet/releases)
- [Changelog](https://github.com/vmg/redcarpet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vmg/redcarpet/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-07 00:20:54 +01:00
915e72033d DEV: Move bulk-select-enabled from body to topic-list element (#31687)
Followup to 41eb83a40185e43feb964288a5ebc5a903f05e13
2025-03-06 23:12:10 +00:00
dd87d23876 Build(deps-dev): Bump rubocop-factory_bot from 2.26.1 to 2.27.0 (#31683)
Bumps
[rubocop-factory_bot](https://github.com/rubocop/rubocop-factory_bot)
from 2.26.1 to 2.27.0.
- [Release
notes](https://github.com/rubocop/rubocop-factory_bot/releases)
-
[Changelog](https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop-factory_bot/compare/v2.26.1...v2.27.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-07 00:07:37 +01:00
23dd5c20d3 Build(deps-dev): Bump ember-cli-deprecation-workflow from 3.1.0 to 3.2.0 (#31682)
Bumps
[ember-cli-deprecation-workflow](https://github.com/ember-cli/ember-cli-deprecation-workflow)
from 3.1.0 to 3.2.0.
- [Release
notes](https://github.com/ember-cli/ember-cli-deprecation-workflow/releases)
-
[Changelog](https://github.com/ember-cli/ember-cli-deprecation-workflow/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/ember-cli/ember-cli-deprecation-workflow/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-06 23:56:17 +01:00
0976e4ad18 Build(deps-dev): Bump ember-cli from 6.2.2 to 6.2.3 (#31680)
Bumps [ember-cli](https://github.com/ember-cli/ember-cli) from 6.2.2 to
6.2.3.
- [Release notes](https://github.com/ember-cli/ember-cli/releases)
-
[Changelog](https://github.com/ember-cli/ember-cli/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/ember-cli/ember-cli/compare/v6.2.2...v6.2.3)

---------

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-06 23:55:16 +01:00
1abc5870c3 Build(deps): Bump aws-eventstream from 1.3.1 to 1.3.2 (#31684)
Bumps [aws-eventstream](https://github.com/aws/aws-sdk-ruby) from 1.3.1
to 1.3.2.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
-
[Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-eventstream/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-06 23:23:36 +01:00
1b95a8e1e0 DEV: replace zero width space character in chat typing indicator (#31675)
We were using a zero width space added by CSS here, but have run into
occasional encoding issues for some reason? a couple people have
reported getting this instead of an empty space:


![image](https://github.com/user-attachments/assets/da39b5f5-61b0-423c-ae3e-18169e4f2f71)

I can't repro the issue, but we can avoid it by removing this space in
CSS — setting the container height to `1em` along with `line-height:
normal` should make it consistent with the height of the text within.

In the blame it seems this static height on the container was added
after the pseudo hack, and achieves the same goal when I test it across
a Firefox/Chrome/Safari
2025-03-06 15:53:50 -05:00
41eb83a401 DEV: Add body class when bulk select is enabled (#31677) 2025-03-06 14:53:32 -06:00
5b092d4466 FIX: ensures emoji picker loader is centered (#31676)
before:
![Screenshot 2025-03-06 at 21 04
32](https://github.com/user-attachments/assets/080d188b-f3ad-48a6-aee7-e8d4be36d407)

after:
![Screenshot 2025-03-06 at 21 04
28](https://github.com/user-attachments/assets/6e131e66-7cc4-45e3-a783-d2774dbf92b4)
2025-03-06 21:19:01 +01:00
dc9269eee5 FEATURE: Handle youtube live url format (#31673)
Meta:
https://meta.discourse.org/t/youtube-autoembeds-for-live-streams/350920

This PR supports YouTube live URLs, such as:
`https://www.youtube.com/live/eJemwqO0SDw`.


![image](https://github.com/user-attachments/assets/b7e57857-5676-4dcf-862e-1e4b4e594009)

![image](https://github.com/user-attachments/assets/f5e6f2d0-a158-41c6-bc20-0642868dbef8)
2025-03-06 15:43:38 -03:00
0e8d36d080 DEV: Fixup theme detection for template-override deprecation (#31672) 2025-03-06 16:46:06 +00:00
fb76696f45 UX: removes per channel context of favorites emojis (#31671)
This was confusing users.
2025-03-06 16:07:58 +01:00
ac736ec0ca DEV: merge mobile stylesheets into common with breakpoints (#31656)
This is the beginning of a longer process to merge our stylesheets under
the common directory.

I also converted a SCSS variable to a CSS custom property along the way.

In the case of the lightbox styles, this seemed more appropriate to
distinguish by primary input type (touch vs mouse) rather than
breakpoint sizes.
2025-03-06 08:44:54 -05:00
9dd26a3954 DEV: discourse-emojis 1.0.32 (#31669)
This gems bring a whole improved fluentui emoji set. Each image has been
recomputed to optimise the size of the emoji and remove useless margins.

For this reason the version has been bumped.

Other changes:
- not loading rake task dependencies in production
- renamed yo_yo/yo-yo to yoyo
2025-03-06 10:35:04 +01:00
3b8b21631b UX: Remove fa- prefix in svg_icon_subset setting description (#31581)
Based on the discussion in
https://github.com/discourse/discourse-social-share/pull/24#discussion_r1975633090
I think "fa-" is no longer needed in core either.
2025-03-06 17:27:48 +11:00
c6b4a09ad9 UX: remove padding in admin card section (#31666)
Before
<img width="1064" alt="Screenshot 2025-03-06 at 3 05 55 pm"
src="https://github.com/user-attachments/assets/38acc2cd-1204-42ec-aac7-18dfee32e8bc"
/>


After
<img width="949" alt="Screenshot 2025-03-06 at 3 06 44 pm"
src="https://github.com/user-attachments/assets/ded3c81f-8057-483d-b997-d1983ccf1318"
/>
2025-03-06 16:35:25 +11:00
ba19430286 DEV: Add a PluginOutlet for mobile-view topic activity number (#31567)
This commit adds a PluginOutlet for activity number in mobile view, so I
can override it with my theme component.

Why?
======

In this theme component
https://meta.discourse.org/t/show-both-op-and-last-reply-on-mobile/267944,
I need to add an avatar to the post time to indicate the last poster.


![image](https://github.com/user-attachments/assets/a33ff8ed-50c6-4bc4-a093-115578ad9bad)

Without this outlet, I can't do this, having to rewrite the entire
`item.gjs`, or use some vanilla JavaScript tricks to do it.

---------

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
2025-03-06 10:50:43 +08:00
f024bc4c6f FIX: Ensure the reviewable.type_source migration is run post-deploy. (#31663)
When the upgrade process from 29a8c6ee498999f114f933d2de2b46989a407660 is run, there's a deployment race condition where old code can write a Reviewable to the database without a `type_source` (incorrectly defaulting it to "unknown").

This change adds a post-deploy migration script that populates any such Reviewables with the correct `type_source` value.
2025-03-06 12:12:46 +11:00
bbc1c2726c Revert "DEV: discourse-emojis 1.0.31 (#31655)" (#31662)
This reverts commit 7e65cdbc9aa86677a2f6f7a8d4f1b8e87da07ff1.

It broke the production build, as it's trying to load
`selenium-webdriver` (a dev dep) in the production env.
2025-03-06 00:40:01 +01:00
6882453ab7 UX: card section toggle (#31644)
Demo

https://github.com/user-attachments/assets/17e2b6d9-ba49-4312-85d9-6ff2ccad2290
2025-03-06 10:31:29 +11:00
f6860dcb92 DEV: Remove installing minio binaries in tests workflow (#31652)
In the `discourse/discourse_test:release` base image, the minio binaries
are already being installed and updated on a daily basis. There is also
no
real need for us to have to run the latest minio binaries once it is
released. As such, we can drop the step in the `tests` workflow.
2025-03-06 10:04:07 +11:00
593f4f7592 Build(deps-dev): Bump ember-exam from 9.0.0 to 9.1.0 (#31660)
Bumps [ember-exam](https://github.com/ember-cli/ember-exam) from 9.0.0
to 9.1.0.
- [Release notes](https://github.com/ember-cli/ember-exam/releases)
-
[Changelog](https://github.com/ember-cli/ember-exam/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ember-cli/ember-exam/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-05 23:40:29 +01:00
1a25f99e13 Build(deps): Bump google-protobuf from 4.29.3 to 4.30.0 (#31658)
Bumps [google-protobuf](https://github.com/protocolbuffers/protobuf)
from 4.29.3 to 4.30.0.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
-
[Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](https://github.com/protocolbuffers/protobuf/commits/v4.30.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-05 23:38:58 +01:00
e29c235281 Build(deps-dev): Bump parallel_tests from 5.0.0 to 5.0.1 (#31657)
Bumps [parallel_tests](https://github.com/grosser/parallel_tests) from
5.0.0 to 5.0.1.
-
[Changelog](https://github.com/grosser/parallel_tests/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/grosser/parallel_tests/compare/v5.0.0...v5.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-05 23:37:28 +01:00
7e65cdbc9a DEV: discourse-emojis 1.0.31 (#31655)
This gems bring a whole improved fluentui emoji set. Each image has been
recomputed to optimize the size of the emoji and remove useless margins.

For this reason the version has been bumped.

Other notable change: the emoji yo-yo can now be called "yoyo".
2025-03-05 21:49:18 +01:00
faa985bf28 DEV: Add search_result_view app event to SearchMenu (#31632)
For plugins/themes to be able to hook into after search result review is
rendered
2025-03-05 12:20:56 -06:00
f9e4ac94f5 DEV: Add a new behavior transformer to topic list item click (#31653)
- Add the behavior transformer `topic-list-item-click` to allow the
customization for the click behavior on the topic list item.
2025-03-05 15:15:17 -03:00
299b1b42ec DEV: Reduce the use of self/set in tests (#31648)
still lots to update but it's a start
2025-03-05 13:10:20 +01:00
0684ac64f2 DEV: Remove the deprecated componentTest helper (#31649) 2025-03-05 12:50:12 +01:00
95939ca499 DEV: set field type in control wrapper (#31647)
Calling `<field.Calendar>` will ultimately call `componentFor` which
will mutate the type of the field. Problem is the way we use a hash to
define all the available controls, would work correctly on first render,
but because of the mutation in `componentFor` if something would trigger
a re-render it would have to evaluate all the `componentFor` calls, and
the last one would "win" (currently calendar), which would mean that a
field rendered as custom would for example become calendar.

The easiest repro was:

```gjs
<Form as |form|>
  <form.field as |field|>
    {{log field}}
    <field.Custom>
      Hello world
    </field.Custom>
  </form.field>
</Form>
```

The fix for now is to mutate the value at the point where the component
is actually rendered, in control-wrapper.

A possibly more correct longer term fix could be to change the API, to
set the type on the field when defined in the template, and render a
generic component which would use this type to know what to render:

```gjs
<form.field @type="calendar" as |field|>
  <field.Control @someCalendarOption="bar" />
</form.field>
```
2025-03-05 11:43:53 +01:00
ba262733a6 A11Y: Improve contrast for FormKit help text and optional text (#31645) 2025-03-04 22:29:15 -07:00
305039b1c3 DEV: ensure Rails application default headers are present in responses (#31619)
Follow up from https://github.com/discourse/discourse/pull/31559.

We expect some standard headers to be added from
`Rails.application.config.action_dispatch.default_headers` for
responses, however these were found to be removed in some error paths. 
For more detail on this behaviour, refer to https://github.com/discourse/discourse/pull/31619#issuecomment-2699644232.

This PR adds those headers back if they aren't there, with the caveats
that we don't add headers that are irrelevant for non-HTML responses,
and neither do we add X-Frame-Options which is intentionally removed for
embeddables.
2025-03-05 13:19:09 +08:00
63213398bf UX: Add left border to indented field and update caret for consistency (#31643)
* Added a subtle left border to the indented field to improve visual
hierarchy
* Updated the caret to align with other expandable elements for
consistency
2025-03-05 14:29:51 +11:00
e4401e587e FIX: Ensure queued posts with watched words are processed correctly. (#31641)
This change ensures that queued posts that have ended up in the review queue due to matched a watched word display correctly.

It also improves the data checking to ensure that any other reviewables with watched words don't break the review queue, either.
2025-03-05 13:59:42 +11:00
223b40de1c FEATURE: Store composer version and device info on post stat (#31600)
We are developing our new composer, and it would be useful
if we could know how posts are being created by members.

To this end, we are going to start storing the following
on post_stats, which are created at the same time as a post
is created:

* writing_device - Based on `BrowserDetection.device`, which in
  turn is based on user agent. Will store .e.g iphone, android,
  mac, windows etc.
* writing_user_agent - Stores the full user agent (truncated at
  400 chars) of the device/browser the member used to write the post.
* composer_version - Either `1` for our old composer, or
  `2` if the new rich composer is enabled in site settings and
  the user has toggled it on
2025-03-05 12:48:32 +10:00
702a2a9cbc UX: display html tags in silence reason (#31598)
Allow HTML tags in silence reason. Tags must be stripped for title
attribute.

Before

![image](https://github.com/user-attachments/assets/05d9819a-9dbf-46b2-b9c5-88187ca9af5b)


After
<img width="1079" alt="Screenshot 2025-03-04 at 11 39 05 am"
src="https://github.com/user-attachments/assets/2bb41deb-227c-47a8-b840-b0316a764252"
/>
<img width="1096" alt="Screenshot 2025-03-04 at 11 39 22 am"
src="https://github.com/user-attachments/assets/02e27fc0-317e-43df-bce8-6b68e48ac40e"
/>
2025-03-05 12:43:03 +11:00
828fcb1ad3 DEV: Add rake task to bulk delete posts (#31642)
Same as #31576, but in that one I added some support files that turned out to be unnecessary and broke the build. So this is the re-do. 🙏
2025-03-05 09:31:23 +08:00
Sam
503645dc34 DEV: bump to major release of mini_racer (#31640)
Only notable changes is that we added
internal support for TimeWithZone which
was absent from previous release

We also improved error messages for T_OBJECT
2025-03-05 12:06:36 +11:00
72ba574d6f DEV: Convert tests using the gjs codemod (#31625)
```sh
pnpm dlx @embroider/template-tag-codemod@alpha --relativeLocalPaths=false --nativeRouteTemplates=false --nativeLexicalThis=false --templateInsertion="end"
```
2025-03-05 01:37:30 +01:00
28e00d9bfe DEV: Update lint-configs and autofix issues (#31620)
This updates us to Prettier 3.x
2025-03-05 01:20:16 +01:00
f8b30ffd06 Build(deps-dev): Bump @swc/core from 1.11.5 to 1.11.7 (#31636)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.11.5 to
1.11.7.
- [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.5...v1.11.7)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-05 00:26:30 +01:00