Simplify the collaborative creation of a new post in a thread

AI-generated summary

The discussion revolves around simplifying the workflow for creating and publishing collaborative posts in a thread. thoka proposes a streamlined process where a post can be directly published to a new thread with a chosen category, automatically using the post’s title as the new topic title. This would eliminate the current tedious steps of manually extracting the title and moving the content. Moin notes the similarity to the existing ‘shared drafts’ feature. Lhc_fl confirms the technical feasibility, suggesting it requires two AJAX requests—one to fetch the post’s raw content and title, and another to create a new post in the desired category. The main challenge, according to Lhc_fl, is developing an intuitive and user-friendly frontend interface for this functionality, which could potentially be implemented as a theme component.

I find our core group repeating the following workflow pattern:

  • create a wiki-post inside a thread to prepare a new topic
  • work on it, keep the discussion in the same thread
  • move it to a new topic in a different category when ready

While working on it, we write the proposed title for the topic in the first row of the wiki-post as a H1 header:

# new Title

new content

The “move step” is a little tedious:

  • edit the wiki to remove the new heading, keep the title in copy paste memory
  • select the post to be moved to another topic
  • paste the heading
  • choose category
  • publish

I’m dreaming of a simplified workflow

  • select “publish to new thread” from the wrench menu of the post
  • choose category
  • publish

which would remove the first topic line and choose its value as the preset for a new topic automatically.

Would such behaviour be realizable by a theme component?

1 Like

This seems similar to shared drafts.

3 Likes

I think it’s perfectly fine. This only needs to send two ajax requests, one to get the original text, and one to process the content and post it as a post.

Wait a minute, I’ll give a critical part of the code

const post_id = 1327039; // You should do some operations before to get the desired post id

$.ajax(`/posts/${post_id}/raw.json`).then(res => {
  const [text, title, raw] = res.match(/\s*#\s+([^\n]+)([\s\S]*)/);
  $.ajax("/posts.json", {
    type: "POST",
    data: {
      raw,
      title,
      category: YOUR_CATEGORY_ID,
    },
  });
});

Building a good-looking and easy-to-use front end should be the most difficult part of this theme component

2 Likes