[PATCH RFC 00/11] review: track and browse every version of a tracked series

Christian Brauner <[email protected]> Sat, 18 Jul 2026 00:37:36 +0200
Newsgroups org.kernel.linux.tools
Message-ID <[email protected]>
The review TUI binds all mail visibility to the revision a series is
tracked at: 'e' opens only the tracked thread, unread badges exist
only on the series row, and u/U updates poll only the tracked
revision.  Earlier versions of a series -- and the discussion that
shaped it -- are invisible even though the revisions catalog knows
they exist.

Make every known version of a tracked series a first-class citizen of
the mail-tracking machinery:

- The revisions catalog grows per-revision message counts (schema
  v11).  Reads stitch the series row over the catalog so the tracked
  revision's live counts win while archived upgrade leftovers never
  shadow anything.

- u/U updates poll every cataloged revision for new mail using the
  same incremental thread queries used elsewhere: zero database
  writes when a thread is quiet, a full refetch plus git-blob caching
  when something new arrived.  Rethreaded revisions sum their
  per-patch threads.

- A new "Find older revisions" action runs the b4 am/mbox backward
  search (change-id query when the cover carries one, subject+sender
  otherwise) with an explicit wantvers covering every previous
  version, records what it finds, and polls the new entries
  immediately so they arrive with counts and cached threads.  A
  retitled series without a change-id still needs manual linking --
  the same limitation b4 am -vN has.

- The tracker list gains expandable per-version rows: 'x' unfolds a
  series into child rows (tracked revision starred) with their own
  unread badges and activity dates, 'X' toggles all series at once.
  Enter/'e' on a child opens that version's thread with
  revision-correct seen syncing, and 'd' range-diffs it against the
  tracked revision directly.  Expansion and cursor state survive the
  periodic DB reloads and limit filtering.

Message-level read state was already keyed by message-id alone, so
Seen/Flagged/Answered flags apply across versions unchanged; this
series adds the missing count/badge and navigation layers on top.

Also included is a standalone fix for 'e' on rethreaded series, which
never passed is_rethreaded and thus fetched a single patch's thread
instead of reassembling the series from its per-patch message-ids.

The series is bisectable, with implementation and tests split
throughout.

Signed-off-by: Christian Brauner (Amutable) <[email protected]>
---
Christian Brauner (11):
      review-tui: fix rethreaded series thread viewing
      review: track message counts for all revisions of a series
      review: test per-revision message tracking
      review-tui: poll every revision on u/U updates
      review-tui: guarantee the tracked revision in revision lists
      review: add backward discovery of older series revisions
      review-tui: add a "Find older revisions" action
      review: test backward revision discovery
      review-tui: extract the Msgs column renderer from TrackedSeriesItem
      review-tui: expand tracked series into per-version rows
      review-tui: test per-version tracker rows

 src/b4/review/tracking.py          | 636 ++++++++++++++++++++++++----
 src/b4/review_tui/_lite_app.py     |   1 +
 src/b4/review_tui/_modals.py       |  27 ++
 src/b4/review_tui/_tracking_app.py | 464 ++++++++++++++++++---
 src/tests/test_review_tracking.py  | 823 +++++++++++++++++++++++++++++++++++++
 src/tests/test_tui_tracking.py     | 578 +++++++++++++++++++++++++-
 6 files changed, 2393 insertions(+), 136 deletions(-)
---
base-commit: 4217c3e5d3e1eb259626142fd71b91ec6d5e3d1e
change-id: 20260718-work-b4-multiver-rows-6032fb71e951