Matrix intake: main-timeline nudge, clearer messages, note text in grid
Four bot-side UX fixes surfaced by the live smoke: - Post a brief pointer in the main timeline (a reply to the user's message) alongside the in-thread proposal card, so proposals aren't missed inside a thread. Pointer only — approvals still happen in the thread, where the note is visible (you can't make an informed yes/no without seeing it). - A bare yes/no typed in the main timeline while a proposal is pending now gets a "reply in the thread" redirect instead of "couldn't tell what to record." - Clearer commit confirmations: "Created a new grid entry for X" vs "Logged a note on X (existing grid entry)." - Send a blank communication subject when a note is present so the grid's one-line note summary shows the note text, not the "(Matrix)" label (provenance stays in source="matrix_intake").
This commit is contained in:
@@ -97,11 +97,16 @@ def build_commit_payload(proposal):
|
||||
"title": proposal.get("contact_title") or "",
|
||||
}
|
||||
note = proposal.get("note") or ""
|
||||
# The CRM's grid note line uses subject-or-body for its one-line summary, so a non-empty
|
||||
# subject hides the actual note text. Send a blank subject when there's a note (let the note
|
||||
# itself show in the grid); fall back to a provenance label only when there's nothing to
|
||||
# show. Provenance is recorded via source="matrix_intake" either way.
|
||||
intent_label = "Note (Matrix)" if proposal.get("intent") == "meeting_note" else "Intake (Matrix)"
|
||||
payload = {
|
||||
"contact": contact,
|
||||
"type": "note",
|
||||
"body": note,
|
||||
"subject": "Intake (Matrix)" if proposal.get("intent") != "meeting_note" else "Note (Matrix)",
|
||||
"subject": "" if note.strip() else intent_label,
|
||||
"append_note": True,
|
||||
"source": "matrix_intake",
|
||||
}
|
||||
@@ -123,5 +128,5 @@ def commit(proposal):
|
||||
row = (data.get("data") or {}).get("row") or {}
|
||||
name = row.get("investor_name") or payload.get("investor_name") or "investor"
|
||||
if proposal.get("_match_id"):
|
||||
return f"Logged note to **{name}**."
|
||||
return f"Added **{name}** to the grid" + (" with a note." if payload.get("body") else ".")
|
||||
return f"Logged a note on **{name}** (existing grid entry)."
|
||||
return f"Created a new grid entry for **{name}**" + (" and logged a note." if payload.get("body") else ".")
|
||||
|
||||
Reference in New Issue
Block a user