31 lines
1.5 KiB
Markdown
31 lines
1.5 KiB
Markdown
# Layout Issue Analysis
|
|
|
|
## Problem Description
|
|
User reports that the application layout is broken:
|
|
1. "Nothing found" notification shows always
|
|
2. Search field that was at bottom is now at top
|
|
|
|
## Current Structure Analysis
|
|
Based on code review of public/index.html and public/script.ts:
|
|
|
|
### HTML Structure (Current):
|
|
1. Search form (input + button) - at TOP
|
|
2. Welcome placeholder - initially visible
|
|
3. Loading spinner - hidden by default
|
|
4. Results list - hidden by default
|
|
5. No results placeholder - hidden by default
|
|
|
|
### JavaScript Logic Issues Found:
|
|
1. **No Results always showing**: In `showNoResults()` method, the noResults element is made visible with `classList.remove('tg-hidden')` but there's no logic to hide it when new search starts or results are found.
|
|
|
|
2. **Search field position**: The search form is structurally at the top in HTML, which matches user complaint.
|
|
|
|
### Display Logic Flow:
|
|
- `showLoading()`: Hides welcome, shows loading, hides results, hides noResults
|
|
- `displayResults()`: Calls `hideLoading()`, shows results if any, otherwise calls `showNoResults()`
|
|
- `showNoResults()`: Calls `hideLoading()`, hides results, SHOWS noResults (but doesn't hide welcome)
|
|
|
|
## Root Causes:
|
|
1. **NoResults visibility issue**: The noResults element is never hidden when starting a new search
|
|
2. **Welcome placeholder management**: Not properly hidden when showing noResults
|
|
3. **Search position**: Structurally at top, needs to be moved to bottom if that was the intended design |