Skip to content

A platform for community discussion. Free, open, simple.

UX: Retitle icebreaker modal and match topic list text sizing (#45520)

Jordan Vidrine20e231854127
diff --git a/app/assets/stylesheets/common/components/admin-onboarding-banner.scss b/app/assets/stylesheets/common/components/admin-onboarding-banner.scss
index 87c434aa3c1..5e9596693fe 100644
--- a/app/assets/stylesheets/common/components/admin-onboarding-banner.scss
+++ b/app/assets/stylesheets/common/components/admin-onboarding-banner.scss
@@ -196,44 +196,74 @@
}
&__card {
- display: flex;
- flex-direction: column;
+ all: unset; // reset browser button styles
+ box-sizing: border-box;
+ display: grid;
+ grid-template-columns: auto 1fr;
align-items: start;
- text-align: left;
+ gap: 0 var(--space-6);
width: 100%;
padding: var(--space-4);
- border: 1px solid var(--content-border-color);
+ border: 1px solid var(--primary-low);
border-radius: var(--d-border-radius);
- background: var(--secondary);
+ text-align: left;
+ cursor: pointer;
+
+ @include viewport.from(sm) {
+ gap: 0 var(--space-8);
+ }
+
+ &:hover,
+ &:focus-visible {
+ border-color: var(--tertiary);
+ }
&:disabled {
- opacity: 0.5;
cursor: not-allowed;
- }
- &:focus-visible,
- &:hover:not(:disabled) {
- outline: 2px solid var(--tertiary);
+ > * {
+ opacity: 0.5;
+ }
- .predefined-topic-options-modal__title {
- color: var(--tertiary);
+ &:hover {
+ border-color: var(--primary-low);
}
}
}
- &__heading {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: var(--space-2);
+ &__icon {
+ font-size: 2.75em;
+ line-height: 1;
+ }
+
+ // Mirrors the topic list's title cell, where the category and excerpt
+ // scale down from the title size.
+ &__content {
+ font-size: var(--d-topic-list-title-font-size);
}
&__title {
display: block;
- font-weight: bold;
+ font-weight: var(--topic-title-font-weight);
+ line-height: var(--line-height-medium);
+ color: var(--title-color);
+ overflow-wrap: break-word;
}
- &__body {
- max-width: var(--modal-max-width);
+ &__category {
+ display: flex;
+ align-items: center;
+ margin-top: var(--d-topic-list-metadata-top-space);
+ font-size: var(--font-down-1);
+ line-height: var(--line-height-large);
+ }
+
+ &__description {
+ display: block;
+ margin-top: var(--space-1);
+ font-size: var(--font-down-1);
+ line-height: var(--line-height-large);
+ color: var(--excerpt-color);
+ overflow-wrap: break-word;
}
}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index f0e47755339..f9ff454bed0 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -637,7 +637,7 @@ en:
completed: "See more ideas"
choose_option: "How would you like to start?"
predefined_topics: "Icebreaker templates"
- predefined_topics_subtitle: "Give new members something to talk about, pick a template to edit and make your own."
+ predefined_topics_subtitle: "Give members something to discuss"
predefined_topics_description: "Pick from a collection of conversation starters to get discussions going"
use_predefined: "Browse templates"
back: "Back"
@@ -645,16 +645,19 @@ en:
icebreakers:
plan_categories:
title: "What categories should we start with?"
+ description: "Ask your team which categories to launch with."
body: "Let’s figure out how to organise things before we launch! What will people want to talk about most? We can start with just a few categories and add more later."
plan_invites:
- title: "Which members should we invite before we launch?"
+ title: "Who should we invite before we launch?"
+ description: "Agree with your team on who to invite first."
body: "It’s always nicer to join a community that already has some people in it. Who should we invite first? Think of folks who love to chat, help others out, and would be excited to get involved early."
introduce_yourself:
title: "Introduce yourself"
+ description: "Get members sharing a little about themselves."
body: "Welcome to the community! Let's get to know each other. Please introduce yourself and share a little bit about your interests. I'll go first: I'm passionate about technology and love teaching others!"
write_your_own:
title: "Write your own"
- body: "Start a conversation with a topic tailored to your community."
+ description: "Start a conversation with a topic tailored to your community."
design_wizard:
title: "Customize your site"
diff --git a/frontend/discourse/app/components/admin-onboarding/modal/predefined-topics-options.gjs b/frontend/discourse/app/components/admin-onboarding/modal/predefined-topics-options.gjs
index f1cdfe52fd2..32378d7125a 100644
--- a/frontend/discourse/app/components/admin-onboarding/modal/predefined-topics-options.gjs
+++ b/frontend/discourse/app/components/admin-onboarding/modal/predefined-topics-options.gjs
@@ -6,6 +6,7 @@ import { service } from "@ember/service";
import Category from "discourse/models/category";
import DModal from "discourse/ui-kit/d-modal";
import dCategoryBadge from "discourse/ui-kit/helpers/d-category-badge";
+import dEmoji from "discourse/ui-kit/helpers/d-emoji";
import { i18n } from "discourse-i18n";
export default class PredefinedTopicOptions extends Component {
@@ -17,10 +18,10 @@ export default class PredefinedTopicOptions extends Component {
const general = Category.findById(this.siteSettings.general_category_id);
return [
- { key: "plan_categories", category: staff },
- { key: "plan_invites", category: staff },
- { key: "introduce_yourself", category: general },
- { key: "write_your_own", category: general },
+ { key: "plan_categories", emoji: "card_index_dividers", category: staff },
+ { key: "plan_invites", emoji: "busts_in_silhouette", category: staff },
+ { key: "introduce_yourself", emoji: "wave", category: general },
+ { key: "write_your_own", emoji: "writing_hand", category: general },
].map((topic) => ({
...topic,
disabled: !topic.category?.canCreateTopic,
@@ -61,7 +62,7 @@ export default class PredefinedTopicOptions extends Component {
@subtitle={{i18n
"admin_onboarding_banner.start_posting.predefined_topics_subtitle"
}}
- @title={{i18n "admin_onboarding_banner.start_posting.predefined_topics"}}
+ @title={{i18n "admin_onboarding_banner.start_posting.title"}}
>
<:body>
<div class="predefined-topic-options-modal__list">
@@ -79,7 +80,10 @@ export default class PredefinedTopicOptions extends Component {
type="button"
{{on "click" (fn this.handleSelectTopic topic)}}
>
- <span class="predefined-topic-options-modal__heading">
+ <span class="predefined-topic-options-modal__icon">
+ {{dEmoji topic.emoji alt="" skipTitle=true}}
+ </span>
+ <span class="predefined-topic-options-modal__content">
<span class="predefined-topic-options-modal__title">
{{i18n
(concat
@@ -90,18 +94,20 @@ export default class PredefinedTopicOptions extends Component {
}}
</span>
{{#if topic.category}}
- {{dCategoryBadge topic.category}}
+ <span class="predefined-topic-options-modal__category">
+ {{dCategoryBadge topic.category}}
+ </span>
{{/if}}
+ <span class="predefined-topic-options-modal__description">
+ {{i18n
+ (concat
+ "admin_onboarding_banner.start_posting.icebreakers."
+ topic.key
+ ".description"
+ )
+ }}
+ </span>
</span>
- <p class="predefined-topic-options-modal__body">
- {{i18n
- (concat
- "admin_onboarding_banner.start_posting.icebreakers."
- topic.key
- ".body"
- )
- }}
- </p>
</button>
{{/each}}
</div>
diff --git a/spec/integrity/admin_onboarding_locale_spec.rb b/spec/integrity/admin_onboarding_locale_spec.rb
index 0c114bca0f3..8c8aeb95ed5 100644
--- a/spec/integrity/admin_onboarding_locale_spec.rb
+++ b/spec/integrity/admin_onboarding_locale_spec.rb
@@ -21,7 +21,9 @@ RSpec.describe "Admin onboarding banner locale keys" do
it "defines every topic option recorded by the staff action log" do
options = banner.fetch("start_posting").fetch("icebreakers")
expect(options.keys).to contain_exactly(*UserHistory::ADMIN_ONBOARDING_TOPIC_OPTIONS)
- expect(options.values).to all(include("title", "body"))
+ expect(options.values).to all(include("title", "description"))
+ # "write_your_own" opens an empty composer, so it has no body to prefill.
+ expect(options.except("write_your_own").values).to all(include("body"))
end
it "defines title, description, action and completed for every step" do