---
phase: 10-refresh-auto-archive-wiring
plan: "01"
subsystem: ui-signal-surface
tags: [slint, callbacks, auto-archive, seed-data]
dependency_graph:
  requires: []
  provides: [refresh-all-clicked callback, card-refresh callback, refresh-clicked callback, refresh-error property, auto-archive initial load]
  affects: [dashboard.slint, card.slint, main.rs]
tech_stack:
  added: []
  patterns: [Slint callback propagation through card grid, auto-archive on initial seed load]
key_files:
  created: []
  modified:
    - crates/app/ui/dashboard.slint
    - crates/app/ui/card.slint
    - crates/app/src/main.rs
decisions:
  - refresh-all-clicked and card-refresh(int) declared on DashboardWindow; card grid routes refresh-clicked up via card-refresh
  - refresh-error drives amber background on three-dots button and "Refresh failed - retry" menu text
  - No-op on_refresh_all_clicked and on_card_refresh registered so app runs without panics until Plan 02 wires real logic
  - Auto-archive compute_and_store called for every seed card on initial load before apply_filters, after runtime is created
metrics:
  duration: "5 min"
  completed_date: "2026-03-20"
  tasks_completed: 2
  files_modified: 3
---

# Phase 10 Plan 01: Slint Signal Surface and Auto-Archive Hook Summary

**One-liner:** Added Slint refresh callback surface (refresh-all-clicked, card-refresh, refresh-clicked, refresh-error) and wired auto-archive compute_and_store into initial seed load.

## Tasks Completed

| # | Name | Commit | Files |
|---|------|--------|-------|
| 1 | Add Slint callback declarations, properties, and CardData field | 622f425 | dashboard.slint, card.slint |
| 2 | Hook auto-archive into initial card load and add refresh-error to seed CardData | ae7bfd8 | main.rs |

## What Was Built

### dashboard.slint
- `refresh-error: bool` field added to `CardData` struct
- `callback refresh-all-clicked` and `callback card-refresh(int)` declared on `DashboardWindow`
- `in property <bool> refresh-all-disabled: false` added on `DashboardWindow`
- Refresh-all button dims (`#3a5299`) when disabled and fires `refresh-all-clicked` only when enabled
- F5 key handler in `global-keys` FocusScope routes to `refresh-all-clicked`
- Card grid wires `refresh-error: card-data.refresh-error` and `refresh-clicked => root.card-refresh(card-index)`

### card.slint
- `in property <bool> refresh-error: false` added on `RecipientCard`
- `callback refresh-clicked()` declared on `RecipientCard`
- Three-dots button background switches to amber (`#4a2810` / `#5a3818`) when `refresh-error` is true
- Refresh menu item shows `"Refresh failed - retry"` when `refresh-error` is true
- `refresh-menu-touch` fires `root.refresh-clicked()` when not disabled

### main.rs
- `refresh_error: false` added to all 3 seed `CardData` literals
- Auto-archive block inserted: calls `rt.archive_store.compute_and_store` for each seed card, sets `card.archive_state` from `ArchiveState` enum
- No-op `on_refresh_all_clicked` and `on_card_refresh` handlers registered to prevent runtime panics

## Deviations from Plan

None — plan executed exactly as written.

## Verification

- `cargo build -p app`: success
- `cargo test -p app --lib`: 109 passed, 0 failed

## Self-Check: PASSED

All files verified present. Both task commits (622f425, ae7bfd8) confirmed in git log.
