From c7fb5582e2fe4cdf04d8d081ed00d48c425cfab8 Mon Sep 17 00:00:00 2001 From: Benny Date: Fri, 3 Apr 2026 09:15:31 +0200 Subject: [PATCH 1/7] feat: fullscreen search modal + back button for mobile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the inline search input in the mobile navbar with a fullscreen search modal overlay. This solves several mobile UX issues: 1. Keyboard no longer closes when navigating between search and results 2. Search query and results persist across navigation (tap result → view details → go back → modal reopens with previous search intact) 3. Modal stays visible until the destination page has loaded (no flash of the home page during navigation) Also adds a back button (chevron-left) in the top-left corner on non-main pages for easy navigation on mobile devices. New file: src/lib/components/search-modal.svelte - Fullscreen overlay with auto-focusing input - 300ms debounced search via TMDB API (movies + TV merged by popularity) - Results displayed as portrait cards in a 2-column grid - Escape/X clears state, tapping a result preserves it for back-navigation - Smooth transitions (fly + fade) with instant skip during navigation Modified: src/lib/components/mobile-nav.svelte - Search input replaced with tap-to-open button that triggers the modal - Back button with glass-morphism style, hidden on main pages --- src/lib/components/mobile-nav.svelte | 63 +++---- src/lib/components/search-modal.svelte | 217 +++++++++++++++++++++++++ 2 files changed, 242 insertions(+), 38 deletions(-) create mode 100644 src/lib/components/search-modal.svelte diff --git a/src/lib/components/mobile-nav.svelte b/src/lib/components/mobile-nav.svelte index 89286ae1..df509877 100644 --- a/src/lib/components/mobile-nav.svelte +++ b/src/lib/components/mobile-nav.svelte @@ -1,11 +1,12 @@ +{#if !isMainPage} + +{/if} +
@@ -46,22 +40,13 @@ - - { - if (e.key === "Enter") { - e.preventDefault(); - navigateToSearch(); - } - }} - class="text-foreground h-full flex-1 bg-transparent text-sm font-medium outline-none placeholder:text-white/40" - autocomplete="off" /> + +
@@ -100,3 +85,5 @@
+ + (searchModalOpen = false)} onopen={() => (searchModalOpen = true)} /> diff --git a/src/lib/components/search-modal.svelte b/src/lib/components/search-modal.svelte new file mode 100644 index 00000000..72c154f8 --- /dev/null +++ b/src/lib/components/search-modal.svelte @@ -0,0 +1,217 @@ + + +{#if open} + + + + + +{/if} From 6af49dd29547d3273b015b339728edd885670022 Mon Sep 17 00:00:00 2001 From: Benny Date: Fri, 3 Apr 2026 09:40:46 +0200 Subject: [PATCH 2/7] address review: safe back fallback, cleanup timers on destroy, fix unused loop var --- src/lib/components/mobile-nav.svelte | 9 ++++++++- src/lib/components/search-modal.svelte | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/lib/components/mobile-nav.svelte b/src/lib/components/mobile-nav.svelte index df509877..7df21ed5 100644 --- a/src/lib/components/mobile-nav.svelte +++ b/src/lib/components/mobile-nav.svelte @@ -6,6 +6,7 @@ import NotificationCenter from "$lib/components/notification-center.svelte"; import SearchModal from "$lib/components/search-modal.svelte"; import { getContext } from "svelte"; + import { goto } from "$app/navigation"; import Search from "@lucide/svelte/icons/search"; import { page } from "$app/state"; import type { createSidebarStore } from "$lib/stores/global.svelte"; @@ -24,7 +25,13 @@ {#if !isMainPage}