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:
@@ -53,3 +53,21 @@ def make_say(client):
|
||||
for chunk in split_message(text):
|
||||
await client.room_send(room_id, "m.room.message", thread_content(chunk, thread_root))
|
||||
return say
|
||||
|
||||
|
||||
def reply_content(text, reply_to_event_id):
|
||||
"""Build a plain (non-threaded) reply: shows in the MAIN timeline as a reply to
|
||||
reply_to_event_id, unlike thread_content() which lands the message inside a thread."""
|
||||
content = {"msgtype": "m.text", "body": text}
|
||||
if reply_to_event_id:
|
||||
content["m.relates_to"] = {"m.in_reply_to": {"event_id": reply_to_event_id}}
|
||||
return content
|
||||
|
||||
|
||||
def make_reply(client):
|
||||
"""Return an async reply(room_id, text, reply_to) that posts a plain main-timeline reply —
|
||||
the brief 'proposed X — see thread' nudge alongside the in-thread proposal card."""
|
||||
async def reply(room_id, text, reply_to):
|
||||
for chunk in split_message(text):
|
||||
await client.room_send(room_id, "m.room.message", reply_content(chunk, reply_to))
|
||||
return reply
|
||||
|
||||
Reference in New Issue
Block a user