ui: align chat list and conversation buffer with mockups

Chat list (*signal*):
- Fringe ● now uses warning face (yellow), matching mockup's
  unread indicator color
- Modeline trailing dashes extended for visual balance

Conversation buffer (*signal:NAME*):
- Compose prompt > changed from bold to link face (blue),
  matching mockup's signal-blue prompt
- Attachment rendering: [attachment: ...] → [photo: ...]
- Modeline: (Signal Chat) → (Signal Chat Fill)
- Added header-line with key hints (RET send, M-RET newline,
  C-c C-g refresh), matching mockup's discoverability goal
This commit is contained in:
2026-06-14 13:00:29 -04:00
parent cedd82738a
commit 71691a5261
3 changed files with 16 additions and 9 deletions
+2 -2
View File
@@ -66,7 +66,7 @@
conversations) conversations)
:initial-value 0))) :initial-value 0)))
(setq mode-line-format (setq mode-line-format
(format " ⌁ %s %d chats %s %s (%s) ─ U:%%- ─ Top ───" (format " ⌁ %s %d chats %s %s (%s) ─ U:%%- ─ Top ────────────"
(propertize "*signal*" 'face 'bold) (propertize "*signal*" 'face 'bold)
total total
(if (> unread-total 0) (if (> unread-total 0)
@@ -109,7 +109,7 @@ CONV is a hash table with string keys from noise-db."
(t (concat sender ": " preview)))) (t (concat sender ": " preview))))
(preview-str (truncate-string-to-width preview-prefix 36 nil nil "")) (preview-str (truncate-string-to-width preview-prefix 36 nil nil ""))
(time-str (noise-chat-list--format-time timestamp))) (time-str (noise-chat-list--format-time timestamp)))
(concat " " fringe " " unread-str " " (concat " " (propertize fringe 'face 'warning) " " unread-str " "
(propertize (format "%-18s" name-str) 'face 'bold) " " (propertize (format "%-18s" name-str) 'face 'bold) " "
preview-str " " preview-str " "
(propertize time-str 'face 'shadow)))) (propertize time-str 'face 'shadow))))
+12 -5
View File
@@ -37,10 +37,17 @@
map) map)
"Keymap for `noise-conversation-mode'.") "Keymap for `noise-conversation-mode'.")
(defconst noise-conversation--mode-header
(concat (propertize "RET" 'face 'help-key-binding) " send "
(propertize "M-RET" 'face 'help-key-binding) " newline "
(propertize "C-c C-g" 'face 'help-key-binding) " refresh")
"Header line showing key hints for `noise-conversation-mode'.")
(define-derived-mode noise-conversation-mode text-mode "Signal Chat" (define-derived-mode noise-conversation-mode text-mode "Signal Chat"
"Major mode for a Noise Signal conversation buffer. "Major mode for a Noise Signal conversation buffer.
\\{noise-conversation-mode-map}" \\{noise-conversation-mode-map}"
:group 'noise) :group 'noise
(setq-local header-line-format noise-conversation--mode-header))
;;;###autoload ;;;###autoload
(defun noise-conversation-open (conversation-id) (defun noise-conversation-open (conversation-id)
@@ -107,7 +114,7 @@ Preserves any input already typed at the prompt."
(propertize (make-string noise-conversation--width ?─) (propertize (make-string noise-conversation--width ?─)
'face 'shadow) 'face 'shadow)
"\n" "\n"
(propertize "> " 'face 'bold)) (propertize "> " 'face 'link))
(add-text-properties (point-min) (point) (add-text-properties (point-min) (point)
'(read-only t '(read-only t
front-sticky (read-only) front-sticky (read-only)
@@ -149,7 +156,7 @@ Preserves any input already typed at the prompt."
(or (gethash "attachment_path" msg) "")))) (or (gethash "attachment_path" msg) ""))))
(setq body (concat body (if (string-empty-p body) "" " ") (setq body (concat body (if (string-empty-p body) "" " ")
(propertize (propertize
(format "[attachment: %s — RET to view]" file) (format "[photo: %s — RET to view]" file)
'face 'link))))) 'face 'link)))))
(let ((line (concat (propertize time-str 'face 'shadow) " " (let ((line (concat (propertize time-str 'face 'shadow) " "
(propertize name 'face 'bold) (propertize name 'face 'bold)
@@ -167,13 +174,13 @@ Preserves any input already typed at the prompt."
(defun noise-conversation--update-modeline () (defun noise-conversation--update-modeline ()
"Update the mode line with the E2E indicator and typing status." "Update the mode line with the E2E indicator and typing status."
(setq mode-line-format (setq mode-line-format
(format " %s %s %s%s ─ U:%%- ─ Bot ───" (format " %s %s %s%s ─ U:%%- ─ Bot ───────────"
(propertize "⌁ E2E" 'face 'success) (propertize "⌁ E2E" 'face 'success)
(propertize (buffer-name) 'face 'bold) (propertize (buffer-name) 'face 'bold)
(if noise-conversation--typing (if noise-conversation--typing
(format "%s is typing… " noise-conversation--typing) (format "%s is typing… " noise-conversation--typing)
"") "")
"(Signal Chat)")) "(Signal Chat Fill)"))
(force-mode-line-update)) (force-mode-line-update))
;;; Composing and sending ;;; Composing and sending
+2 -2
View File
@@ -132,7 +132,7 @@
(should (string= "draft text" (noise-conversation--current-input)))))) (should (string= "draft text" (noise-conversation--current-input))))))
(ert-deftest noise-conversation-format-attachment () (ert-deftest noise-conversation-format-attachment ()
"Attachment messages render the [attachment: ...] hint." "Attachment messages render the [photo: ...] hint."
(noise-conversation-test--with-db (noise-conversation-test--with-db
(noise-conversation-test--seed) (noise-conversation-test--seed)
(noise-db-insert-message "+1" :timestamp 1717930300.0 (noise-db-insert-message "+1" :timestamp 1717930300.0
@@ -140,7 +140,7 @@
:has-attachment t :has-attachment t
:attachment-path "IMG_2041.jpg") :attachment-path "IMG_2041.jpg")
(with-current-buffer (noise-conversation-open "+1") (with-current-buffer (noise-conversation-open "+1")
(should (string-match-p "\\[attachment: IMG_2041\\.jpg — RET to view\\]" (should (string-match-p "\\[photo: IMG_2041\\.jpg — RET to view\\]"
(buffer-string)))))) (buffer-string))))))
(ert-deftest noise-conversation-typing-indicator () (ert-deftest noise-conversation-typing-indicator ()