UX: improve composer control spacing on mobile (#21021)

This commit is contained in:
Kris 2023-04-11 15:11:00 -04:00 committed by GitHub
parent 0ab3ba5f0d
commit ce601ac84c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 81 additions and 65 deletions

View File

@ -272,45 +272,6 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if (or this.isUploading this.isProcessingUpload)}}
<div id="file-uploading">
{{#if this.isProcessingUpload}}
{{loading-spinner size="small"}}<span>{{i18n
"upload_selector.processing"
}}</span>
{{else}}
{{loading-spinner size="small"}}<span>{{i18n
"upload_selector.uploading"
}}
{{this.uploadProgress}}%</span>
{{/if}}
{{#if this.isCancellable}}
<a
href
id="cancel-file-upload"
{{on "click" this.cancelUpload}}
>{{d-icon "times"}}</a>
{{/if}}
</div>
{{/if}}
<div class={{if this.isUploading "hidden"}} id="draft-status">
{{#if this.model.draftStatus}}
<span class="draft-error" title={{this.model.draftStatus}}>
{{#if this.model.draftConflictUser}}
{{avatar this.model.draftConflictUser imageSize="small"}}
{{d-icon "user-edit"}}
{{else}}
{{d-icon "exclamation-triangle"}}
{{/if}}
{{#unless this.site.mobileView}}
{{this.model.draftStatus}}
{{/unless}}
</span>
{{/if}}
</div>
<span> <span>
<PluginOutlet <PluginOutlet
@name="composer-after-save-or-cancel" @name="composer-after-save-or-cancel"
@ -356,7 +317,48 @@
@icon="pencil-alt" @icon="pencil-alt"
/> />
{{/if}} {{/if}}
{{/if}}
{{#if (or this.isUploading this.isProcessingUpload)}}
<div id="file-uploading">
{{#if this.isProcessingUpload}}
{{loading-spinner size="small"}}<span>{{i18n
"upload_selector.processing"
}}</span>
{{else}} {{else}}
{{loading-spinner size="small"}}<span>{{i18n
"upload_selector.uploading"
}}
{{this.uploadProgress}}%</span>
{{/if}}
{{#if this.isCancellable}}
<a
href
id="cancel-file-upload"
{{on "click" this.cancelUpload}}
>{{d-icon "times"}}</a>
{{/if}}
</div>
{{/if}}
<div class={{if this.isUploading "hidden"}} id="draft-status">
{{#if this.model.draftStatus}}
<span class="draft-error" title={{this.model.draftStatus}}>
{{#if this.model.draftConflictUser}}
{{avatar this.model.draftConflictUser imageSize="small"}}
{{d-icon "user-edit"}}
{{else}}
{{d-icon "exclamation-triangle"}}
{{/if}}
{{#unless this.site.mobileView}}
{{this.model.draftStatus}}
{{/unless}}
</span>
{{/if}}
</div>
{{#unless this.site.mobileView}}
<DButton <DButton
@action={{action "togglePreview"}} @action={{action "togglePreview"}}
@translatedTitle={{this.toggleText}} @translatedTitle={{this.toggleText}}
@ -366,7 +368,7 @@
(unless this.showPreview "active") (unless this.showPreview "active")
}} }}
/> />
{{/if}} {{/unless}}
</div> </div>
</div> </div>
{{else}} {{else}}

View File

@ -337,7 +337,8 @@ html.composer-open {
.save-or-cancel { .save-or-cancel {
align-items: center; align-items: center;
display: flex; display: flex;
flex: 1 1 auto; flex: 0 1 auto;
margin-right: 1em;
.btn-primary { .btn-primary {
flex: 0 0 auto; flex: 0 0 auto;
@ -357,32 +358,36 @@ html.composer-open {
color: var(--danger); color: var(--danger);
} }
} }
}
#draft-status, #draft-status,
#file-uploading { #file-uploading {
margin-left: 25px; color: var(--primary-high);
margin-right: 0.5em;
} }
#file-uploading { #file-uploading {
display: flex; display: flex;
align-items: center; align-items: center;
a { a {
margin-left: 5px; margin-left: 0.33em;
color: var(--primary-high); color: var(--primary-high);
} }
.spinner { .spinner {
margin-right: 5px; margin-right: 0.33em;
} }
} }
#draft-status .d-icon-user-edit {
#draft-status {
margin-left: auto;
.d-icon-user-edit {
color: var(--danger); color: var(--danger);
font-size: 20px; font-size: 20px;
vertical-align: -5.5px; vertical-align: -5.5px;
} }
+ .btn-mini-toggle {
margin-left: 0;
} }
#draft-status,
#file-uploading {
color: var(--primary-high);
} }
#file-uploader { #file-uploader {
@ -595,7 +600,7 @@ body:not(.ios-safari-composer-hacks) {
} }
.toggle-preview { .toggle-preview {
margin-left: 8px; margin-left: auto;
transition: all 0.33s ease-out; transition: all 0.33s ease-out;
&.active { &.active {

View File

@ -226,7 +226,6 @@ a.toggle-preview {
#draft-status, #draft-status,
#file-uploading { #file-uploading {
flex-grow: 1;
text-align: right; text-align: right;
} }

View File

@ -101,8 +101,18 @@
.submit-panel { .submit-panel {
margin-top: 6px; margin-top: 6px;
flex-wrap: wrap;
gap: 0.25em 0;
.create {
max-width: 50vw;
span {
@include ellipsis;
}
}
.save-or-cancel { .save-or-cancel {
margin-right: 0.5em;
flex: 1 1 auto; flex: 1 1 auto;
#draft-status, #draft-status,