Optimize message editor

This commit is contained in:
dtonon 2026-04-27 19:39:38 +01:00
parent 7b79b0914a
commit e94764b865
2 changed files with 10 additions and 10 deletions

View file

@ -357,7 +357,7 @@
onblur={onTextareaBlur}
aria-autocomplete="list"
aria-controls={mentionOpen ? "mention-listbox" : undefined}
class="w-full rounded-t border border-gray-200 px-3 py-2 focus:outline-none focus:ring-1 focus:ring-brand disabled:opacity-50 resize-none {minHeightClass}"
class="block w-full rounded-t border border-gray-200 px-3 py-2 focus:outline-none focus:ring-1 focus:ring-brand disabled:opacity-50 resize-y {minHeightClass}"
></textarea>
{#if mentionOpen}
<div

View file

@ -71,8 +71,11 @@
const source = (selectedText ?? post.content).trim();
if (!source) return;
const block = formatQuoteBlock(source, ref);
const sep = replyContent.length > 0 && !replyContent.endsWith("\n\n")
? replyContent.endsWith("\n") ? "\n" : "\n\n"
const sep =
replyContent.length > 0 && !replyContent.endsWith("\n\n")
? replyContent.endsWith("\n")
? "\n"
: "\n\n"
: "";
replyContent = replyContent + sep + block + "\n\n";
await tick();
@ -228,11 +231,7 @@
>
</div>
<div data-quote-post-index={index} id="post-{p.id}" class="scroll-mt-32">
<PostContent
content={p.content}
{profiles}
{threadEventAuthors}
/>
<PostContent content={p.content} {profiles} {threadEventAuthors} />
</div>
<div class="flex items-center justify-between mt-3">
<Reactions reactions={[]} zaps={0} />
@ -303,7 +302,8 @@
bind:this={editorEl}
bind:value={replyContent}
disabled={replying}
rows={4}
rows={8}
minHeightClass="min-h-[12rem]"
placeholder="Write a reply..."
contextPubkeys={allPosts.map((p) => p.pubkey)}
{threadEventAuthors}