Asking for feedback: Tag Reveal Component in Topic Lists - Expand/Collapse tags in topic lists

Hey,

This feature could be interesting in some situations!

At first glance, there are a few things to note:

  • Theme settings and Site settings are not the same. You need to retrieve the service first to access max_tags_per_topic, e.g.: const siteSettings = api.container.lookup("service:site-settings");

  • The extra checks to get the limit should not be necessary; you can retrieve the value directly. You can probably do Math.min(settings.max_tags_visible, siteSettings.max_tags_per_topic )

  • You are not restoring the visibility of separators.

  • You might want to unregister the events

  • The process on initial load should not be needed with MutationObserver. Usually, before going global, you would want to check first if there is a way to reduce the scope around the element using the API (plugin outlet, for example).

Let me check if there is a different way!

1 Like