updates
ober
2972730fd9518ae53b3815f63274977776708bf4
--- a/README.md +++ b/README.md @@ -68,12 +68,8 @@ make tui-shim The TUI opens `signal-cli jsonRpc --receive-mode manual`, then subscribes with `subscribeReceive` once the app reader is active, so new Signal events arrive -while it is running without racing the UI startup. Shift+Up / Shift+Down move the -selected conversation up or down the list, so you can keep the people you talk -to at the top and push the rest down (your terminal must forward modified arrow -keys; ordering is per-session since history is in memory). At startup it -preloads active groups -and known contacts into the conversation pane. The current interface keeps +while it is running without racing the UI startup. At startup it preloads +active groups and known contacts into the conversation pane. The current interface keeps in-memory conversations for this session, routes incoming messages, edits, reactions, deletes, calls, receipts, and typing events into threads, and sends plain text from the @@ -95,7 +91,7 @@ list. Deleted conversations are remembered in relaunches, even though signal-cli (a linked device) keeps re-syncing your phone's contacts. If a removed person messages you again the thread reappears; to remove someone from your Signal account everywhere, delete them on your phone -too. Use q, Esc, or Ctrl-C to quit. +too. Use Ctrl-Q or Ctrl-C to quit. ## Encrypted message log --- a/signal/tui/main.ss +++ b/signal/tui/main.ss @@ -555,39 +555,6 @@ [(>= index count) (- count 1)] [else index])) - ;; Reorder the conversation list so the user can keep the people they talk to - ;; at the top. Shift+Up/Down moves the selected conversation by one slot; the - ;; selection follows the moved item so it can be nudged repeatedly. Order is - ;; session-only for now, since history is in memory. - (def (move-conversation! state delta) - (let* ([conversations (tui-state-conversations state)] - [count (length conversations)] - [from (clamp-index (tui-state-selected-index state) count)] - [to (+ from delta)]) - (cond - [(< count 2) (void)] - [(< to 0) (tui-state-status-set! state "Already at the top.")] - [(>= to count) (tui-state-status-set! state "Already at the bottom.")] - [else - (let ([reordered (swap-list conversations from to)]) - (tui-state-conversations-set! state reordered) - (tui-state-selected-index-set! state to) - (tui-state-status-set! - state - (string-append "Moved " - (conversation-title (list-ref reordered to)) - (if (< delta 0) " up." " down."))))]))) - - (def (swap-list xs i j) - (let ([v (list->vector xs)]) - (let ([tmp (vector-ref v i)]) - (vector-set! v i (vector-ref v j)) - (vector-set! v j tmp)) - (vector->list v))) - - (def (shift? mod) - (not (= (bitwise-and mod TB_MOD_SHIFT) 0))) - (def (non-empty-string? s) (and (string? s) (not (string=? s "")))) @@ -884,14 +851,10 @@ (def (handle-chat-event! state actor ev) (let ([key (tui-event-key ev)] - [ch (tui-event-ch ev)] - [mod (tui-event-mod ev)]) + [ch (tui-event-ch ev)]) (cond - [(or (= key TB_KEY_ESC) - (= key TB_KEY_CTRL_C) - (= key TB_KEY_CTRL_Q) - (and (> ch 0) (char=? (integer->char ch) #\q) - (string=? (tui-state-input state) ""))) + [(or (= key TB_KEY_CTRL_C) + (= key TB_KEY_CTRL_Q)) (tui-state-quit?-set! state #t)] [(= key TB_KEY_CTRL_N) (open-new-message! state)] @@ -913,13 +876,9 @@ (tui-state-input-set! state "") (tui-state-status-set! state "Composer cleared.")] [(= key TB_KEY_ARROW_UP) - (if (shift? mod) - (move-conversation! state -1) - (select-conversation! state (- (tui-state-selected-index state) 1)))] + (select-conversation! state (- (tui-state-selected-index state) 1))] [(= key TB_KEY_ARROW_DOWN) - (if (shift? mod) - (move-conversation! state 1) - (select-conversation! state (+ (tui-state-selected-index state) 1)))] + (select-conversation! state (+ (tui-state-selected-index state) 1))] [(= key TB_KEY_ENTER) (if (string=? (tui-state-input state) "") (tui-state-status-set! state "No message entered.") @@ -2322,7 +2281,7 @@ (draw-text! (+ x 1) y (- width 2) (status-fg) (status-bg) (string-append "TUI | " (tui-state-status state) - " | Ctrl-N new Ctrl-F find Ctrl-U attach Ctrl-T theme Ctrl-D del q quit"))) + " | Ctrl-N new Ctrl-F find Ctrl-U attach Ctrl-T theme Ctrl-D del Ctrl-Q quit"))) (def (draw-cursor! state width composer-y) (cond