DiscoToc toggle doesn't show when topic has no replies

Hi all,

I see that DiscoTOC automatically disables the Timeline/Contents toggle button if the documentation topic has no replies.

This was confusing for me. I installed the Discourse Topic Print Component and it doesn’t appear to work directly with DiscoTOC, either because DiscoTOC replaced the plugin outlet, or it uses the plugin outlet itself (from what I see, only one component/plugin can use each outlet?).

That would be fine, if the toggle shows up all the time and I could direct users to click the timeline and then see the print button. But for now, I need to make sure any document I want users to be able to cleanly print has a reply to it, otherwise they won’t be able to click that button.

In my ideal world, these two components would just work better together - documentation categories are why I want people to be able to cleanly print, so an optional button implementing the print component directly in DiscoTOC would be great. But as a simpler, option, giving users an option to always show the toggle would help in the nearterm.

I’d be open to making a PR to support this (likely a setting “always show toggle button” that defaults to false to maintain current behavior, then modifying the line I linked above to use it), but wanted to make sure that you would be open to the PR first. Optionally, I might like to have another option to enable “Print Documentation” below the TOC, also disabled by default and maybe with a minimum trust level setting? I know I’m getting into feature request territory here, but before I start modifying code, wanted to get a gut check from you all about what’s appropriate.

Thanks!

I thought this had been implemented now DiscoTOC style is broken if there is no reply on mobile

Are you on an older version of Discourse that may not have this included?

FWIW I can see the toc button here on meta for topics with no replies (eg the example one in the topic linked above Customizing the topic list)

1 like

Thanks for the reply - I should have mentioned I’m running Discourse 3.5.1 with the latest version of DiscoTOC. And DiscoTOC itself does show up, so I think it’s a different issue, and also an intentional design choice to limit the toggle button to show up only if there are replies and always show the TOC by default. That’s why I put this in the UX category - I think there’s a UX consideration, but that the component is behaving as designed right now.

1 like