Prior to this fix events with a description wouldn't show in the
composer when they contain a description. This was particularly
problematic as saving the post in this state would remove the event.
Since the session is backed by a cookie, storing too much data will lead
to a cookie overflow error.
A return path can be quite large sometimes, so intead of storing it in
the session, this patch stores it in our server session.
There was two issues:
- using the `TopicListItemSerializer` was fetching way more than we need
and also expecting includes from other plugins (assign for example),
switching to our own dedicated serializer seems a better choice here
- event dates were not preloaded
- fixed a spec which was supposed to track N+1 but was commented
I also improved our fabricator to limit the boilerplate needed.
We might need few more indices to improve perf event more here but going
to merge this first.
We've had the new floatkit-based autocomplete live in various parts of
Discourse for about a month now, and it's stable enough for us to remove
the site setting letting admins revert to the jquery-based autocomplete
library which is now deprecated.
Introduces two new site settings to apply exponential age-based
penalties to semantic topic suggestions, similar to algorithms
used by Reddit/HN:
* ai_embeddings_semantic_related_age_penalty (default: 0.3)
Controls penalty strength. 0.0 = disabled, 0.3 = gentle bias
toward newer content, 1.0+ = strong recency preference
* ai_embeddings_semantic_related_age_time_scale (default: 365 days)
Controls time horizon. Use 365 for yearly scale, 90 for
quarterly scale, etc.
Formula: similarity_score / POWER(age_in_days / time_scale + 1, penalty)
This allows sites to de-prioritize older topics in suggestions
while maintaining configurability for forums with different
content lifecycles. Performance optimized with conditional
JOINs only when penalty > 0.
"Age" here is using bumped_at to work with communities with long
lived mega topics too.
---------
Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
This PR modernizes the GroupSelector component by migrating from the
legacy jQuery autocomplete to FloatKit’s DMultiSelect component.
### Changes
* Migrated GroupSelector from an Ember Classic component to Glimmer
component
* Replaced jQuery-based autocomplete with FloatKit’s DMultiSelect
component which handles search
* New scroll-into-view modifier for smooth keyboard navigation (can be
used later to replace d-autocomplete's similar functionality)
* Improved FloatKit's `size` middleware option handling to allow passing
through both minWidth and width props
* Selected items are dynamically removed from dropdown options (no
duplicates)
Previously we introduced threads in Chat DMs in #29170 - however setting
the default to false seems like a better fit.
This will take effect for all new DM chats initiated, existing chats are
not changed but threads can still be turned off manually within each
channel's settings.
Prior to this commit we would show the collapsible DMs section which has
a [+] on hover to start a DM but it was not very nice visually and also
had low affordance.
The new empty DMs state:
<img width="275" height="77" alt="Screenshot 2025-09-16 at 09 07 57"
src="https://github.com/user-attachments/assets/99976dfd-44ec-40f8-a6d1-c0d15f550524"
/>
To prepare for the introduction of `CategoryDefaultTimer`, which allows
posts created in certain categories to have a default TopicTimer, we
need to rename the `topic_id` column to `timerable_id`.
---------
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
## 🔍 Overview
Fixes custom date range functionality in AI usage admin page where:
- Users experienced visual glitches when selecting dates
- Date picker would show incorrect dates after refresh
- Users had to refresh multiple times to get correct date range
**Changes:**
- Added fromDate/toDate getters with fallback logic for preview
functionality
- Updated DateTimeInputRange to use preview-aware getters
- Clear temporary dates after refresh to prevent stale state
- Added system test to prevent regression
The date picker now immediately shows selected dates (preview) and
maintains correct values after refresh, eliminating user confusion.
This addresses the exact issue reported in [the meta
topic](https://meta.discourse.org/t/discourse-ai-admin-usage-page-custom-date-range-issues/378959)
and provides a clean solution with test coverage to prevent regression.
Seeing many errors about
```
DiscourseAi::Completions::Endpoints::Gemini: status: 400 - body: {
"error": {
"code": 400,
"message": "* GenerateContentRequest.contents: contents is not specified\n",
"status": "INVALID_ARGUMENT"
}
}
```
This is triggered due to posts with images and no text.
The solution here is to set the locale to site default locale.
This eliminates mobile/user.scss and desktop/user.scss in favor of
breakpoints in common/base/user.scss
There was some old seemingly unused CSS removed, but this should
otherwise not cause any major visual changes.
This was preventing the `map_events_to_color` site setting to work
correctly given we couldn't match on tag slug as it was not present.
This commit adds system specs and removes the js test as it was
misleading and incorrectly passing due to the fixture which couldn't
catch the issue in the serializer.
Prior to this fix we would fetch thread data even if it was present in
the bus data, that's already unnecessary work in a normal situation but
that's even worse when a user is coming back to their computer as we
will have to catchup multiple new threads at once.
Also ensures we correctly await fetching data from server when
necessary.
No test as there are not behavior change.
Prior to this change we would have different context for quick reactions
and for channels this commit just move everything into one context which
is less surprising.
Allows admins to set the `calendar_event_display` site setting to decide
how full-calendar should render events.
It accepts the following values:
- auto
- block
- list-item
And will default to: auto
The AFL Grand Final is typically help on the last Saturday of September,
though there are occasional exceptions. Since 2015, the Friday before
the Grand Final is a public holiday in Victoria, Australia.
This change defines the typical date for the public holiday, but allows
exceptions to be defined where necessary.
When the LLM Triage automation script causes a post to be placed in the
review queue, it includes a message linking to the rule responsible.
The string for this message included a placeholder for `base_path`, but
didn't interpolate it in the `i18n` call.
When visiting a channel's members info route directly, the add member
button will always be shown because the logic to show the button assumes
that chat messages have been loaded. Skip for now while we figure out a
fix.
Allow picking Saturday,Sunday or Monday as first day of week.
Keeps current default and adds extensive testing.
---------
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Co-authored-by: Martin Brennan <martin@discourse.org>
review_delete will add to review queue and delete post, optionally you
can
also opt to notify user
---------
Co-authored-by: Krzysztof Kotlarek <kotlarek.krzysztof@gmail.com>
Allows to set the max attendees of an event. When an event is full you
can only mark yourself as interested or not going. The going button will
be disabled.
Maximum attendees can be defined in the post builder:
<img width="569" height="106" alt="Screenshot 2025-09-01 at 20 57 16"
src="https://github.com/user-attachments/assets/bf61cd57-d35e-44a7-8d05-263ee9cd7df0"
/>
---------
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Addresses two issues. On sites with many old events, we would not show
the correct items because the query would return the older events first.
Adds `includeSubcategories` parameter to include events from
subcategories in the list.
No tests for now, we might refactor this component very soon.
When creating or updating a chat message, uploads attached to the
message are filtered so as to only keep uploads created by the message
creator using `Upload.user`. This field, however, only points to the
_original_ user that created the upload, but since uploads are
de-duplicated, other users might have also uploaded the file. This PR
fixes this by looking at the `UserUpload`s instead (as suggested by
@SamSaffron).
Reported here: https://meta.discourse.org/t/chat-upload-bug/379253
We were not correctly computing the dates when the option showLocalTime
is enabled on an event. In this case we need to generate a floating time
without a zone in the date.
This commit also refactors the serializers to avoid duplication.
This spec is flaking a lot. Adding debug logs to try and identify
whether this is a specific-specific problem, or something which may
affect production too.
Adds support for:
https://blog.google/products/gemini/updated-image-editing-model/
This mode generates images natively, we updated the Gemini endpoint to
support handling image output.
Additionally, there is a refinement to how we provide image context to
models, we avoid very short descriptions and simply
inline images in the context, prior to this fix image generating models
could get confused and start generating markdown blobs.
This takes care to properly omit images from context in model responses
for anthropic and open ai in responses api.