77 Commits

Author SHA1 Message Date
Jarek Radosz
78283bd98a
remove js: true from specs 2025-06-20 23:49:44 +02:00
Keegan George
a4194d3fb2
FIX: AI preferences tab button not appearing unless Helper enabled (#1452)
This update fixes an issue where the AI user preferences tab was not appearing unless `SiteSetting.ai_helper_enabled` was `true`. This is because we previously checked for it's presence when user preferences only had a single setting related to Helper. However, since then, we've also added search discoveries setting there too. As such, we don't want it to depend on Helper. We also sneak in this update a modernization of converting the preferences template from `.hbs` to `.gjs`.
2025-06-20 10:12:08 -07:00
Keegan George
baaa3d199a
FIX: streaming related specs (#1448)
## 🔍 Overview
This update fixes an issue where message bus streaming related specs
were not working correctly. To do so we pass the `last_id` when
subscribing to `MessageBus` which allows us to unskip those broken
tests.

---------

Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
2025-06-19 07:41:18 -07:00
Joffrey JAFFEUX
6a33e5154d
DEV: makes ai menu helper a standalone menu (#1434)
The current menu was rendering inside the post text toolbar (on desktop). This is not ideal as the post text toolbar rendering is conditioned on the presence of text selection, when you click a button on the toolbar, by design of the web browsers you will lose your text selection, making all of this super tricky.

This commit makes desktop and mobile behave in the same way by rendering their own menu and capturing the quote state when we render the post text selection toolbar, this allows us to reason a much simpler way about the AI helper.

This commit also removes what appears to be an unused file and corrects which was seemingly copy/paste mistakes.

⚠️ Technical note, this commit is correcting the message bus subscription which amongst other things allows to write specs which are not flaky. However due to the current implementation we have a channel per post, which means we need to serialize on last message bus id per post. 

We have two possible solutions here:
- subscribe at the topic level
- refactor the code to be able to use `MessageBus.last_ids` to be able to grab multiple posts at once instead of having to call `MessageBus.last_id` and done one Redis call per post

---------

Co-authored-by: Keegan George <kgeorge13@gmail.com>
2025-06-19 11:56:00 +02:00
Rafael dos Santos Silva
bc8e57d7e8
DEV: Move title suggestion to an array (#1435) 2025-06-16 18:06:54 -03:00
Joffrey JAFFEUX
26217e51f9
DEV: a real selection change has a pointerup event (#1427)
This is needed for https://github.com/discourse/discourse/pull/33143 as we now rely on this pointerup event.
2025-06-12 00:59:21 +02:00
Roman Rizzi
0338dbea23 FEATURE: Use different personas to power AI helper features.
You can now edit each AI helper prompt individually through personas, limit access to specific groups, set different LLMs, etc.
2025-06-04 14:23:00 -03:00
Joffrey JAFFEUX
306fec2b24
FIX: edit-topic is not invisible on desktop (#1394)
Fix due to https://github.com/discourse/discourse/pull/32941
2025-06-03 16:30:19 +02: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
Martin Brennan
0c8718e0d5
DEV: Update spec for topic tag suggester (#1269)
This second post was not used and is making the topic scroll
down to post 2, which can mess with editing the OP sometimes
2025-04-17 14:06:45 +10:00
Martin Brennan
b5d42f373b
DEV: Re-introduce proofreading specs (#1263)
Followup fe7e73a6a436795c053a611884431f663f4bdd27 and
1300cc8a36dc33870f0d3c81e1e1a21a93e1f1de

Reintroduces proofreader specs and unskips ones skipped when
streaming composer suggestions were added. We just need to make sure
the jobs run immediately in specs because the job is what sends the
MessageBus event to the UI.

Also adds a pageobject method to confirm a diff is shown
in the modal before pressing Confirm button.
2025-04-16 11:11:43 +10:00
Martin Brennan
fe7e73a6a4
Revert "DEV: Add test to cover proofreading in rich editor (#1259)" (#1261)
This reverts commit e81108abb6819d36eb3c6b9f539c56eb47d34e59.
2025-04-15 15:58:09 +10:00
Martin Brennan
e81108abb6
DEV: Add test to cover proofreading in rich editor (#1259)
This core PR must be merged for this to work
https://github.com/discourse/discourse/pull/32280

We want to make sure we don't have regressions with this
functionality in the rich editor, which uses contendeditable
and other APIs than the old composer.
2025-04-15 14:05:09 +10:00
Keegan George
1300cc8a36
FEATURE: Add streaming to composer helper (#1256)
This update adding streaming to the AI helper inside the composer.
2025-04-14 08:18:50 -07:00
Keegan George
129ced9088
FIX: Split topic suggester fixes (#1253)
This update fixes a few issues in the split topic suggester. It fixes an issue where not all the category suggestions were appearing in the client. It also fixes an issue where the `move-post` request fails when creating a new topic with only one tag suggestion.
2025-04-09 13:12:34 -07:00
Keegan George
48fff48aa2
FIX: failing image caption spec (#1195) 2025-03-14 10:19:04 -07:00
Rafael dos Santos Silva
37bf160d26
FIX: Add workaround to pgvector HNSW search limitations (#1133)
From [pgvector/pgvector](https://github.com/pgvector/pgvector) README

> With approximate indexes, filtering is applied after the index is scanned. If a condition matches 10% of rows, with HNSW and the default hnsw.ef_search of 40, only 4 rows will match on average. For more rows, increase hnsw.ef_search.
> 
> Starting with 0.8.0, you can enable [iterative index scans](https://github.com/pgvector/pgvector#iterative-index-scans), which will automatically scan more of the index when needed.


Since we are stuck on 0.7.0 we are going the first option for now.
2025-02-19 16:30:01 -03:00
Keegan George
d6beac48f8
DEV: Improve explain suggestion footnote replacement (#999)
Previously, when clicking add footnote on an explain suggestion it would replace the selected word by finding the first occurrence of the word. This results in issues when there are more than one occurrences of a word in a post. This is not trivial to solve, so this PR instead prevents incorrect text replacements by only allowing the replacement if it's unique. We use the same logic here that we use to determine if something can be fast edited.

In this PR we also update tests for post helper explain suggestions. For a while, we haven't had tests here due to streaming/timing issues, we've been skipping our system specs. In this PR, we add acceptance tests to handle this which gives us improved ability to publish message bus updates in the testing environment so that it can be better tested without issues.
2024-12-04 11:41:34 -08:00
Keegan George
fc88bb08ab
FIX: Tag suggester is suggesting already assigned tags (#990)
This PR fixes an issue where the tag suggester for edit title topic area was suggesting tags that are already assigned on a post. It also updates the amount of suggested tags to 7 so that there is still a decent amount of tags suggested when tags are already assigned.
2024-12-03 07:25:04 +11:00
Keegan George
6b7d7c1179
REFACTOR: Helper suggestions (#914)
This PR adds some updates to the Helper suggestions to improve it's functionality and modernize some of the codebase.
2024-11-27 12:21:03 -08:00
Keegan George
493d65af1f
FIX: Diff modal closing along with composer menu on mobile (#803)
The `DiffModal` is triggered after selecting an option in the composer helper menu. After selecting an option, we should close the composer helper menu and only show the diff modal. On mobile, there was an edge-case where `this.args.close()` for was causing the closing of both the `DiffModal` and the `AiComposerHelperMenu`. This PR resolves that by ensuring the menu is closed _first_ asynchronously, followed by opening the relevant modal.
2024-09-16 14:00:41 -07:00
Keegan George
9cd14b0003
DEV: Move composer AI helper to toolbar (#796)
Previously we had moved the AI helper from the options menu to a selection menu that appears when selecting text in the composer. This had the benefit of making the AI helper a more discoverable feature. Now that some time has passed and the AI helper is more recognized, we will be moving it back to the composer toolbar.

This is better because:
- It consistent with other behavior and ways of accessing tools in the composer
- It has an improved mobile experience
- It reduces unnecessary code and keeps things easier to migrate when we have composer V2.
- It allows for easily triggering AI helper for all content by clicking the button instead of having to select everything.
2024-09-13 11:59:30 -07:00
Keegan George
943504049c
FIX: Prevent proofreading when there is no content (#779) 2024-08-28 12:21:34 -07:00
Sam
f148452f4c
FEATURE: single click proofreading (#769)
Previously there was too much work proofreading text, new implementation
provides a single shortcut and easy way of proofreading text.


Co-authored-by: Martin Brennan <martin@discourse.org>
2024-08-26 15:43:40 +10:00
Keegan George
bfe3b1c3b8
FIX: Modals in composer helper menu not working (#755) 2024-08-16 10:08:58 -07:00
Keegan George
23b88537d9
FIX: Prevent AI caption setting from showing unless all criteria is met (#753) 2024-08-14 10:17:36 -07:00
Keegan George
f72ab12761
DEV: Clearly separate post/composer helper settings (#747) 2024-08-12 15:40:23 -07:00
Keegan George
1d6a6c9f8f
FEATURE: Stream other post helper options (#745) 2024-08-08 11:32:39 -07:00
Keegan George
1254d7c7d0
REFACTOR: AI Composer Helper Menu (#715) 2024-08-06 10:57:39 -07:00
Roman Rizzi
5c196bca89
FEATURE: Track if a model can do vision in the llm_models table (#725)
* FEATURE: Track if a model can do vision in the llm_models table

* Data migration
2024-07-24 16:29:47 -03:00
Keegan George
08355ea5d8
FEATURE: Show post helper as bottom modal on mobile (#704) 2024-07-10 11:01:05 -07:00
Roman Rizzi
8849caf136
DEV: Transition "Select model" settings to only use LlmModels (#675)
We no longer support the "provider:model" format in the "ai_helper_model" and
"ai_embeddings_semantic_search_hyde_model" settings. We'll migrate existing
values and work with our new data-driven LLM configs from now on.
2024-06-19 18:01:35 -03:00
Keegan George
90c5e4bb0e
FIX: Reply broken when auto caption is enabled (#642) 2024-05-27 12:17:35 -07:00
Keegan George
a1c649965f
FEATURE: Auto image captions (#637) 2024-05-27 10:49:24 -07:00
Keegan George
59e63a2da9
FIX: Unresponsive post buttons due to Ask AI highlight (#635) 2024-05-21 13:58:37 -07:00
Keegan George
8875830f6a
FEATURE: Insert footnote from explained result (#591) 2024-05-03 11:53:17 -07:00
Keegan George
cb4d438506
UX: Highlight AI post helper selection (#520) 2024-04-04 11:35:01 -07:00
Keegan George
740731ab53
FIX: Image caption feature should respect composer AI helper groups (#522) 2024-03-11 15:35:20 -07:00
Loïc Guitaut
6ae4218a96 DEV: Fix new Rubocop offenses 2024-03-06 15:23:29 +01:00
Keegan George
cee1b3d275
FIX: Backspace in composer custom prompt closes menu (#505) 2024-03-04 13:33:31 -08:00
Keegan George
6a30b06a55
DEV: Cancel popup should abort request (#497) 2024-02-28 13:32:45 -08:00
Keegan George
2c7d34ff1f
DEV: Image caption system specs (#487) 2024-02-26 12:22:09 -08:00
Keegan George
944fd6569c
DEV: Add granular control for AI composer helper features (#458) 2024-02-01 14:58:04 -08:00
Roman Rizzi
392e2e8aef
Revert "UX: Validate embeddings settings (#455)" (#456)
This reverts commit 85fca89e011933a0479abaf4bf0945983fb948b8.
2024-02-01 14:06:51 -03:00
Roman Rizzi
85fca89e01
UX: Validate embeddings settings (#455) 2024-02-01 13:05:38 -03:00
Roman Rizzi
0634b85a81
UX: Validations to LLM-backed features (except AI Bot) (#436)
* UX: Validations to Llm-backed features (except AI Bot)

This change is part of an ongoing effort to prevent enabling a broken feature due to lack of configuration. We also want to explicit which provider we are going to use. For example, Claude models are available through AWS Bedrock and Anthropic, but the configuration differs.

Validations are:

* You must choose a model before enabling the feature.
* You must turn off the feature before setting the model to blank.
* You must configure each model settings before being able to select it.

* Add provider name to summarization options

* vLLM can technically support same models as HF

* Check we can talk to the selected model

* Check for Bedrock instead of anthropic as a site could have both creds setup
2024-01-29 16:04:25 -03:00
Jarek Radosz
5802cd1a0c
DEV: Fix various typos (#434) 2024-01-19 12:51:26 +01:00
Ted Johansson
37e6ac169e
DEV: Update test setup to work with auto groups (#424)
We're updating core to change TL based access settings to be group based. This requires some updates of tests to work correctly. (The existing test setup gives false positives.)
2024-01-15 20:18:56 +08:00
Keegan George
d674e47ca4
FEATURE: AI suggestion buttons in move-to-topic modal (#360) 2023-12-15 12:11:14 -08:00
Keegan George
408d9f68eb
FEATURE: Proofread with post AI helper (#359) 2023-12-14 19:30:52 -08:00