""" Brand theming for the AI Messaging System Visualization Tool. """ import streamlit as st BRAND_CONFIG = { "drumeo": { "color": "#E84545", "light": "#FDEAEA", "emoji": "🥁", "label": "Drumeo", }, "pianote": { "color": "#4A90D9", "light": "#EAF3FC", "emoji": "🎹", "label": "Pianote", }, "guitareo": { "color": "#F5A623", "light": "#FEF6E7", "emoji": "🎸", "label": "Guitareo", }, "singeo": { "color": "#7B68EE", "light": "#F0EEFF", "emoji": "🎤", "label": "Singeo", }, "playbass": { "color": "#3DAA5C", "light": "#E8F7ED", "emoji": "🎸", "label": "Playbass", }, "all": { "color": "#555555", "light": "#F5F5F5", "emoji": "🎵", "label": "All Brands", }, } CAMPAIGN_LABELS = { "dailyPush_dailyStreak": "Daily Streak", "dailyPush_weeklyStreak": "Weekly Streak", "dailyPush_noStreak": "No Streak (Re-engagement)", "all": "All Campaigns", } ALL_BRANDS = ["all", "drumeo", "pianote", "guitareo", "singeo", "playbass"] ALL_CAMPAIGNS = [ "all", "dailyPush_dailyStreak", "dailyPush_weeklyStreak", "dailyPush_noStreak", ] # Scenarios per campaign, applied client-side after data load. # Detection uses the RECOMMENDATION column in DAILY_PUSH_MESSAGES. # For weeklyStreak: RECOMMENDATION == 'for_you' → no_practice_this_week CAMPAIGN_SCENARIOS = { "all": [], "dailyPush_dailyStreak": [], # single scenario, no sub-filter needed "dailyPush_weeklyStreak": [ ("all", "All"), ("practiced_this_week", "Practiced This Week"), ("no_practice_this_week", "No Practice This Week"), ], "dailyPush_noStreak": [], } def get_scenarios(campaign: str) -> list: """Return scenario (key, label) pairs for a given campaign.""" return CAMPAIGN_SCENARIOS.get(campaign, []) def detect_scenario(recommendation_value) -> str: """ Detect the weekly-streak sub-scenario from the RECOMMENDATION column. RECOMMENDATION == 'for_you' → user hasn't practiced this week anything else → user has practiced this week """ s = str(recommendation_value or "").strip().lower() return "no_practice_this_week" if s == "for_you" else "practiced_this_week" def get_brand(brand: str) -> dict: return BRAND_CONFIG.get(brand.lower() if brand else "all", BRAND_CONFIG["all"]) def get_campaign_label(campaign: str) -> str: return CAMPAIGN_LABELS.get(campaign, campaign) def inject_global_css(): """Inject shared CSS into the Streamlit app.""" st.markdown( """ """, unsafe_allow_html=True, )