mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
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:
6 files changed
+569
-200
No files matched your search
@@ -85,10 +85,9 @@ func TestUsageErrorsPrecedeRequests(t *testing.T) {
|
||||
{[]string{"milestone", "issue", "remove", "7", "1", "1", "--no-input"}, "resource 1 is selected more than once"},
|
||||
{[]string{"milestone", "list", "--limit", "1001"}, `"-L, --limit" flag: must be 1..1000`},
|
||||
{[]string{"milestone", "list", "--state", "merged"}, "--state must be open, closed, or all"},
|
||||
{[]string{"notification", "list", "--status", "invalid"}, "--status must contain unread, read, or pinned"},
|
||||
{[]string{"notification", "list", "--type", "invalid"}, "--type must contain issue, pull, commit, or repository"},
|
||||
{[]string{"notification", "list", "--status", "invalid"}, "--status must be unread, read, or pinned"},
|
||||
{[]string{"notification", "list", "--type", "invalid"}, "--type must be issue, pull, commit, or repository"},
|
||||
{[]string{"notification", "list", "--limit", "many"}, `"-L, --limit" flag: must be 1..1000`},
|
||||
{[]string{"notification", "list", "--mine", "-R", "alice/project"}, "--mine and --repo are mutually exclusive"},
|
||||
{[]string{"notification", "list", "--since="}, "invalid --since: use a date, RFC3339 timestamp, or duration such as 24h"},
|
||||
{[]string{"notification", "list", "--since=1h", "--before=2h"}, "--since must not be later than --before"},
|
||||
{[]string{"notification", "mark-read"}, "supply notification IDs or --all"},
|
||||
@@ -96,8 +95,8 @@ func TestUsageErrorsPrecedeRequests(t *testing.T) {
|
||||
{[]string{"notification", "mark-read", "1", "--status", "unread"}, "--status and --before require --all"},
|
||||
{[]string{"notification", "mark-read", "--all", "--before="}, "invalid --before: use a date, RFC3339 timestamp, or duration such as 24h"},
|
||||
{[]string{"notification", "mark-read", "9", "09"}, "resource 9 is selected more than once"},
|
||||
{[]string{"notification", "watch", "--interval", "0s"}, "--interval and --timeout must be positive"},
|
||||
{[]string{"notification", "watch", "--timeout", "0s"}, "--interval and --timeout must be positive"},
|
||||
{[]string{"notification", "watch", "--interval", "0s"}, "--interval must be positive and --timeout not negative"},
|
||||
{[]string{"notification", "watch", "--timeout", "-1s"}, "--interval must be positive and --timeout not negative"},
|
||||
{[]string{"notification", "watch", "--before=-1h"}, "invalid --before: relative duration cannot be negative"},
|
||||
{[]string{"org", "create", "team", "--visibility", "unknown"}, "--visibility must be public, limited, or private"},
|
||||
{[]string{"org", "edit", "team"}, "supply organization fields to edit"},
|
||||
|
||||
Reference in new issue
Block a user