Skip to content

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

Cleanup mobile topic footer area (#30132)

Régis Hanol6ef0b5d508a2
diff --git a/app/assets/javascripts/discourse/app/components/topic-admin-menu.gjs b/app/assets/javascripts/discourse/app/components/topic-admin-menu.gjs
index 241e6bd4aff..6b88c55135a 100644
--- a/app/assets/javascripts/discourse/app/components/topic-admin-menu.gjs
+++ b/app/assets/javascripts/discourse/app/components/topic-admin-menu.gjs
@@ -84,225 +84,216 @@ export default class TopicAdminMenu extends Component {
<template>
{{#if this.showAdminButton}}
- <span class="topic-admin-menu-button-container">
- <span class="topic-admin-menu-button">
- <DMenu
- @identifier="topic-admin-menu"
- @onRegisterApi={{this.onRegisterApi}}
- @modalForMobile={{true}}
- @autofocus={{true}}
- @triggerClass="btn-default btn-icon toggle-admin-menu"
- >
- <:trigger>
- {{icon "wrench"}}
- </:trigger>
- <:content>
- <DropdownMenu as |dropdown|>
- {{#if
- (or
- this.currentUser.canManageTopic
- this.details.can_split_merge_topic
- )
- }}
- <dropdown.item class="topic-admin-multi-select">
- <DButton
- @label="topic.actions.multi_select"
- @action={{fn this.onButtonAction "toggleMultiSelect"}}
- @icon="list-check"
- />
- </dropdown.item>
- {{/if}}
-
- {{#if
- (or
- this.currentUser.canManageTopic
- this.details.can_moderate_category
- )
- }}
- {{#if this.canDelete}}
- <dropdown.item class="topic-admin-delete">
- <DButton
- @label="topic.actions.delete"
- @action={{fn this.onButtonAction "deleteTopic"}}
- @icon="trash-can"
- class="popup-menu-btn-danger btn-danger"
- />
- </dropdown.item>
- {{else if this.canRecover}}
- <dropdown.item class="topic-admin-recover">
- <DButton
- @label="topic.actions.recover"
- @action={{fn this.onButtonAction "recoverTopic"}}
- @icon="arrow-rotate-left"
- />
- </dropdown.item>
- {{/if}}
- {{/if}}
+ <DMenu
+ @identifier="topic-admin-menu"
+ @onRegisterApi={{this.onRegisterApi}}
+ @modalForMobile={{true}}
+ @autofocus={{true}}
+ @triggerClass="btn-default btn-icon toggle-admin-menu"
+ >
+ <:trigger>
+ {{icon "wrench"}}
+ </:trigger>
+ <:content>
+ <DropdownMenu as |dropdown|>
+ {{#if
+ (or
+ this.currentUser.canManageTopic
+ this.details.can_split_merge_topic
+ )
+ }}
+ <dropdown.item class="topic-admin-multi-select">
+ <DButton
+ @label="topic.actions.multi_select"
+ @action={{fn this.onButtonAction "toggleMultiSelect"}}
+ @icon="list-check"
+ />
+ </dropdown.item>
+ {{/if}}
- {{#if this.details.can_close_topic}}
- <dropdown.item
- class={{if
- @topic.closed
- "topic-admin-open"
- "topic-admin-close"
- }}
- >
- <DButton
- @label={{if
- @topic.closed
- "topic.actions.open"
- "topic.actions.close"
- }}
- @action={{fn this.onButtonAction "toggleClosed"}}
- @icon={{if @topic.closed "unlock" "lock"}}
- />
- </dropdown.item>
- {{/if}}
+ {{#if
+ (or
+ this.currentUser.canManageTopic
+ this.details.can_moderate_category
+ )
+ }}
+ {{#if this.canDelete}}
+ <dropdown.item class="topic-admin-delete">
+ <DButton
+ @label="topic.actions.delete"
+ @action={{fn this.onButtonAction "deleteTopic"}}
+ @icon="trash-can"
+ class="popup-menu-btn-danger btn-danger"
+ />
+ </dropdown.item>
+ {{else if this.canRecover}}
+ <dropdown.item class="topic-admin-recover">
+ <DButton
+ @label="topic.actions.recover"
+ @action={{fn this.onButtonAction "recoverTopic"}}
+ @icon="arrow-rotate-left"
+ />
+ </dropdown.item>
+ {{/if}}
+ {{/if}}
- {{#if
- (and
- this.details.can_pin_unpin_topic
- (not this.isPrivateMessage)
- (or this.visible this.featured)
- )
+ {{#if this.details.can_close_topic}}
+ <dropdown.item
+ class={{if
+ @topic.closed
+ "topic-admin-open"
+ "topic-admin-close"
}}
- <dropdown.item class="topic-admin-pin">
- <DButton
- @label={{if
- this.featured
- "topic.actions.unpin"
- "topic.actions.pin"
- }}
- @action={{fn this.onButtonAction "showFeatureTopic"}}
- @icon="thumbtack"
- />
- </dropdown.item>
- {{/if}}
+ >
+ <DButton
+ @label={{if
+ @topic.closed
+ "topic.actions.open"
+ "topic.actions.close"
+ }}
+ @action={{fn this.onButtonAction "toggleClosed"}}
+ @icon={{if @topic.closed "unlock" "lock"}}
+ />
+ </dropdown.item>
+ {{/if}}
- {{#if
- (and
- this.details.can_archive_topic (not this.isPrivateMessage)
- )
- }}
- <dropdown.item class="topic-admin-archive">
- <DButton
- @label={{if
- this.archived
- "topic.actions.unarchive"
- "topic.actions.archive"
- }}
- @action={{fn this.onButtonAction "toggleArchived"}}
- @icon="folder"
- />
- </dropdown.item>
- {{/if}}
+ {{#if
+ (and
+ this.details.can_pin_unpin_topic
+ (not this.isPrivateMessage)
+ (or this.visible this.featured)
+ )
+ }}
+ <dropdown.item class="topic-admin-pin">
+ <DButton
+ @label={{if
+ this.featured
+ "topic.actions.unpin"
+ "topic.actions.pin"
+ }}
+ @action={{fn this.onButtonAction "showFeatureTopic"}}
+ @icon="thumbtack"
+ />
+ </dropdown.item>
+ {{/if}}
+
+ {{#if
+ (and this.details.can_archive_topic (not this.isPrivateMessage))
+ }}
+ <dropdown.item class="topic-admin-archive">
+ <DButton
+ @label={{if
+ this.archived
+ "topic.actions.unarchive"
+ "topic.actions.archive"
+ }}
+ @action={{fn this.onButtonAction "toggleArchived"}}
+ @icon="folder"
+ />
+ </dropdown.item>
+ {{/if}}
- {{#if this.details.can_toggle_topic_visibility}}
- <dropdown.item class="topic-admin-visible">
- <DButton
- @label={{if
- this.visible
- "topic.actions.invisible"
- "topic.actions.visible"
- }}
- @action={{fn this.onButtonAction "toggleVisibility"}}
- @icon={{if this.visible "far-eye-slash" "far-eye"}}
- />
- </dropdown.item>
- {{/if}}
+ {{#if this.details.can_toggle_topic_visibility}}
+ <dropdown.item class="topic-admin-visible">
+ <DButton
+ @label={{if
+ this.visible
+ "topic.actions.invisible"
+ "topic.actions.visible"
+ }}
+ @action={{fn this.onButtonAction "toggleVisibility"}}
+ @icon={{if this.visible "far-eye-slash" "far-eye"}}
+ />
+ </dropdown.item>
+ {{/if}}
- {{#if (and this.details.can_convert_topic)}}
- <dropdown.item class="topic-admin-convert">
- <DButton
- @label={{if
- this.isPrivateMessage
- "topic.actions.make_public"
- "topic.actions.make_private"
- }}
- @action={{fn
- this.onButtonAction
- (if
- this.isPrivateMessage
- "convertToPublicTopic"
- "convertToPrivateMessage"
- )
- }}
- @icon={{if this.isPrivateMessage "comment" "envelope"}}
- />
- </dropdown.item>
- {{/if}}
+ {{#if (and this.details.can_convert_topic)}}
+ <dropdown.item class="topic-admin-convert">
+ <DButton
+ @label={{if
+ this.isPrivateMessage
+ "topic.actions.make_public"
+ "topic.actions.make_private"
+ }}
+ @action={{fn
+ this.onButtonAction
+ (if
+ this.isPrivateMessage
+ "convertToPublicTopic"
+ "convertToPrivateMessage"
+ )
+ }}
+ @icon={{if this.isPrivateMessage "comment" "envelope"}}
+ />
+ </dropdown.item>
+ {{/if}}
- <dropdown.divider />
+ <dropdown.divider />
- {{#if this.currentUser.canManageTopic}}
- <dropdown.item class="admin-topic-timer-update">
- <DButton
- @label="topic.actions.timed_update"
- @action={{fn this.onButtonAction "showTopicTimerModal"}}
- @icon="far-clock"
- />
- </dropdown.item>
+ {{#if this.currentUser.canManageTopic}}
+ <dropdown.item class="admin-topic-timer-update">
+ <DButton
+ @label="topic.actions.timed_update"
+ @action={{fn this.onButtonAction "showTopicTimerModal"}}
+ @icon="far-clock"
+ />
+ </dropdown.item>
- {{#if this.currentUser.staff}}
- <dropdown.item class="topic-admin-change-timestamp">
- <DButton
- @label="topic.change_timestamp.title"
- @action={{fn this.onButtonAction "showChangeTimestamp"}}
- @icon="calendar-days"
- />
- </dropdown.item>
- {{/if}}
+ {{#if this.currentUser.staff}}
+ <dropdown.item class="topic-admin-change-timestamp">
+ <DButton
+ @label="topic.change_timestamp.title"
+ @action={{fn this.onButtonAction "showChangeTimestamp"}}
+ @icon="calendar-days"
+ />
+ </dropdown.item>
+ {{/if}}
- <dropdown.item class="topic-admin-reset-bump-date">
- <DButton
- @label="topic.actions.reset_bump_date"
- @action={{fn this.onButtonAction "resetBumpDate"}}
- @icon="anchor"
- />
- </dropdown.item>
+ <dropdown.item class="topic-admin-reset-bump-date">
+ <DButton
+ @label="topic.actions.reset_bump_date"
+ @action={{fn this.onButtonAction "resetBumpDate"}}
+ @icon="anchor"
+ />
+ </dropdown.item>
- <dropdown.item class="topic-admin-slow-mode">
- <DButton
- @label="topic.actions.slow_mode"
- @action={{fn
- this.onButtonAction
- "showTopicSlowModeUpdate"
- }}
- @icon="hourglass-start"
- />
- </dropdown.item>
- {{/if}}
+ <dropdown.item class="topic-admin-slow-mode">
+ <DButton
+ @label="topic.actions.slow_mode"
+ @action={{fn this.onButtonAction "showTopicSlowModeUpdate"}}
+ @icon="hourglass-start"
+ />
+ </dropdown.item>
+ {{/if}}
- {{#if (or this.currentUser.staff this.extraButtons.length)}}
- <dropdown.divider />
+ {{#if (or this.currentUser.staff this.extraButtons.length)}}
+ <dropdown.divider />
- {{#if this.currentUser.staff}}
- <dropdown.item class="topic-admin-moderation-history">
- <DButton
- @label="review.moderation_history"
- @href={{this.topicModerationHistoryUrl}}
- @icon="list"
- />
- </dropdown.item>
- {{/if}}
+ {{#if this.currentUser.staff}}
+ <dropdown.item class="topic-admin-moderation-history">
+ <DButton
+ @label="review.moderation_history"
+ @href={{this.topicModerationHistoryUrl}}
+ @icon="list"
+ />
+ </dropdown.item>
+ {{/if}}
- {{#each this.extraButtons as |button|}}
- <dropdown.item>
- <DButton
- @label={{button.label}}
- @translatedLabel={{button.translatedLabel}}
- @icon={{button.icon}}
- class={{concatClass "btn-transparent" button.className}}
- @action={{fn this.onExtraButtonAction button.action}}
- />
- </dropdown.item>
- {{/each}}
- {{/if}}
- </DropdownMenu>
- </:content>
- </DMenu>
- </span>
- </span>
+ {{#each this.extraButtons as |button|}}
+ <dropdown.item>
+ <DButton
+ @label={{button.label}}
+ @translatedLabel={{button.translatedLabel}}
+ @icon={{button.icon}}
+ class={{concatClass "btn-transparent" button.className}}
+ @action={{fn this.onExtraButtonAction button.action}}
+ />
+ </dropdown.item>
+ {{/each}}
+ {{/if}}
+ </DropdownMenu>
+ </:content>
+ </DMenu>
{{/if}}
</template>
}
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 edca533a29e..fa8fe109f89 100644
--- a/app/assets/javascripts/discourse/app/components/topic-footer-buttons.hbs
+++ b/app/assets/javascripts/discourse/app/components/topic-footer-buttons.hbs
@@ -1,68 +1,111 @@
<div class="topic-footer-main-buttons">
- <TopicAdminMenu
- @topic={{this.topic}}
- @toggleMultiSelect={{this.toggleMultiSelect}}
- @showTopicSlowModeUpdate={{this.showTopicSlowModeUpdate}}
- @deleteTopic={{this.deleteTopic}}
- @recoverTopic={{this.recoverTopic}}
- @toggleFeaturedOnProfile={{this.toggleFeaturedOnProfile}}
- @toggleClosed={{this.toggleClosed}}
- @toggleArchived={{this.toggleArchived}}
- @toggleVisibility={{this.toggleVisibility}}
- @showTopicTimerModal={{this.showTopicTimerModal}}
- @showFeatureTopic={{this.showFeatureTopic}}
- @showChangeTimestamp={{this.showChangeTimestamp}}
- @resetBumpDate={{this.resetBumpDate}}
- @convertToPublicTopic={{this.convertToPublicTopic}}
- @convertToPrivateMessage={{this.convertToPrivateMessage}}
- />
-
- {{#if this.site.mobileView}}
- <TopicFooterMobileDropdown
+ <div class="topic-footer-main-buttons__actions">
+ <TopicAdminMenu
@topic={{this.topic}}
- @content={{this.dropdownButtons}}
+ @toggleMultiSelect={{this.toggleMultiSelect}}
+ @showTopicSlowModeUpdate={{this.showTopicSlowModeUpdate}}
+ @deleteTopic={{this.deleteTopic}}
+ @recoverTopic={{this.recoverTopic}}
+ @toggleFeaturedOnProfile={{this.toggleFeaturedOnProfile}}
+ @toggleClosed={{this.toggleClosed}}
+ @toggleArchived={{this.toggleArchived}}
+ @toggleVisibility={{this.toggleVisibility}}
+ @showTopicTimerModal={{this.showTopicTimerModal}}
+ @showFeatureTopic={{this.showFeatureTopic}}
+ @showChangeTimestamp={{this.showChangeTimestamp}}
+ @resetBumpDate={{this.resetBumpDate}}
+ @convertToPublicTopic={{this.convertToPublicTopic}}
+ @convertToPrivateMessage={{this.convertToPrivateMessage}}
/>
- {{/if}}
- {{#each this.inlineActionables as |actionable|}}
- {{#if (eq actionable.type "inline-button")}}
- {{#if (eq actionable.id "bookmark")}}
- <BookmarkMenu
- @showLabel={{this.showBookmarkLabel}}
- @bookmarkManager={{this.topicBookmarkManager}}
- @buttonClasses="btn-default"
- />
+ {{#each this.inlineActionables as |actionable|}}
+ {{#if (eq actionable.type "inline-button")}}
+ {{#if (eq actionable.id "bookmark")}}
+ <BookmarkMenu
+ @showLabel={{this.showBookmarkLabel}}
+ @bookmarkManager={{this.topicBookmarkManager}}
+ @buttonClasses="btn-default"
+ />
+ {{else}}
+ <DButton
+ @action={{actionable.action}}
+ @icon={{actionable.icon}}
+ @translatedLabel={{actionable.label}}
+ @translatedTitle={{actionable.title}}
+ @translatedAriaLabel={{actionable.ariaLabel}}
+ @disabled={{actionable.disabled}}
+ id={{concat "topic-footer-button-" actionable.id}}
+ class={{concat-class
+ "btn-default"
+ "topic-footer-button"
+ actionable.classNames
+ }}
+ />
+ {{/if}}
{{else}}
- <DButton
- @action={{actionable.action}}
- @icon={{actionable.icon}}
- @translatedLabel={{actionable.label}}
- @translatedTitle={{actionable.title}}
- @translatedAriaLabel={{actionable.ariaLabel}}
- @disabled={{actionable.disabled}}
- id={{concat "topic-footer-button-" actionable.id}}
- class={{concat-class
- "btn-default"
- "topic-footer-button"
- actionable.classNames
+ <DropdownSelectBox
+ @id={{concat "topic-footer-dropdown-" actionable.id}}
+ @value={{actionable.value}}
+ @content={{actionable.content}}
+ @onChange={{action actionable.action}}
+ @options={{hash
+ icon=actionable.icon
+ none=actionable.noneItem
+ disabled=actionable.disabled
}}
+ class={{concat-class "topic-footer-dropdown" actionable.classNames}}
/>
{{/if}}
- {{else}}
- <DropdownSelectBox
- @id={{concat "topic-footer-dropdown-" actionable.id}}
- @value={{actionable.value}}
- @content={{actionable.content}}
- @onChange={{action actionable.action}}
- @options={{hash
- icon=actionable.icon
- none=actionable.noneItem
- disabled=actionable.disabled
- }}
- class={{concat-class "topic-footer-dropdown" actionable.classNames}}
+ {{/each}}
+
+ {{#if this.site.mobileView}}
+ {{#if this.dropdownButtons}}
+ <DMenu
+ @modalForMobile={{true}}
+ @identifier="topic-footer-mobile-dropdown"
+ >
+ <:trigger>
+ {{d-icon "ellipsis-vertical"}}
+ </:trigger>
+ <:content>
+ <DropdownMenu as |dropdown|>
+ {{#each this.dropdownButtons as |button|}}
+ <dropdown.item>
+ <DButton
+ @action={{button.action}}
+ @icon={{button.icon}}
+ @translatedLabel={{button.label}}
+ @translatedTitle={{button.title}}
+ @translatedAriaLabel={{button.ariaLabel}}
+ @disabled={{button.disabled}}
+ id={{concat "topic-footer-button-" button.id}}
+ class={{concat-class
+ "btn-default"
+ "topic-footer-button"
+ button.classNames
+ }}
+ />
+ </dropdown.item>
+ {{/each}}
+ </DropdownMenu>
+ </:content>
+ </DMenu>
+ {{/if}}
+
+ <PinnedButton
+ @pinned={{this.topic.pinned}}
+ @topic={{this.topic}}
+ @appendReason={{false}}
/>
+
+ {{#if this.showNotificationsButton}}
+ <TopicNotificationsButton
+ @topic={{this.topic}}
+ @appendReason={{false}}
+ />
+ {{/if}}
{{/if}}
- {{/each}}
+ </div>
<PluginOutlet
@name="topic-footer-main-buttons-before-create"
@@ -87,23 +130,29 @@
/>
</div>
-<PinnedButton @pinned={{this.topic.pinned}} @topic={{this.topic}} />
-
-{{#if this.showNotificationsButton}}
- <TopicNotificationsButton
+{{#if this.site.desktopView}}
+ <PinnedButton
+ @pinned={{this.topic.pinned}}
@topic={{this.topic}}
- @expanded={{true}}
- class="notifications-button-footer"
+ @appendReason={{true}}
/>
- {{#if this.showNotificationUserTip}}
- <UserTip
- @id="topic_notification_levels"
- @triggerSelector=".notifications-button-footer details"
- @titleText={{i18n "user_tips.topic_notification_levels.title"}}
- @contentText={{i18n "user_tips.topic_notification_levels.content"}}
- @priority={{800}}
+ {{#if this.showNotificationsButton}}
+ <TopicNotificationsButton
+ @topic={{this.topic}}
+ @expanded={{true}}
+ class="notifications-button-footer"
/>
+
+ {{#if this.showNotificationUserTip}}
+ <UserTip
+ @id="topic_notification_levels"
+ @triggerSelector=".notifications-button-footer details"
+ @titleText={{i18n "user_tips.topic_notification_levels.title"}}
+ @contentText={{i18n "user_tips.topic_notification_levels.content"}}
+ @priority={{800}}
+ />
+ {{/if}}
{{/if}}
{{/if}}
diff --git a/app/assets/javascripts/discourse/app/components/topic-progress.hbs b/app/assets/javascripts/discourse/app/components/topic-progress.hbs
index a0c2562a493..339c0fc94e6 100644
--- a/app/assets/javascripts/discourse/app/components/topic-progress.hbs
+++ b/app/assets/javascripts/discourse/app/components/topic-progress.hbs
@@ -21,11 +21,11 @@
style={{html-safe this.progressStyle}}
>
<div class="nums">
- <h4>{{this.progressPosition}}</h4>
- <span class={{if this.hugeNumberOfPosts "hidden"}}>
- <span>/</span>
- <h4>{{this.postStream.filteredPostsCount}}</h4>
- </span>
+ <span>{{this.progressPosition}}</span>
+ <span class={{if this.hugeNumberOfPosts "hidden"}}>/</span>
+ <span
+ class={{if this.hugeNumberOfPosts "hidden"}}
+ >{{this.postStream.filteredPostsCount}}</span>
</div>
<div class="bg"></div>
</nav>
diff --git a/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs b/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs
index e9e241810a0..e78c7ff56d9 100644
--- a/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs
+++ b/app/assets/javascripts/discourse/app/components/topic-timeline/container.gjs
@@ -21,7 +21,6 @@ import icon from "discourse-common/helpers/d-icon";
import { bind, debounce } from "discourse-common/utils/decorators";
import domUtils from "discourse-common/utils/dom-utils";
import { i18n } from "discourse-i18n";
-import TopicNotificationsButton from "select-kit/components/topic-notifications-button";
import BackButton from "./back-button";
import Scroller from "./scroller";
@@ -660,10 +659,6 @@ export default class TopicTimelineScrollArea extends Component {
/>
{{/if}}
- {{#if this.currentUser}}
- <TopicNotificationsButton @topic={{@model}} @expanded={{false}} />
- {{/if}}
-
<PluginOutlet
@name="timeline-footer-controls-after"
@outletArgs={{hash model=@model fullscreen=@fullscreen}}
diff --git a/app/assets/javascripts/discourse/app/instance-initializers/topic-footer-buttons.js b/app/assets/javascripts/discourse/app/instance-initializers/topic-footer-buttons.js
index aa46b1fead2..a252020b7d4 100644
--- a/app/assets/javascripts/discourse/app/instance-initializers/topic-footer-buttons.js
+++ b/app/assets/javascripts/discourse/app/instance-initializers/topic-footer-buttons.js
@@ -31,9 +31,6 @@ export default {
},
});
},
- dropdown() {
- return this.site.mobileView;
- },
classNames: ["share-and-invite"],
dependentKeys: [
"topic.shareUrl",
@@ -117,6 +114,7 @@ export default {
label: "topic.defer.title",
title: "topic.defer.help",
action: "deferTopic",
+ classNames: ["defer-topic"],
displayed() {
return this.canDefer;
},
diff --git a/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js b/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js
index afd72122ed3..88a703f45f6 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/share-topic-test.js
@@ -2,7 +2,6 @@ import { click, currentURL, visit } from "@ember/test-helpers";
import { test } from "qunit";
import CategoryFixtures from "discourse/tests/fixtures/category-fixtures";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
-import selectKit from "discourse/tests/helpers/select-kit-helper";
import { i18n } from "discourse-i18n";
acceptance("Share and Invite modal", function (needs) {
@@ -101,13 +100,7 @@ acceptance("Share and Invite modal - mobile", function (needs) {
test("Topic footer mobile button", async function (assert) {
await visit("/t/internationalization-localization/280");
- assert
- .dom("#topic-footer-button-share-and-invite")
- .doesNotExist("the button doesn’t exist");
-
- const subject = selectKit(".topic-footer-mobile-dropdown");
- await subject.expand();
- await subject.selectRowByValue("share-and-invite");
+ await click(".topic-footer-button.share-and-invite");
assert.dom(".share-topic-modal").exists("shows the modal");
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-footer-button-api-mobile-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-footer-button-api-mobile-test.js
index 6a21d8c74eb..95dbd82c616 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/topic-footer-button-api-mobile-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-footer-button-api-mobile-test.js
@@ -1,8 +1,7 @@
-import { visit } from "@ember/test-helpers";
+import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { withPluginApi } from "discourse/lib/plugin-api";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
-import selectKit from "discourse/tests/helpers/select-kit-helper";
acceptance(
"Topic - Plugin API - registerTopicFooterButton (mobile)",
@@ -26,9 +25,8 @@ acceptance(
});
await visit("/t/internationalization-localization/280");
- const subject = selectKit(".topic-footer-mobile-dropdown");
- await subject.expand();
- await subject.selectRowByValue("foo");
+ await click(".topic-footer-mobile-dropdown-trigger");
+ await click("#topic-footer-button-foo");
assert.verifySteps(["action called"]);
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-notifications-button-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-notifications-button-test.js
index ca3b7afc5ec..20f9901d610 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/topic-notifications-button-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-notifications-button-test.js
@@ -32,30 +32,5 @@ acceptance("Topic Notifications button", function (needs) {
"Watching",
"displays the right notification level"
);
-
- const timelineNotificationOptions = selectKit(
- ".topic-timeline .topic-notifications-options"
- );
-
- assert.strictEqual(
- timelineNotificationOptions.header().value(),
- "3",
- "displays the right notification level"
- );
-
- await timelineNotificationOptions.expand();
- await timelineNotificationOptions.selectRowByValue("0");
-
- assert.strictEqual(
- timelineNotificationOptions.header().value(),
- "0",
- "displays the right notification level"
- );
-
- assert.strictEqual(
- notificationOptions.header().label(),
- "Muted",
- "displays the right notification level"
- );
});
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-timeline-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-timeline-test.js
index 8f6feccaae9..afb3116a320 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/topic-timeline-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-timeline-test.js
@@ -332,13 +332,6 @@ acceptance("Glimmer Topic Timeline", function (needs) {
});
});
- test("has a topic admin menu", async function (assert) {
- await visit("/t/internationalization-localization");
- assert
- .dom(".timeline-controls .topic-admin-menu-button")
- .exists("admin menu is present");
- });
-
test("has a reply-to-post button", async function (assert) {
await visit("/t/internationalization-localization");
assert
@@ -346,13 +339,6 @@ acceptance("Glimmer Topic Timeline", function (needs) {
.exists("reply to post button is present");
});
- test("has a topic notification button", async function (assert) {
- await visit("/t/internationalization-localization");
- assert
- .dom(".timeline-footer-controls .topic-notifications-button")
- .exists("topic notifications button is present");
- });
-
test("Shows dates of first and last posts", async function (assert) {
await visit("/t/deleted-topic-with-whisper-post/129");
assert.dom(".timeline-date-wrapper .now-date").hasText("Jul 2020");
diff --git a/app/assets/javascripts/select-kit/addon/components/dropdown-select-box/dropdown-select-box-header.hbs b/app/assets/javascripts/select-kit/addon/components/dropdown-select-box/dropdown-select-box-header.hbs
index f9a68e025a3..bd796e2cccb 100644
--- a/app/assets/javascripts/select-kit/addon/components/dropdown-select-box/dropdown-select-box-header.hbs
+++ b/app/assets/javascripts/select-kit/addon/components/dropdown-select-box/dropdown-select-box-header.hbs
@@ -12,6 +12,4 @@
{{#if this.selectKit.options.showCaret}}
{{d-icon this.caretIcon class="caret-icon"}}
{{/if}}
- &#8203;
- {{! Zero-width space character, so icon-only button height = regular button height }}
</div>
\ No newline at end of file
diff --git a/app/assets/javascripts/select-kit/addon/components/notifications-button/notifications-button-row.js b/app/assets/javascripts/select-kit/addon/components/notifications-button/notifications-button-row.js
index d68fea1b916..3788254780d 100644
--- a/app/assets/javascripts/select-kit/addon/components/notifications-button/notifications-button-row.js
+++ b/app/assets/javascripts/select-kit/addon/components/notifications-button/notifications-button-row.js
@@ -22,10 +22,6 @@ export default class NotificationsButtonRow extends DropdownSelectBoxRowComponen
@computed("_start")
get description() {
- if (this.site && this.site.mobileView) {
- return null;
- }
-
return escapeExpression(i18n(`${this._start}.description`));
}
diff --git a/app/assets/javascripts/select-kit/addon/components/pinned-button.hbs b/app/assets/javascripts/select-kit/addon/components/pinned-button.hbs
index a043b053518..2c7d128a706 100644
--- a/app/assets/javascripts/select-kit/addon/components/pinned-button.hbs
+++ b/app/assets/javascripts/select-kit/addon/components/pinned-button.hbs
@@ -1,4 +1,8 @@
-<p class="reason">
+{{#if this.appendReason}}
+ <p class="reason">
+ <PinnedOptions @value={{this.pinned}} @topic={{this.topic}} />
+ <span class="text">{{html-safe this.reasonText}}</span>
+ </p>
+{{else}}
<PinnedOptions @value={{this.pinned}} @topic={{this.topic}} />
- <span class="text">{{html-safe this.reasonText}}</span>
-</p>
\ No newline at end of file
+{{/if}}
\ No newline at end of file
diff --git a/app/assets/javascripts/select-kit/addon/components/pinned-button.js b/app/assets/javascripts/select-kit/addon/components/pinned-button.js
index 1b82e6110e2..6f129235658 100644
--- a/app/assets/javascripts/select-kit/addon/components/pinned-button.js
+++ b/app/assets/javascripts/select-kit/addon/components/pinned-button.js
@@ -9,6 +9,7 @@ import { pluginApiIdentifiers } from "select-kit/components/select-kit";
@pluginApiIdentifiers("pinned-button")
export default class PinnedButton extends Component {
descriptionKey = "help";
+ appendReason = true;
@discourseComputed("topic.pinned_globally", "pinned")
reasonText(pinnedGlobally, pinned) {
diff --git a/app/assets/javascripts/select-kit/addon/components/topic-footer-mobile-dropdown.js b/app/assets/javascripts/select-kit/addon/components/topic-footer-mobile-dropdown.js
deleted file mode 100644
index 90eb36287bd..00000000000
--- a/app/assets/javascripts/select-kit/addon/components/topic-footer-mobile-dropdown.js
+++ /dev/null
@@ -1,21 +0,0 @@
-import { action } from "@ember/object";
-import { classNames } from "@ember-decorators/component";
-import ComboBoxComponent from "select-kit/components/combo-box";
-import {
- pluginApiIdentifiers,
- selectKitOptions,
-} from "select-kit/components/select-kit";
-
-@classNames("topic-footer-mobile-dropdown")
-@selectKitOptions({
- none: "topic.controls",
- filterable: false,
- autoFilterable: false,
-})
-@pluginApiIdentifiers("topic-footer-mobile-dropdown")
-export default class TopicFooterMobileDropdown extends ComboBoxComponent {
- @action
- onChange(value, item) {
- item.action && item.action();
- }
-}
diff --git a/app/assets/stylesheets/common/base/_index.scss b/app/assets/stylesheets/common/base/_index.scss
index 148f54f4c93..2e8ccb93867 100644
--- a/app/assets/stylesheets/common/base/_index.scss
+++ b/app/assets/stylesheets/common/base/_index.scss
@@ -1,26 +1,25 @@
-@import "_topic-list";
@import "_bookmark-list";
+@import "_topic-list";
@import "about";
@import "activation";
@import "alert";
@import "bbcode";
-@import "reorder-categories";
@import "category-list";
@import "code_highlighting";
@import "colorpicker";
@import "compose";
@import "composer-user-selector";
@import "crawler_layout";
-@import "d-image-grid";
@import "d-icon";
+@import "d-image-grid";
@import "dialog";
@import "directory";
@import "discourse";
@import "edit-category";
@import "edit-topic-timer-modal";
-@import "empty-state";
@import "ember-select";
@import "emoji";
+@import "empty-state";
@import "exception";
@import "explain-reviewable";
@import "faqs";
@@ -31,6 +30,7 @@
@import "json_schema";
@import "lightbox";
@import "login";
+@import "login-signup-page";
@import "magnific-popup";
@import "menu-panel";
@import "modal";
@@ -40,27 +40,28 @@
@import "personal-message";
@import "popup-menu";
@import "redirection";
+@import "reorder-categories";
@import "reviewables";
@import "revise-and-reject-post-reviewable";
@import "rtl";
-@import "search-menu";
@import "search";
+@import "search-menu";
@import "share_link";
@import "shared-drafts";
@import "sidebar";
@import "sidebar-custom-section";
@import "sidebar-footer";
-@import "sidebar-section";
@import "sidebar-more-section-links";
+@import "sidebar-section";
@import "sidebar-section-link";
@import "static-login";
-@import "login-signup-page";
@import "tagging";
@import "tooltip";
+@import "topic";
@import "topic-admin-menu";
+@import "topic-footer";
@import "topic-post";
-@import "topic";
@import "upload";
+@import "user";
@import "user-badges";
@import "user-tips";
-@import "user";
diff --git a/app/assets/stylesheets/common/base/topic-footer.scss b/app/assets/stylesheets/common/base/topic-footer.scss
new file mode 100644
index 00000000000..0192b569e5f
--- /dev/null
+++ b/app/assets/stylesheets/common/base/topic-footer.scss
@@ -0,0 +1,127 @@
+#topic-footer-buttons {
+ display: flex;
+
+ html.anon & {
+ justify-content: end;
+ }
+
+ max-width: calc(
+ var(--topic-avatar-width) + var(--topic-body-width) +
+ var(--topic-body-width-padding) * 2
+ );
+
+ .topic-footer-main-buttons {
+ display: flex;
+ gap: 0.5rem;
+
+ &__actions {
+ display: flex;
+ gap: 0.5rem;
+ flex-wrap: wrap;
+ align-items: center;
+ }
+
+ .bookmark.bookmarked {
+ .d-icon-discourse-bookmark-clock,
+ .d-icon-bookmark {
+ color: var(--tertiary);
+ }
+ }
+
+ .create {
+ align-self: flex-start;
+ }
+ }
+
+ .pinned-button,
+ .topic-notifications-button {
+ .text {
+ color: var(--primary-high);
+ }
+ }
+}
+
+.topic-navigation {
+ display: flex;
+ justify-content: flex-end;
+ align-items: center;
+}
+
+#topic-progress-wrapper {
+ position: fixed;
+ &.docked {
+ position: initial;
+
+ .toggle-admin-menu {
+ display: none;
+ }
+ }
+
+ bottom: 0;
+ html:not(.footer-nav-visible) & {
+ bottom: env(safe-area-inset-bottom);
+ }
+
+ right: 10px;
+ z-index: z("timeline");
+ display: flex;
+ justify-content: flex-end;
+
+ border-radius: var(--d-border-radius);
+ overflow: hidden;
+
+ .btn {
+ border: 0;
+ }
+
+ &.with-transitions {
+ transition: bottom 0.2s, margin-bottom 0.2s;
+
+ #topic-progress .bg {
+ transition: width 0.5s;
+ }
+ }
+
+ &:not(.docked) {
+ @media screen and (min-width: $reply-area-max-width) {
+ right: calc(50%); // right side of composer
+ margin-right: calc(#{$reply-area-max-width} / 2 * -1);
+ }
+ }
+
+ #topic-progress {
+ position: relative;
+ background-color: var(--secondary);
+ color: var(--tertiary);
+
+ padding: 0.35em 1em;
+ border: 1px solid var(--tertiary-low);
+
+ /* as a big ol' click target, don't let text inside be selected */
+ @include unselectable;
+
+ .nums {
+ display: flex;
+ gap: 0.3rem;
+ align-items: center;
+ height: 100%;
+ position: relative;
+ z-index: z("base");
+ font-weight: bold;
+ }
+ .d-icon {
+ position: absolute;
+ right: 8px;
+ bottom: 9px;
+ z-index: z("base");
+ }
+ .bg {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ width: var(--progress-bg-width, 0);
+ background-color: var(--tertiary-low);
+ }
+ }
+}
diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss
index 3cae298399d..dd244d30390 100644
--- a/app/assets/stylesheets/common/base/topic-post.scss
+++ b/app/assets/stylesheets/common/base/topic-post.scss
@@ -1425,70 +1425,6 @@ span.mention {
}
}
-html.anon #topic-footer-buttons {
- display: flex;
- justify-content: end;
-}
-
-#topic-footer-buttons {
- margin: var(--below-topic-margin) 0;
- padding: 0;
-
- .topic-footer-main-buttons {
- display: flex;
- flex-wrap: wrap;
- align-items: stretch; // aligns items by making them the same height
- button,
- details {
- margin-right: 0.54em;
- }
-
- > * {
- margin-bottom: 0.5em; // all immediate children should have a bottom margin in case of wrapping
- }
-
- .topic-admin-menu-button-container {
- display: inline-flex;
-
- .topic-admin-menu-button {
- display: flex; // to make this button match siblings behavior, all of its parents need to be flex
- }
- }
- }
-
- .pinned-button:not(.is-hidden) + .topic-notifications-button {
- margin-top: 0;
- }
-
- .pinned-button,
- .topic-notifications-button {
- margin: 0.5em 0 1em;
-
- .reason {
- color: var(--primary-high);
- display: inline-flex;
- margin: 0;
- align-items: center;
-
- .dropdown-select-box {
- .select-kit-selected-name {
- width: 100%;
- overflow: hidden;
- }
-
- .name {
- @include ellipsis;
- }
- }
-
- .text {
- margin-left: 0.5em;
- line-height: var(--line-height-medium);
- }
- }
- }
-}
-
iframe {
max-width: 100%;
max-height: #{"min(1000px, 200vh)"};
diff --git a/app/assets/stylesheets/common/base/topic.scss b/app/assets/stylesheets/common/base/topic.scss
index b06751d206e..f9cde6f3dbd 100644
--- a/app/assets/stylesheets/common/base/topic.scss
+++ b/app/assets/stylesheets/common/base/topic.scss
@@ -99,23 +99,6 @@
position: relative;
}
}
- #topic-progress-wrapper {
- .topic-admin-menu-button .toggle-admin-menu {
- border-top-right-radius: 0;
- border-bottom-left-radius: var(--d-border-radius);
- border-bottom-right-radius: 0;
- }
- #topic-progress {
- border-radius: var(--d-border-radius);
- overflow: hidden;
- }
- .topic-admin-menu-button-container + #topic-progress {
- border-top-left-radius: 0;
- border-top-right-radius: var(--d-border-radius);
- border-bottom-left-radius: 0;
- border-bottom-right-radius: var(--d-border-radius);
- }
- }
}
.progress-back-container {
@@ -134,85 +117,6 @@
}
}
-#topic-progress-wrapper {
- position: fixed;
- bottom: 0px;
- right: 10px;
- margin: 0 auto;
- display: flex;
- justify-content: flex-end;
- z-index: z("timeline");
- .topic-admin-menu-button-container {
- display: flex;
- > span {
- display: flex;
- }
- }
-
- &.docked {
- position: initial;
- }
-
- html:not(.footer-nav-visible) & {
- bottom: env(safe-area-inset-bottom);
- }
-
- &:not(.docked) {
- @media screen and (min-width: $reply-area-max-width) {
- // position to right side of composer
- right: calc(50% + 10px);
- margin-right: calc(#{$reply-area-max-width} / 2 * -1);
- }
- }
-
- &.with-transitions {
- transition: bottom 0.2s, margin-bottom 0.2s;
-
- #topic-progress .bg {
- transition: width 0.5s;
- }
- }
-}
-
-#topic-progress {
- --topic-progress-height: 42px;
- position: relative;
- background-color: var(--secondary);
- color: var(--tertiary);
- border: 1px solid var(--tertiary-low);
- width: 145px;
- height: var(--topic-progress-height);
-
- /* as a big ol' click target, don't let text inside be selected */
- @include unselectable;
-
- .nums {
- position: relative;
- top: 12px;
- width: 100%;
- text-align: center;
- z-index: z("base");
- }
- h4 {
- display: inline;
- font-size: var(--font-up-2);
- line-height: var(--line-height-small);
- }
- .d-icon {
- position: absolute;
- right: 8px;
- bottom: 9px;
- z-index: z("base");
- }
- .bg {
- position: absolute;
- top: 0;
- bottom: 0;
- width: var(--progress-bg-width, 0);
- background-color: var(--tertiary-low);
- }
-}
-
.topic-status-info,
.topic-timer-info {
border-top: 1px solid var(--primary-low);
diff --git a/app/assets/stylesheets/common/topic-timeline.scss b/app/assets/stylesheets/common/topic-timeline.scss
index a787bfeccd6..33c6fdb1dbf 100644
--- a/app/assets/stylesheets/common/topic-timeline.scss
+++ b/app/assets/stylesheets/common/topic-timeline.scss
@@ -112,11 +112,7 @@
bottom: 20px;
left: 10px;
- .topic-admin-menu-button-container {
- display: flex;
- }
-
- .topic-admin-menu-button {
+ .topic-admin-menu {
display: flex;
}
}
@@ -171,7 +167,7 @@
touch-action: none;
min-width: 6em;
- .topic-admin-menu-button .btn {
+ .topic-admin-menu .btn {
height: 100%;
}
diff --git a/app/assets/stylesheets/desktop/_index.scss b/app/assets/stylesheets/desktop/_index.scss
index d68adbeed02..7253b39b7c8 100644
--- a/app/assets/stylesheets/desktop/_index.scss
+++ b/app/assets/stylesheets/desktop/_index.scss
@@ -5,11 +5,12 @@
@import "header";
@import "invite-signup";
@import "latest-topic-list";
+@import "login-signup-page";
@import "menu-panel";
@import "modal";
-@import "topic-list";
-@import "topic-post";
@import "post-action-feedback";
@import "topic";
+@import "topic-footer";
+@import "topic-list";
+@import "topic-post";
@import "user";
-@import "login-signup-page";
diff --git a/app/assets/stylesheets/desktop/topic-footer.scss b/app/assets/stylesheets/desktop/topic-footer.scss
new file mode 100644
index 00000000000..8b97a198eea
--- /dev/null
+++ b/app/assets/stylesheets/desktop/topic-footer.scss
@@ -0,0 +1,14 @@
+html:not(.anon) #topic-footer-buttons {
+ flex-direction: column;
+ gap: var(--below-topic-margin);
+
+ .pinned-button,
+ .topic-notifications-button {
+ .reason {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5rem;
+ margin: 0;
+ }
+ }
+}
diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss
index 62e73354704..8b5409ead07 100644
--- a/app/assets/stylesheets/desktop/topic-post.scss
+++ b/app/assets/stylesheets/desktop/topic-post.scss
@@ -452,34 +452,6 @@ pre.codeblock-buttons:hover {
}
}
-#topic-footer-buttons {
- max-width: calc(
- var(--topic-body-width) + (var(--topic-body-width-padding) * 2) +
- var(--topic-avatar-width)
- );
-
- @media screen and (max-width: 924px) {
- .topic-footer-main-buttons {
- margin-top: 1em; // some extra space for the docked progress bar
- }
- }
-
- .bookmark {
- .d-icon-bookmark.bookmarked {
- color: var(--tertiary);
- }
- }
-
- .bookmark.bookmarked .d-icon-bookmark,
- .bookmark.bookmarked .d-icon-discourse-bookmark-clock {
- color: var(--tertiary);
- }
-
- .feature-on-profile.featured-on-profile .d-icon-id-card {
- color: var(--tertiary);
- }
-}
-
span.post-count {
background: var(--primary);
color: var(--secondary);
diff --git a/app/assets/stylesheets/desktop/topic.scss b/app/assets/stylesheets/desktop/topic.scss
index cb8d6330536..557e42faa66 100644
--- a/app/assets/stylesheets/desktop/topic.scss
+++ b/app/assets/stylesheets/desktop/topic.scss
@@ -53,48 +53,6 @@
}
}
-#topic-progress-expanded {
- border: 1px solid var(--primary-low);
- padding: 5px;
- background: var(--secondary);
-
- position: relative;
- left: 340px;
- width: 135px;
-
- button.full {
- width: 100%;
- margin-bottom: 5px;
- .d-icon {
- display: block;
- margin-top: 2px;
- margin-bottom: 2px;
- font-size: var(--font-up-2);
- }
- }
- .jump-form {
- input[type="text"] {
- float: left;
- width: 45px;
- height: 20px;
- text-align: center;
- margin-bottom: 0;
- font-size: var(--font-up-1);
- }
- button.btn {
- float: right;
- width: 55px;
- }
- }
- button.btn.jump-prompt {
- margin: 0;
- }
-
- button.btn.jump-bottom {
- margin: 5px 0 0 0;
- }
-}
-
#topic-filter {
background-color: var(--highlight-bg);
padding: 8px;
@@ -105,28 +63,6 @@
z-index: z("dropdown");
}
-#topic-progress:hover {
- cursor: pointer;
-}
-
-#topic-progress,
-#topic-progress-expanded {
- right: 0;
- left: 0;
-}
-
.onscreen-post .row {
display: flex; // children should never wrap
}
-
-@media all and (min-width: 400px) {
- #topic-footer-main-buttons {
- max-width: 70%;
- }
-}
-
-@media all and (max-width: 485px) {
- #topic-footer-main-buttons {
- max-width: 100%;
- }
-}
diff --git a/app/assets/stylesheets/mobile/_index.scss b/app/assets/stylesheets/mobile/_index.scss
index cc21b6e68ac..696fa9ce9ab 100644
--- a/app/assets/stylesheets/mobile/_index.scss
+++ b/app/assets/stylesheets/mobile/_index.scss
@@ -1,9 +1,9 @@
@import "admin_badges";
@import "admin_customize";
@import "admin_flags";
+@import "admin_report";
@import "admin_report_counters";
@import "admin_report_table";
-@import "admin_report";
@import "admin_reports";
@import "alert";
@import "compose";
@@ -16,10 +16,10 @@
@import "header";
@import "invite-signup";
@import "lightbox";
-@import "menu-panel";
@import "list-controls";
@import "login-modal";
@import "login-signup-page";
+@import "menu-panel";
@import "modal";
@import "modal-overrides";
@import "new-user";
@@ -29,7 +29,8 @@
@import "reviewables";
@import "sidebar";
@import "signup-progress-bar";
+@import "topic";
+@import "topic-footer";
@import "topic-list";
@import "topic-post";
-@import "topic";
@import "user";
diff --git a/app/assets/stylesheets/mobile/components/_index.scss b/app/assets/stylesheets/mobile/components/_index.scss
index 5af7ecf3147..c6f42c21789 100644
--- a/app/assets/stylesheets/mobile/components/_index.scss
+++ b/app/assets/stylesheets/mobile/components/_index.scss
@@ -1,6 +1,5 @@
@import "bookmark-menu";
@import "more-topics";
-@import "topic-footer-mobile-dropdown";
@import "topic-map";
@import "user-card";
@import "user-stream-item";
diff --git a/app/assets/stylesheets/mobile/components/topic-footer-mobile-dropdown.scss b/app/assets/stylesheets/mobile/components/topic-footer-mobile-dropdown.scss
deleted file mode 100644
index aae47b4cfd8..00000000000
--- a/app/assets/stylesheets/mobile/components/topic-footer-mobile-dropdown.scss
+++ /dev/null
@@ -1,40 +0,0 @@
-.select-kit {
- &.combo-box {
- &.topic-footer-mobile-dropdown {
- .select-kit-row {
- padding: 0.75em 0.5em;
- border-bottom: 1px solid rgba(var(--primary-low-rgb), 0.5);
-
- .name {
- line-height: var(--line-height-medium);
- }
-
- &:last-child {
- border: none;
- }
-
- .d-icon {
- color: var(--primary-medium);
- }
-
- &.is-highlighted {
- background: var(--tertiary-low);
-
- .name {
- color: var(--primary);
- }
- }
-
- &.bookmarked {
- .d-icon {
- color: var(--tertiary);
- }
- }
- }
-
- .select-kit-collection {
- max-height: 100%;
- }
- }
- }
-}
diff --git a/app/assets/stylesheets/mobile/topic-footer.scss b/app/assets/stylesheets/mobile/topic-footer.scss
new file mode 100644
index 00000000000..58f3415f39a
--- /dev/null
+++ b/app/assets/stylesheets/mobile/topic-footer.scss
@@ -0,0 +1,18 @@
+html:not(.anon) #topic-footer-buttons {
+ .topic-footer-main-buttons {
+ .d-button-label {
+ display: none;
+ }
+
+ .pinned-button,
+ .topic-notifications-button {
+ .selected-name .name {
+ display: none;
+ }
+ }
+
+ .d-icon {
+ margin-right: 0;
+ }
+ }
+}
diff --git a/app/assets/stylesheets/mobile/topic-post.scss b/app/assets/stylesheets/mobile/topic-post.scss
index 506fc7fa6bb..a046d2a41e8 100644
--- a/app/assets/stylesheets/mobile/topic-post.scss
+++ b/app/assets/stylesheets/mobile/topic-post.scss
@@ -250,51 +250,6 @@ a.reply-to-tab {
clear: both;
}
-#topic-footer-buttons {
- .d-icon-bookmark.bookmarked,
- .d-icon-discourse-bookmark-clock.bookmarked {
- color: var(--tertiary);
- }
-
- .topic-footer-main-buttons {
- display: flex;
- align-items: stretch;
- }
-
- .topic-footer-mobile-dropdown {
- margin-right: 0.5em;
- display: flex;
- }
-
- .select-kit-header {
- height: 100%;
- }
-
- .topic-notifications-button,
- .pinned-button {
- display: flex;
- align-items: center;
-
- .reason {
- display: flex;
- flex-direction: column;
- align-items: flex-start;
-
- .text {
- margin-left: 0;
- margin-top: 0.25rem;
- }
- }
- @include breakpoint(mobile-medium) {
- display: inline-block;
- .reason {
- display: block;
- margin: 0.5em 0 0 0;
- }
- }
- }
-}
-
span.post-count {
background: var(--primary);
color: var(--secondary);
diff --git a/app/assets/stylesheets/mobile/topic.scss b/app/assets/stylesheets/mobile/topic.scss
index 6546f04a58f..2ef300170a1 100644
--- a/app/assets/stylesheets/mobile/topic.scss
+++ b/app/assets/stylesheets/mobile/topic.scss
@@ -31,47 +31,6 @@
top: -100%; // above parent container + some extra space
}
-#topic-progress-expanded {
- border: 1px solid var(--primary-low);
- padding: 5px;
- background: var(--secondary);
-
- position: absolute;
- bottom: 34px;
- width: 135px;
-
- button.full {
- width: 100%;
- margin-bottom: 5px;
- .d-icon {
- display: block;
- margin-top: 2px;
- margin-bottom: 2px;
- font-size: var(--font-up-2);
- }
- }
- .jump-form {
- input[type="text"] {
- float: left;
- width: 45px;
- height: 20px;
- text-align: center;
- font-size: var(--font-up-1);
- }
- button.btn {
- float: right !important;
- width: 55px;
- }
- }
- button.btn.jump-prompt {
- margin: 0;
- }
- button.btn.jump-bottom {
- margin-top: 5px;
- margin-bottom: 0;
- }
-}
-
.topic-error {
padding: 18px;
width: 90%;
@@ -128,15 +87,3 @@ sub sub {
margin-bottom: 0.5rem;
}
}
-
-.topic-footer-main-buttons {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
-}
-
-.container.posts .topic-navigation {
- // docked progress bar on large screens using mobile view
- grid-area: posts;
- grid-row: 3; // after topic map
-}
diff --git a/app/assets/stylesheets/wcag.scss b/app/assets/stylesheets/wcag.scss
index e6c984266aa..7bdb87e0431 100644
--- a/app/assets/stylesheets/wcag.scss
+++ b/app/assets/stylesheets/wcag.scss
@@ -203,7 +203,7 @@ html {
// Post controls
- .topic-admin-menu-button-container,
+ .topic-admin-menu,
.timeline-controls {
.btn .d-icon {
// admin wrenches
diff --git a/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.gjs b/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.gjs
index e975510342b..f8525019290 100644
--- a/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.gjs
+++ b/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.gjs
@@ -33,12 +33,6 @@ export default class ComposerPresenceDisplay extends Component {
});
setupWhisperChannel = helperFn((_, on) => {
- // NOTE: this is here to prevent some flakes in tests
- // For some random reasons, this component is being rendered even though `currentUser` is `null`
- if (!this.currentUser) {
- return;
- }
-
const { topic } = this.args.model;
const { whisperer } = this.currentUser;
@@ -120,36 +114,38 @@ export default class ComposerPresenceDisplay extends Component {
}
<template>
- {{this.setupReplyChannel}}
- {{this.setupWhisperChannel}}
- {{this.setupEditChannel}}
- {{this.notifyState}}
-
- {{#if (gt this.users.length 0)}}
- <div class="presence-users">
- <div class="presence-avatars">
- {{#each this.users as |user|}}
- <UserLink @user={{user}}>
- {{avatar user imageSize="small"}}
- </UserLink>
- {{/each}}
- </div>
-
- <span class="presence-text">
- <span class="description">
- {{~#if this.isReply~}}
- {{i18n "presence.replying" count=this.users.length}}
- {{~else~}}
- {{i18n "presence.editing" count=this.users.length}}
- {{~/if~}}
- </span>
- <span class="wave">
- <span class="dot">.</span>
- <span class="dot">.</span>
- <span class="dot">.</span>
+ {{#if this.currentUser}}
+ {{this.setupReplyChannel}}
+ {{this.setupWhisperChannel}}
+ {{this.setupEditChannel}}
+ {{this.notifyState}}
+
+ {{#if (gt this.users.length 0)}}
+ <div class="presence-users">
+ <div class="presence-avatars">
+ {{#each this.users as |user|}}
+ <UserLink @user={{user}}>
+ {{avatar user imageSize="small"}}
+ </UserLink>
+ {{/each}}
+ </div>
+
+ <span class="presence-text">
+ <span class="description">
+ {{~#if this.isReply~}}
+ {{i18n "presence.replying" count=this.users.length}}
+ {{~else~}}
+ {{i18n "presence.editing" count=this.users.length}}
+ {{~/if~}}
+ </span>
+ <span class="wave">
+ <span class="dot">.</span>
+ <span class="dot">.</span>
+ <span class="dot">.</span>
+ </span>
</span>
- </span>
- </div>
+ </div>
+ {{/if}}
{{/if}}
</template>
}
diff --git a/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.gjs b/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.gjs
index 5df9df8beb3..3b1690f698d 100644
--- a/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.gjs
+++ b/plugins/discourse-presence/assets/javascripts/discourse/components/topic-presence-display.gjs
@@ -30,12 +30,6 @@ export default class TopicPresenceDisplay extends Component {
});
setupWhisperChannel = helperFn((_, on) => {
- // NOTE: this is here to prevent some flakes in tests
- // For some random reasons, this component is being rendered even though `currentUser` is `null`
- if (!this.currentUser) {
- return;
- }
-
const { topic } = this.args;
const { whisperer } = this.currentUser;
@@ -62,30 +56,32 @@ export default class TopicPresenceDisplay extends Component {
}
<template>
- {{this.setupReplyChannel}}
- {{this.setupWhisperChannel}}
-
- {{#if (gt this.users.length 0)}}
- <div class="presence-users">
- <div class="presence-avatars">
- {{#each this.users as |user|}}
- <UserLink @user={{user}}>
- {{avatar user imageSize="small"}}
- </UserLink>
- {{/each}}
- </div>
-
- <span class="presence-text">
- <span class="description">
- {{i18n "presence.replying_to_topic" count=this.users.length}}
+ {{#if this.currentUser}}
+ {{this.setupReplyChannel}}
+ {{this.setupWhisperChannel}}
+
+ {{#if (gt this.users.length 0)}}
+ <div class="presence-users">
+ <div class="presence-avatars">
+ {{#each this.users as |user|}}
+ <UserLink @user={{user}}>
+ {{avatar user imageSize="small"}}
+ </UserLink>
+ {{/each}}
+ </div>
+
+ <span class="presence-text">
+ <span class="description">
+ {{i18n "presence.replying_to_topic" count=this.users.length}}
+ </span>
+ <span class="wave">
+ <span class="dot">.</span>
+ <span class="dot">.</span>
+ <span class="dot">.</span>
+ </span>
</span>
- <span class="wave">
- <span class="dot">.</span>
- <span class="dot">.</span>
- <span class="dot">.</span>
- </span>
- </span>
- </div>
+ </div>
+ {{/if}}
{{/if}}
</template>
}
diff --git a/plugins/discourse-presence/assets/javascripts/discourse/connectors/topic-above-footer-buttons/presence.hbs b/plugins/discourse-presence/assets/javascripts/discourse/connectors/topic-above-footer-buttons/presence.hbs
index 56dfb744777..f708925aac5 100644
--- a/plugins/discourse-presence/assets/javascripts/discourse/connectors/topic-above-footer-buttons/presence.hbs
+++ b/plugins/discourse-presence/assets/javascripts/discourse/connectors/topic-above-footer-buttons/presence.hbs
@@ -1,2 +1 @@
-{{! Note: the topic-above-footer-buttons outlet is only rendered for logged-in users }}
<TopicPresenceDisplay @topic={{@outletArgs.model}} />
\ No newline at end of file
diff --git a/plugins/discourse-presence/assets/javascripts/discourse/connectors/topic-navigation-bottom/presence.hbs b/plugins/discourse-presence/assets/javascripts/discourse/connectors/topic-navigation-bottom/presence.hbs
new file mode 100644
index 00000000000..f708925aac5
--- /dev/null
+++ b/plugins/discourse-presence/assets/javascripts/discourse/connectors/topic-navigation-bottom/presence.hbs
@@ -0,0 +1 @@
+<TopicPresenceDisplay @topic={{@outletArgs.model}} />
\ No newline at end of file
diff --git a/plugins/discourse-presence/assets/stylesheets/presence.scss b/plugins/discourse-presence/assets/stylesheets/presence.scss
index ad4f8e31464..266f2f319ed 100644
--- a/plugins/discourse-presence/assets/stylesheets/presence.scss
+++ b/plugins/discourse-presence/assets/stylesheets/presence.scss
@@ -84,3 +84,20 @@
}
}
}
+
+// Always hide the "Topic Presence" in the topic timeline
+.topic-navigation.with-timeline .topic-navigation-bottom-outlet.presence {
+ display: none;
+}
+
+// Hide the "Topic Presence" in the topic footer when the timeline is hidden
+body:has(.topic-navigation.with-topic-progress)
+ .topic-above-footer-buttons-outlet.presence {
+ display: none;
+}
+
+.topic-navigation-bottom-outlet.presence {
+ margin-right: auto;
+ order: -1;
+ display: flex;
+}
diff --git a/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/dropdowns.hbs b/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/dropdowns.hbs
index 4875e9c43c4..b0ba20b0b59 100644
--- a/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/dropdowns.hbs
+++ b/plugins/styleguide/assets/javascripts/discourse/components/sections/atoms/dropdowns.hbs
@@ -62,10 +62,6 @@
/>
</StyleguideExample>
-<StyleguideExample @title="<TopicFooterMobileDropdown>">
- <TopicFooterMobileDropdown @topic={{@dummy.topic}} />
-</StyleguideExample>
-
<StyleguideExample
@title="<CategoryChooser>"
@initialValue={{get @categories "0" "name"}}
diff --git a/spec/system/page_objects/pages/topic.rb b/spec/system/page_objects/pages/topic.rb
index 5e5000c6e28..919991f6669 100644
--- a/spec/system/page_objects/pages/topic.rb
+++ b/spec/system/page_objects/pages/topic.rb
@@ -267,7 +267,7 @@ module PageObjects
end
def click_admin_menu_button
- within_topic_footer_buttons { find(".topic-admin-menu-button").click }
+ within_topic_footer_buttons { find(".toggle-admin-menu").click }
end
def watch_topic