@AdminSidebar(user, currentPath)
(or
in some cases)
```
To apply full-width layout, change the inner div in all three:
```templ
(or
)
```
**Do NOT** modify the `main` element or the flex wrapper in any admin template - these are part of the admin sidebar layout.
---
### Phase 7: Add Inline Script for Dashboard Initialization
**Goal:** Ensure wood paneling is applied immediately on dashboard load
#### File: `templates/dashboard.templ`
**Add inline script after existing scripts (around line 20):**
```templ
```
**This ensures:**
- Wood paneling applied before external woodPaneling.js loads
- No flash of wrong background
- Progressive enhancement: works even if JS fails
---
## Testing Checklist
After implementation:
### Wood Paneling
- [ ] Wood paneling options appear in theme dropdown under "Bookshelf Background" section
- [ ] "None" option removes wood texture
- [ ] Selecting "Wood Light" applies light wood texture to dashboard background
- [ ] Selecting "Wood Dark" applies dark wood texture to dashboard background
- [ ] Selecting "Wood Mahogany" applies mahogany texture to dashboard background
- [ ] Texture covers only `#collections-container` area (not header or sidebar)
- [ ] Texture looks seamless when repeated
- [ ] Wood preference persists across page refreshes (localStorage)
- [ ] Active wood option has darker background highlight
- [ ] Switching between wood options updates immediately
### Full-Width Layout
- [ ] Header uses full width on all pages
- [ ] Dashboard uses full width
- [ ] Collections page uses full width
- [ ] Bookshelf page uses full width
- [ ] All other pages use full width
- [ ] Content still has appropriate padding for readability
- [ ] Layout responsive on mobile devices
### Theme System
- [ ] Wood themes removed from theme dropdown
- [ ] Color themes still work correctly
- [ ] Active color theme has darker background highlight
- [ ] Theme switching still saves to server
- [ ] No wood theme options in color theme section
### Performance
- [ ] Wood textures load quickly (no visible delay on reasonable connection)
- [ ] No flash of wrong background on page load
- [ ] Texture files are optimized (< 500 KB each)
---
## Files Summary
### New Files Created
- `web/src/woodPaneling.ts` - Wood paneling management
- `web/src/themeDropdown.ts` - Active indicator management
- `web/static/textures/wood-light.png` - Light wood texture
- `web/static/textures/wood-dark.png` - Dark wood texture
- `web/static/textures/wood-mahogany.png` - Mahogany texture
### Files Modified
- `templates/header.templ` - Remove wood themes, add wood paneling section, remove max-width
- `tailwind.config.ts` - Remove theme-wood-* from safelist, add wood background images
- `web/src/header.ts` - Remove wood theme logic from `changeThemeTo()`
- `templates/dashboard.templ` - Remove max-width, add inline initialization script
- `templates/*.templ` - Remove `max-w-7xl` from all page templates
---
## Migration Notes
### Breaking Changes
- Wood themes removed from theme system
- Users with wood theme selected will see tokyo-night (or their last color theme)
- Wood paneling preference starts as "none" (users must opt-in)
### Backward Compatibility
- Color themes unaffected
- localStorage theme preference still works
- Server-side theme sync still works
### Database Dependencies
- None (wood paneling is localStorage only)
### Performance
- Wood textures only loaded when selected
- "None" option = no texture load (fastest)
- Texture size optimized to ~200-500 KB each
### Progressive Enhancement
- Pages work without wood paneling (default "none")
- Wood paneling degrades gracefully if JS fails
- Color themes work independently of wood paneling
---
## Rollback Plan
If issues arise:
1. Remove wood paneling section from header
2. Restore `max-w-7xl` containers in templates
3. Delete wood texture files
4. Revert header.ts to include wood theme logic
5. Wood paneling preference in localStorage will be ignored (harmless)
---
## Future Improvements
1. **Per-page wood paneling:** Allow wood on bookshelf page, not just dashboard
2. **Texture variety:** Add more wood options (oak, pine, walnut)
3. **Texture intensity:** Add opacity slider for subtler effect
4. **Custom textures:** Allow users to upload their own backgrounds
5. **Server-side sync:** Store wood paneling preference in database for cross-device sync
6. **Preview mode:** Show texture preview before applying
7. **High-DPI textures:** Provide 2x versions for retina displays
---
## Attribution
All wood textures are CC0 licensed (no attribution required):
- **Light wood:** qubodup - https://opengameart.org/content/light-wood-1024x1024
- **Dark/Mahogany wood:** Luke.RUSTLTD - https://opengameart.org/content/5-wood-textures
**Optional:** Add to README.md or about page for documentation purposes.