adds valueTransformers to the "Flag" button component:
flag-button-render-decision: whether to show the flag
flag-button-disabled-state: whether the flag button should be in a
disabled state
post-action-menu__flag create-flag: ability to add class to flag button.
also adds "like-button-render-decision" valueTransformer to Like button,
which determines whether to show or hide the like flag.
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
- do not compute the menu while selection is changing, only when pointer
is released
The situation was very bad on android but it should also improve other
situations.
When your mouse was over the message actions container, not only it
wouldn't scroll your channel, but it would scroll the whole page, this
redirect ensures we correctly scroll the scroller associated with this
message actions container.
This commit adds an @enabled boolean to `<LoadMore />` to allow for
cases where the element is visible in the viewport but you don't want to
allow the `loadMore` behaviour. A use case for this is when our
controllers return some `canLoadMore` boolean. There is no use
attempting to load more from the server in this case, there will be
nothing else.
I also moved the CSS styles for the `<LoadMore />` component into
a new file.
This also fixes a bug in the users list shown here
https://meta.discourse.org/t/users-list-only-partial/368793
This is a second attempt at:
https://github.com/discourse/discourse/pull/33001
We had to [revert the
commit](https://github.com/discourse/discourse/pull/33157) because it
was performing a site-setting check at boot time, which is prone to
issues and not allowed.
This PR:
- re-introduces the changes in the original PR
- a fix by not performing a site-setting check at boot time (verified
by: `SKIP_DB_AND_REDIS=1 DISCOURSE_DEV_DB="nonexist" bin/rails runner
"puts 'booted'"` locally and should be caught by the new CI check
introduced here: https://github.com/discourse/discourse/pull/33158)
- adds a fix to the translation editor to not show the original post
locale in the dropdown, as well as adding an indicator of what the
original post locale is in a small badge in the header:
- 
Hard to take a screenshot, the "Log In" button having a right margin
forced the rest of the block to be slightly misaligned. It's not visible
on the default screen, but quite visible when adding other
centre-aligned elements to the page.
## 🔍 Overview
Previously we added the ability to translate existing posts in different
languages: https://github.com/discourse/discourse/pull/32564. In this
update we add the ability to set a post language upon initially creating
a post.
Internally, we also clean-up/improve a few things, like:
- adding a `PostLanguageSelector` component
- Adding a `available_content_localization_locales` onto `SiteSetting`
so it's available in the service (without needing to parse the JSON to
access it)
- fix issues with the translation-editor not working due to some
regressions from here: https://github.com/discourse/discourse/pull/32869
- ensure everything works for replies/drafts/edits
## 📷 Screenshots

This commit introduces new features and utilities related to the backup
and restore system that make use of remote URLs:
- `discourse restore` accepts a URL to a backup file
- `discourse backup_url` generates a URL of a backup file (S3 only)
- `discourse import_backup_url` downloads a backup file from a URL to
the configured backup store
This can be used to move content between two Discourse instances by
backing up the entire site, copying the backup URL, importing or
restoring it on the other instance.
We will not update localization on every edit for now. To compensate,
the existing indicator will also add information if a translation might
be outdated.
Related: https://github.com/discourse/discourse-ai/pull/1422
/t/156185
We had a regression where you can no longer update an existing webhook to have a blank secret field.
The problem is the blank field will return a value of undefined, which is ignored by the store when sending the request to the back-end.
This fixes that by using the nullish coalescing operator to replace undefined with an empty string.
This commit takes the dragging behaviour of the grippie
element (the blue bar) at the top of the composer and makes
it into an ember Modifier for use in more places.
The first usage is to add a grippie resizer to the bottom of AceEditor
to followup f819b1ec4dc96e78de075e15df37d114851f785c, since
the `@resizable` option allows the user to vertically resize
the code editor.
Custom composer-related behaviour is now done via callbacks from
the modifier. The .grippie CSS class has been hoisted so the style
applies everywhere, then AceEditor modifies the appearance to blend
a bit better.
---------
Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
Added `topic` tracking to posts and improved quoted post handling by
linking quoted posts to their parent topic.
Introduced error handling for decorators to prevent crashes and ensure
smoother operation in case of unexpected issues.
- Fix displaying the time gap
- Do not display the counter on links with zero posts
- Adjust button padding and icon margin in the post metadata button
indicators (edit)
Changes the gear icon for the more menu to a circle-plus icon.
Changes the emoji icon to its outline version, to make it less similar
to the circle-plus icon.
Changes the styles (eg. icon sizes) of the toolbar, using a flexbox
instead of a grid, with some tweaks and animations to the toggle switch,
which occupies a smaller width now.
Removes the gray button-bar bottom border.
Moves the Insert Date/Time item to the more menu, and changes its icon
to a clock.
### Before, hovering more menu
<img width="758" alt="image"
src="https://github.com/user-attachments/assets/84d8f5aa-519e-40a2-ba44-d58d7294f6b0"
/>
### After, hovering more menu

---------
Co-authored-by: chapoi <101828855+chapoi@users.noreply.github.com>
As defined in: https://playwright.dev/docs/emulation
Example:
```ruby
context "xxxx", color_scheme: "dark", timezone: "Australia/Brisbane" do
# ...
end
```
This change validates mentions for `users` and `groups` when using the
rich text editor.
When the mention is valid (ie. the user or group exists) it will
visually show as a mention node, but when the user or group does not
exist then it will appear as regular text in the editor.
There are 2 parts to this:
### Existing drafts / toggling from Markdown to Rich Text
We automatically add mention nodes for all `@mentions` and then process
any invalid mentions by removing the mention node and replacing it with
text.
### When manually typing in Rich Text
We find the mention within the text and then if valid we replace it with
a mention node.
### Validation
The validation happens in a single request when loading a draft or
switching from Markdown to Rich Text. The response provides a list of
valid usernames and groups. It also provides additional context for
groups and users that are not reachable (ie. unmentionable groups or
suspended users etc) but we don't use this currently.
We then store the valid and invalid mentions to prevent unnecessary
requests later.
As new mentions are typed then they will also be validated using the
same request as above (if they are not already stored in our valid /
invalid sets).
In #33012 we phased out the site settings for:
- disable_avatar_education_message
- sequential_replies_threshold
- warn_reviving_old_topic_age
This change is a follow up migration to delete the site settings from
the database.
When there is a relevant `username` associated with an outgoing email,
like in the case of post notifications, the `X-Discourse-Sender` header
will be added to the email, indicating the sender's username.
This mimics the `X-GitHub-Sender` header used by GitHub, which is useful
for filtering and categorizing emails based on the sender.
Introduced a map to manage scheduled/debounced timers, ensuring they are
canceled when the component is destroyed. This improves memory
management and prevents potential issues with lingering timers after
destruction. Updated relevant methods to utilize this new tracking
mechanism.
Currently, the first two rows returned by `DiscourseDB#query_array` are
silently dropped during the column size check in
`DiscourseDB#load_mapping`. This happens because the rows object, while
an enumerator, isn't fully compliant, it doesn't rewind during
introspection. As a result, calls like `#first`, `#peek`, or `#any?`
advance the iterator.
Ideally, we’d fix this by updating the `query_array` enumeration
implementation. However, customizing the enumerator to be fully
compliant would likely introduce unnecessary perf overhead for all use
cases. So, this fix works around that limitation by building the map a
little differently.
Non-colocated `.hbs` files in themes and plugins should be treated as
classic components, not glimmer components.
This regressed in cb6cc8dcd339b5036fecfd8ae0301accc7df4ee1
Also adds Ember's `component-template-resolving` deprecation to our list
of deprecations which trigger admin warnings.
The moment locale files expect `this.` to be the window object. In a
type=module, `this` is `undefined`. This commit wraps the
moment-timezone definitions in an IIFE to resolve that.
Also adds a system spec to prevent future moment-timezone regressions.
Followup to a2b0c193dff40278c0a93995cc9b97b05dc8abb2