discourse/app/assets
Isaac Janzen caa29ec973
DEV: Update how we determine the presence of a topic in the header (#27138)
# Context

We currently have a tracked value of `topic` in the header service that we utilize across the app for determining the presence of a topic.

A simple example is: If you are in a topic, and scroll down the page, we need to communicate to the header that a topic is present and we change the styling of the header. 

The issue with this logic is that when entering a topic (and you are at the top of the page), we **haven't** set the topic on the header service yet. We only set the topic when you have scrolled down on the page (set by `app/components/discourse-topic.js`) 

This is unhelpful behavior when you are utilizing a plugin outlet that is receiving the `topic` from the header: 

17add599e3/app/assets/javascripts/discourse/app/components/header/topic/info.gjs (L85)

As the `topic` won't be present until you scroll down the page. 

# Changes

This PR adds a tracked `inTopic` value to the header service that is a boolean value. This is to let the app know

> Yes, we are scrolled within a topic

And instead sets the tracked `topic` value immediately, if you are loading a topic, to allow the necessary data to be populated to the plugin outlets on page load.
2024-05-28 07:16:18 -06:00
..
images FIX: Use correct location for wizard background image (#24183) 2023-10-31 15:57:47 +00:00
javascripts DEV: Update how we determine the presence of a topic in the header (#27138) 2024-05-28 07:16:18 -06:00
stylesheets UX: add space to following list (#27154) 2024-05-23 17:26:15 +04:00