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:
@@ -36,6 +36,9 @@ class ProposalStore:
|
||||
def has(self, thread_root):
|
||||
return thread_root in self._pending
|
||||
|
||||
def any_pending(self):
|
||||
return bool(self._pending)
|
||||
|
||||
|
||||
def _parse_edit(text):
|
||||
"""Parse 'edit field=value' (also 'field: value'); return (canonical_field, value) or None."""
|
||||
@@ -101,3 +104,11 @@ def render(proposal):
|
||||
lines.append("")
|
||||
lines.append("Reply **yes** to commit, **edit field=value** to change a field, or **no** to discard.")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def summary_line(proposal):
|
||||
"""A brief one-liner for the main-timeline nudge; the full card lives in the thread."""
|
||||
name = proposal.get("investor_name") or proposal.get("contact_name") or "?"
|
||||
if proposal.get("intent") == "meeting_note":
|
||||
return f"📝 Proposed a meeting note for **{name}** — see the thread to review & approve."
|
||||
return f"📇 Proposed a new investor: **{name}** — see the thread to review & approve."
|
||||
|
||||
Reference in New Issue
Block a user