mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-16 16:34:45 +00:00
FIX: Unresponsive post buttons due to Ask AI highlight (#635)
This commit is contained in:
parent
3a9080dd14
commit
59e63a2da9
@ -59,7 +59,7 @@ export default class AIHelperOptionsMenu extends Component {
|
|||||||
highlightSelectedText() {
|
highlightSelectedText() {
|
||||||
const postId = this.args.outletArgs.data.quoteState.postId;
|
const postId = this.args.outletArgs.data.quoteState.postId;
|
||||||
const postElement = document.querySelector(
|
const postElement = document.querySelector(
|
||||||
`article[data-post-id='${postId}']`
|
`article[data-post-id='${postId}'] .cooked`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!postElement) {
|
if (!postElement) {
|
||||||
@ -135,7 +135,7 @@ export default class AIHelperOptionsMenu extends Component {
|
|||||||
|
|
||||||
const postId = this.args.outletArgs.data.quoteState.postId;
|
const postId = this.args.outletArgs.data.quoteState.postId;
|
||||||
const postElement = document.querySelector(
|
const postElement = document.querySelector(
|
||||||
`article[data-post-id='${postId}']`
|
`article[data-post-id='${postId}'] .cooked`
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!postElement) {
|
if (!postElement) {
|
||||||
|
@ -65,6 +65,14 @@ RSpec.describe "AI Post helper", type: :system, js: true do
|
|||||||
expect(post_ai_helper).to have_no_highlighted_text
|
expect(post_ai_helper).to have_no_highlighted_text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "allows post control buttons to still be functional after clicking the AI button" do
|
||||||
|
select_post_text(post)
|
||||||
|
post_ai_helper.click_ai_button
|
||||||
|
topic_page.click_like_reaction_for(post)
|
||||||
|
wait_for { post.reload.like_count == 1 }
|
||||||
|
expect(post.like_count).to eq(1)
|
||||||
|
end
|
||||||
|
|
||||||
context "when using explain mode" do
|
context "when using explain mode" do
|
||||||
let(:mode) { CompletionPrompt::EXPLAIN }
|
let(:mode) { CompletionPrompt::EXPLAIN }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user