From 6cc359f25a945a4f3272b733d3a72cb18c95fdbb Mon Sep 17 00:00:00 2001 From: tanyar09 Date: Thu, 4 Dec 2025 13:13:55 -0500 Subject: [PATCH] feat: Add video player modal and enhance search filters in Modify and Search components This commit introduces a video player modal in the Modify component, allowing users to play selected videos directly within the application. Additionally, the Search component has been updated to include a collapsible filters section for media type selection, improving user experience when searching for images or videos. The layout adjustments ensure better responsiveness and usability across various screen sizes. Documentation has been updated to reflect these changes. --- frontend/src/pages/Modify.tsx | 38 ++++++++++++++++-- frontend/src/pages/Search.tsx | 74 +++++++++++++++++------------------ 2 files changed, 72 insertions(+), 40 deletions(-) diff --git a/frontend/src/pages/Modify.tsx b/frontend/src/pages/Modify.tsx index b0621db..dc7d515 100644 --- a/frontend/src/pages/Modify.tsx +++ b/frontend/src/pages/Modify.tsx @@ -169,6 +169,7 @@ export default function Modify() { const [busy, setBusy] = useState(false) const [error, setError] = useState(null) const [success, setSuccess] = useState(null) + const [selectedVideoToPlay, setSelectedVideoToPlay] = useState(null) const gridRef = useRef(null) @@ -812,10 +813,10 @@ export default function Modify() {
{ - // Open video in new window or navigate to video page - window.open(`/api/v1/videos/${video.id}/thumbnail`, '_blank') + // Open video player modal + setSelectedVideoToPlay(video) }} - title="Click to view video" + title="Click to play video" >
{video.filename}
{video.date_taken && ( @@ -950,6 +951,37 @@ export default function Modify() {
)} + + {/* Video player modal */} + {selectedVideoToPlay && ( +
setSelectedVideoToPlay(null)}> +
e.stopPropagation()}> +
+

{selectedVideoToPlay.filename}

+ +
+ + {selectedVideoToPlay.date_taken && ( +
+ Date taken: {new Date(selectedVideoToPlay.date_taken).toLocaleDateString()} +
+ )} +
+
+ )} ) } diff --git a/frontend/src/pages/Search.tsx b/frontend/src/pages/Search.tsx index a7b9dbf..330ae55 100644 --- a/frontend/src/pages/Search.tsx +++ b/frontend/src/pages/Search.tsx @@ -588,7 +588,7 @@ export default function Search() { return (
{/* Search Type Selector */} -
+
- {/* Filters */} -
-
-

Filters

- -
- {filtersExpanded && ( -
-
- - -
-
- )} -
- {/* Search Inputs */} {(searchType !== 'no_faces' && searchType !== 'no_tags' && searchType !== 'processed' && searchType !== 'unprocessed') && ( -
+
{searchType === 'name' && (
@@ -678,7 +646,7 @@ export default function Search() { type="date" value={dateTo} onChange={(e) => setDateTo(e.target.value)} - className="w-full border rounded px-3 py-2" + className="w-48 border rounded px-3 py-2" placeholder="YYYY-MM-DD (optional)" />
@@ -740,6 +708,38 @@ export default function Search() {
)} + {/* Filters */} +
+
+

Filters

+ +
+ {filtersExpanded && ( +
+
+ + +
+
+ )} +
+ {/* Search Button */}