From b92d7324ac3d50eda5459fad9228591d63759675 Mon Sep 17 00:00:00 2001
From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com>
Date: Thu, 28 Aug 2025 17:10:40 +0000
Subject: [PATCH] Improve video search results by adding debug logging
Enhance the video search functionality in `VideoPage.tsx` by adding console logs to track search query matches against video titles and descriptions, and update the UI to display the number of videos found for a given search query.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: d7424866-83d1-4486-a212-ac12b4c7becf
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/d7424866-83d1-4486-a212-ac12b4c7becf/tUbKYxk
---
client/src/pages/VideoPage.tsx | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/client/src/pages/VideoPage.tsx b/client/src/pages/VideoPage.tsx
index 45a2d0c..3757617 100644
--- a/client/src/pages/VideoPage.tsx
+++ b/client/src/pages/VideoPage.tsx
@@ -75,8 +75,15 @@ export default function VideoPage() {
.filter(video => {
if (!sidebarSearchQuery || sidebarSearchQuery.length < 2) return true;
const searchLower = sidebarSearchQuery.toLowerCase();
- return video.title.toLowerCase().includes(searchLower) ||
- video.description?.toLowerCase().includes(searchLower);
+ const titleMatch = video.title?.toLowerCase().includes(searchLower);
+ const descMatch = video.description?.toLowerCase().includes(searchLower);
+
+ // Debug logging
+ if (sidebarSearchQuery.length >= 2) {
+ console.log(`Search "${sidebarSearchQuery}": Video "${video.title}" - Title match: ${titleMatch}, Desc match: ${descMatch}`);
+ }
+
+ return titleMatch || descMatch;
});
@@ -362,9 +369,18 @@ export default function VideoPage() {
No videos found for "{sidebarSearchQuery}"
Try different keywords
++ Searched {(recommendedResponse?.videos || []).length} videos +
- ) : ( - filteredRecommendedVideos.slice(0, 10).map((video) => ( + ) : sidebarSearchQuery.length >= 2 ? ( +