A platform for community discussion. Free, open, simple.
UX: Composer redesign full width metadata (#42349)
chapoi936986f0ae25
diff --git a/app/assets/stylesheets/common/upcoming-changes/uc-enable-composer-redesign.scss b/app/assets/stylesheets/common/upcoming-changes/uc-enable-composer-redesign.scssindex a2112083d59..9118380c3a9 100644--- a/app/assets/stylesheets/common/upcoming-changes/uc-enable-composer-redesign.scss+++ b/app/assets/stylesheets/common/upcoming-changes/uc-enable-composer-redesign.scss@@ -20,6 +20,14 @@height: auto;min-height: 0;}++ // structure properly when :where is gone+ &.hide-preview .d-editor-container {+ grid-template-columns: 1fr;+ grid-template-areas:+ "fields"+ "editor";+ }}.grippie {@@ -153,6 +161,11 @@}}+ // TODO move to plugin css when UC is removed+ .showing-ai-suggestions #reply-title {+ padding-right: calc(var(--space-7) + 27px);+ }+.title-input {#reply-title {border: 0;@@ -160,7 +173,7 @@font-size: var(--font-up-4);font-weight: bold;margin-bottom: 0 !important;- padding-bottom: var(--space-2) !important;+ padding-bottom: var(--space-3) !important;&::placeholder {color: var(--primary-medium);@@ -175,6 +188,7 @@}}+ // TODO move to plugin css when UC is removed.suggest-titles-button {right: var(--space-4) !important;top: var(--space-4);@@ -183,7 +197,7 @@}}- .d-editor-textarea-wrapper {+ #reply-control .d-editor-textarea-wrapper {--composer-slide-easing: cubic-bezier(0.2, 0, 0, 1);border: 0;@@ -237,10 +251,38 @@display: none;}+ #reply-control .d-editor-container {+ display: grid;+ grid-template-columns: 1fr 1fr;+ grid-template-rows: min-content 1fr;+ grid-template-areas:+ "fields fields"+ "editor preview";++ &.--rich-editor-enabled {+ grid-template-columns: 1fr;+ grid-template-areas:+ "fields"+ "editor";+ }++ .composer-fields {+ grid-area: fields;+ }++ .d-editor-textarea-column {+ grid-area: editor;+ }++ .d-editor-preview-wrapper {+ grid-area: preview;+ }+ }+// clean up selector once the uc- body class is no longer in the way.show-preview .d-editor-container.--markdown-editor-enabled {.d-editor-textarea-column {- border-right: 1px solid var(--primary-low);+ border-right: none;}.d-editor-preview-wrapper {diff --git a/frontend/discourse/app/components/composer-editor.gjs b/frontend/discourse/app/components/composer-editor.gjsindex c5511b2c93a..f9544ff97ce 100644--- a/frontend/discourse/app/components/composer-editor.gjs+++ b/frontend/discourse/app/components/composer-editor.gjs@@ -126,6 +126,10 @@ export default class ComposerEditor extends Component {});}+ get composerRedesign() {+ return this.siteSettings.enable_composer_redesign;+ }+willDestroyElement() {super.willDestroyElement(...arguments);this.uppyComposerUpload.teardown();@@ -1005,6 +1009,7 @@ export default class ComposerEditor extends Component {@onSetup={{this.setupEditor}}@disableSubmit={{this.composer.disableSubmit}}@toolbarPortalTarget={{this.toolbarPortalTarget}}+ @renderYieldAboveContainer={{this.composerRedesign}}{{didInsert this._composerEditorInitEditor}}{{willDestroy this._composerEditorDestroyEditor}}{{didInsert this._composerEditorInitPreview}}diff --git a/frontend/discourse/app/ui-kit/d-editor.gjs b/frontend/discourse/app/ui-kit/d-editor.gjsindex 52d0bf241f0..38dec39b8ca 100644--- a/frontend/discourse/app/ui-kit/d-editor.gjs+++ b/frontend/discourse/app/ui-kit/d-editor.gjs@@ -758,8 +758,14 @@ export default class DEditor extends Component {<divclass={{dConcatClass "d-editor-container" this.editorContainerModeClass}}>- <div class="d-editor-textarea-column">+ {{#if @renderYieldAboveContainer}}{{yield}}+ {{/if}}++ <div class="d-editor-textarea-column">+ {{#unless @renderYieldAboveContainer}}+ {{yield}}+ {{/unless}}<divclass="d-editor-textarea-wrapper