[PATCH RFC v2 23/25] review-tui: give the unseen badge a column of its own

Christian Brauner <[email protected]>
Newsgroups org.kernel.linux.tools
Message-ID <[email protected]>
The Msgs column packs the thread total and the unseen badge into adjacent
fields, so a two-digit total and a badge render as "15(3)" and read as a
single number.

Put a separator between them and widen the badge to four columns, so a
two-digit unseen count still fits, and move the header label over the
field it now describes.

Assisted-by: claude-opus-5
Signed-off-by: Christian Brauner (Amutable) <[email protected]>
---
 src/b4/review_tui/_tracking_app.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/b4/review_tui/_tracking_app.py b/src/b4/review_tui/_tracking_app.py
index 53466498..37377758 100644
--- a/src/b4/review_tui/_tracking_app.py
+++ b/src/b4/review_tui/_tracking_app.py
@@ -772,7 +772,13 @@ def _append_msgs(
     message_count: Optional[int],
     seen_message_count: Optional[int],
 ) -> None:
-    """Append the Msgs column (total + unseen badge) to *label*."""
+    """Append the Msgs column (total + unseen badge) to *label*.
+
+    Ten columns: two of lead-in, three for the total, a separator, four for
+    the badge.  The separator is what keeps a two-digit total and a badge
+    from reading as one number, and the badge is four wide so a two-digit
+    unseen count still fits inside the field.
+    """
     base, badge, base_accent = _msgs_fields(message_count, seen_message_count)
     base_style = ''
     badge_style = ''
@@ -783,7 +789,8 @@ def _append_msgs(
         if badge:
             badge_style = accent
     label.append(f'  {base.rjust(3)}', style=base_style)
-    label.append(f'{badge:<3s}', style=badge_style)
+    label.append(' ')
+    label.append(f'{badge:<4s}', style=badge_style)
 
 
 class TrackedSeriesItem(ListItem):
@@ -1432,7 +1439,7 @@ class TrackingApp(LoreNodeShutdownMixin, CheckRunnerMixin, App[Optional[str]]):
                 await self.mount(empty, before=self.query_one(Footer))
                 return
 
-            header_text = f'{"Submitter":<20s}{"A":>1s} {"A·R·T":>7s}  {"Msgs":>6s}  {"S":<4s}{"Subject"}'
+            header_text = f'{"Submitter":<20s}{"A":>1s} {"A·R·T":>7s}  {"Msgs":<8s}{"S":<6s}{"Subject"}'
             header = Static(header_text, id='tracking-header')
 
             list_items: List[ListItem] = [TrackedSeriesItem(s) for s in display_series]

-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.