Multi-line messages with Shift+Enter on every service #305

Closed
opened 2026-10-07 20:43:15 -04:00 by Salastil · 1 comment
Owner

Decided: Shift+Enter makes a new line everywhere, IRC included. Now Shift+Enter does nothing (Composer.tsx:861-864) and pasted text is flattened to one line (440).

Daemon work per service:

  • IRC (nobilis/src/backend/irc/send.rs, send_plain): split on \n first. With draft/multiline, send one batch in which line boundaries do not carry draft/multiline-concat (wrapped pieces of a long line still do); without it, each line is its own PRIVMSG. Strip \r. Only the first line is parsed as a /command.
  • Discord, Matrix: native newlines (Matrix markup.rs already emits <br/>).
  • Sneedchat: received messages use [br]; check how the site's send path treats \n and convert if needed.
  • Kick: single-line chat - newlines become spaces.

Verified on the wire against the fake IRC server, with and without draft/multiline.

Part of the v1.0 UI pass.

Decided: Shift+Enter makes a new line everywhere, IRC included. Now Shift+Enter does nothing (Composer.tsx:861-864) and pasted text is flattened to one line (440). **Daemon work per service:** - **IRC** (`nobilis/src/backend/irc/send.rs`, `send_plain`): split on `\n` first. With `draft/multiline`, send one batch in which line boundaries do *not* carry `draft/multiline-concat` (wrapped pieces of a long line still do); without it, each line is its own PRIVMSG. Strip `\r`. Only the first line is parsed as a `/command`. - **Discord, Matrix:** native newlines (Matrix `markup.rs` already emits `<br/>`). - **Sneedchat:** received messages use `[br]`; check how the site's send path treats `\n` and convert if needed. - **Kick:** single-line chat - newlines become spaces. Verified on the wire against the fake IRC server, with and without `draft/multiline`. _Part of the v1.0 UI pass._
Salastil added this to the v1.0 milestone 2026-10-07 20:43:15 -04:00
Salastil added the feature label 2026-10-07 20:43:15 -04:00
Author
Owner

Finished: 9ba630c.

Before (top) and after (bottom), three lines typed with Shift+Enter:

multiline

  • Shift+Enter is a new line, on every service; Enter still sends; pasted line breaks stay (they used to be flattened to spaces).
  • IRC (nobilis irc/send.rs, drafts.rs): the lines the person wrote go as one draft/multiline batch where the network offers it - and a line's first piece does not carry multiline-concat, so the breaks arrive as breaks (only the pieces of a line too long for the wire are joined) - and as one message per line where it does not. A command (/me ...) must be one line.
  • Discord, Matrix: newlines go through as they are (Matrix's formatter already emits <br/>).
  • Sneedchat: a break is sent as [br], which is how the site writes one and how every incoming message already says it.
  • Kick: chat is one line, so breaks become spaces.

Checked on the wire in the isolated test copy against a fake IRC server. Without the capability the three lines arrived as three PRIVMSGs; with draft/multiline offered they arrived as BATCH +ml... draft/multiline, three tagged PRIVMSGs with no concat, and BATCH -ml..., and showed up in the log as one message of three lines. Unit tests cover the line planning (breaks, long lines, blank lines), Sneedchat's [br] and Kick's single line.

Not tested against a live Sneedchat room (posting there needs your say-so) - the [br] form is what the site itself writes, but whether it renders the same from a sent message is worth one real try.

Finished: [9ba630c](https://git.salastil.com/Salastil/moho/commit/9ba630cb170f31f60306073cc013669d11d7b11f). Before (top) and after (bottom), three lines typed with Shift+Enter: ![multiline](https://git.salastil.com/attachments/2f1df2f7-ff93-45b3-bae8-3fb94ec6a779) - **Shift+Enter is a new line**, on every service; Enter still sends; **pasted line breaks stay** (they used to be flattened to spaces). - **IRC** (nobilis `irc/send.rs`, `drafts.rs`): the lines the person wrote go as one **`draft/multiline` batch** where the network offers it - and a line's first piece does *not* carry `multiline-concat`, so the breaks arrive as breaks (only the pieces of a line too long for the wire are joined) - and as **one message per line** where it does not. A command (`/me ...`) must be one line. - **Discord, Matrix**: newlines go through as they are (Matrix's formatter already emits `<br/>`). - **Sneedchat**: a break is sent as `[br]`, which is how the site writes one and how every incoming message already says it. - **Kick**: chat is one line, so breaks become spaces. Checked on the wire in the isolated test copy against a fake IRC server. Without the capability the three lines arrived as three `PRIVMSG`s; with `draft/multiline` offered they arrived as `BATCH +ml... draft/multiline`, three tagged `PRIVMSG`s with no `concat`, and `BATCH -ml...`, and showed up in the log as one message of three lines. Unit tests cover the line planning (breaks, long lines, blank lines), Sneedchat's `[br]` and Kick's single line. Not tested against a live Sneedchat room (posting there needs your say-so) - the `[br]` form is what the site itself writes, but whether it renders the same from a sent message is worth one real try.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#305