Editing: Up edits your last message, multi-line editor, delete on empty #300

Closed
opened 2026-10-07 20:43:12 -04:00 by Salastil · 2 comments
Owner

The composer's only ArrowUp handling drives autocomplete (Composer.tsx:823, 844). Edit is only in the context menu (MessageRow.tsx:509-518). The editor is a one-line input.

Discord and Element: Up in an empty box edits your last message; the editor is multi-line with a hint; clearing it offers to delete.

Fix: Up in an empty composer edits your last message; a multi-line editor reusing the composer's formatting/serialisation (lib/composeFormat.ts), with an "esc to cancel · enter to save" hint; an empty edit offers delete; "(edited)" shows the edit time on hover where the service provides it. (The blur-discards-edit bug is filed separately.)

Part of the v1.0 UI pass.

The composer's only ArrowUp handling drives autocomplete (Composer.tsx:823, 844). Edit is only in the context menu (MessageRow.tsx:509-518). The editor is a one-line input. Discord and Element: Up in an empty box edits your last message; the editor is multi-line with a hint; clearing it offers to delete. **Fix:** Up in an empty composer edits your last message; a multi-line editor reusing the composer's formatting/serialisation (`lib/composeFormat.ts`), with an "esc to cancel · enter to save" hint; an empty edit offers delete; "(edited)" shows the edit time on hover where the service provides it. (The blur-discards-edit bug is filed separately.) _Part of the v1.0 UI pass._
Salastil added this to the v1.0 milestone 2026-10-07 20:43:12 -04:00
Salastil added the feature label 2026-10-07 20:43:12 -04:00
Author
Owner

Mostly done in 6a82c32; leaving this open for the last item.

editor

Done:

  • Up arrow in an empty message box edits your last message (Discord, Sneedchat, Matrix; only chat lines of yours with text that are not still sending).
  • The editor is multi-line (Shift+Enter for a new line, Enter saves, Escape cancels), keeps its place when it loses focus, and shows "escape to cancel · enter to save".
  • An empty save asks "Nothing left. Delete the message instead?" with Delete / Keep editing.
  • Checked in the test copy with real key events: Up opened the editor with the message's text, clicking away kept it open, Enter on empty asked, Escape closed.

Not done: "(edited)" showing the edit time on hover. The message has only an edited flag on the wire, not when; the daemon would need to carry the edit timestamp (Discord gives edited_timestamp, Matrix the replacing event's time) first.

Mostly done in [6a82c32](https://git.salastil.com/Salastil/moho/commit/6a82c3261c4c925e17f4a1f57999c96e7ab91c3e); leaving this open for the last item. ![editor](https://git.salastil.com/attachments/a99fc419-9382-4cca-a3d0-8e44a13e4442) Done: - **Up arrow in an empty message box edits your last message** (Discord, Sneedchat, Matrix; only chat lines of yours with text that are not still sending). - **The editor is multi-line** (Shift+Enter for a new line, Enter saves, Escape cancels), keeps its place when it loses focus, and shows "escape to cancel · enter to save". - **An empty save asks** "Nothing left. Delete the message instead?" with Delete / Keep editing. - Checked in the test copy with real key events: Up opened the editor with the message's text, clicking away kept it open, Enter on empty asked, Escape closed. Not done: **"(edited)" showing the edit time on hover.** The message has only an `edited` flag on the wire, not when; the daemon would need to carry the edit timestamp (Discord gives `edited_timestamp`, Matrix the replacing event's time) first.
Author
Owner

Finished: 7f4c356.

The last piece of this one - the edit time. Up-to-edit, the multi-line editor with its hint and the offer to delete on an empty edit were done earlier in the pass; "(edited)" now says when on hover.

  • Daemon (nobilis e51f139): Message.editedTs (Unix seconds). It rides in the existing edited column with no schema change: 0 never edited, 1 edited at a time nobody wrote down, anything above that is the time. A live edit - Discord's message update, a Matrix replacement, Sneedchat's - is stamped with when it was seen, and the messageUpdated event carries it so the open window updates at once. Test: an_edit_is_stamped_with_when_it_was_seen; clippy and 861 daemon tests pass.
  • Window: the tag's tooltip reads "Edited " where it is known, and plain "Edited" for an edit that was already there when the message was first read (history does not say when, and the service's own edit stamp is not kept for those yet).
  • No picture: the change is a native tooltip, which a screenshot cannot capture.
Finished: [7f4c356](https://git.salastil.com/Salastil/moho/commit/7f4c356eb3dba80769c28777aa6c3a0de3f5af92). The last piece of this one - the edit time. Up-to-edit, the multi-line editor with its hint and the offer to delete on an empty edit were done earlier in the pass; "(edited)" now says when on hover. - **Daemon (nobilis e51f139):** `Message.editedTs` (Unix seconds). It rides in the existing `edited` column with no schema change: 0 never edited, 1 edited at a time nobody wrote down, anything above that is the time. A live edit - Discord's message update, a Matrix replacement, Sneedchat's - is stamped with when it was seen, and the `messageUpdated` event carries it so the open window updates at once. Test: `an_edit_is_stamped_with_when_it_was_seen`; clippy and 861 daemon tests pass. - **Window:** the tag's tooltip reads "Edited <full time>" where it is known, and plain "Edited" for an edit that was already there when the message was first read (history does not say when, and the service's own edit stamp is not kept for those yet). - No picture: the change is a native tooltip, which a screenshot cannot capture.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#300