A platform for community discussion. Free, open, simple.
FEATURE: Bump dismiss button & new checkbox upcoming changes to permanent (#42871)
Martin Brennan43cce00681e4
diff --git a/app/assets/stylesheets/common/base/_topic-list.scss b/app/assets/stylesheets/common/base/_topic-list.scssindex 25baf26a9da..493836109d5 100644--- a/app/assets/stylesheets/common/base/_topic-list.scss+++ b/app/assets/stylesheets/common/base/_topic-list.scss@@ -361,6 +361,18 @@@include viewport.until(sm) {margin-bottom: 0;++ .dismiss-container-bottom {+ .topic-dismiss-buttons__menu {+ display: none;+ }++ .topic-dismiss-buttons__button {+ border-top-right-radius: var(--d-button-border-radius);+ border-bottom-right-radius: var(--d-button-border-radius);+ border-right: var(--d-button-default-border);+ }+ }}@include viewport.from(sm) {@@ -747,6 +759,33 @@}@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);+ }++ .topic-dismiss-buttons__button .d-icon {+ display: none;+ }++ .topic-dismiss-buttons__menu .d-icon {+ display: inline-flex;+ }++ .footer-nav-visible & {+ bottom: calc(+ var(--footer-nav-height) + env(safe-area-inset-bottom) + var(--space-4)+ );+ }+ }+.fade.in {opacity: 1;}diff --git a/app/assets/stylesheets/common/form-kit/_control-checkbox.scss b/app/assets/stylesheets/common/form-kit/_control-checkbox.scssindex 3b32c7b2a5f..5d45fad9c04 100644--- a/app/assets/stylesheets/common/form-kit/_control-checkbox.scss+++ b/app/assets/stylesheets/common/form-kit/_control-checkbox.scss@@ -1,18 +1,17 @@.form-kit {&__control-checkbox {- &[type="checkbox"] {- margin: 0.17em;- margin-right: 0;- margin-left: 0;- }+ position: absolute;+ opacity: 0;&-label {+ position: relative;display: flex;- gap: 0.5em;+ gap: 0.75em;margin: 0;font-weight: normal !important;color: var(--primary);font-size: var(--font-down-1-rem);+ cursor: pointer;.form-kit__field[data-disabled] & {cursor: not-allowed;@@ -20,6 +19,42 @@}}+ &__control-checkbox-checkmark {+ width: 1.25em;+ height: 1.25em;+ border: 2px solid var(--primary-low-mid);+ border-radius: 5px;+ align-items: center;+ display: flex;+ justify-content: center;+ position: relative;+ box-sizing: border-box;+ background: var(--secondary);+ flex-shrink: 0;+ overflow: hidden;+ transition: border 0.2s ease;++ &::before {+ content: "";+ position: absolute;+ top: 50%;+ left: 50%;+ width: 50%;+ height: 50%;+ background: var(--tertiary);+ border-radius: 50%;+ transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);+ opacity: 0;+ transform: translate(-50%, -50%) scale(0);+ }++ .d-icon {+ display: none;+ width: 75%;+ height: 75%;+ }+ }+&__control-checkbox-content {display: flex;flex-direction: column;@@ -34,3 +69,21 @@}}}++.form-kit__control-checkbox-label:hover .form-kit__control-checkbox-checkmark {+ border-color: var(--tertiary);+}++.form-kit__control-checkbox:checked + .form-kit__control-checkbox-checkmark {+ border-color: var(--tertiary-low);++ &::before {+ opacity: 1;+ transform: translate(-50%, -50%) scale(3);+ }++ .d-icon {+ display: initial;+ color: var(--secondary);+ }+}diff --git a/app/assets/stylesheets/common/upcoming-changes/_index.scss b/app/assets/stylesheets/common/upcoming-changes/_index.scssindex 52cc078250b..460bcae0d1d 100644--- a/app/assets/stylesheets/common/upcoming-changes/_index.scss+++ b/app/assets/stylesheets/common/upcoming-changes/_index.scss@@ -1,4 +1,2 @@-@import "uc-dismiss";@import "uc-enable-composer-redesign";-@import "uc-enable-new-checkbox-style";@import "uc-modernize-foundation-theme";diff --git a/app/assets/stylesheets/common/upcoming-changes/uc-dismiss.scss b/app/assets/stylesheets/common/upcoming-changes/uc-dismiss.scssdeleted file mode 100644index f7a68c8d6dc..00000000000--- a/app/assets/stylesheets/common/upcoming-changes/uc-dismiss.scss+++ /dev/null@@ -1,45 +0,0 @@-@use "lib/viewport";--:where(.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);- }-- .topic-dismiss-buttons__button .d-icon {- display: none;- }-- .topic-dismiss-buttons__menu .d-icon {- display: inline-flex;- }-- .footer-nav-visible & {- bottom: calc(- var(--footer-nav-height) + env(safe-area-inset-bottom) +- var(--space-4)- );- }- }-- .dismiss-container-bottom {- .topic-dismiss-buttons__menu {- display: none;- }-- .topic-dismiss-buttons__button {- border-top-right-radius: var(--d-button-border-radius);- border-bottom-right-radius: var(--d-button-border-radius);- border-right: var(--d-button-default-border);- }- }- }-}diff --git a/app/assets/stylesheets/common/upcoming-changes/uc-enable-new-checkbox-style.scss b/app/assets/stylesheets/common/upcoming-changes/uc-enable-new-checkbox-style.scssdeleted file mode 100644index 6b1653695a9..00000000000--- a/app/assets/stylesheets/common/upcoming-changes/uc-enable-new-checkbox-style.scss+++ /dev/null@@ -1,93 +0,0 @@-:where(.uc-enable-new-checkbox-style) {- .form-kit {- &__control-checkbox {- /* hide native checkbox */- position: absolute;- opacity: 0;-- &-label {- position: relative;- display: flex;- gap: 0.75em;- margin: 0;- font-weight: normal !important;- color: var(--primary);- font-size: var(--font-down-1-rem);- cursor: pointer;-- .form-kit__field[data-disabled] & {- cursor: not-allowed;- }- }- }-- &__control-checkbox-checkmark {- /* custom box */- width: 1.25em;- height: 1.25em;- border: 2px solid var(--primary-low-mid);- border-radius: 5px;- align-items: center;- display: flex;- justify-content: center;- position: relative;- box-sizing: border-box;- background: var(--secondary);- flex-shrink: 0;- overflow: hidden;- transition: border 0.2s ease;-- &::before {- content: "";- position: absolute;- top: 50%;- left: 50%;- width: 50%;- height: 50%;- background: var(--tertiary);- border-radius: 50%;- transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);- opacity: 0;- transform: translate(-50%, -50%) scale(0);- }-- .d-icon {- display: none;- width: 75%;- height: 75%;- }- }-- &__control-checkbox-content {- flex-direction: column;- gap: 0.25rem;- }-- &__control-checkbox-description {- color: var(--primary-medium);-- &:empty {- display: none;- }- }- }-- .form-kit__control-checkbox-label:hover- .form-kit__control-checkbox-checkmark {- border-color: var(--tertiary);- }-- .form-kit__control-checkbox:checked + .form-kit__control-checkbox-checkmark {- border-color: var(--tertiary-low);-- &::before {- opacity: 1;- transform: translate(-50%, -50%) scale(3);- }-- .d-icon {- display: initial;- color: var(--secondary);- }- }-}diff --git a/config/site_settings.yml b/config/site_settings.ymlindex 957b0ecd9d7..90b580acc36 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -4706,7 +4706,7 @@ experimental:hidden: truearea: "experimental"upcoming_change:- status: "stable"+ status: "permanent"impact: "feature,all_members"learn_more_url: "https://meta.discourse.org/t/-/403284"body_class: true@@ -4781,7 +4781,7 @@ experimental:hidden: trueclient: trueupcoming_change:- status: "stable"+ status: "permanent"impact: "feature,all_members"learn_more_url: "https://meta.discourse.org/t/-/387322"body_class: truediff --git a/frontend/discourse/app/components/discovery/topics.gjs b/frontend/discourse/app/components/discovery/topics.gjsindex afe7df729f3..ebbb8475b67 100644--- a/frontend/discourse/app/components/discovery/topics.gjs+++ b/frontend/discourse/app/components/discovery/topics.gjs@@ -26,7 +26,6 @@ export default class DiscoveryTopics extends Component {@service currentUser;@service topicTrackingState;@service site;- @service siteSettings;get redirectedReason() {return this.currentUser?.user_option.redirected_to_top?.reason;@@ -147,12 +146,7 @@ export default class DiscoveryTopics extends Component {}get showBottomDismissButtons() {- return (- this.allLoaded &&- (!this.site.mobileView ||- (this.site.mobileView &&- !this.siteSettings.floating_dismiss_topics_on_mobile))- );+ return this.allLoaded && !this.site.mobileView;}@actiondiff --git a/frontend/discourse/app/controllers/user-topics-list.js b/frontend/discourse/app/controllers/user-topics-list.jsindex 75eb10933b7..e6528777016 100644--- a/frontend/discourse/app/controllers/user-topics-list.js+++ b/frontend/discourse/app/controllers/user-topics-list.js@@ -17,7 +17,6 @@ import { QUERY_PARAMS } from "discourse/routes/user-topic-list";// Lists of topics on a user's page.export default class UserTopicsListController extends Controller {@service site;- @service siteSettings;@tracked model;@tracked listContext = "user-activity";@@ -61,11 +60,7 @@ export default class UserTopicsListController extends Controller {}get showBottomDismissButtons() {- return (- !this.site.mobileView ||- (this.site.mobileView &&- !this.siteSettings.floating_dismiss_topics_on_mobile)- );+ return !this.site.mobileView;}@computed("model.topics.length", "incomingCount")diff --git a/frontend/discourse/app/form-kit/components/fk/control/checkbox.gjs b/frontend/discourse/app/form-kit/components/fk/control/checkbox.gjsindex 6201dc6162b..1be3ce717c6 100644--- a/frontend/discourse/app/form-kit/components/fk/control/checkbox.gjs+++ b/frontend/discourse/app/form-kit/components/fk/control/checkbox.gjs@@ -1,6 +1,5 @@import { on } from "@ember/modifier";import { action } from "@ember/object";-import { service } from "@ember/service";import FKBaseControl from "discourse/form-kit/components/fk/control/base";import FKLabel from "discourse/form-kit/components/fk/label";import FKRequired from "discourse/form-kit/components/fk/required";@@ -10,7 +9,6 @@ import dIcon from "discourse/ui-kit/helpers/d-icon";export default class FKControlCheckbox extends FKBaseControl {static controlType = "checkbox";- @service siteSettings;@actionhandleInput(event) {@@ -31,11 +29,9 @@ export default class FKControlCheckbox extends FKBaseControl {...attributes{{on "change" this.handleInput}}/>- {{#if this.siteSettings.enable_new_checkbox_style}}- <span class="form-kit__control-checkbox-checkmark">{{dIcon- "check"- }}</span>- {{/if}}+ <span class="form-kit__control-checkbox-checkmark">{{dIcon+ "check"+ }}</span><span class="form-kit__control-checkbox-content">{{#if @field.showControlTitle}}<span class="form-kit__control-checkbox-title">diff --git a/frontend/discourse/tests/acceptance/mobile-new-dismiss-test.js b/frontend/discourse/tests/acceptance/mobile-new-dismiss-test.jsindex 8c878a99c75..321202c0697 100644--- a/frontend/discourse/tests/acceptance/mobile-new-dismiss-test.js+++ b/frontend/discourse/tests/acceptance/mobile-new-dismiss-test.js@@ -6,7 +6,6 @@ import { acceptance } from "discourse/tests/helpers/qunit-helpers";acceptance("New dismiss - Mobile", function (needs) {needs.mobileView();- needs.settings({ floating_dismiss_topics_on_mobile: true });needs.user({ unified_new_enabled: true });needs.pretender((server, helper) => {const topicList = cloneJSON(topicFixtures["/latest.json"]);diff --git a/spec/system/page_objects/components/form_kit.rb b/spec/system/page_objects/components/form_kit.rbindex 51e8b5d8fb7..ca34e579e0f 100644--- a/spec/system/page_objects/components/form_kit.rb+++ b/spec/system/page_objects/components/form_kit.rb@@ -63,28 +63,18 @@ module PageObjectsenddef uncheck- if control_type == "checkbox" && SiteSetting.enable_new_checkbox_style+ if control_type == "checkbox"return unless valuecomponent.find(".form-kit__control-checkbox-checkmark").click- return- end-- within component do- uncheck("input[type='checkbox']", visible: :all)endenddef check- if control_type == "checkbox" && SiteSetting.enable_new_checkbox_style+ if control_type == "checkbox"return if valuecomponent.find(".form-kit__control-checkbox-checkmark").click- return- end-- within component do- check("input[type='checkbox']", visible: :all)endend@@ -135,11 +125,7 @@ module PageObjectsdef togglecase control_typewhen "checkbox"- if SiteSetting.enable_new_checkbox_style- component.find(".form-kit__control-checkbox-checkmark").click- else- component.find("input[type='checkbox']").click- end+ component.find(".form-kit__control-checkbox-checkmark").clickwhen "password"component.find(".form-kit__control-password-toggle").clickwhen "toggle"