This commit addresses multiple collection management issues to improve user experience:
## Template Selection Modal Improvements
- Replace inline styles with CSS classes for reliable visual feedback
- Fix default template selection conflicts that showed multiple templates as selected
- Add styled template previews that show actual CSS styling differences
- Improve modal responsiveness and visual hierarchy
## Collection Item Creation Fixes
- Fix empty collection items with no content/height that were unclickable
- Preserve template placeholder content during item creation instead of clearing it
- Implement proper positioning system using GetMaxPosition to place new items at collection end
- Add position calculation logic to prevent new items from jumping to beginning
## Backend Positioning System
- Add GetMaxPosition method to all repository implementations (SQLite, PostgreSQL, HTTPClient)
- Update CreateCollectionItemFromTemplate to calculate correct position (maxPos + 1)
- Maintain reconstruction ordering by position ASC for consistent item placement
## Frontend Template Selection
- CSS class-based selection states replace problematic inline style manipulation
- Template previews now render actual HTML with real page styling
- Improved hover states and selection visual feedback
- Fixed auto-selection interference with user interaction
These changes ensure collection items appear in expected order and template selection
provides clear visual feedback with actual styling previews.
- Remove auto-discovery entirely (~450 lines)
* Delete internal/content/discoverer.go
* Simplify enhancer to single-phase processing
* Remove duplicate container expansion logic
- Consolidate repository implementations
* Move internal/content/client.go → internal/db/http_client.go
* Group all repository implementations in db/ package
- Add file utilities to engine following Go stdlib patterns
* Add engine.ProcessFile() and ProcessDirectory() methods
* Engine now handles both content processing AND file operations
- Move site management to dedicated package
* Move internal/content/site_manager.go → internal/sites/manager.go
* Clear separation of site lifecycle from content processing
- Preserve container expansion (syntactic sugar)
* .insertr on containers still auto-applies to viable children
* Container detection logic consolidated in engine/utils.go
Result: Clean architecture with single source of truth for .insertr processing