Topic-timeline api.decorateWidget call has stopped working

AI-generated summary

The api.decorateWidget call for the topic timeline has stopped working due to updates in the Ember/Glimmer components. david suggests using a Plugin Outlet instead.

After implementing an outlet, bartv encountered issues with inserting data from within a Theme Component, which merefield clarified should be possible from both Theme Components and theme JS.

However, bartv experienced issues with the outlet rendering only for admins, not regular users. david explained that the outlet is only visible when ‘timeline controls’ are shown and suggested introducing another outlet before the {{#if condition. featheredtoast agreed that an additional outlet would be beneficial.

Hey friends!

I can’t pinpoint exactly when, but somewhere this year the following code has stopped working. It’s not throwing any errors, just doesn’t do anything anymore - I suspect this might be related to this change, but I’m not sure.

var bHTML = (some html);

api.decorateWidget('topic-timeline-container:before', helper => {
    return helper.h('div.side-block', [
    	helper.rawHtml(bHTML),
    ]);
});

Any ideas how I can fix this?

The timeline has been updated to use regular Ember/Glimmer components rather than our custom ‘widget’ system, so I’m afraid decorateWidget won’t work there any more.

Instead, you’ll need to use a Plugin Outlet. Right now we have these two:

But if they don’t work for your use case please let us know and we’re happy to look at introducing new ones.

I sorta got this to work, but I couldn’t find a way to insert any data from within a Theme Component. Is that still only possible from theme JS?

What do you mean by insert data?

There should be no difference between TC JS and a Theme.

I spoke too soon and I need some more help with this. I added the following code in the HEAD section of a Theme Component:

<script type='text/x-handlebars' data-template-name='/connectors/timeline-controls-before/adnet'>
    <div class="side-block">
        <div id="supporters"></div>
    </div>
</script>

While this renders for me, the admin, it doesn’t display for regular users. Any idea why?

Looks like that outlet is only rendered when the ‘timeline controls’ are visible

Perhaps we should introduce another outlet before that {{#if. What do you think @isaac @featheredtoast

Can confirm, this would be nice available outside {{#if :+1:t2: