Send pick-any checks with Other text; keep inbox focus across updates

This commit is contained in:
Ian Gulliver
2026-10-14 23:54:13 -07:00
parent 2b4d92e7d5
commit 75c76eff0a
11 changed files with 184 additions and 134 deletions
+3
View File
@@ -372,6 +372,9 @@ func deliveryMessage(pending []store.Pending) string {
for _, o := range *r.Options {
fmt.Fprintf(b, "- %s\n", o)
}
if r.Text != nil && strings.TrimSpace(*r.Text) != "" {
fmt.Fprintf(b, "%s added: %s\n", r.User, *r.Text)
}
} else {
fmt.Fprintf(b, "%s chose: %s\n", r.User, (*r.Options)[0])
}
+2 -2
View File
@@ -219,7 +219,7 @@ func TestDeliveryMessage(t *testing.T) {
msg := deliveryMessage([]store.Pending{
{Item: question, Response: api.InboxResponse{User: "alice", Type: api.Option, Options: opts("blue")}},
{Item: checklist, Response: api.InboxResponse{User: "alice", Type: api.Option, Options: opts("tests", "docs")}},
{Item: checklist, Response: api.InboxResponse{User: "alice", Type: api.Option, Options: opts("tests", "docs"), Text: str("also run go vet")}},
{Item: question, Response: api.InboxResponse{User: "bob", Type: api.Other, Text: str("what is it for?"),
Attachments: []api.Attachment{{Kind: api.AttachmentKindUrl, Url: str("https://example.com")}}}},
{Item: failure, Response: api.InboxResponse{User: "alice", Type: api.Other, Text: str("stop and write tests")}},
@@ -228,7 +228,7 @@ func TestDeliveryMessage(t *testing.T) {
for _, want := range []string{
"Your question q1: Which color?",
"alice chose: blue",
"Your question q2: Which chores?\nalice checked:\n- tests\n- docs\n",
"Your question q2: Which chores?\nalice checked:\n- tests\n- docs\nalice added: also run go vet\n",
"bob answered (none of your options): what is it for?",
`calling ask_human with thread_id "q1"`,
`"url":"https://example.com"`,