From 889a1b307c07533aac8ee5300804aa94915a0552 Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Tue, 12 May 2026 17:23:51 -0400 Subject: [PATCH] Show shift type label for both weekend shifts in notifications Night shift notifications on weekends were missing the type label, making them ambiguous. Also fix schedule post text fallback to use this_monday instead of now for the start date. --- src/shared/python/shared/blocks.py | 4 +++- src/slack-bot/app.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/shared/python/shared/blocks.py b/src/shared/python/shared/blocks.py index 1c3d947..134564f 100644 --- a/src/shared/python/shared/blocks.py +++ b/src/shared/python/shared/blocks.py @@ -131,7 +131,9 @@ def build_shift_change_message( dt = datetime.strptime(date_str, "%Y-%m-%d") day_label = dt.strftime("%A, %b %-d") type_label = ( - f" ({SHIFT_LABELS.get(shift_type, shift_type)})" if shift_type == "day" else "" + f" ({SHIFT_LABELS.get(shift_type, shift_type)})" + if dt.strftime("%A") in WEEKEND_DAYS + else "" ) if action == "picked_up": diff --git a/src/slack-bot/app.py b/src/slack-bot/app.py index e51e9cf..707f6aa 100644 --- a/src/slack-bot/app.py +++ b/src/slack-bot/app.py @@ -252,7 +252,7 @@ def create_app( channel=channel, ts=post["message_ts"], blocks=blocks, - text=f"After-Hours Schedule — {now.strftime('%b %-d')} to {end_date.strftime('%b %-d')}", + text=f"After-Hours Schedule — {this_monday.strftime('%b %-d')} to {end_date.strftime('%b %-d')}", ) except Exception: logger.warning("Could not update schedule post", exc_info=True)