Commit Graph
4357 Commits
Author SHA1 Message Date
Joffrey JAFFEUX e9b4bfa87f FIX: supports description for post events in rich editor (#34873)
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.
2025-09-19 10:39:36 +02:00
Loïc Guitaut 3fc6511278 FIX: Don’t store return path in the session
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.
2025-09-19 10:05:20 +02:00
Joffrey JAFFEUX 908371191f PERF: removes N+1 when loading events list (#34841)
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.
2025-09-19 09:12:23 +02:00
Kelv 547d99e3b4 DEV: remove toggles for switching between jquery & floatkit autocomplete (#34867)
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.
2025-09-19 14:50:04 +08:00
Rafael dos Santos SilvaandPenar Musaraj 281d0c3e11 FEATURE: add configurable age penalty for semantic related topics (#34842)
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>
2025-09-18 10:24:19 -03:00
Kelv 0fa102b838 UX: overhaul of GroupSelector with Floatkit (#34685)
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)
2025-09-18 15:33:52 +08:00
David Battersby 532d656d17 FEATURE: disable chat DM threads by default (#34840)
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.
2025-09-17 16:52:13 +04:00
Joffrey JAFFEUX cebc0d4131 UX: adds a start new dm link when no dms present (#34820)
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"
/>
2025-09-17 08:18:31 +02:00
1983a44812 CHORE: Import holiday definition updates. (#34835)
The Discourse Calendar plugin includes a hard fork of the [holidays
gem](https://github.com/holidays/holidays/).

There have been some updates to the original gem since the fork, this
change pulls in the major updates.

---------

Co-authored-by: Ivan Kuchin <tadump+git@gmail.com>
Co-authored-by: Phil Peble <ppeble@activecampaign.com>
Co-authored-by: Claudio Rodrigo Pereyra Diaz <claudiorodrigo@pereyradiaz.com.ar>
Co-authored-by: Michael Smith <michael.smith076@msd.govt.nz>
Co-authored-by: Lairton Mendes <lairton.mendes@gmail.com>
Co-authored-by: Lars Aurbakken <Lars.Aurbakken@ist.com>
Co-authored-by: i2chris <35810281+i2chris@users.noreply.github.com>
Co-authored-by: Dennis van de Hoef <dennisvdhoef@gmail.com>
2025-09-17 16:07:06 +10:00
LincaandAlan Guo Xiang Tan eeeb7d302f DEV: rename topic_id to timerable_id for BaseTimer (#34667)
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>
2025-09-17 13:19:17 +08:00
Keegan George e6e538ee8e FIX: AI usage doesn't refresh custom date ranges correctly (#34816)
## 🔍 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.
2025-09-16 10:16:01 -07:00
Natalie Tay 3d47622d0f FIX: Do not send empty content when detecting language (#34825)
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.
2025-09-17 00:52:40 +08:00
Roman Rizzi df34b9ab71 FIX: LLM config must be valid before running a test (#34806)
<img width="500" height="246" alt="Screenshot 2025-09-15 at 10 34 05 AM"
src="https://github.com/user-attachments/assets/8d406f25-4720-4d63-9f0d-64031b64111b"
/>
2025-09-15 11:40:01 -03:00
Kris 6a6ef12264 REFACTOR: merge mobile and desktop user CSS into common file (#34787)
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.
2025-09-15 09:16:47 -04:00
Discourse Translator Bot ccf379900d Update translations (#34804) 2025-09-15 10:47:22 +02:00
Joffrey JAFFEUX dc8d00c950 FIX: ensures event serializer has tags info (#34801)
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.
2025-09-15 07:51:42 +02:00
Joffrey JAFFEUX 0436fc8034 PERF: do not fetch thread data when we have it (#34799)
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.
2025-09-15 07:49:14 +02:00
Joffrey JAFFEUX 61e838781e FIX: ensures quick reactions usage shows in frequently (#34798)
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.
2025-09-15 07:48:22 +02:00
Joffrey JAFFEUX ed6beea336 UX: control event display through a site setting (#34795)
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
2025-09-13 11:35:52 +02:00
Joffrey JAFFEUX 79928d858a FIX: removes custom fc-past-event (#34796)
fullcalendar will add fc-event-past class by itself, this commit also
correctly reapplies the opacity on past events.
2025-09-13 11:22:17 +02:00
Discourse Translator Bot 3a8a9f27ce Update translations (#34745) 2025-09-12 16:17:25 +02:00
Gary Pendergast 8990c973ec FIX: Define the typical AFL Grand Final date. (#34768)
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.
2025-09-11 11:21:31 +10:00
Gary Pendergast a9bac35678 FIX: Ensure base_path is correctly inserted into LLM triage messages. (#34778)
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.
2025-09-11 11:21:06 +10:00
Kris f7238c188e UX: use more specific language for dynamic polls (#34769)
"Editing" can be a little misleading, because we technically only allow
adding/removing — if you edit an existing option the votes are reset.

This shortens the text by removing the "dynamic poll" text (seems
self-explanatory without naming it), and also specifies adding/removing


Before:
<img width="1252" height="878" alt="image"
src="https://github.com/user-attachments/assets/c583fa91-5b06-476e-b220-d9d86026e0de"
/>
<img width="1160" height="856" alt="image"
src="https://github.com/user-attachments/assets/16314712-71e2-4590-8093-b837b194fc32"
/>


After: 
<img width="1170" height="826" alt="image"
src="https://github.com/user-attachments/assets/8725a789-c2dd-44e0-8881-7b31871a4e58"
/>
<img width="1162" height="1012" alt="image"
src="https://github.com/user-attachments/assets/7ebacfee-1785-4d6f-8bca-73025db9a924"
/>


I also reduced padding to the poll info slightly to give text a little
more space before wrapping.
2025-09-10 09:14:32 -04:00
Joffrey JAFFEUX db974047e4 FIX: ensures category calendar is querying a date range (#34764)
We were loading all events and not just the displayed range for category
calendar, which would load too many events and mostly expired events.
2025-09-08 17:01:21 +02:00
Blake Erickson d7601c904d DEV: Skip flaky d-assign spec (#34749)
This test appears to be flaky. Specifically the last expect.

Follow up to: #34734

Also added a spoiler-alert flakey spec
2025-09-05 12:45:28 -06:00
Penar Musaraj 6c8c1bb7b6 DEV: Fix flaky assign spec (#34734) 2025-09-05 11:48:33 +08:00
Alan Guo Xiang Tan 435ae4c5f3 DEV: Skip a broken spec (#34742)
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.
2025-09-05 11:32:29 +08:00
Discourse Translator Bot 06b9718717 Update translations (#34723) 2025-09-04 12:27:34 +02:00
chapoiandOsamaSayegh 3e01922cb8 DEV: add automation trigger on-close-topic (#34705)
Adds a trigger to use when a topic closes.

---------

Co-authored-by: OsamaSayegh <asooomaasoooma90@gmail.com>
2025-09-04 12:00:32 +02:00
Natalie Tay 641ef5cd30 DEV: Remove remnant puts (#34716)
Remnant from https://github.com/discourse/discourse/pull/34678
2025-09-04 11:12:38 +08:00
Natalie Tay a9b1fb9b43 FIX: Add ld+json VideoObject to each lazy video (#34678)
Lazily loaded videos currently won't be picked up by search engines as
they do not contain an iframe or VideoObject.

This commit uses a new API `build_plugin_html
"server:topic-show-crawler-post-end"` to insert populated
[ld+json](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data#supported-formats)
into the end of each post which has a video.

Results:
-
https://search.google.com/test/rich-results/result?id=vegb8Qkz7HThsMbFaeN2AQ
-
https://search.google.com/test/rich-results/result?id=asumX41RneM2tMstchv45A
- (vimeo)
https://search.google.com/test/rich-results/result?id=EZWOMJCkDqEQIHfOLkSkcw

Note: 

There were originally two ways around this 
- add each VideoObject to the `post.cook` all the time agnostic of
crawler view
- or add them to the `<head>` with appropriate metadata, needing to
duplicate all post meta data within a `isPartOf` attribute.

I chose to create a new api so that we can satisfy both "only add the
meta data in crawler view" and prevent post metadata duplication.
2025-09-03 22:01:14 +08:00
Discourse Translator Bot 95ea149548 Update translations (#34698) 2025-09-03 15:32:48 +02:00
Natalie Tay 485c9a5c22 UX: Some translation progress chart refinements (#34674)
Follow up to https://github.com/discourse/discourse/pull/34643

- Pluralizes posts
- Shows the chart even if `ai_translation_backfill_hourly_rate` is zero,
and indicates as such
- Appropriate paddings
- Hides labels if bar too short

| desk | mob |
|---|---|
| <img width="1264" height="831" alt="Screenshot 2025-09-02 at 2 18
25 PM"
src="https://github.com/user-attachments/assets/e9462238-7ca4-4beb-a1ab-aa70b6d93036"
/> | <img width="300" height="2796" alt="d
loc_admin_plugins_discourse-ai_ai-translations_mobile_view=1(iPhone 14
Pro Max)"
src="https://github.com/user-attachments/assets/4e5047f5-9185-426a-aabf-c992f9df4d04"
/> |
2025-09-03 11:19:50 +08:00
Discourse Translator Bot 5678d1fe83 Update translations (#34682) 2025-09-02 15:44:12 +02:00
0ccb0c3c8c FEATURE: allow picking first day of week in calendar (#34670)
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>
2025-09-02 12:44:50 +02:00
Sam 0d9be3d0bf FIX: use user timezone when creating new events (#34675) 2025-09-02 10:31:06 +02:00
Alan Guo Xiang Tan 2f398db9b6 FEATURE: Add run query param to group data explorer reports (#34673)
Follow-up to 19acdbe3d9
2025-09-02 14:52:29 +08:00
SamandKrzysztof Kotlarek 062f13ab1c FEATURE: Add option to flag + delete for llm triage (#34590)
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>
2025-09-02 09:16:30 +10:00
SamandJoffrey JAFFEUX ea9f2f532b FEATURE: introduce max attendees for events (#34313)
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>
2025-09-01 22:56:19 +02:00
Penar Musaraj 1c5de45a77 FIX: Include subcategories in upcoming events list, add after param (#34640)
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.
2025-09-01 16:33:49 +02:00
Charles Lechasseur 0fa180beed FIX: In chat messages, filter uploads by UserUpload, not by Upload.user (#34596)
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
2025-09-01 20:06:27 +10:00
Joffrey JAFFEUX b636cdcbe6 FIX: compute correct date with local time (#34623)
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.
2025-09-01 11:46:34 +02:00
Discourse Translator Bot 5a8f5e8f07 Update translations (#34658) 2025-09-01 10:54:32 +02:00
David Taylor 84971be9d9 DEV: Debug timeout of .join on AI cancel_manager_spec (#34663)
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.
2025-09-01 09:44:04 +01:00
Natalie Tay 86fcf37082 UX: Show a bit more information on translation progress chart (#34643)
This PR improves the data shown on the ai-translations chart
2025-09-01 11:10:09 +08:00
Discourse Translator Bot 7f07453157 Update translations (#34633) 2025-08-29 17:24:43 +02:00
Alan Guo Xiang Tan 19acdbe3d9 FEATURE: Add run query param to automatically run data explorer reports (#34565) 2025-08-29 15:34:31 +08:00
Meghna aae7c3e22f UX: fix brand capitalization in locale (#34631) 2025-08-29 12:14:05 +05:30
Sam 00c98781c1 FEATURE: add support for google image model (#34570)
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.
2025-08-29 14:39:37 +10:00