From a3ea2886dccd3115da3c3c31e5dfde93d1e9def9 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 14 Oct 2024 09:54:01 +0200 Subject: [PATCH] DEV: Set priorities on user tips (#29176) Currently the topic timeline tip appears before the suggested topics one only due to a small implementation detail in the latter. This ensures that tips appear in the expected order when more than one of these components is rendered at the same time. --- .../app/components/header/user-dropdown/notifications.gjs | 1 + .../javascripts/discourse/app/components/suggested-topics.hbs | 1 + .../discourse/app/components/topic-footer-buttons.hbs | 1 + .../discourse/app/components/topic-timeline/container.hbs | 1 + 4 files changed, 4 insertions(+) diff --git a/app/assets/javascripts/discourse/app/components/header/user-dropdown/notifications.gjs b/app/assets/javascripts/discourse/app/components/header/user-dropdown/notifications.gjs index 281a08ac2fd..c20de9203fc 100644 --- a/app/assets/javascripts/discourse/app/components/header/user-dropdown/notifications.gjs +++ b/app/assets/javascripts/discourse/app/components/header/user-dropdown/notifications.gjs @@ -64,6 +64,7 @@ export default class Notifications extends Component { @titleText={{i18n "user_tips.first_notification.title"}} @contentText={{i18n "user_tips.first_notification.content"}} @showSkipButton={{true}} + @priority={{40}} /> {{/if}} diff --git a/app/assets/javascripts/discourse/app/components/suggested-topics.hbs b/app/assets/javascripts/discourse/app/components/suggested-topics.hbs index c7acf98180e..58703a14eb3 100644 --- a/app/assets/javascripts/discourse/app/components/suggested-topics.hbs +++ b/app/assets/javascripts/discourse/app/components/suggested-topics.hbs @@ -12,6 +12,7 @@ @titleText={{i18n "user_tips.suggested_topics.title"}} @contentText={{i18n "user_tips.suggested_topics.content"}} @placement="top-start" + @priority={{10}} /> {{/unless}} diff --git a/app/assets/javascripts/discourse/app/components/topic-footer-buttons.hbs b/app/assets/javascripts/discourse/app/components/topic-footer-buttons.hbs index 5256f012f86..e7498a441ec 100644 --- a/app/assets/javascripts/discourse/app/components/topic-footer-buttons.hbs +++ b/app/assets/javascripts/discourse/app/components/topic-footer-buttons.hbs @@ -97,6 +97,7 @@ @triggerSelector=".notifications-button" @titleText={{i18n "user_tips.topic_notification_levels.title"}} @contentText={{i18n "user_tips.topic_notification_levels.content"}} + @priority={{20}} /> {{/if}} diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs index 32354fb917b..cea43f8ef68 100644 --- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs +++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.hbs @@ -67,6 +67,7 @@ @contentText={{i18n "user_tips.topic_timeline.content"}} @placement="left" @triggerSelector=".timeline-scrollarea-wrapper" + @priority={{30}} />