diff --git a/app.py b/app.py index c150b89..fdc1b76 100644 --- a/app.py +++ b/app.py @@ -4542,9 +4542,17 @@ def _render_reports_tab(month_value): _is_campaign_month = report.CAMPAIGN_START <= _month_start <= report.CAMPAIGN_END except ValueError: pass + if _is_campaign_month: + _title_text = f"{stats['period_label']} End of Month Campaign Report" + elif month_value in report.CUSTOM_PERIODS: + # Just the date range and its lead theme, e.g. "Nov 3 - Nov 26 (Failure + # Analysis)" — no "TXproducts —" prefix, the Campaign dropdown above it + # already names the campaign and the company. + _title_text = stats["period_label"] + else: + _title_text = f"TXproducts — {stats['period_label']}" title_heading = html.H3( - f"{stats['period_label']} End of Month Campaign Report" if _is_campaign_month - else f"TXproducts — {stats['period_label']}", + _title_text, style={"color": "#1b3a5c", "marginBottom": "0", "fontWeight": "700", "fontSize": "2rem", "whiteSpace": "nowrap"}) diff --git a/report.py b/report.py index c428332..3b7c00c 100644 --- a/report.py +++ b/report.py @@ -289,6 +289,11 @@ def build_report_docx(ctx, timeframe_value="all"): title_text = "TXproducts — 3-Month Campaign Report (July-September 2026)" elif monthly_notes and is_campaign_month: title_text = f"{period_label} End of Month Campaign Report" + elif timeframe_value in CUSTOM_PERIODS: + # Just the date range and its lead theme, e.g. "Nov 3 - Nov 26 (Failure + # Analysis)" — no "TXproducts —" prefix, the Campaign dropdown above it + # already names the campaign and the company. + title_text = period_label elif monthly_notes: title_text = f"TXproducts — {period_label}" else: