Commit Graph
4 Commits
Author SHA1 Message Date
john-okeefe a70945f019 docs: add line number reference for template replacement section
Added specific line numbers (40-262) to Phase 4.3 specification
to indicate the exact section in templates/bookshelf.templ that
should be replaced with the new filter form code.

This clarifies the implementation instructions by providing precise
file location information for the filter section replacement.
2026-03-23 21:10:54 -04:00
john-okeefe b607cfc387 docs: complete unified search implementation plan with Phase 4 specifications
This commit finalizes the implementation plan with complete code
specifications for the remaining work needed to complete the unified
search and filter feature.

**Phase 4 Specifications Added:**

1. **Backend Handler (4.1):**
   - Complete SearchMediaItems handler rewrite with autocomplete detection
   - New handleFieldValuesSearch method for dropdown suggestions
   - Fixed QueryParam bugs (Echo doesn't support default values)
   - Autocomplete query routing: author=value, genre=value, etc.
   - Service layer integration for combined search + filters

2. **Frontend Templates (4.2-4.3):**
   - Search button + Enter key triggers (no blur/immediate filtering)
   - Pure HTML5 datalist approach (no Alpine.js reactive state)
   - All filter inputs with autocomplete support
   - Clear filters button for UX
   - Updated HTMX triggers from 'change' to 'keyup[key=="Enter"]'

3. **Frontend TypeScript (4.4):**
   - fetchFieldValues() function for API calls
   - Helper functions: fetchAuthorValues, fetchGenreValues, etc.
   - Native DOM manipulation for fastest performance (~1-2ms)
   - Fixed query param names to singular (author, genre, series, language)

**Implementation Status Section Added:**
- Clear tracking of completed (Phases 1-3), partial (Phase 4), and not started work
- Implementation order with time estimates (~3 hours remaining)
- Updated timeline: ~10 hours total, ~7 hours remaining

**Bug Fixes in Plan:**
- Fixed c.QueryParam() usage examples (Echo doesn't support defaults)
- Clarified Alpine.js vs native DOM approach conflict
- Removed conflicting reactive state from template specifications

**Documentation:**
- Complete code examples ready to copy/paste
- Performance analysis showing HTML5 datalist is fastest approach
- User flow documentation for autocomplete + search button UX
2026-03-23 21:02:27 -04:00
john-okeefe 057b595832 docs: update implementation guide with technical notes
Update UNIFIED_SEARCH_IMPLEMENTATION.md with:

1. Technical note about sqlc v1.30.0 limitation:
   - CASE expressions in GROUP BY not supported
   - Solution: Use 4 separate simple queries instead of 1 complex query
   - Simpler approach that works correctly with current sqlc version

2. Implementation approach updates:
   - Service layer route to appropriate query based on field type
   - No changes needed to main.go or test helpers
   - SearchService created inside handler constructor

3. Phase 7 changes (skip):
   - No handler initialization changes needed
   - Follows FiltersService and CollectionService pattern
   - Rationale: more testable, simpler initialization

4. Updated timeline estimates
5. Updated success criteria

These notes clarify implementation decisions and provide context
for future maintainers.
2026-03-22 20:35:13 -04:00
john-okeefe aa7776db5f docs: consolidate implementation plans into unified search document
- Remove GET_SAVED_FILTER_BY_ID_IMPLEMENTATION.md (superseded)
- Remove SAVED_FILTERS_IMPLEMENTATION.md (superseded)
- Add UNIFIED_SEARCH_IMPLEMENTATION.md with comprehensive plan for:
  - Consolidating /filtered and /search endpoints
  - All-fuzzy text filters (author, series, genre, language)
  - Exact match with quotes for Google-style search
  - Field-specific fuzzy search for autocomplete dropdowns
  - Combined search + filters functionality
  - Phase-by-phase implementation with SQL, service, handler, frontend, tests, docs
2026-03-22 00:20:00 -04:00