# Task Registry
_Last updated: 2026-03-05_

---

## CSV Import UX — Progress & Feedback

- [ ] **Remap CSV import progress bar percentages** — The current mapping (`5-90%` for row processing, `90-100%` for rebuild) compresses the DB-write phase into the same bucket as CSV parsing. Split it into three distinct segments that better reflect actual work:
  - `0-60%`: CSV row processing (reading and parsing rows)
  - `60-90%`: Database updates (writing/upserting orders to DB)
  - `90-100%`: Rebuild customer profiles
  - **Files to change:** `supporthub/app/templates/customers.html` lines ~454-468 (JS polling logic — the `pct` calculation branches) and `supporthub/app/main.py` lines ~2718-2734 (server-side phase transitions in `api_orders_import_csv`). The server already emits `phase: 'processing'` and `phase: 'rebuilding'`; a new `phase: 'db_write'` value will need to be emitted between them (set after `import_orders_csv` returns and before `rebuild_customer_profiles` starts, but the DB-write work actually happens inside `import_orders_csv` — consider splitting `on_progress` so the callback can distinguish parse vs. write sub-phases, or simply set `phase = 'db_write'` at the end of `import_orders_csv` before returning).
  - Status: `pending`
  - Context: Raised 2026-03-05 — user noticed the bar jumps straight from row-counting to rebuild with no visual acknowledgement of the DB-write step.
  - Blocked by: nothing

- [ ] **Add growl notifications for each CSV import phase transition** — Currently only the final success/error growl is shown (customers.html ~line 496). Add intermediate growls so the user knows when each phase begins:
  1. Upload complete → processing starts: growl "Parsing CSV rows..." (type `info`)
  2. Row processing done → DB writes begin: growl "Writing orders to database..." (type `info`)
  3. DB writes done → rebuild starts: growl "Rebuilding customer profiles..." (type `info`)
  4. Final success growl already exists — keep as-is.
  - **Where to add:** The JS polling function (customers.html ~line 450) already watches `p.phase`. Add phase-change detection by tracking `lastPhase` across poll ticks and firing a growl when `p.phase !== lastPhase`. The server-side `phase` values that need to exist: `'processing'` (already exists), `'db_write'` (new, see task above), `'rebuilding'` (already exists).
  - Status: `pending`
  - Context: Raised 2026-03-05 — companion to the progress bar remap task; both should be done together since they both depend on introducing the new `db_write` phase.
  - Blocked by: "Remap CSV import progress bar percentages" (the `db_write` phase must exist before the growl for it can fire)
