discourse/app/assets/javascripts
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
..
admin Build(deps): Bump the babel group with 2 updates (#27185) 2024-05-27 11:25:56 +02:00
custom-proxy Build(deps-dev): Bump glob from 10.3.16 to 10.4.1 (#27186) 2024-05-27 11:41:43 +02:00
deprecation-silencer DEV: Silence whitespace-eating-comment warnings (#27129) 2024-05-22 16:21:51 +02:00
dialog-holder Build(deps): Bump ember-template-imports from 4.1.0 to 4.1.1 (#27024) 2024-05-15 02:27:59 +02:00
discourse DEV: Update how we determine the presence of a topic in the header (#27138) 2024-05-28 07:16:18 -06:00
discourse-common Build(deps): Bump the babel group with 2 updates (#27185) 2024-05-27 11:25:56 +02:00
discourse-hbr DEV: Convert discourse-hbr to a regular package (#26562) 2024-04-08 20:00:34 +01:00
discourse-i18n Build(deps): Bump @embroider/addon-shim in the embroider group (#27142) 2024-05-23 00:32:09 +02:00
discourse-markdown-it Build(deps): Bump @embroider/addon-shim in the embroider group (#27142) 2024-05-23 00:32:09 +02:00
discourse-plugins Build(deps): Bump the babel group with 2 updates (#27185) 2024-05-27 11:25:56 +02:00
discourse-widget-hbs Build(deps): Bump the babel group with 2 updates (#27185) 2024-05-27 11:25:56 +02:00
docs
ember-addons
ember-cli-progress-ci PERF: Improve production JS build in low-memory environments (#26849) 2024-05-02 11:43:59 +01:00
ember-production-deprecations DEV: Drop unused shims for Ember 3 deprecations (#26563) 2024-04-09 09:22:37 +01:00
float-kit Build(deps): Bump the babel group with 2 updates (#27185) 2024-05-27 11:25:56 +02:00
locales FEATURE: Add Uyghur language (#27183) 2024-05-27 09:58:18 +02:00
pretty-text Build(deps): Bump the babel group with 2 updates (#27185) 2024-05-27 11:25:56 +02:00
select-kit Build(deps): Bump the babel group with 2 updates (#27185) 2024-05-27 11:25:56 +02:00
theme-transpiler Build(deps): Bump the babel group with 2 updates (#27185) 2024-05-27 11:25:56 +02:00
truth-helpers Build(deps): Bump @embroider/addon-shim in the embroider group (#27142) 2024-05-23 00:32:09 +02:00
.npmrc
handlebars-shim.js
polyfills.js
run-patch-package
service-worker.js.erb DEV: Drop workbox dependency (#26735) 2024-04-24 10:19:12 +01:00