Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX: Use full width when displaying a single recommendations list. #22896

Merged
merged 1 commit into from Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,6 +1,5 @@
<div
class="more-content-wrapper
{{if this.showTitleOnMobile 'mobile-single-list'}}"
class="more-content-wrapper {{if this.singleList 'single-list'}}"
{{did-insert this.buildListPills}}
>
{{#if this.showTopicListsNav}}
Expand Down
11 changes: 3 additions & 8 deletions app/assets/javascripts/discourse/app/components/more-topics.js
Expand Up @@ -15,10 +15,6 @@ export default class MoreTopics extends Component {
return this.site.mobileView && !this.singleList;
}

get showTitleOnMobile() {
return this.site.mobileView && this.singleList;
}

@action
rememberTopicListPreference(value) {
this.moreTopicsPreferenceTracking.updatePreference(value);
Expand All @@ -28,10 +24,6 @@ export default class MoreTopics extends Component {

@action
buildListPills() {
if (!this.site.mobileView) {
return;
}

next(() => {
const pills = Array.from(
document.querySelectorAll(".more-content-topics")
Expand All @@ -44,6 +36,9 @@ export default class MoreTopics extends Component {

if (pills.length <= 1) {
this.singleList = true;
}

if (this.singleList || !this.site.mobileView) {
return;
}

Expand Down
4 changes: 0 additions & 4 deletions app/assets/stylesheets/common/base/topic.scss
Expand Up @@ -368,10 +368,6 @@ a.badge-category {
max-width: 757px;
}

.more-content-wrapper .topic-list-body .topic-list-data:first-of-type {
padding-left: 0;
}

// Target the .badge-category text, the bullet icon needs to maintain `display: block`
.more-content-topics h3 .badge-wrapper.bullet span.badge-category,
.more-content-topics h3 .badge-wrapper.box span,
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/desktop/topic-post.scss
Expand Up @@ -362,6 +362,12 @@ pre.codeblock-buttons:hover {
}
}

.more-content-wrapper.single-list {
.more-content-topics {
width: 100%;
}
}

.more-content-topics {
margin-top: 2em;

Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/desktop/topic.scss
Expand Up @@ -138,6 +138,7 @@

.more-content-wrapper {
display: flex;
justify-content: space-around;

.topic-list-header,
.posts-map,
Expand All @@ -148,6 +149,10 @@
.topic-list-body {
border-top: none;

.topic-list-item {
padding-left: 5px;
}

.topic-list-item:last-of-type {
border-bottom: none;
}
Expand Down
6 changes: 5 additions & 1 deletion app/assets/stylesheets/mobile/topic-post.scss
Expand Up @@ -253,11 +253,15 @@ a.reply-to-tab {
}

.more-content-wrapper {
&:not(.mobile-single-list) {
&:not(.single-list) {
.more-topics-title {
display: none;
}
}

.topic-list-data {
padding-left: 5px;
}
}

.more-content-topics {
Expand Down