Add hey thread comment for private thread notes
The gap
hey reply mails a reply. There is no CLI for the other thing a thread holds: a private internal note. Those notes show up as kind: "comment" in hey thread read, but you could only add them in the web app.
The comments write is not in hey-sdk OpenAPI. Empty or wrong form fields can create a blank comment, so this has to post a specific field.
The change
hey thread comment <thread-id> -m "..." posts a private internal note, not a mailed reply.
POST /topics/{topic_id}/comments?account_id={account_id}viaClient.PostForm(same redirect-capturing form path as collections, snippets, and publications)- Body:
comment[content]=<plain text>ā sent exactly as typed, not converted from Markdown - Success is
302 Location: /imbox; the redirect is not followed - Account ID comes from
Topics().Getso All Accounts still posts against the thread's mail account - After a successful post,
hey thread readshows the note askind: "comment"
--message/-m is required and cannot be blank.
Tests
internal/cmd/thread_comment_test.go checks the POST path and query, form field, Accept: */*, Content-Type: application/x-www-form-urlencoded, that Markdown-looking text is sent verbatim, that missing/empty -m and a bad thread ID make no request, and that /imbox is not followed.
TMPDIR=/tmp/t GOWORK=off make check is green. (Without the short TMPDIR, three pre-existing TUI unix-socket tests fail to bind on this machine; they are unrelated to this change.)
Summary by cubic
Adds hey thread comment <thread-id> -m "..." so private internal thread notes can be posted from the CLI. Previously these notes could be read via hey thread read but only created in the web app.
New Features
- Posts to
/topics/{id}/commentsthroughPostFormsince the comments write is not in the SDK OpenAPI. - Sends the message exactly as typed rather than converting Markdown, unlike other
-mflags. - Requires non-blank
-m; treats the 302 to/imboxas success and does not follow it.