The issue revolves around the js.composer.reply_placeholder being incorrectly applied to both new topic creation and replies, despite being intended for replies only. Tris20 highlights that this causes confusing placeholder text in new topics, especially in support communities where context-specific guidance is valuable. Moin suggests a potential fix from a meta.discourse.org topic, which Tris20 initially finds helpful but later notes doesn’t fully work — specifically, it incorrectly shows reply placeholders when creating topics from within an existing topic. As a solution, Tris20 provides a custom JavaScript snippet that correctly distinguishes between reply and new-topic placeholders using composer.replyingToTopic and composer.creatingTopic, assigning distinct guidance text for each. The snippet sets custom_reply_placeholder and custom_topic_placeholder translations and modifies the composer-editor component to return the appropriate placeholder based on context. Moin adds another reference to a related topic on topic template placeholders, suggesting further exploration. Overall, the community seeks a core-level fix to allow separate, context-aware placeholders for replies and new topics to improve user guidance.
The js.compser.reply_placeholder text appears to be coupled to the text in the composer when a topic is created, despite being reply specific.
How to reproduce?
This can be seen by comparing a modified version of placeholder text to the composer.
Some fixes that come to mind
One fix might be to change the name of the placeholder, however we would love to have the option to modify the placeholders of both replies and creates separately.
Why would create and reply placeholders be useful?
As shown below, we’ve started using the following placeholder text for new topics. However, this guidance makes no sense in the context of a reply.
If the fix for this resulted in a placeholder for both replies and creating, we would be able to provide improved JIT guidance for all users(which would be amazing for support communities like ours).
That’s a great find. Gave it quick try and seems to very nicely separate the reply and create placeholders. Would love to see this change made in core, but very happy to use the changes given by Joe. Thanks for linking this @Moin
Just as a followup, the code snippet posted by Joe didn’t work as expected with our new topic button: when a user creates a new topic while they were reading a topic, they would get the reply text.
Below is an alternative appraoch which:
Presents a placeholder for new topics whether they are started in the Categories page or from within a topic
Presents a different placeholder for replies
<script type="text/discourse-plugin" version="0.8">
// Custom placeholders
const placeHolderForReplies = `When helping someone else:
1. Describe what you think the problem is
2. Tell them what you think they should do
3. Show them how to do it (code snippets, images, etc)
4. Include links and references `;
const placeHolderForNewTopics = `Type here.
1. Tell us what you're trying to do.
2. Tell us what you already tried.
3. Post error logs as code snippets.`;
// Import required modules
const discourseComputed = require("discourse-common/utils/decorators").default;
const currentLocale = I18n.currentLocale();
I18n.translations[currentLocale].js.composer.custom_reply_placeholder = placeHolderForReplies;
I18n.translations[currentLocale].js.composer.custom_topic_placeholder = placeHolderForNewTopics;
api.modifyClass("component:composer-editor", {
@discourseComputed("composer.replyingToTopic", "composer.creatingTopic")
replyPlaceholder(replyingToTopic, creatingTopic) {
// Determine if the composer is for replying or creating a new topic
if (creatingTopic) {
return "composer.custom_topic_placeholder"; // New topic placeholder
} else if (replyingToTopic) {
return "composer.custom_reply_placeholder"; // Reply placeholder
}
return this._super(...arguments); // Fallback to default behavior
}
});
</script>