Complete frontend refactoring: UI enhancements, pagination, filtering, search architecture, and data management improvements

# Phase 1: Feature Implementation
- Add "Create new..." option in `AddEntryToCollectionDialog` for inline collection creation with auto-select
- Implement lazy loading pagination with IntersectionObserver for Watchlist, Collections, and Media pages
- Add reusable useDebounce hook (300-400ms) and apply to all search inputs across pages
- Reset scroll position to top when switching between sidebar navigation pages via useLocation()
- Reorganize MediaPage with horizontal control layout, add Media Type filter (All/Audio/Video), and Custom Media filter (Show All/Official Only/Custom Only)
- Add three-dot menu (MoreHorizontal icon) to collection cards with Edit/Delete options and "Get all parts" feature
- Replace numeric rating input with interactive star rating component in EditCollectionDialog (0-10 stars with half-star support)
- Display entry type badges ("Movie" / "TV Series") on home page trending/popular sections and search results
- Create PeopleSearchResult component with profile images; integrate useTmdbSearchPeople hook linking to `/people/tmdb/:tmdbId`
- Add TMDB Rating and User Rating filters to Library page with range sliders (0-10, step 1) and state persistence in useLibraryStore
- Add All/Movies/TV Series type filter to Watchlist page with filtered count display
- Improve People Details page mobile UI: optimize header, info section sizing, and filmography card layouts for touch

# Phase 2: Architecture Refactoring & Bug Fixes
- Fix scroll-to-top on sidebar navigation by constraining AppLayout root to `h-screen overflow-hidden` so `<main>` becomes proper scroll container
- Extract search from HomePage into dedicated SearchPage component with `/search` route, debounced input, and URL query sync via SearchParams
- Add Search nav item with icon to sidebar for easy search access
- HomePage search input now navigates to `/search?q=...` instead of handling inline, separating concerns and enabling search bookmarking
- Entry type pill badges now conditionally render via `showTypeBadge` prop on EntryCard—only SearchPage passes this to prevent display on home/discover pages
- Fix people ID bug: people search results now link to `/people/tmdb/:tmdbId` (TMDB redirect route) instead of `/people/:id`, correctly mapping TMDB IDs to local database IDs through PersonTmdbRedirectPage
- Enhance People Details filmography sorting: "Not in Library" section now detects self roles (self/themselves/himself/herself) and sorts non-self by release date (new→old) with all self roles pushed to end of list

# Summary
- Created new files: SearchPage.tsx, useDebounce.ts
This commit is contained in:
Mohammed Abad committed 2026-04-12 01:33:00 +01:00
1 parent d28b4caa7e
commit 9a8ee181e5
23 files changed
+680 -188

No files matched your search

@@ -13,9 +13,10 @@ import type { Entry, TmdbEntry } from '@/types';
interface EntryCardProps {
entry?: Entry;
tmdbEntry?: TmdbEntry;
showTypeBadge?: boolean;
}
export function EntryCard({ entry, tmdbEntry }: EntryCardProps) {
export function EntryCard({ entry, tmdbEntry, showTypeBadge }: EntryCardProps) {
const [showConfirm, setShowConfirm] = useState(false);
const createEntry = useCreateEntry();
const deleteEntry = useDeleteEntry();
@@ -105,6 +106,16 @@ export function EntryCard({ entry, tmdbEntry }: EntryCardProps) {
<Star className="absolute right-2 top-2 h-4 w-4 fill-yellow-400 text-yellow-400" />
)}
{/* Entry type pill */}
{showTypeBadge && tmdbEntry && (
<Badge
variant="secondary"
className="absolute bottom-2 right-2 text-[10px] px-1.5 py-0.5 opacity-90 z-10 pointer-events-none"
>
{isTv ? 'TV Series' : 'Movie'}
</Badge>
)}
{/* Hover overlay */}
<div className="absolute inset-0 flex flex-col justify-end bg-gradient-to-t from-black/90 via-black/40 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100">
<div className="p-3 space-y-1">