This commit is applying different techniques to make selecting text of a
post less error prone:
- ensure we only ever show the toolbar when the common ancestor of a
range is cooked
- ensures the menu is not interfering with text selection
The situation was very bad on android but it should also improve other
devices.
Note that one visual change of this commit is that the fast edit menu is
now a standalone modal.
Followup 4fe85fdb53d32a4ceda2fffcadbf22d2cbf5de7e
It's not ideal, but currently the admin-sidebar modifies ADMIN_NAV_MAP,
and the admin search data source relies on this modification to include
plugin pages in search.
This commit removes the cloneJSON added in the previous one and adds a
test to ensure this doesn't regress.
A followup commit will do some refactoring to stop this behaviour of
modifying the global ADMIN_NAV_MAP.
Long ago (~2 years), we had a sidebar section with text content. This
contained "about" content for anonymous visitors. We no longer have this
section so this component is completely unused.
- Refactored the `actions-summary` widget and its related test to
directly use a `post` model instance, ensuring more consistent data
handling. Updated relevant rendering and widget registration logic to
align with the changes.
- Fix displaying the user that deleted the post
- Fix the post action text displayed
The parent component of `ThemeSettingRelativesSelectorComponent`,
`SiteSettingComponent`, has recently been migrated from being a legacy
component to a Glimmer component (in
https://github.com/discourse/discourse/pull/33255), but we missed
updating the child class to use Glimmer's patterns, namely how arguments
are accessed in Glimmer components (`this.args.foo` vs `this.foo`).
`SiteSerializer#post_action_types` and `SiteSerializer#topic_flag_types`
both call the `Flag.used_flag_ids` method which executes queries that
becomes very slow on sites with alot of records in either the
`post_actions` or `reviewable_scores` table.
On the `post_actions` table, we execute `SELECT DISTINCT
post_action_type_id FROM post_actions`. On the `reviewable_scores`
table, we execute `SELECT DISTINCT reviewable_scope_type FROM
reviewable_scopes`. The problem with both queries is that it requires
the PG planner to scan through every single row in those tables.
For our use case, all we actually need is to check if a flag is being
referenced by a record in either the `post_actions` or
`reviewable_scores` tables. This commit updates the `Flag.used_flag_ids`
to accept a `flag_ids`
argument and use the argument to check whether the flag ids are
referenced in the `post_action_type_id` or `reviewable_scope_type`
foreign keys.
The `uploads:sync_access_control` rake task should reset the access
control
of all s3 objects linked to an upload record. This means that if the
`s3_use_acls` site setting has been disabled, the rake task should
remove the existing ACL that has been set previously.
Followup 5b236ccc0774e3b0f5e0b34c99c1c36d9ea9604e, a change here
made it so the theme setting name was no longer showing on the
UI, this commit fixes the issue by making sure it's sent from
the server in the same way as site setting humanized names.
...so I can override it in a customer plugin.
The goal here is to be able to create the same user data export but
provide the results by uploading to an s3 bucket instead of sending a PM
to the user.
This PR allows `bypass_time_window` to be passed to the
`SendPushNotification` job, to continue sending a PN, even if the user
has been active recently.
Previously, there was no way to edit post localizations, so the
`post.raw` was always returning the localized value. With localization
UI and endpoints now, we want to always return the original raw and the
composer to reflect the original value.
https://github.com/discourse/discourse/pull/33184 will handle the
decision to show the post edit composer or the post localization
composer.
Also fix some issues in the source, wasn't returning a promise
with the early return.
Saw this in the CI log failures:
> ℹ️ Hint: when the assertion failed, the Ember runloop was not in a
settled state. Maybe you missed an `await` further up the test? Or maybe
you need to manually add `await settled()` before your assertion?
(hasPendingTimers, hasRunLoop, isRenderPending)
This commit moves the humanization of site setting names from the client
side to the server side, since this is becoming more widely used and
will be useful for specs to be able to access the same humanized name
formatting without duplicating the logic on the server.
There are only a couple of places in the admin UI that we send this
down in the JSON, the `site.sitSettings` object does not include these
humanized names as they are not needed.
Followup fb7fa2902cf685ee9d4002e5448b4817f2dbef98,
prevent opening the chat channel selector with Ctrl/Meta+K
in any inputs except the chat composer, most of the time you
do not want this, but especially in the topic composer.
In that case, you want the link insert modal to open.
Before this change, topics with a hidden OP were still visible, we only
checked if all posts were hidden to change visibility of the topic.
With this change, if the OP is flagged and is hidden the topic will also
be hidden.
---------
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
All the way back in bc52bdfa1280ba08e6fb1931c26e18aa7fee9f7f we changed
the definition of new_user_posting_on_first_day? to return true if the
user was TL0 unconditionally. However this changes the logic of
the method, and essentially makes it "lie". Yes TL0 may be considered
a new user in other places, but in this method specifically we want
to check it's their "first day" of posting, not just that they are TL0.
The intent per these commits:
* 487c20959c874666db726d69c00abe139ba1aeab
* 5aa1272f05fc0de0b08577707d3370d10fafdd51
* 9834d1150300de26ffc35cb6af9a3ac91666e216
Was consider any user < TL2 who hadn't made their first post yet
as a new user posting on their first day. If they had made a post
>= 24 hours ago, they were no longer considered a new user posting
on their first day.
This commit restores that logic and also cleans up the spec and
guardian check to be clearer.
This PR introduces explicit state management for decorators as part of
the quote controls refactor. The legacy quote controls logic has been
migrated to a new Glimmer component, and state handling for decorator
functions associated with post content rendering is now formalized and
standardized.
### Key Points
- **Decorator State Introduction:**
- Introduces explicit state objects for use within post and cooked-html
decorators, replacing previous ad-hoc or implicit state tracking.
- Uses `TrackedMap` for state management, improving reactivity and
ensuring consistent, predictable updates when decorator state changes.
- **Component Refactor:**
- The quote controls logic is now fully encapsulated in a Glimmer
component, leveraging the new decorator state handling for cleaner, more
maintainable code.
- Legacy implementations have been removed to reduce technical debt.
- **Context and Data Handling:**
- Decorators and components now receive state and context as explicit
parameters, standardizing the interface and improving code readability.
- Direct properties (such as `post`, `highlightTerm`, and
`ignoredUsers`) replace the previous `data` object, simplifying context
management.
- **Other Improvements:**
- Enhanced error handling for async content.
- Improved extensibility by supporting custom wrapper elements in quoted
content.
- Added functionality to highlight original quoted text.
---------
Co-authored-by: David Taylor <david@taylorhq.com>
## 🔍 Overview
This update fixes a few issues related to keyboard shortcuts from the
toolbar API and the textarea text manipulation:
- it converts the keymap return value from `itsatrap` format to
`ProseMirror` format so that the default is prevented, thus allowing for
custom keyboard shortcuts to work inside the editor without triggering
system defaults.
- pushes a fix where the keyboard shortcut could get triggered even when
the `condition` value returned `false` whenever it had a custom
shortcut.
- fixes an issue in the markdown textarea editor where selecting text
and tabbing works but also focuses the next element
This PR relates to the locale setting in the composer and fixes 2
quirks:
- When replying to a post, the composer sets the locale of the new post
in composer to the locale of the post being replied. This PR defaults
the value to "none"
- When creating a new post, the composer sets the locale to the user's
locale. However we are seeing the behaviour that users do not write in
the locale they set their profile to. This PR defaults the value to
"none"
Fixes an issue where the admin search results was showing
breadcrumbs with a double up of the parent label. For example,
we would show "Plugins > Plugins > AI > Usage" or
"Advanced > Advanced > Backups > Logs".
Also adds a missing translation for the chat incoming webhooks
page.
This change adds an API for retrieving the current value of a component within a FormKit form. It makes use of the existing `@onRegisterApi` parameter, adding a `get()` method to match the existing `set()` method.
The FormKit textarea component was using `@field.value` as inner content, preventing dynamic updates to the `textarea` value through the form API.
This change moves the `textarea` value to being set in the `value` attribute, instead.
Followup 30b0e38877af703606042cf1a2997a9a06582c32
Changes margin to padding for topic filter empty state to prevent the
"See X new or updated topics" banner from overlapping with the empty
state
when there are no topics in the filter.
This commit starts to introduce services to replace actions in the
ThemesController. We will start with the low langing fruit:
* Create
* Destroy
* BulkDestroy
* GetTranslations
Endpoints like #import and #update will be much harder.
Also, the https://github.com/discourse/discourse-theme-creator plugin
overrides some of these controller actions directly, so we need
to be careful.
Follow up from #33284 to add the missing style type value. This value
was originally meant for just categories but it makes things much easier
(and more complete) to add these values for other hashtag data types
like tags/channels etc, especially since they have default `icon` values
already.