1
0
mirror of synced 2026-08-04 06:46:57 +00:00
Commit Graph

215 Commits

Author SHA1 Message Date
Sam 2d6ec5e1e6 FIX: apply diffs more consistently (#1367)
* FIX: apply diffs more consistently

1. Do escaping direct in diff streamer, that way HTML tags and other unsafe chars can be displayed and fixed
2. Add safeguard to ensure streaming always stops when it was terminated elsewhere

* lint

* bug unsubscribe should unsubscribe
2025-05-24 15:19:48 +10:00
Jordan Vidrine adc92e1e75 UX: Allow rounded corners (#1365) 2025-05-23 10:42:55 -05:00
Keegan George 61ef1932fa DEV: Follow-up small fixes to AI composer helper (#1361)
**This update includes a variety of small fixes to the AI composer helper:**
- ensures there is no flash of no text when diff modal is triggered
- escapes selected text prior to diff streaming
- uses monospace font in diff modal since text rendered is raw markdown
2025-05-22 12:37:42 -07:00
Keegan George c29183fc2d FEATURE: Add diff streaming animation (#1355)
Previously we attempted to add a diff streaming animation to the AI composer helper: https://github.com/discourse/discourse-ai/pull/1332, but it resulted in issues despite attempted fixes (https://github.com/discourse/discourse-ai/pull/1338) so we temporarily suppressed the diff animation (https://github.com/discourse/discourse-ai/pull/1341).

This update makes a second attempt at implementing the diff streaming animation. Instead of creating a custom diff algorithm, we make use of a third-party library [`jsDiff`](https://github.com/kpdecker/jsdiff) (which we added to core here: https://github.com/discourse/discourse/pull/32833). While streaming, the diff animation often struggles with markdown links and images, so we make use of `markdown-it` parser to detect those cases and prevent breaking the animation.

---------

Co-authored-by: Sam Saffron <sam.saffron@gmail.com>
2025-05-22 08:10:50 +10:00
Kris 53905f65ac FEATURE: add participants and invite button to AI conversations (#1354) 2025-05-21 10:27:06 +10:00
Keegan George dfea784fc4 DEV: Improve diff streaming accuracy with safety checker (#1338)
This update adds a safety checker which scans the streamed updates. It ensures that incomplete segments of text are not sent yet over message bus as this will cause breakage with the diff streamer. It also updates the diff streamer to handle a thinking state for when we are waiting for message bus updates.
2025-05-15 11:38:46 -07:00
Keegan George acd1986a5c FEATURE: Improved diff streaming for AI composer helper (#1332)
This update improves the animation for streaming a diff of changes when AI helper proofread is triggered. It shows the original text with diff changes live instead of after the fact.
2025-05-12 15:57:59 -07:00
Kris 5892e9e66c UX: stick new question button to top of mobile sidebar (#1329) 2025-05-08 17:09:12 -04:00
Isaac Janzen a49ed0cd01 UX: Apply bot conversation sidebar styles to mobile sidebar (#1328) 2025-05-08 15:10:42 -05:00
Kris 851ca57866 UX: style adjustments for conversations (#1325) 2025-05-07 16:13:25 -04:00
Sam d62c76d1e8 FIX: do not display empty state while fetching bot conversations (#1320)
* FIX: do not display empty state while fetching bot conversations

* skip test in playwright and fix implementation

* tiny css fix, missing padding
2025-05-07 15:04:35 +10:00
Roman Rizzi c0a2d4c935 DEV: Use structured responses for summaries (#1252)
* DEV: Use structured responses for summaries

* Fix system specs

* Make response_format a first class citizen and update endpoints to support it

* Response format can be specified in the persona

* lint

* switch to jsonb and make column nullable

* Reify structured output chunks. Move JSON parsing to the depths of Completion

* Switch to JsonStreamingTracker for partial JSON parsing
2025-05-06 10:09:39 -03:00
Kris b2a6ee9c05 UX: update conversation input styles (#1308) 2025-05-02 13:42:12 -04:00
Sam 8b1b6811f4 FEATURE: add support for uploads when starting a convo (#1301)
This commit introduces file upload capabilities to the AI Bot conversations interface and improves the overall dedicated UX experience. It also changes the experimental setting to a more permanent one.

## Key changes:

- **File upload support**:
  - Integrates UppyUpload for handling file uploads in conversations
  - Adds UI for uploading, displaying, and managing attachments
  - Supports drag & drop, clipboard paste, and manual file selection
  - Shows upload progress indicators for in-progress uploads
  - Appends uploaded file markdown to message content

- **Renamed setting**:
  - Changed `ai_enable_experimental_bot_ux` to `ai_bot_enable_dedicated_ux`
  - Updated setting description to be clearer
  - Changed default value to `true` as this is now a stable feature
  - Added migration to handle the setting name change in database

- **UI improvements**:
  - Enhanced input area with better focus states
  - Improved layout and styling for conversations page
  - Added visual feedback for upload states
  - Better error handling for uploads in progress

- **Code organization**:
  - Refactored message submission logic to handle attachments
  - Updated DOM element IDs for consistency
  - Fixed focus management after submission

- **Added tests**:
  - Tests for file upload functionality
  - Tests for removing uploads before submission
  - Updated existing tests to work with the renamed setting


---------

Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
2025-05-01 12:21:07 +10:00
Kris 81a664b3da UX: put full page search discoveries in sidebar (#1289) 2025-04-30 12:01:21 -04:00
Sam 7dc3c30fa4 FEATURE: correctly decorate AI bots (#1300)
AI bots come in 2 flavors

1. An LLM and LLM user, in this case we should decorate posts with persona name
2. A Persona user, in this case, in PMs we decorate with LLM name

(2) is a significant improvement, cause previously when creating a conversation
you could not tell which LLM you were talking to by simply looking at the post, you would
have to scroll to the top of the page.

* lint

* translation missing
2025-04-30 16:36:38 +10:00
Kris 541e6d7437 UX: increase composer action z-index above ai suggestion (#1296) 2025-04-29 10:42:51 -04:00
Renato Atilio 8669e8ae59 Revert "UX: keep composer actions above AI input icons (#1291)" (#1292)
This reverts commit 51a0516aa8.
2025-04-29 08:57:20 +10:00
Kris 51a0516aa8 UX: keep composer actions above AI input icons (#1291)
* UX: keep composer actions above AI input icons

* update comment
2025-04-28 10:45:28 -04:00
Isaac Janzen b6630b670f DEV: Update sidebar grouping date labels (#1290)
- Add `Today` label
- Make some minor UX changes
- Add specs
2025-04-26 15:31:22 -05:00
Isaac Janzen 81ef532268 UX: Only scroll when we surpass max input height (#1288) 2025-04-25 13:20:34 -05:00
Isaac Janzen cd0cfc0bfc DEV: Group PMs by date (#1287)
# Preview

https://github.com/user-attachments/assets/3fe3ac8f-c938-4df4-9afe-11980046944d

# Details

- Group pms by `last_posted_at`. In this first iteration we are group by `7 days`, `30 days`, then by month beyond that. 
- I inject a sidebar section link with the relative (last_posted_at) date and then update a tracked value to ensure we don't do it again. Then for each month beyond the first 30days, I add a value to the `loadedMonthLabels` set and we reference that (plus the year) to see if we need to load a new month label.
- I took the creative liberty to remove the `Conversations` section label - this had no purpose
- I hid the _collapse all sidebar sections_ carrot. This had no purpose. 
- Swap `BasicTopicSerializer` to `ListableTopicSerializer` to get access to `last_posted_at`
2025-04-25 13:20:18 -05:00
Kris 10748015fd UX: minor alignment adjustments for experiemental bot UI (#1285)
* UX: minor alignment adjustments for experiemental bot UI

* account for powered by discourse badge

* breakpoint lint
2025-04-24 17:27:31 -04:00
Mark VanLandingham 797d727a20 UX: Bring back New Conversation button on mobile sidebar (#1283) 2025-04-24 13:47:11 -05:00
Isaac Janzen 1a0d1d6e84 DEV: Add ai-bot-conversations-above-input plugin outlet and update loading animation (#1284)
Update loading animation 

https://github.com/user-attachments/assets/f3bb6ca7-5d84-4231-8ea1-fa49fa402eae


- Add plugin outlet 
- update `updateInputValue` so that it can be used by plugins to update the input value
2025-04-24 13:33:33 -05:00
Mark VanLandingham b7b9179bc8 FEATURE: Allow for persona & llm selection in bot conversations page (#1276) 2025-04-24 11:17:24 -05:00
Sam 2a5c60db10 FEATURE: display more places where AI is used / Chat streamer (#1278)
* FEATURE: display more places where AI is used

- Usage was not showing automation or image caption in llm list.
- Also: FIX - reasoning models would time out incorrectly after 60 seconds (raised to 10 minutes)

* correct enum not to enumerate non configured models

* FEATURE: implement chat streamer

This implements a basic chat streamer, it provides 2 things:

1. Gives feedback to the user when LLM is generating
2. Streams stuff much more efficiently to client (given it may take 100ms or so per call to update chat)
2025-04-24 16:22:19 +10:00
Jordan Vidrine e1731dc3df UX: Align styling with conventions (#1275) 2025-04-23 14:14:55 -05:00
Joffrey JAFFEUX d2002f81a7 DEV: migrates tools form to form-kit (#1204)
This PR is a retry of: #1135, where we migrate AiTools form to FormKit. The previous PR accidentally removed code related to setting enum values, and as a result was reverted. This update includes enums correctly along with the previous updates.
2025-04-22 09:23:25 -07:00
Isaac Janzen e8b0f86300 FEATURE: Bot Conversation Homepage (#1273) 2025-04-22 10:22:03 -05:00
Mark VanLandingham 244ec9d61e REVERT: "FEATURE: Experimental Private Message Bot Homepage (#1159)" (#1272)
This reverts commit 5fec8fe79e.
2025-04-21 16:42:05 -05:00
Mark VanLandingham 5fec8fe79e FEATURE: Experimental Private Message Bot Homepage (#1159)
Overview
This PR introduces a Bot Homepage that was first introduced at https://ask.discourse.org/.

Key Features:
Add a bot homepage: /discourse-ai/ai-bot/conversations
Display a sidebar with previous bot conversations
Infinite scroll for large counts
Sidebar still visible when navigation mode is header_dropdown
Sidebar visible on homepage and bot PM show view
Add New Question button to the bottom of sidebar on bot PM show view
Add persona picker to homepage
2025-04-21 15:17:10 -05:00
Keegan George ef08e5ea45 UX: Improve groups list in feature table when many groups (#1254)
This update improves the displaying of groups in the features table when there are many groups for a particular persona.
2025-04-10 09:14:51 -07:00
Keegan George 4de39a07e5 FEATURE: Configure persona backed features in admin panel (#1245)
In this feature update, we add the UI for the ability to easily configure persona backed AI-features. The feature will still be hidden until structured responses are complete.
2025-04-10 08:16:31 -07:00
Kris 32da999144 FIX: less generic animation names (#1243) 2025-04-02 11:28:10 -04:00
Kris 7b56d7d4fc UX: adjust artificat UI styles (#1240) 2025-04-01 16:11:36 -04:00
Keegan George bf5ccb452c FEATURE: Continue conversation from Discobot discovery (#1234)
This feature update allows for continuing the conversation with Discobot Discoveries in an AI bot chat. After discoveries gives you a response to your search you can continue with the existing context.
2025-04-01 10:22:39 -07:00
Kris 5331b6dd8e UX: wider search pane, border, smaller font size (#1238) 2025-04-01 12:57:32 -04:00
Keegan George f3e78f0d80 FIX: Search discoveries improvements (#1228)
**This update makes a few improvements to search discoveries:**
- [x] in search menu panel: search discoveries should still be triggered when no regular results are present
- [x] in full page search: search discoveries should still be triggered when no regular results are present
- [x] flakiness in search discoveries sometimes not working properly.

---------

Co-authored-by: awesomerobot <kris.aubuchon@discourse.org>
2025-03-31 08:38:40 -07:00
Keegan George 9dfae3d472 UX: Convert sentiment analysis overview to horizontal bars (#1216)
The sentiment analysis report page initially showcases sentiments via category/tag by doughnut visualizations. However, this isn't an optimal view for quickly scanning and comparing each result. This PR updates the overview to include a table visualization with horizontal bars to represent sentiment analysis instead of doughnuts. Doughnut visualizations are still maintained however when accessing the sentiment data in the drill down for individual entries.

This approach is an intermediary step, as we will eventually add whole clustering and sizing visualization instead of a table. As such, no relevant tests are added in this PR.
2025-03-25 13:36:52 -07:00
Roman Rizzi 2a8be6e2d7 REFACTOR: Migrate Personas' form to FormKit (#1178)
* REFACTOR: Migrate Personas' form to FormKit

We re-arranged fields into sections so we can better differentiate which options are specific to the AI bot.

* few form-kit improvements

https://github.com/discourse/discourse/pull/31934

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-03-21 14:46:33 -03:00
Sam b6483e416d Revert "DEV: Convert tool editor to form kit (#1135)" (#1201)
This reverts commit 107f14456b.

enum was not handled, so reverting for now
2025-03-18 18:07:04 +11:00
Keegan George 107f14456b DEV: Convert tool editor to form kit (#1135)
* DEV: Make tool presets a dropdown

* DEV: Select tool presets via DMenu instead

* WIP

* WIP: Add parameter types, uploader, script, etc.

* WIP

* updates

* fix lint

* FIX: spec

* fixes
2025-03-17 11:38:25 -03:00
Jarek Radosz 7d7c169afa DEV: Update linting (#1194) 2025-03-17 15:14:53 +11:00
Kris 24e6aa52bb UX: try AI search to side on large screens (#1196) 2025-03-14 14:11:02 -04:00
Jarek Radosz ec8018333e DEV: Update linting (#1191) 2025-03-13 13:25:38 +00:00
Penar Musaraj ac29d3080f DEV: Fix SCSS linting issue (#1187) 2025-03-12 13:25:17 -04:00
Keegan George bb32d0d737 FEATURE: Add ability to disable search discoveries (#1177)
This update adds the ability to disable search discoveries. This can be done through a tooltip when search discoveries are shown. It can also be done in the AI user preferences, which has also been updated to accommodate more than just the one image caption setting.
2025-03-10 14:17:58 -07:00
Keegan George 94e0834b88 DEV: Sentiment follow-up updates (#1172)
###  What's new?
- [X] show sentiment counts by color on doughnut without needing to hover
- [X] minor UI padding adjustments
- [X] hide filters that are not allowed to be adjusted in selected chart view
- [X] fix z-index issues with drill-down filters
2025-03-10 09:25:55 -07:00
Keegan George 8863cf0c86 DEV: Updates to sentiment analysis reports (#1161)
**This PR includes a variety of updates to the Sentiment Analysis report:**
- [X] Conditionally showing sentiment reports based on `sentiment_enabled` setting
- [X] Sentiment reports should only be visible in sidebar if data is in the reports
- [X] Fix infinite loading of posts in drill down
- [x] Fix markdown emojis showing not showing as emoji representation
- [x] Drill down of posts should have URL
- [x] ~~Different doughnut sizing based on post count~~ [reverting and will address in follow-up (see: `/t/146786/47`)]
- [X] Hide non-functional export button 
- [X] Sticky drill down filter nav
2025-03-05 13:53:56 -08:00