How to move topic-notifications-button and invite-reply-button from footer?

AI-generated summary

In a discussion titled “How to move topic-notifications-button and invite-reply-button from footer?” within the Dev category, user stevenpslade seeks assistance relocating two specific buttons from the topic footer to the first post area, potentially via a widget or post menu. The buttons in question are topic-notifications-button and invite-reply-button, located in discourse/app/assets/javascripts/discourse/views/topic-footer-buttons.js.es6. stevenpslade initially considered extending the ContainerView in a plugin but struggled to recreate the necessary logic or determine how to move the functionality elsewhere.

In a follow-up post, stevenpslade noted that implementing invite-reply-button seems straightforward by adding the showInvite action to a custom button. However, the topic-notifications-button presents a greater challenge as it is a component rather than a view. The user inquired about the best approach to include this component within a virtual DOM (vdom) widget, noting that while Handlebars makes this easy, the vdom implementation is unclear. They mentioned using api.container.lookupFactory("component:" + "topic-notifications-button") as a potential method to retrieve the component but remain unsure how to integrate it into the widget structure.

There are two special buttons in discourse/app/assets/javascripts/discourse/views/topic-footer-buttons.js.es6: topic-notifications-button and invite-reply-button.

I am exploring the possibility of moving these buttons to an area in the first post, probably a widget attached to the post or the post-menu. I am struggling though with how to do this.

One thought I had was to get extend or reopen the ContainerView in my plugin:

const ContainerView = api.container.lookupFactory('view:container');
  ContainerView.reopen({
  //code in here that would at least recreate putting these buttons on the page

However, I can’t 1) Even recreate the logic in my plugin to show these buttons elsewhere and 2) think how to move the logic else where.

Does anyone have any suggestions?

It seems as invite-reply-button should be an easy one to create. I will simply add the showInvite action to the button I create.

The more complicated issue is certainly the topic-notifications-button. Unlike the other buttons, it is a component, not a view. Is this an advantage? In Handlebars it would be easy to call the component in the template, how is this done in a widget with virtual-dom?

EDIT: api.container.lookupFactory("component:" + "topic-notifications-button"); …this is about all I have so far. A possible way to get the component I need, but how to included in vdom widget?