Skip to content

Comments

feat(dashboard): add interactive complaints analysis dashboard#6

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
feature/complaints-dashboard
Open

feat(dashboard): add interactive complaints analysis dashboard#6
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
feature/complaints-dashboard

Conversation

@devin-ai-integration
Copy link
Contributor

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

feat(dashboard): add interactive Streamlit complaints analysis dashboard

Summary

This PR adds an interactive Streamlit dashboard for analyzing customer complaints data from Supabase. The dashboard replaces the static HTML report with a live, filterable application featuring:

  • Live Supabase connection with 5-minute data caching to reduce API calls
  • Filter dropdowns for category, severity, status, customer segment, and date range
  • Dynamic KPI cards that update based on applied filters (total complaints, avg resolution, repeat complainers, compensation stats)
  • Interactive charts using Plotly:
    • Time series with daily/weekly/monthly toggle
    • Category breakdown bar chart
    • Severity distribution donut chart
    • Resolution time distribution
  • Outlier highlights section (>60 days resolution, >£300 compensation, same-day resolution)
  • Repeat complainers analysis (customers with 3+ complaints)

Review & Testing Checklist for Human

  • Verify Supabase connection: The app hasn't been tested with live Supabase credentials. Set SUPABASE_URL and SUPABASE_KEY environment variables and run streamlit run dashboard/app.py to confirm data loads correctly
  • Validate data schema: Confirm the santander_customer_complaints table has all expected columns (complaint_id, customer_id, category, severity, status, complaint_date, resolution_date, resolution_days, compensation_amount, customer_segment)
  • Test compensation parsing: The code assumes compensation_amount is formatted as "£X.XX" (line 113). Verify this matches actual data format - if values are already numeric or use different formatting, this will fail
  • Test filter combinations: Apply various filter combinations and verify statistics/charts update correctly
  • Note: python-dotenv is in requirements.txt but not actually imported in app.py - environment variables must be set externally (e.g., via shell export or Streamlit secrets)

Recommended test plan:

  1. Install dependencies: pip install -r dashboard/requirements.txt
  2. Set environment variables: export SUPABASE_URL=... SUPABASE_KEY=...
  3. Run: streamlit run dashboard/app.py
  4. Test each filter individually, then in combination
  5. Toggle time series aggregation (Daily/Weekly/Monthly)
  6. Verify outlier counts match expectations

Notes

- Add Streamlit app with live Supabase connection and 5-minute caching
- Implement filter dropdowns: category, severity, status, date range, customer segment
- Add dynamic KPI statistics that update with filters
- Create interactive time series chart with daily/weekly/monthly toggle
- Add category breakdown bar chart and severity donut chart
- Include resolution time distribution visualization
- Add outlier highlights section (>60 days, >£300, same-day)
- Include repeat complainers analysis (3+ complaints)
- Add requirements.txt with dependencies
- Add README with setup instructions

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

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