Skip to content

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

FEATURE: Add floating dismiss on mobile upcoming change (#36747)

Martin Brennanb2137390daa6
diff --git a/app/assets/stylesheets/common/base/_index.scss b/app/assets/stylesheets/common/base/_index.scss
index 55bb290a3c9..8f832040b98 100644
--- a/app/assets/stylesheets/common/base/_index.scss
+++ b/app/assets/stylesheets/common/base/_index.scss
@@ -67,3 +67,4 @@
@import "user";
@import "user-badges";
@import "user-tips";
+@import "uc-dismiss";
diff --git a/app/assets/stylesheets/common/base/uc-dismiss.scss b/app/assets/stylesheets/common/base/uc-dismiss.scss
new file mode 100644
index 00000000000..1186c41cbea
--- /dev/null
+++ b/app/assets/stylesheets/common/base/uc-dismiss.scss
@@ -0,0 +1,29 @@
+@use "lib/viewport";
+
+.uc-floating-dismiss-topics-on-mobile {
+ @include viewport.until(sm) {
+ .dismiss-container-top {
+ position: fixed;
+ bottom: calc(env(safe-area-inset-bottom) + var(--space-4));
+ right: 50%;
+ transform: translateX(50%);
+ z-index: 2;
+ transition: bottom 0.3s ease;
+
+ .dismiss-read {
+ box-shadow: var(--shadow-dropdown);
+
+ .d-icon {
+ display: none;
+ }
+ }
+
+ .footer-nav-visible & {
+ bottom: calc(
+ var(--footer-nav-height) + env(safe-area-inset-bottom) +
+ var(--space-4)
+ );
+ }
+ }
+ }
+}
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 5d0b1c1d775..e833e89dc6e 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -2758,6 +2758,7 @@ en:
content_localization_allow_author_localization: "Allow authors update localizations of their own topics and posts via the post menu."
enable_upcoming_changes: "Enable upcoming changes"
fake_upcoming_change: "This is a fake upcoming change for testing purposes. No need to translate this string."
+ floating_dismiss_topics_on_mobile: "Shows a floating 'Dismiss...' button on mobile for the topic list for easier access and to free up space in the top of the topic list"
experimental_rename_faq_to_guidelines: "This change renames the FAQ page to Guidelines. The FAQ page will still be available at /faq. The 'faq url' setting works as before."
errors:
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 91912fd3806..4a99ce15102 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -21,6 +21,11 @@
# is changed.
# themeable - Set to true if themes can override this site setting. Generally, only client side affecting settings
# that change the UI should be themeable, and try limit to simple setting types like bool, list, integer, enum.
+# upcoming_change - Additional metadata with the following options to show in the /admin/config/upcoming-changes page:
+# - status: experimental | alpha | beta | stable
+# - impact: two parts separated by comma - feature|other , staff|admins|moderators|all_members|developers
+# - learn_more_url: a url for more information
+#
#
#
# type: email - Must be a valid email address.
@@ -4219,3 +4224,10 @@ experimental:
default: false
hidden: true
client: true
+ floating_dismiss_topics_on_mobile:
+ default: false
+ hidden: true
+ client: true
+ upcoming_change:
+ status: "experimental"
+ impact: "feature,all_members"
diff --git a/public/images/upcoming_changes/floating_dismiss_topics_on_mobile.png b/public/images/upcoming_changes/floating_dismiss_topics_on_mobile.png
new file mode 100644
index 00000000000..a0aff760ce6
Binary files /dev/null and b/public/images/upcoming_changes/floating_dismiss_topics_on_mobile.png differ