diff --git a/desktop/src/features/messages/lib/useRichTextEditor.ts b/desktop/src/features/messages/lib/useRichTextEditor.ts index dc65ccad9..69dc079eb 100644 --- a/desktop/src/features/messages/lib/useRichTextEditor.ts +++ b/desktop/src/features/messages/lib/useRichTextEditor.ts @@ -112,7 +112,9 @@ export function useRichTextEditor({ { extensions: [ StarterKit.configure({ - // Use hard breaks (Shift+Enter) — Enter submits the message. + // Hard-break node is kept enabled so pasted markdown that contains + // explicit hard breaks still round-trips, but Shift+Enter is rebound + // below (`smartShiftEnter`) to split into a real new paragraph. hardBreak: { keepMarks: true, }, @@ -258,8 +260,12 @@ export function useRichTextEditor({ // Non-empty → split the paragraph within the blockquote. return ed.chain().splitBlock().focus().run(); } - // Default: hard break (StarterKit handles it). - return false; + // Default: split into a real new paragraph. WYSIWYG parity + // with the rendered timeline — two paragraphs always have + // margin between them. Previously inserted a hard break + // (
), which produced a single \n on send and rendered + // visibly tighter than the post-send paragraph spacing. + return ed.chain().splitBlock().focus().run(); }, ArrowDown: ({ editor: ed }) => { // Empty last list item + Down → exit list to paragraph below. @@ -320,7 +326,7 @@ export function useRichTextEditor({ editorProps: { attributes: { class: - "min-h-0 resize-none overflow-y-hidden border-0 bg-transparent px-0 py-0 text-sm leading-6 md:leading-6 shadow-none focus-visible:ring-0 caret-foreground outline-hidden prose-sm max-w-none", + "min-h-0 resize-none overflow-y-hidden border-0 bg-transparent px-0 py-0 text-sm leading-7 md:leading-7 shadow-none focus-visible:ring-0 caret-foreground outline-hidden max-w-none", "data-testid": "message-input", }, // ArrowUp in an empty composer → edit your last message (Slack diff --git a/desktop/src/shared/styles/globals.css b/desktop/src/shared/styles/globals.css index 60bd597ec..843a62014 100644 --- a/desktop/src/shared/styles/globals.css +++ b/desktop/src/shared/styles/globals.css @@ -221,13 +221,64 @@ } /* ── Tiptap rich-text composer ──────────────────────────────────────── */ +/* + * Composer styles mirror the rendered Markdown timeline (see + * desktop/src/shared/ui/markdown.tsx, default variant) so the editor is + * visually WYSIWYG with the sent message. The owl rules `& > * + *` drive + * inter-block spacing, leaving an isolated single block (e.g. an empty + *