From cc827ca1e5c541266a472d5ed17a9e295a08b15c Mon Sep 17 00:00:00 2001 From: beantownbabe <156287695+beantownbabe@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:47:59 +0100 Subject: [PATCH] Move Follower Gains calendar/New Followers per Day directly under the KPI row Reordered: calendar row now comes first in the content area (right under the KPI tiles/Team member dropdown), followed by Visibility (full width), Posts (full width), then the Impressions/Engagement Rate/Demographics row. Refactored _build_person_dashboard/_build_empty_person_dashboard to return their pieces (source_note, calendar_row, charts_row) separately instead of a pre-assembled Div, so _render_team_tab controls the final ordering directly. Co-Authored-By: Claude Sonnet 5 --- app.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index 15244eb..87893ba 100644 --- a/app.py +++ b/app.py @@ -3052,7 +3052,7 @@ def _build_person_dashboard(name, data): _team_demographics_table(data["content_demographics"])), md=3), ], className="gx-3 mb-3") - return html.Div([source_note, calendar_row, charts_row]) + return source_note, calendar_row, charts_row _TEAM_EMPTY_PLACEHOLDER = html.Div("No data yet", className="text-muted text-center", @@ -3082,7 +3082,7 @@ def _build_empty_person_dashboard(name): dbc.Col(section("Content Demographics — Top 5 (who engages)", _TEAM_EMPTY_PLACEHOLDER), md=3), ], className="gx-3 mb-3") - return html.Div([source_note, calendar_row, charts_row]) + return source_note, calendar_row, charts_row @app.callback( @@ -3108,22 +3108,23 @@ def _render_team_tab(name): if not data: stat_row = _team_empty_stat_row() posts_section = section("Posts This Window — Originals vs Reposts", _TEAM_EMPTY_PLACEHOLDER) - body = _build_empty_person_dashboard(name) + source_note, calendar_row, charts_row = _build_empty_person_dashboard(name) disabled = True else: stat_row = _team_stat_row(data) post_details = post_details_tracker.load_post_details(DATA_DIR, UPLOAD_DIR) posts_section = section("Posts This Window — Originals vs Reposts", _team_top_posts_table(data["top_posts"], post_details)) - body = _build_person_dashboard(name, data) + source_note, calendar_row, charts_row = _build_person_dashboard(name, data) disabled = False - visibility_posts_row = dbc.Row([ - dbc.Col(visibility_row, md=3), - dbc.Col(posts_section, md=9), - ], className="gx-3 mb-3") + # Follower Gains/New Followers per Day comes first, directly under the KPI row - + # Visibility/Posts and the rest of the charts follow below it. + visibility_row_full = dbc.Row([dbc.Col(visibility_row, md=12)], className="gx-3 mb-3") + posts_row_full = dbc.Row([dbc.Col(posts_section, md=12)], className="gx-3 mb-3") + body = html.Div([source_note, calendar_row, visibility_row_full, posts_row_full, charts_row]) - return stat_row, html.Div([visibility_posts_row, body]), disabled + return stat_row, body, disabled @app.callback(