# S01: Fix Key Moment Search Links — UAT

**Milestone:** M008
**Written:** 2026-03-31T05:05:15.454Z

## UAT: Fix Key Moment Search Links

### Preconditions
- Chrysopedia stack running on ub01 (docker ps shows all containers healthy)
- At least one technique page with key moments exists in the database
- Qdrant has been re-indexed after deployment (or title-based fallback is acceptable for semantic results)

### Test 1: Key Moment Semantic Search → Parent Page Navigation
1. Open http://ub01:8096
2. Type "compression" in the search bar
3. Wait for results to appear
4. Identify a result with type "key_moment" (shown with a moment/clip icon)
5. Click the key moment result
6. **Expected:** Browser navigates to `/techniques/{parent-technique-slug}#km-{moment-id}` — the parent technique page loads and the page scrolls to the specific key moment in the key moments list

### Test 2: Key Moment Keyword Search → Parent Page Navigation
1. Open http://ub01:8096
2. Type a query that matches a key moment title via keyword search (e.g., a specific technique name that exists as a key moment)
3. Click the key moment result
4. **Expected:** Same as Test 1 — navigates to parent technique page with hash-scroll

### Test 3: Technique Page Search → Normal Navigation (No Regression)
1. Open http://ub01:8096
2. Search for a term that matches a technique page title
3. Click the technique page result
4. **Expected:** Navigates to `/techniques/{slug}` — the technique page loads normally (no hash fragment, no scroll behavior)

### Test 4: Hash-Scroll Works on Direct URL
1. Open a technique page URL directly in the browser
2. Find a key moment ID from the page (inspect element on any key moment `<li>` — look for `id="km-{uuid}"`)
3. Append `#km-{that-uuid}` to the URL and reload
4. **Expected:** Page loads and scrolls smoothly to the specific key moment

### Test 5: Missing Parent Slug Fallback
1. If any key moment in the database has a NULL technique_page_id (orphan moment):
   - Search for it
   - Click the result
   - **Expected:** Browser navigates to a search page with the moment's title as the query — NOT a 404 page

### Edge Cases
- **Empty search results:** Search for gibberish → no results shown, no errors in console
- **Key moment at top of page:** If the target moment is the first in the list, scrollIntoView should still work (no-op if already visible)
- **Browser back button:** After navigating from search to technique page via key moment link, pressing Back returns to search results
