fix(notification): read the inbox by default and stream watch as NDJSON

notification commands required a repository unless --mine was given.
They now act on the account's inbox (D17); -R, TEA_REPO or the new
--this-repo limit them to one repository, and --mine is a hidden no-op.

notification list is a table with ID, TYPE, REPOSITORY, SUBJECT ("#17
Improve greeting", bold when unread), STATE and UPDATED, a "Showing N of
M" line and an empty message on a terminal; piped rows add the status
and the URL. The ID links to the subject. JSON gains the subject number.

notification view shows the subject, its state and the latest comment,
then marks an unread notification as read. mark-read, mark-unread, pin
and unpin report each change ("Pinned notification 12
(alice/project#17)"), and --all confirms on a terminal and reports the
count. notification watch --json printed one array when it exited; it
now prints each change as one JSON object per line, prints a line per
change on a terminal, and runs until Ctrl-C there instead of stopping
after a minute.

Status and type filters complete and validate their values, notification
IDs complete from the inbox, and every command has examples.

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-11 23:50:46 +02:00
1 parent 014dba8512
commit 85034c524f
6 files changed
+569 -200

No files matched your search

-10
View File
@@ -415,8 +415,6 @@ func walkCommands(cmd *cobra.Command, visit func(*cobra.Command)) {
// have yet to complete; see TestHelpTextsAreComplete.
const (
shortsToFix = `
notification mark-read
notification mark-unread
pr review cancel-request
`
examplesToWrite = `
@@ -459,13 +457,6 @@ const (
milestone list
milestone reopen
milestone view
notification list
notification mark-read
notification mark-unread
notification pin
notification unpin
notification view
notification watch
pr attachment delete
pr attachment download
pr attachment edit
@@ -547,7 +538,6 @@ const (
label
milestone
milestone issue
notification
pr
pr attachment
pr comment