- {{#unless this.model.viewFullscreen}}
-
+
- {{#if this.site.mobileView}}
-
- {{#if this.canEdit}}
- {{d-icon "times"}}
- {{else}}
- {{d-icon "far-trash-alt"}}
- {{/if}}
-
- {{else}}
-
{{i18n "close"}}
- {{/if}}
- {{/unless}}
+ {{#if this.site.mobileView}}
+
+ {{#if this.canEdit}}
+ {{d-icon "times"}}
+ {{else}}
+ {{d-icon "far-trash-alt"}}
+ {{/if}}
+
+ {{else}}
+
{{i18n "close"}}
+ {{/if}}
{{#if this.site.mobileView}}
{{#if this.whisperOrUnlistTopic}}
diff --git a/app/assets/javascripts/discourse/tests/acceptance/composer-test.js b/app/assets/javascripts/discourse/tests/acceptance/composer-test.js
index 5c60c6086b0..705caa4a8dc 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/composer-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/composer-test.js
@@ -509,6 +509,12 @@ acceptance("Composer", function (needs) {
"it expands composer to full screen"
);
+ assert.strictEqual(
+ count(".composer-fullscreen-prompt"),
+ 1,
+ "the exit fullscreen prompt is visible"
+ );
+
await click(".toggle-fullscreen");
assert.strictEqual(
@@ -535,6 +541,34 @@ acceptance("Composer", function (needs) {
);
});
+ test("Composer fullscreen submit button", async function (assert) {
+ await visit("/t/this-is-a-test-topic/9");
+ await click(".topic-post:nth-of-type(1) button.reply");
+
+ assert.strictEqual(
+ count("#reply-control.open"),
+ 1,
+ "it starts in open state by default"
+ );
+
+ await click(".toggle-fullscreen");
+
+ assert.strictEqual(
+ count("#reply-control button.create"),
+ 1,
+ "it shows composer submit button in fullscreen"
+ );
+
+ await fillIn(".d-editor-input", "too short");
+ await click("#reply-control button.create");
+
+ assert.strictEqual(
+ count("#reply-control.open"),
+ 1,
+ "it goes back to open state if there's errors"
+ );
+ });
+
test("Composer can toggle between reply and createTopic", async function (assert) {
await visit("/t/this-is-a-test-topic/9");
await click(".topic-post:nth-of-type(1) button.reply");
diff --git a/app/assets/stylesheets/desktop/compose.scss b/app/assets/stylesheets/desktop/compose.scss
index 31b430a09fe..8b45b63e566 100644
--- a/app/assets/stylesheets/desktop/compose.scss
+++ b/app/assets/stylesheets/desktop/compose.scss
@@ -288,3 +288,24 @@ a.toggle-preview {
}
}
}
+
+.composer-fullscreen-prompt {
+ animation: fadeIn 1s ease-in-out;
+ animation-delay: 1.5s;
+ animation-direction: reverse;
+ animation-fill-mode: forwards;
+ position: fixed;
+ left: 50%;
+ top: 10%;
+ transform: translate(-50%, 0);
+ .rtl & {
+ // R2 is not smart enough to support this swap
+ transform: translate(50%, 0);
+ }
+ z-index: z("header") + 1;
+ background: var(--primary-very-high);
+ color: var(--secondary);
+ padding: 0.5em 0.75em;
+ pointer-events: none;
+ border-radius: 2px;
+}
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 3b776812efb..a4b5a3d4965 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -2259,6 +2259,7 @@ en:
abandon: "close composer and discard draft"
enter_fullscreen: "enter fullscreen composer"
exit_fullscreen: "exit fullscreen composer"
+ exit_fullscreen_prompt: "Press
ESC to exit full screen"
show_toolbar: "show composer toolbar"
hide_toolbar: "hide composer toolbar"
modal_ok: "OK"
@@ -2307,7 +2308,7 @@ en:
image_alt_text:
aria_label: Alt text for image
- delete_image_button: Delete Image
+ delete_image_button: Delete Image
notifications:
tooltip: