Skip to content

Comments

Add interactive Supabase complaints dashboard with live filtering and charts#7

Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1764809015-complaints-dashboard
Open

Add interactive Supabase complaints dashboard with live filtering and charts#7
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1764809015-complaints-dashboard

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 4, 2025

Add interactive Supabase complaints dashboard with filtering and charts

Summary

This PR adds a Streamlit dashboard that connects to Supabase to display and analyze customer complaints data. The dashboard includes:

  • Live Supabase connection with 5-minute caching for performance
  • Filter dropdowns: category, severity, status, customer segment, and date range
  • Dynamic statistics that update based on applied filters (total complaints, avg/median resolution time, compensation stats, repeat complainers count)
  • Interactive charts: time series with daily/weekly/monthly toggle, category breakdown bar chart, severity pie chart, resolution time distribution
  • Outlier analysis with tabs for long resolution (>60 days), high compensation (>£300), and zero-day resolution cases
  • Repeat complainers section showing customers with 3+ complaints

Review & Testing Checklist for Human

  • CRITICAL: Add RLS policy to Supabase - The santander_customer_complaints table has RLS enabled but no policy allowing anonymous read access. Run this SQL in Supabase: CREATE POLICY "Allow anonymous read access" ON santander_customer_complaints FOR SELECT TO anon USING (true);
  • Verify the hardcoded Supabase anon key (line 17) is acceptable for this use case, or move to environment variables
  • Test all filter combinations work correctly and update the statistics/charts
  • Verify the time series granularity toggle (Daily/Weekly/Monthly) works as expected
  • Check that outlier thresholds (60 days, £300) match business requirements

Recommended test plan:

  1. Add the RLS policy in Supabase dashboard
  2. Run pip install -r dashboard/requirements.txt
  3. Run streamlit run dashboard/app.py
  4. Verify data loads and all filters/charts work
  5. Deploy to Streamlit Cloud or similar for public access

Notes

  • The dashboard uses Santander red branding (#ec0000)
  • Data is cached for 5 minutes; use the "Refresh Data" button to force reload
  • No unit tests included in this PR

Link to Devin run: https://app.devin.ai/sessions/f6d5f9be2d984febb02532bc0f610bea
Requested by: Joao Esteves (joao.esteves@cognition.ai) / @joao-cognition

- Add Streamlit dashboard with live Supabase connection
- Implement filter dropdowns: category, severity, status, date range, customer segment
- Add dynamic statistics that update with filters
- Add interactive charts: time series (daily/weekly/monthly toggle), category breakdown, severity distribution, resolution time distribution
- Add outlier analysis section with tabs for long resolution, high compensation, and zero-day cases
- Add repeat complainers section
- Include caching with 5-minute TTL for performance

Co-Authored-By: Joao Esteves <joao.esteves@cognition.ai>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: Joao Esteves <joao.esteves@cognition.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants