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:
@@ -22,6 +22,15 @@ def test_store_put_get_pop():
|
||||
assert s.pop("$missing") is None
|
||||
|
||||
|
||||
def test_store_any_pending():
|
||||
s = proposals.ProposalStore()
|
||||
assert not s.any_pending()
|
||||
s.put("$r", SAMPLE)
|
||||
assert s.any_pending()
|
||||
s.pop("$r")
|
||||
assert not s.any_pending()
|
||||
|
||||
|
||||
def test_interpret_yes_variants():
|
||||
for t in ("yes", "Y", "approve", " ok ", "👍"):
|
||||
assert proposals.interpret_reply(t)[0] == "approve", t
|
||||
@@ -87,6 +96,15 @@ def test_render_meeting_note_variant():
|
||||
assert "meeting note" in proposals.render(note).lower()
|
||||
|
||||
|
||||
def test_summary_line_new_vs_note():
|
||||
new_line = proposals.summary_line(SAMPLE)
|
||||
assert "Acme Capital" in new_line and "new investor" in new_line.lower()
|
||||
note_line = proposals.summary_line(dict(SAMPLE, intent="meeting_note"))
|
||||
assert "Acme Capital" in note_line and "meeting note" in note_line.lower()
|
||||
# the nudge must point the user to the thread, where the actual action lives
|
||||
assert "thread" in new_line.lower()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
fns = [v for k, v in sorted(globals().items()) if k.startswith("test_") and callable(v)]
|
||||
for fn in fns:
|
||||
|
||||
Reference in New Issue
Block a user