Skip to main content

Module compose

Module compose 

Source
Expand description

Send-mail compose modal — multi-line vim-style editor + CLI send.

Two abstractions live here, mirroring the PR-UI-4 approvals split:

  • Editor — pure-state vim-style multi-line buffer. apply_key takes a KeyEvent and returns an EditorAction so the surrounding App can react to commands like “send” / “cancel” without the editor itself knowing about the message bus.
  • MessageSender — write side. CliMessageSender shells out to teamctl send <agent> "<body>" (DM) or teamctl broadcast #<channel> "<body>" (broadcast), the same architectural discipline as PR-UI-4’s CliApprovalDecider. A direct INSERT INTO messages … from the UI would silently sidestep the channel-ACL + ratelimit + delivery hooks the CLI already runs through.

Vim keybindings shipped in PR-UI-5: insert mode (i/a/o, Esc back to Normal), Normal motions (h/j/k/l, arrows, 0/$), ex command shim (:w/:q/:wq), Ctrl+Enter to send, Esc-Esc to cancel. Word motions (w/b) and line ops (dd/yy/p) deferred to the PR-UI-7 polish cycle — flagged in the PR description.

Modules§

test_support

Structs§

CliMessageSender
Editor

Enums§

ComposeTarget
EditorAction
VimMode

Traits§

MessageSender