Remove Total Followers tile from Reports tab and PDF

"Total Followers (as of today)" was confusing on a monthly report
read days or weeks after the month closed, since the live/global
follower count keeps drifting past whatever month is being reported
on. Month Start already gives the one followers figure that's
actually pinned to that specific reporting period, so the redundant
tile is dropped entirely rather than repurposed. Live dashboard tabs
outside Reports are unaffected and keep showing the live total.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
beantownbabeandClaude Sonnet 5 committed 2026-09-30 08:26:59 +02:00
1 parent 573046c275
commit 5eafbd972b
2 files changed
+8 -14

No files matched your search

-4
View File
@@ -4261,10 +4261,6 @@ def _render_reports_tab(month_value):
_reports_kpi_body_style = {"padding": "0.4rem 0.7rem"}
kpi_row = html.Div([
html.Div(kpi("Total Followers", f"{current_total_followers:,}", color=_REPORTS_ACCENT,
label_style=_reports_centered_label, value_style=_reports_big_centered_value,
card_style=_reports_card_style, body_style=_reports_kpi_body_style),
style={"flex": "1", "minWidth": "0"}),
html.Div(kpi("Month Start",
f"{stats['start_of_month_followers']:,}" if stats["start_of_month_followers"] is not None else "—",
color=_REPORTS_ACCENT,
+8 -10
View File
@@ -170,16 +170,15 @@ def _counter_rows(counter, header_left, top_n=None):
def build_report_pdf(ctx, timeframe_value="all"):
"""ctx is a dict bundling everything the report needs from the live app:
D, posts, comp_ordered, current_total_followers, daily_followers_figure (the
figure-builder function), std_fn (the _std styling helper), TMPL, FORMAT_COLORS,
growth_snapshot, and optionally monthly_notes (a curated per-month narrative dict,
see monthly_report_notes.py) and directory_data (the parsed Follower Directory,
see follower_directory_data.py). monthly_notes/directory_data are only rendered
D, posts, comp_ordered, daily_followers_figure (the figure-builder function),
std_fn (the _std styling helper), TMPL, FORMAT_COLORS, growth_snapshot, and
optionally monthly_notes (a curated per-month narrative dict, see
monthly_report_notes.py) and directory_data (the parsed Follower Directory, see
follower_directory_data.py). monthly_notes/directory_data are only rendered
when monthly_notes is present, so "All Time"/year-level reports are unaffected."""
D = ctx["D"]
posts = ctx["posts"]
comp_ordered = ctx["comp_ordered"]
current_total_followers = ctx["current_total_followers"]
daily_followers_figure = ctx["daily_followers_figure"]
std_fn = ctx["std_fn"]
tmpl = ctx["TMPL"]
@@ -227,17 +226,16 @@ def build_report_pdf(ctx, timeframe_value="all"):
# --- KPI summary table ---
story.append(Paragraph("Key Metrics", h2_style))
kpi_data = [
["Total Followers\n(as of today)", "Month Start", "New Followers", "Posts Published",
["Month Start", "New Followers", "Posts Published",
"Total Impressions", "Total Page Views", "Best Post Real Eng.", "Avg. Eng. Rate", "Monthly Growth Rate"],
[f"{current_total_followers:,}",
f"{start_of_month_followers:,}" if start_of_month_followers is not None else "—",
[f"{start_of_month_followers:,}" if start_of_month_followers is not None else "—",
f"{new_followers:,}", f"{posts_published:,}",
f"{total_impressions:,}", f"{total_page_views:,}",
f"{best_eng:.1f}%" if best_eng is not None else "Pending audit",
f"{avg_eng:.2f}%" if avg_eng else "—",
f"{monthly_growth_rate:+.1f}%" if monthly_growth_rate is not None else "—"],
]
kpi_table = Table(kpi_data, colWidths=[2 * cm] * 9)
kpi_table = Table(kpi_data, colWidths=[2 * cm] * 8)
kpi_table.setStyle(TableStyle([
("BACKGROUND", (0, 0), (-1, 0), LIGHT_GRAY),
("TEXTCOLOR", (0, 0), (-1, 0), TEXT_GRAY),