# Failure Display Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Introduce a configurable "failing source" threshold (default 5 consecutive failures) and surface it on the Dashboard as per-platform health bars plus a strict failing-source list.
**Architecture:** Four small changes. (1) Backend adds one default setting key. (2) Settings page adds one number input. (3) Dashboard script adds a settings fetch and three derived computeds. (4) Dashboard template replaces the "Sources Needing Attention" card body with platform bars + a filtered table, removing the old recent-failure-based list.
**Tech Stack:** Python/Quart + SQLAlchemy backend, Vue 3 + Vuetify 3 + Pinia frontend. No test infrastructure in the repo; verification is via `npm run build`, spec-file diffs, and visual inspection after the user deploys.
Spec: `docs/superpowers/specs/2026-04-17-failure-display-design.md`
---
## File Structure
| File | Role | Change |
|---|---|---|
| `backend/app/models/setting.py` | DEFAULT_SETTINGS dict | Add `"dashboard.failure_threshold": 5` |
| `frontend/src/views/Settings.vue` | Application settings page | Add Dashboard section with threshold input |
| `frontend/src/views/Dashboard.vue` | Main dashboard page | Add settings store + computeds; replace "Sources Needing Attention" card body; remove obsolete `sourcesWithErrors`; add scoped CSS |
No new files. No store changes — `useSettingsStore` in `frontend/src/stores/settings.js` already exposes `fetchSettings()` and a reactive `settings` ref.
---
## Task 1: Add default threshold to backend settings
**Files:**
- Modify: `backend/app/models/setting.py:39-46`
- [ ] **Step 1: Add the new key to `DEFAULT_SETTINGS`**
Open `backend/app/models/setting.py` and replace the `DEFAULT_SETTINGS` dict (currently lines 39–46) with:
```python
# Default settings that should exist
DEFAULT_SETTINGS = {
"download.parallel_limit": 3,
"download.rate_limit": 3.0,
"download.retry_count": 3,
"download.schedule_interval": 28800, # 8 hours
"notification.enabled": False,
"notification.webhook_url": None,
"dashboard.failure_threshold": 5,
}
```
Why this is enough: `settings` is a key-value table. `GET /api/settings` (in `backend/app/api/settings.py`) merges stored rows on top of `DEFAULT_SETTINGS` and returns the result. A brand-new key appears in the API response immediately; existing installations get the default until/unless the user saves a different value from the Settings page. No migration, no new endpoint.
- [ ] **Step 2: Commit**
```bash
git add backend/app/models/setting.py
git commit -m "feat(settings): add dashboard.failure_threshold default (5)"
```
---
## Task 2: Add threshold input to the Settings page
**Files:**
- Modify: `frontend/src/views/Settings.vue` (template only)
- [ ] **Step 1: Insert a Dashboard section above the Notifications divider**
In `frontend/src/views/Settings.vue`, locate the block that ends the Download Settings section and starts the Notifications section:
```vue