Having it in d-ai's plugin.rb file solves it when running plugin tests.
But when running core tests, plugins are not loaded, but the tables
still exist in the database.
Followup to 6247fdc255
Updates `prosemirror-model` to use this fix: [When preserving
whitespace, replace newlines with line break replacements
](https://github.com/ProseMirror/prosemirror-model/commit/79e9f2b9497ec3aac70d180aa846267dafa48d9a)
Adds `linebreakReplacement: true` to our hard break node spec
definition.
Adds a system test to confirm a `white-space: pre` HTML pasted from the
clipboard parses new lines as hard breaks.
**Description**
Replaces separate @strip_images and @markdown_images boolean flags with
a single @image_mode variable that can be :strip, :markdown, or nil.
Keeping the interface but ensuring only one
When adding a note through the timeline tab, the note wasn't being
persisted to the reviewable's reviewable_notes array. This caused the
note to disappear when switching between tabs.
This is a follow up to cf4193e6e1.
When chat is being initialized, we initiate an async request to
`/chat/api/me/channels` via `this.chat.loadChannels` but do not await on the request to be completed.
This is fine when a user is not visiting a chat channel route directly.
However, not awaiting on `this.chat.loadChannels` can cause problems
like a user's thread list or drafts to not be displayed if the
`/chat/api/me/channels` request does not return before rendering
happens. To resolve this, we will now wait for the promise in
`this.chat.loadChannels` to resolve before allowing rendering to happen on the `ChatChannelRoute`.
When a `PUT`, `POST`, or `DELETE` operation doesn't need to return any
data, we've historically either returned nothing, or `{ success: "OK"
}`.
A more consistent way to return the same data would be with a 204 status
response. This gives the same information as the `{ success: "OK" }`
body (ie, that the operation successfully completed), without needing to
read or parse the response body.
This change adds a 204 response for `Admin::SiteSettingsController`.
Additional controllers could be migrated in follow-up PRs, or on an
ad-hoc basis.
This change adds a new `ReviewableActionBuilder#build_bundle` helper for
quickly defining action bundles that can be performed on reviewables.
`ReviewableActionBuilder#build_action` has also been updated to allow
plugin-defined actions to appear correctly.
The core reviewable types have been updated to use this new method, and
I've also added support for reviewable chat messages, to demonstrate
plugin support.
Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
Since the new modifier has been added, some specs were not using using
the focus check on the composer (included in `fill_composer` method) and
we were actually not focused which was causing these specs to fail.
The `{{prevent-scroll-on-focus}}` modifier is a workaround for a bug in
iOS where safari won't follow `preventScroll: true` and will actually
scroll. I thought that not having the timeout would be good enough, but
we actually need this delay to ensure we are past the moment where
safari will start respecting `preventScroll: true`.
The `RSVP.Promise` polyfill has some subtle differences to native
promises. In this case, we ran into a problem where calling `reject()`
inside JQuery's `error` handler would throw an exception, and then stop
JQuery's own error cleanup from running. That caused subtle problems,
like the global `ajaxError` event failing to fire.
Switching from `RSVP.Promise` to `Promise` normally introducing subtle
timing changes. However, I think in this case we are insulated from that
because we're already calling resolve/reject via `@ember/runloop`'s
`run()` function. 🤞
To simplify our repository architecture, we're moving the admin panel from a separate package(/ember-addon) to a directory inside the main app package. This will make future configuration of tools like typescript/glint, and Vite, much easier. It also means that the admin panel is now transpiled via Webpack, and can internally make use of async-imports and bundle-splitting.
Admin modules will now be referenced like `discourse/admin/...`. Backwards-compatibility is maintained for the old import paths via a custom babel transform.
A 'compatModules' technique is used to keep all of the admin invokables and routes/controllers/templates available to Ember's resolver.
Adds a safe inset bottom for lightbox captions on mobile and removes
image padding on small screens. This change also applies bottom
depending on whether caption is being set or not.
How it looks:
<img width="225" height="487" alt="IMG_9334"
src="https://github.com/user-attachments/assets/d92d379a-ad63-44d0-8320-a0861b2a10e4"
/>
Instead of having to clean an array in a contract using a
`before_validation` block, for example, we can now pass `compact_blank:
true` to the attribute, like this:
```ruby
attribute :ids, :array, compact_blank: true
```
Updates `prosemirror-inputrules` to use this fix:
https://github.com/ProseMirror/prosemirror-inputrules/commit/7f63cfbb58310394ee83c578b2c910311b59428c
Adjusts our `markInputRule` so we can type something like
```
**`code`**
```
And the `code` will get the `strong` input rule applied, but cases like
these should not apply the `strong` input rule:
```
`** code` **
*`* code`**
**`code*`*
etc
```
And adds a simple test.
In "_correctMissingState()" we should not be breaking out of the for
loop on the first topic we've already seen, instead we should continue
iterating over all the information provided by the server.
Internal ref - t/105864/20
Co-authored-by: Kudzai Tuso <kudzai@discourse.org>
When we updated the list of available/supported holidays regions in
eabbac18cf and in
1983a44812 we left some records with
invalid regions.
This adds a migration to correct old records, as well as adding an error
handling to log an error when a region is invalid, rather than throwing
an exception and breaking the background job.
Ref - https://meta.discourse.org/t/-/384873
## Summary
- Adds estimated completion time (ETA) display for AI translation
backfill progress
- ETA is calculated based on the configured hourly rate and remaining
untranslated posts
- Display format automatically adjusts based on time remaining (minutes,
hours, or days)
- ETA appears inline with the post count for better UX
## Implementation Details
- Backend sends `hourly_rate` from site settings to frontend
- Frontend calculates total remaining posts across all locales
- ETA calculation: `remaining_posts / hourly_rate`
- Format logic:
- < 1 hour: shows minutes
- 1-24 hours: shows hours
- \> 24 hours: shows days
- Only displays when backfill is enabled and there are posts remaining
<img width="1243" height="242" alt="image"
src="https://github.com/user-attachments/assets/314bc399-9694-43ec-8591-0237c1b902f6"
/>
Compact docs:
> All optional newlines and whitespace will be omitted when generating
code in compact mode.
By default it's in auto mode, and emits a warning when it gets
auto-disabled for large files.
We use terser to strip unnecessary whitespace in production, so there's
no real benefit to us using `compact`. Easier to just disable it and
stop the warnings.
1. Update `register_preloaded_category_custom_fields` API to be
reload-safe
2. Update post-voting to use this in all cases, and remove the
`respond_to?` checks since this plugin is now bundled with core