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
We will be moving towards `type="module"` for all of Discourse's JS
bundles in the near future. This commit makes a start by applying the
change to translation bundles.
This was previously merged, but the lack of `apply_cdn_headers` on the
locales controller led to CORS errors on sites with CDNs.
We will be moving towards `type="module"` for all of Discourse's JS
bundles in the near future. This commit makes a start by applying the
change to translation bundles.
For empty chats, a dummy message is created with `id=null` (an
unsaved Ember model).
The timer or placeholder's display is determined by the message ID's presence now (not the `createdAt` prop).
Previously we would check the request for a matching CDN hostname before
applying the `Access-Control-Allow-Origin` header. That logic requires
the CDN to include its public-facing hostname in the `Host` header,
which is not always the case.
Since we are only running this `apply_cdn_headers` before_action on
publicly-accessible asset routes, we can simplify things so that the
`Access-Control-Allow-Origin: *` header is always included. That will
make CDN config requirements much more relaxed.
At the moment, this is primarily relevant to the HighlightJsController
routes, which are loaded using native JS `type=module`. But in the near
future, we plan to expand our use of `type=module` to more critical JS
assets like translations and themes.
Also drops the `Access-Control-Allow-Methods` header from these
responses. That isn't needed for `GET` and `HEAD` requests.
This brings the search_icon header search mode to parity with the
search_field mode. We don't want to show either of these if the welcome
banner is showing, since it has a search field, this is redundant.
If you scroll the page and the welcome banner is hidden, then we
show the header search icon.
This commit also cleans up some code related to the page-search
shortcut, which we no longer use, including limiting showing search
on topic only if there are > 20 posts.
Without this wrapper, `data` is defined in the global scope and clashes
when there are multiple themes with translations.
Followup to 033cccdf17a56b43f9f243bb549abe0a41a0de63
We can remove the wrapper once we land
https://github.com/discourse/discourse/pull/33107
Theme translations are very simple JS, and do not need to be run through
the theme transpiler. This brings their format in-line with core/plugin
translations.
Extracted from https://github.com/discourse/discourse/pull/33103
In production, the enforce_hostname middleware overwrites the HTTP_HOST
env using `Discourse.base_url_no_prefix`, which takes into account any
configured protocol/hostname/post overrides.
That middleware is not used in development, so if we want omniauth to
respect any host/port overrides, we need to configure the 'full host'
directly.
Most composer tips use the "educational" template name but similar
topics uses it's own template. We only allow showing if a tip using the
template name wasn't shown already. So therefore a welcome message (ie.
"educational") could show at the same time as a "similar topics" tip,
which isn't ideal from a UX perspective.
This change prevents overlapping composer tips by only opening the popup
if there are no popups open already. Therefore requiring the user to
close a tip before another different tip type could open.
This commit fixes displaying the post highlighted when navigating using
the keyboard.
Ember was overriding the direct DOM manipulations, causing the browser
outline to be displayed.
When we ported over the about page extra groups theme component, we used a hidden site setting to control this as per MO.
We don't need this any more. We can simply rely on the presence of any configured groups to decide.