---
phase: 20.1.1
plan: "08"
subsystem: ui-recipients-sidebar
tags: [slint, sidebar, summary-popup, recipient-detail, tile-click, main-rs]
dependency_graph:
  requires: [20.1.1-06, 20.1.1-07]
  provides: [recipient-detail-sidebar-wired, summary-popup-deleted, tile-click-sidebar-D19]
  affects: [crates/app/ui/card.slint, crates/app/ui/dashboard.slint, crates/app/ui/option-grid.slint, crates/app/src/main.rs]
tech_stack:
  patterns: [slint-conditional-panel, populate-from-sqlite, sidebar-state-on-parent, in-vs-in-out-segregation]
key_files:
  modified:
    - crates/app/ui/card.slint
    - crates/app/ui/dashboard.slint
    - crates/app/ui/option-grid.slint
    - crates/app/src/main.rs
decisions:
  - "summary-popup deleted entirely; sidebar owns all recipient editing state (D-16)"
  - "populate_recipient_sidebar writes only `in` data props, never `in-out` drafts (T-2018-04)"
  - "ByRecipient tile-click opens sidebar without navigating to filtered card view (D-19/Pitfall 8)"
  - "card-name-navigate is a no-op stub — Plan 09 implements cross-tab navigation"
metrics:
  duration_minutes: ~90
  completed: "2026-04-15"
  tasks_completed: 4
  tasks_total: 4
  files_changed: 4
---

# Phase 20.1.1 Plan 08: Delete summary-popup; wire RecipientDetailPanel sidebar in dashboard Summary

**One-liner:** Deleted the 540-line summary-popup PopupWindow from card.slint, imported and mounted RecipientDetailPanel in the Recipients tab with live SQLite data, and rewired ByRecipient tile-click to open the sidebar instead of navigating to filtered card view (D-16, D-17, D-18, D-19).

## Tasks Completed

| Task | Name | Commit | Key Files |
|------|------|--------|-----------|
| 1 | Delete summary-popup; add card-name-clicked | 033136f | card.slint |
| 2+3 | Mount RecipientDetailPanel; RecipientGrid highlight | 12f6051 | dashboard.slint, option-grid.slint |
| 4 | Wire sidebar callbacks; populate_recipient_sidebar | d765aab | main.rs |

## What Was Built

- **Task 1 (card.slint):** Deleted the entire `summary-popup := PopupWindow { ... }` block (~540 lines). Removed all dead properties that were only used by the popup (editing-rx-od/os, editing-purpose, rx-od/os-draft, purpose-draft, rx-copied, popover-saved, various callbacks). Replaced the `name-area` TouchArea `clicked` handler from `summary-popup.show()` to `root.card-name-clicked(root.recipient-id)`. Added `callback card-name-clicked(string)` declaration.

- **Task 2 (dashboard.slint):** Added `import { RecipientDetailPanel }`. Added 14 `in` data properties (detail-recipient-*) and 8 `in-out` editing state properties (detail-editing-*, detail-*-draft) on DashboardWindow. Added 9 sidebar callbacks (sidebar-save-purpose, sidebar-save-rx-od/os, sidebar-save-discord-username, sidebar-copy-rx, sidebar-view-shopify-customer, sidebar-view-recipient-issue, sidebar-close, card-name-navigate). Mounted RecipientDetailPanel conditionally inside the Recipients tab block (`if show-option-grid && show-recipient-grid && recipient-detail-visible`). RecipientGrid shrinks by 330px when sidebar is visible. Added `card-name-clicked(rid) => { root.card-name-navigate(rid); }` forwarding in RecipientCard loop.

- **Task 3 (option-grid.slint):** Added `in property <string> selected-tile-name: ""` to RecipientGrid. Updated tile Rectangle background and border-width to highlight the selected tile using `Colors.surface-elevated` and `Colors.accent`.

- **Task 4 (main.rs):** Added `populate_recipient_sidebar` free function that reads RecipientRow + CardRow from SQLite and calls all 14 `set_detail_recipient_*` setters. Modified `on_tile_clicked` to branch on `DiscoveryMode::ByRecipient` — opens sidebar instead of navigating to filtered card view (D-19/Pitfall 8). Added `on_sidebar_save_purpose`, `on_sidebar_save_rx_od/os`, `on_sidebar_save_discord_username` wired to existing Phase 16-03/16.1 write-back helpers. Added `on_sidebar_copy_rx` (reads both Rx fields from SQLite, formats, calls `copy_to_clipboard`). Added `on_sidebar_view_shopify_customer` and `on_sidebar_view_recipient_issue` using `open_shopify_url`/`open_discord_dm` pattern. Added `on_sidebar_close` that hides sidebar and clears all editing state. Added `on_tab_clicked` guard to hide sidebar when navigating away from tab index 2. Added `on_card_name_navigate` no-op stub (Plan 09 scope).

## Verification

- `cargo check --workspace` exits 0 (only pre-existing unused-variable warning in dashboard/assignment.rs)
- `cargo test --workspace --lib` passes — all 46+ library unit tests pass
- `grep -rn "summary-popup" crates/` returns 0 functional matches (D-16 hard gate met)
- Binary link fails only because app.exe is locked by the running process — not a code issue

## Deviations from Plan

### Auto-fixed Issues

**1. [Rule 1 - Bug] Removed stale `apply_optimistic_note_update` reference from test**
- **Found during:** Task 4 verification (`cargo test --workspace`)
- **Issue:** `apply_optimistic_note_update` was deleted as part of summary-popup cleanup in Task 1 (it was a notes-popover helper). A unit test in `optimistic_update_tests` mod still imported and referenced the deleted function, causing a compile error in test mode.
- **Fix:** Removed the import and the function-existence assertion for `apply_optimistic_note_update`. Updated the comment to document the removal.
- **Files modified:** `crates/app/src/main.rs` (test module at line ~6797)
- **Commit:** d765aab (included in Task 4 commit)

## Known Stubs

- `on_card_name_navigate`: no-op stub — Plan 09 implements cross-tab navigation from card face to Recipients tab + auto-select sidebar.

## Self-Check: PASSED

All 4 modified files exist. All 3 task commits (033136f, 12f6051, d765aab) confirmed in git log.
