Skip to main content

render_row

Function render_row 

Source
pub fn render_row(
    row: &MessageRow,
    team: &TeamSnapshot,
    tab: MailboxTab,
) -> String
Expand description

Format a single row for the mailbox pane. Kept terse: prefix in brackets + one-line body. Multi-line bodies are flattened with a space so a single message stays one row in the pane.

Prefix is tab-aware (T-231, #462):

  • Inbox[<senderName>] for a DM, or [#channel] [<sender>] for a folded-in channel/wire row (recipient channel:…). The channel segment keeps the disambiguator-first labelling (T-249) so a broadcast stays distinct from a direct message now that both share the Inbox.
  • Sent[→<recipientName>]. Sender on a Sent row is always the focused agent (that’s the filter), so showing it is redundant. Operators want to see WHO the agent talked to; recipient resolution goes through crate::data::recipient_label which handles agent, channel:, and user: recipient shapes.
  • Channel (internal — the MailboxFirst feed) → [#channel] [<sender>], the two-segment T-249 shape.