diff --git a/app/assets/javascripts/discourse/app/controllers/topic.js b/app/assets/javascripts/discourse/app/controllers/topic.js index 9d5fd69deb6..76efe82073e 100644 --- a/app/assets/javascripts/discourse/app/controllers/topic.js +++ b/app/assets/javascripts/discourse/app/controllers/topic.js @@ -657,7 +657,8 @@ export default Controller.extend(bufferedProperty("model"), { if ( composerController.get("model.topic.id") === topic.get("id") && - composerController.get("model.action") === Composer.REPLY + composerController.get("model.action") === Composer.REPLY && + post?.get("post_number") !== 1 ) { composerController.set("model.post", post); composerController.set("model.composeState", Composer.OPEN); diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-test.js index 22a30cc32b1..3f0920527aa 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/composer-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/composer-test.js @@ -334,6 +334,22 @@ acceptance("Composer", function (needs) { ); }); + test("Replying to the first post in a topic is a topic reply", async function (assert) { + await visit("/t/internationalization-localization/280"); + + await click("#post_1 .reply.create"); + assert.strictEqual( + query(".reply-details a.topic-link").innerText, + "Internationalization / localization" + ); + + await click("#post_1 .reply.create"); + assert.strictEqual( + query(".reply-details a.topic-link").innerText, + "Internationalization / localization" + ); + }); + test("Can edit a post after starting a reply", async function (assert) { await visit("/t/internationalization-localization/280");