---
status: fixing
trigger: "10 remaining Phase 20.1 UAT bugs - batch fix"
created: 2026-04-12T00:00:00Z
updated: 2026-04-12T01:00:00Z
---

## Current Focus

hypothesis: All 8 bugs have confirmed root causes and fixes applied
test: Build passes, BUGSWEEPER tests confirm Bug 7 fix
expecting: Human verification of all fixes
next_action: Request human verification of remaining bugs

## Symptoms

expected: App renders fast, tabs switch instantly, UI elements properly aligned and functional
actual: 10s startup hang, 2s tab switch delay, UI alignment issues, missing features
errors: None visible (performance and UI layout issues)
reproduction: See individual bug descriptions
started: After Phase 20.1 product image changes

## Eliminated

(none)

## Evidence

- timestamp: 2026-04-12T00:01:00Z
  checked: build_item_squares_from_vm in main.rs:527-629
  found: Name-based fallback at line 602 calls read_all_products() per item square — O(N*M) table scans on UI thread
  implication: Root cause of Bug 1. FIXED: replaced with read_product_by_name() — single indexed query.

- timestamp: 2026-04-12T00:02:00Z
  checked: sendable_to_product_tile_data, refresh_product_grid
  found: Image::load_from_path synchronous but Slint caches by path. With only 3 products, overhead is minimal after Bug 1 fix.
  implication: Bug 2 was primarily caused by Bug 1's read_all_products per-item. Residual image decode cost is minimal with Slint's path cache.

- timestamp: 2026-04-12T00:03:00Z
  checked: on_tab_clicked handler
  found: Unconditional set_product_detail_visible(false) on every tab switch
  implication: Root cause of Bug 7. FIXED: only hide when leaving ByProductShipped, restore when returning.

- timestamp: 2026-04-12T00:04:00Z
  checked: on_on_product_sidecar_set_image handler
  found: upgrade_in_event_loop closure only updates product grid tiles, not sidecar detail properties
  implication: Root cause of Bug 8. FIXED: added local cache write + sidecar image update in closure.

- timestamp: 2026-04-12T00:05:00Z
  checked: card.slint note editing (lines 553-640)
  found: Editing rectangle 38px vs non-editing 20px, card height fixed at 196px
  implication: Root cause of Bug 6. FIXED: redesigned as 20px HorizontalLayout with inline Save/X buttons.

- timestamp: 2026-04-12T00:06:00Z
  checked: product-detail.slint TouchArea overlays
  found: TouchAreas after TextInputs intercept mouse-down, blocking click-drag selection
  implication: Root cause of Bug 5. FIXED: removed both TouchArea overlays. TextInput handles focus natively.

- timestamp: 2026-04-12T00:07:00Z
  checked: product-detail.slint Flickable viewport
  found: No viewport-height set, causing content to float in middle
  implication: Root cause of Bug 3. FIXED: set viewport-height to unit-list-layout.preferred-height.

- timestamp: 2026-04-12T00:08:00Z
  checked: product-detail.slint creating-unit block
  found: No auto-focus, no scroll-to-bottom when add row appears
  implication: Root cause of Bug 4. FIXED: added serial-focus-trigger + changed handler for auto-focus and scroll.

- timestamp: 2026-04-12T00:09:00Z
  checked: BUGSWEEPER round-trip test of Bug 7
  found: tab-click(0) -> sidecar=false, tab-click(3) -> sidecar=true. Confirmed working.
  implication: Bug 7 fix verified programmatically.

## Resolution

root_cause: 8 separate root causes — see Evidence entries above
fix: Applied fixes to 4 files (see files_changed)
verification: Build passes. Bug 7 verified via BUGSWEEPER. Awaiting human verification of visual bugs.
files_changed:
  - crates/service/src/db/sqlite.rs (added read_product_by_name)
  - crates/app/src/main.rs (Bug 1, 7, 8 fixes)
  - crates/app/ui/product-detail.slint (Bug 3, 4, 5 fixes)
  - crates/app/ui/card.slint (Bug 6 fix)
