From 58973473c9b02611ee7bb4e0c6d7a8018909dd0a Mon Sep 17 00:00:00 2001 From: Jan Novak Date: Fri, 8 May 2026 00:26:04 +0200 Subject: [PATCH] fix(py): make junior '?' cell text sticky across exception overrides Go's build_juniors sets cellText = "?" + countStr whenever md.IsUnknown is true, regardless of whether an exception overrides the expected amount. Python was checking expected == "?" for this branch, but reconcile replaces expected with the exception amount (e.g. 0) before the view builder runs, so the "?" was silently dropped to "-". Fix: derive is_unknown from original_expected == "?" (set before exception substitution) instead of expected == "?". Also align the tooltip guard: Go only shows Received/Expected tooltip for non-unknown months (or when paid > 0), matching the same is_unknown flag. Co-Authored-By: Claude Sonnet 4.6 --- scripts/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/views.py b/scripts/views.py index 05e5055..c63f67e 100644 --- a/scripts/views.py +++ b/scripts/views.py @@ -310,8 +310,9 @@ def build_juniors_view_model( cell_text = "-" amount_to_pay = 0 - if expected == "?" or (isinstance(expected, int) and expected > 0): - if expected == "?": + is_unknown = original_expected == "?" + if is_unknown or (isinstance(expected, int) and expected > 0): + if is_unknown: status = "empty" cell_text = f"?{count_str}" elif paid >= expected: @@ -339,7 +340,7 @@ def build_juniors_view_model( status = "surplus" cell_text = f"PAID {paid}" - if (isinstance(expected, int) and expected > 0) or paid > 0: + if (not is_unknown and isinstance(expected, int) and expected > 0) or paid > 0: tooltip = f"Received: {paid}, Expected: {expected}" else: tooltip = ""