Repository source: docs/plans/backlog/improve_messaging.txt
I reviewed the inbox, sent, and conversation pages (the one existing thread, with user "thanks") without sending anything, so send behaviour, error states and unread handling are untested. The instructions for the coding agents follow.
**Instructions for coding agents: private messaging usability pass**
Restructure the mailbox around conversations instead of individual messages. Today the inbox and sent pages each render one full card per message, so the sent page shows nine separate cards all addressed to the same person. Replace both with a single Messages list that has one row per counterpart, showing the username, a one-line preview of the latest message, its time, and an unread indicator, sorted by most recent activity. The whole row should be a link to the conversation. If a separate Sent view is kept, make it a filter of the same list and give the active tab a visible selected style; the Inbox · Sent links currently look identical even though `aria-current` is set, and neither is marked on the conversation page.
Add a way to start a message from the Messages page. There is no compose or "New message" control on inbox or sent, so the only entry point is an existing conversation link. Add a "New message" action with a username field (autocomplete from the user list) that routes to that user's conversation page. Also add an unread count to the Messages item in the top navigation.
Make the conversation page behave like a chat. It currently opens at the oldest message with the compose form at the very bottom of a roughly 2,300-pixel page, so replying to a ten-message thread requires scrolling the whole history. On load, scroll to the newest message and focus the compose box, or pin the composer to the bottom of the viewport. Load older history on demand rather than rendering everything. Shrink the composer: drop the "Message thanks" heading and the redundant "Message" label in favour of a placeholder, start the textarea at two or three rows and grow it automatically, send on Enter (or Ctrl/Cmd+Enter) with Shift+Enter for a newline, and append the sent message in place without a full reload. Keep the encryption note as a single muted line under the box.
Make each message compact and directional. Each message now uses a tall card with "To: thanks" or "From: thanks" and "Sent: …" on separate lines, and the only cue for who is speaking is the word To versus From. In a conversation, drop those labels and distinguish sent from received by alignment and background colour, with the time shown small beside the message. Group consecutive messages from the same sender and add date separators. This should fit roughly three to four times as many messages per screen.
Fix timestamps. They are shown as raw ISO UTC strings such as `2026-10-09T19:37:24Z`. Render them in the viewer's local time in a short relative or friendly form ("2:37 PM", "Yesterday", "Oct 9"), keep the exact value in a `<time datetime>` element, and show it in the title on hover.
Clarify the verification mark and fix its text. The checkmark's tooltip and `aria-label` read "Siganture verified"; correct it to "Signature verified". Make the mark quieter when verified, and make a failed or missing verification prominent, with a clear warning style and explanation, since that is the case the user needs to notice. Confirm that the hidden per-message reader-error element shows a readable message, with a retry, when decryption fails.
Tidy navigation and consistency. On the conversation page the counterpart's name is plain text in the heading and in every message; link the heading to their profile and add a clear back link to the Messages list. Add an empty state to the list ("No messages yet" plus the New message action). Page titles and headings are inconsistent ("Inbox" versus "Sent Messages"); align them. Add pagination or incremental loading to the list, since none exists now.