From c0a890d5f583a7e43305d44e9c81226782dec130 Mon Sep 17 00:00:00 2001 From: ChenyqThu <84364275+ChenyqThu@users.noreply.github.com> Date: Sun, 10 May 2026 20:49:19 -0700 Subject: [PATCH] docs: PR draft - update --unread + --until usage --- PR_DRAFT.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/PR_DRAFT.md b/PR_DRAFT.md index 418d7d7..f19eb14 100644 --- a/PR_DRAFT.md +++ b/PR_DRAFT.md @@ -35,6 +35,10 @@ wx biz-articles --account "Datawhale" wx biz-articles --since 2026-05-10 wx biz-articles --since 2026-05-01 --until 2026-05-10 +# Show only accounts with unread messages, one latest article per account +wx biz-articles --unread +wx biz-articles --unread --account "Datawhale" # combine: unread within specific account + # JSON output (for downstream piping) wx biz-articles --json wx biz-articles --since 2026-05-10 --json | jq '.[].url' @@ -66,6 +70,13 @@ Each article item includes: - New `extract_cdata` helper function strips CDATA wrappers from XML content - Results sorted by `pub_time` DESC (article publish time, not message receive time) +### `--unread` semantics + +- Queries `session.db` for `unread_count > 0` rows whose `chat_type == official_account`, intersects with `--account` filter if both provided +- Returns at most **one latest article per account** (dedupe by `account_username` after the global pub_time DESC sort) +- Aligns with the behavior of `wx unread --filter official` for fast "what unread accounts are there + what's the latest title" scanning +- Empty intersection short-circuits before scanning biz tables + ## Changes - `src/ipc.rs`: Add `BizArticles` IPC request variant