aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/messages.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/messages.js')
-rw-r--r--src/features/messages.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index 5040b0f..28e20f1 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -9960,6 +9960,7 @@ export function messagesFeature(ctx) {
// A textarea that grows with the reply, like the chat composer: Enter
// sends, Shift+Enter (or Ctrl+J) breaks the line — a reply used to be
// a one-line field with no way to write a paragraph.
+ h('div', { class: 'compose-box' },
h('coinos-text', {
class: 'thread-reply-input', placeholder: t('threadReplyHint'),
style: 'font-family:var(--sans);min-height:64px;max-height:160px',
@@ -9990,15 +9991,17 @@ export function messagesFeature(ctx) {
}
},
}),
+ h('div', { class: 'compose-tools' },
+ (ctx.uploadMedia || ctx.uploadImage) ? h('button', {
+ type: 'button', class: 'compose-tool', title: t('feedAttach'), 'aria-label': t('feedAttach'), disabled: !!ui.postUploading,
+ onClick: () => document.getElementById('reply-file')?.click(),
+ }, ui.postUploading ? h('span', { class: 'spinner sm' }) : h('span', { style: 'display:flex', html: CLIP })) : null,
+ gifs.button('reply', 'compose-tool gif-btn'))),
mentionList('.thread-reply-input'),
h('div', { class: 'row reply-tools wrap', style: 'gap:8px;align-items:center' },
// A reply can carry a picture too — same upload, same imeta tag, same
// paperclip. The URL lands in the draft, which is what every client
// reads as the media.
- (ctx.uploadMedia || ctx.uploadImage) ? h('button', {
- class: 'attach-btn', title: t('feedAttach'), 'aria-label': t('feedAttach'), disabled: !!ui.postUploading,
- onClick: () => document.getElementById('reply-file')?.click(),
- }, ui.postUploading ? h('span', { class: 'spinner sm' }) : h('span', { style: 'display:flex', html: CLIP })) : null,
h('input', {
type: 'file', id: 'reply-file', accept: 'image/*,video/*', style: 'display:none',
onChange: async (e) => {
@@ -10012,7 +10015,6 @@ export function messagesFeature(ctx) {
});
},
}),
- gifs.button('reply', 'attach-btn gif-btn'),
h('span', { class: 'grow' }),
h('div', { class: 'row gap6 composer-options' },
previewBtn(!!s.preview, () => { s.preview = !s.preview; render(); }),
@@ -10741,6 +10743,9 @@ export function messagesFeature(ctx) {
if (ui.profCompose == null && !draftFor(POST_DRAFT)) return null;
const text = composeText();
return h('div', { class: 'col', style: 'gap:8px' },
+ // the attach and GIF buttons sit in the field's corner: the row under
+ // it is for what you do with the post (Post, Preview, Cancel)
+ h('div', { class: 'compose-box' },
h('coinos-text', {
class: 'post-input', placeholder: t('profComposePh'),
style: 'font-family:var(--sans);min-height:84px;max-height:320px',
@@ -10759,6 +10764,12 @@ export function messagesFeature(ctx) {
if (ui.postPreview) render();
},
}),
+ h('div', { class: 'compose-tools' },
+ (ctx.uploadMedia || ctx.uploadImage) ? h('button', {
+ type: 'button', class: 'compose-tool', title: t('feedAttach'), 'aria-label': t('feedAttach'), disabled: !!ui.postUploading,
+ onClick: () => document.getElementById('post-file')?.click(),
+ }, ui.postUploading ? h('span', { class: 'spinner sm' }) : h('span', { style: 'display:flex', html: CLIP })) : null,
+ gifs.button('post', 'compose-tool gif-btn'))),
mentionList('.post-input'),
ui.postPreview ? draftPreview(text) : null,
mediaBar(),
@@ -10781,15 +10792,10 @@ export function messagesFeature(ctx) {
render();
}
} }, t('profPostBtn')),
- (ctx.uploadMedia || ctx.uploadImage) ? h('button', {
- class: 'attach-btn', title: t('feedAttach'), 'aria-label': t('feedAttach'), disabled: !!ui.postUploading,
- onClick: () => document.getElementById('post-file')?.click(),
- }, ui.postUploading ? h('span', { class: 'spinner sm' }) : h('span', { style: 'display:flex', html: CLIP })) : null,
h('input', {
type: 'file', id: 'post-file', accept: 'image/*,video/*', style: 'display:none',
onChange: async (e) => { const f = e.target.files && e.target.files[0]; e.target.value = ''; await attachMedia(f); },
}),
- gifs.button('post', 'attach-btn gif-btn'),
h('div', { class: 'row gap6 composer-options' },
previewBtn(!!ui.postPreview, () => { ui.postPreview = !ui.postPreview; render(); }),
h('button', { class: 'btn-ghost btn-sm', onClick: requestCancelPost }, t('cancel')))),