# GSD Debug Knowledge Base

Resolved debug sessions. Used by `gsd-debugger` to surface known-pattern hypotheses at the start of new investigations.

---

## byproduct-multi-item-grouping — ByProductShipped shows pipe-separated combo strings as single tiles instead of splitting into individual product tiles
- **Date:** 2026-03-20
- **Error patterns:** pipe-separated, item_summary, multi-item, ByProductShipped, product tile, grouping, combo string, discovery mode
- **Root cause:** Four code sites (build_product_tiles in main.rs, dimmed_product_names in main.rs, FilteredCards filter predicate in main.rs, extract_product_tiles in discovery.rs) all treated item_summary as an atomic string key and never split on " | " before grouping or filtering.
- **Fix:** All four sites updated to split item_summary on " | " and trim each part. FilteredCards predicate changed from equality to `.split(" | ").any(|part| part.trim() == tile_name)`. Four regression tests added to discovery.rs.
- **Files changed:** crates/app/src/main.rs, crates/app/src/dashboard/discovery.rs
---

## item-modal-focus-and-esc — Item add modal search input not auto-focused on open; Esc fires global handler instead of closing modal
- **Date:** 2026-03-20
- **Error patterns:** auto-focus, TextInput, modal, Esc, FocusScope, init, invisible, key-pressed, close modal, focus
- **Root cause:** Two combined issues: (1) init handlers for focus calls fire at component construction when the modal is invisible and never re-fire when the modal becomes visible later. (2) modal-focus FocusScope is a sibling Rectangle of the inner panel, not an ancestor of search-input, so key events from TextInput never bubble to it — Esc always reaches the global FocusScope.
- **Fix:** Added focus-lookup-search() public function using a counter property (search-focus-trigger) + local mirror + changed handler pattern inside the search if-block to trigger focus after modal is visible. Added key-pressed Escape handlers directly on all three TextInputs (search-input, create-name-input, Shopify URL input) calling root.close-requested(). Rust calls w.invoke_focus_lookup_search() after set_lookup_modal_open(true).
- **Files changed:** crates/app/ui/lookup-modal.slint, crates/app/ui/dashboard.slint, crates/app/src/main.rs
---
